- Joined
- Jan 14, 2007
- Messages
- 509
- Reaction score
- 85
Recently someone asked me the logic behind storage box SQL Codes. I simply told him to use the search option. He ended up to a thread with a Tutorial.
Unfortunately, generating a box of HP candy (Item code is 9) using this logic isn't possible I guess.
Here is a simple tutorial for this one.
Let's consider the code of 100 UJ
The Code is 17;1644544;659990;0
The Code for UJ is 6144
The Code for A Storage Box is 17
And the constant Zoneserver uses to calculate the Count of items in a storage box is 16384
Simple logic to generate a box will be
17; (16384 x ItemCount) + ItemCode ;659990;0
To reverse the process (to get the details of the codes)
Simply,
Take 1644544 (from the example code of 100 UJ box)
Now, we will divide 1644544 by the constant 16384 and will get the remainder out of it. The remainder will the Item code of the item and the Quotient will be the count of the Item in the storage box.
In PHP you can simply use this to get the details :
Hey, Just wanted to add some stuff..!!
One can easily guess the codes for a box of a particular items..!!
Lemme explain how..!!
Let us consider a Box of UJ's..!!
The Code is 17;1644544;659990;0
The Code for UJ is 6144
The Code for A Storage Box is 17
So if we didnt know the code for the box, we could form it like this.
17 (code of storage box);164 (constant)45(61{from UJ Code}-16{constant value})44(last 2); Item ID; Item Slot
So basically the code ends up to be 17;16445144;Item ID;Item Slot
This works for all. Why do we have to substract 16 - thats a long story and not necessary here..
For eg now, you need to make a box of Peridots, now how do we get it..?
The code for Peridot is 8417.
SO the box will be 17;164 (constant) 68 (84-16) 17;Item ID; Slot
So the code for the box of peridots is 17;1646817;Item ID; Slot
Same way Soul of Silbadu is 9685, so box code is 17;1648085;Item ID; Slot
Hope this helps..
And as for the Item ID slot - you could use ... 131845 - universal box code..
Unfortunately, generating a box of HP candy (Item code is 9) using this logic isn't possible I guess.
Here is a simple tutorial for this one.
Let's consider the code of 100 UJ
The Code is 17;1644544;659990;0
The Code for UJ is 6144
The Code for A Storage Box is 17
And the constant Zoneserver uses to calculate the Count of items in a storage box is 16384
Simple logic to generate a box will be
17; (16384 x ItemCount) + ItemCode ;659990;0
To reverse the process (to get the details of the codes)
Simply,
Take 1644544 (from the example code of 100 UJ box)
Now, we will divide 1644544 by the constant 16384 and will get the remainder out of it. The remainder will the Item code of the item and the Quotient will be the count of the Item in the storage box.
In PHP you can simply use this to get the details :
PHP:
$itemnumber = fmod($2ndcode, 16384);$bb = $2ndcode - $itemnumber;$count = $bb / 16384;