All in One questions of mine :)

06/25/2012 08:44 ~Crystaline#1
Since, I don't wanna spam question to the forum so i decided to put my questions here, and I hope someone will try to answer.

#1 StackItem - how stack item is coded? As I know, only pots like (vanilla, etc) are getting stacked together. How can I make the other stack-able item getting stacked together too? Like for examples: Meteors, EXP Pots, and etc.

#2 Weapon Accessory Time Limit - How do I add limit on a accessory for 7 days? Shall I create a column onto Item table? and name it as AccessorryLimit? How will the server know that the accessory is activated? and how it will know that it will expire?

[Please don't make any foolishness on my thread, Thank you]

Sincerly,
~Crystaline
06/25/2012 09:02 KraHen#2
#1 When you send an item packet there`s a value which contains the stack number.
#2 You should save the date, hour, everything when the accessory was activated, then compare that to the current server date.
06/25/2012 09:19 Zeroxelli#3
Also, a heads up. People tend to use Environment.TickCount to measure the distance between two points in time in their servers. This is not good practice! Though it is okay in certain circumstances where the difference in time is less than, say, 3-4 weeks, any more than that and it will wrap around to a negative number and screw up your system. I recommend that it is avoided completely, short of checking the time between things inside the server itself, such as your last jump, attack, etc. Other than that, I recommend you use something like a unix epoch timestamp. As I've posted before, use these functions I've made, or something similar:

Code:
       public static readonly DateTime Epoch = new DateTime(1970, 1, 1);

        public static long Microtime()
        {
            return Convert.ToInt64((DateTime.UtcNow - Epoch).TotalMilliseconds);
        }

        public static long MilliSecondsSince(long UTS)
        {
            return (Microtime() - UTS);
        }

        public static long SecondsSince(long UTS)
        {
            return (Microtime() - UTS) / 1000;
        }
06/25/2012 10:48 ~Crystaline#4
Thanks for the two of you.

Btw, How will the server know when I activated my accessories?

PS: Any staff around, please don't close this thread since I will be updating this for more questions of mine in future.
06/25/2012 10:59 Zeroxelli#5
Quote:
Originally Posted by ~Crystaline View Post
Thanks for the two of you.

Btw, How will the server know when I activated my accessories?

PS: Any staff around, please don't close this thread since I will be updating this for more questions of mine in future.
You would add a check using a timer or another method.
07/10/2012 02:54 ~Crystaline#6
Packet 1009 subtype 41 is the weapon accessory activation right?

Any ideas or an example how will the server know that my accessory is not yet active? And How do I spawn the Activate effect to the accessory?
07/10/2012 03:25 -Shunsui-#7
For StackItem there's a value in the ItemType which says the Max Stack Size if >= 1 Allow Stacking the max being whats in the ItemType.

To spawn the Activation time : Item Packet Offset : 60 as Uint32, You write the total Seconds of the time left,
07/10/2012 03:56 ~Crystaline#8
Quote:
Originally Posted by -Shunsui- View Post
For StackItem there's a value in the ItemType which says the Max Stack Size if >= 1 Allow Stacking the max being whats in the ItemType.

To spawn the Activation time : Item Packet Offset : 60 as Uint32, You write the total Seconds of the time left,
Umm, nerd question "Will you at least struct that one for me? I'm not sure were to put it."

was it like this?

07/10/2012 11:55 shadowman123#9
Quote:
Originally Posted by ~Crystaline View Post
Umm, nerd question "Will you at least struct that one for me? I'm not sure were to put it."

was it like this?

its right ..btw the Time is in Seconds :D
07/11/2012 12:32 ~Crystaline#10
Umm, okay. Thanks :) Goodluck to myself lol :)
07/11/2012 16:29 romeoromeo#11
Quote:
Originally Posted by ~Crystaline View Post
Umm, nerd question "Will you at least struct that one for me? I'm not sure were to put it."

was it like this?

Try this ... about the stackitem .
the Class ConquerItemInformation is reading all items and its values which are placed in the file Database/items.txt in ur debg folder
Example for one item :

Code:
1002020  Vanilla  0  0  0  0  0  0  0  0  0  0  600  0  0  0  0  0  0  2000  0  1  1  0  0  0  0  0  0  0  0  0  1  1000  0  0  0  0  0  0  0  0  0  0  0  0  0  [COLOR="Red"]5 [/COLOR] 0  0  0  0  0  Drug  None  5  0  0  0  14020  500
1002020 Vanilla 0 0 0 0 0 0 0 0 0 0 600 0 0 0 0 0 0 2000 0 1 1 0 0 0 0 0 0 0 0 0 1 1000 0 0 0 0 0 0 0 0 0 0 0 0 0 5 0 0 0 0 0 Drug None 5 0 0 0 14020 500

count started by Zero ... so zero is id = 1002020 one is name = Vanilla and so on ... the Stack size is 47 which is colord red ... i think u can change it either in the items.txt file .... or while reading in code ... example for the Dragonball :
StackSize = Convert.ToUInt16(data[47]);
if (ID == 1088000) StackSize = 10;
attention :do not take anything from me as a correct answer if you did not try it your self
07/11/2012 16:47 ~Crystaline#12
I have already added the StackSize thingy, and it works like a charm :)
I'm currently doing some research about the AccessoryTime limit and the Refinery issue. Although, thanks for your concern.
07/11/2012 17:45 shadowman123#13
Quote:
Originally Posted by ~Crystaline View Post
I have already added the StackSize thingy, and it works like a charm :)
I'm currently doing some research about the AccessoryTime limit and the Refinery issue. Although, thanks for your concern.
Well once Sm1 Wear the Accessory Save this Time In ConquerItem Database and then if 7 days passed Item DisAppear :D
07/11/2012 19:01 turk55#14
Quote:
Originally Posted by shadowman123 View Post
Well once Sm1 Wear the Accessory Save this Time In ConquerItem Database and then if 7 days passed Item DisAppear :D
If you want the thing to work properly, you should be able to see the amount of time left instead of making it just disappear after 7 days.

For the timer you could add 2 more rows to the table, 1 for when it starts and 1 for when it ends.
so you basically insert in the first when it got activated and at the second one 7 days later.
The time within could be used to show the amount of time left.
07/11/2012 19:20 shadowman123#15
Quote:
Originally Posted by turk55 View Post
If you want the thing to work properly, you should be able to see the amount of time left instead of making it just disappear after 7 days.

For the timer you could add 2 more rows to the table, 1 for when it starts and 1 for when it ends.
so you basically insert in the first when it got activated and at the second one 7 days later.
The time within could be used to show the amount of time left.
well in impulse Source it Send the Remaining Time Through Difference bet Start time Stored in database and DateTime.Now.Sec or smthing like that