SQL ITEMS GUIDE BY Rhamd

 

============================================
1. Items positioning on database binary field
============================================


SQL server interprets the binary allways as a pair of terms (digits), for exemple in warehouse ull got a binary 1200, it means that ur warehouse need to be 2400 terms (or it will bug with some item like kriss)...

For each binary 10 (or 20 terms) u got a item... that are 120 positions on warehouse (from 0 to 119)

To not bug
ur warehouse, u must fill all NOT USED position (even any graphical space of items) with not "0" values but with "F" values, ex. a position that has no item it will be: "FFFFFFFFFFFFFFFFFFFF"



============================================
2. Spliting information abbout item
============================================


On every item, ull got 20 terms in hexa, we can split as like an information relacioned with wich, look:

AABBCCDDDDDDDDEEFFGG

where the fields r:

AA = Means the hexa for items
BB = Skill, look, Lvl and options(only up to 3rd option)
CC = Duration
DDDDDDDD = Serial Number
EE = Excellent atributes (automactlly for weapon or others) and other informations about opt4 and 2nd loopback of items
FF n GG = something about put addictional excellent information but not yet discovered for me.



============================================
3. ITEMS HEXA
============================================


Just convert as said in a lot of threads, or think like this:

:: In hexa code, 2 terms u got FF that it means 256 (0-255) in Decimal...

:: U got 16 classes of items and 32 types of this variations (16*32=512, but u flag the first loopback block of 256(the first 0-7 classes) in EXCELLENT "field" information), for exemple:

"0" SWORD - this class its on first loop (0 to 7) so excellent field its from 00 up to 7F(00 means no excellent, 7F means all excellent)

and variations of this class r the items it selfes:
kriss = 0,
short sword=1...
angelic sword=19
and from 20 to 31 has no items.



============================================
4. SLOL HEXA
============================================


In SLOL (Skill, Luck, Opt n Lvl) field, its the most complex of fields.

Just take this:

LVL= +8
LUCK = +4
SKILL = +128
OPT: +4 = +1 ; +8 = +2 ; +12 = +3

exemple:

lvl 9 +luck +skill +opt 12

9*8 +4 +128 +3 =
72 + 4 + 128 +3 = 207 = CF

*NOTE: for items opt4 (+16) use apropriate value in excellent field

 

============================================
5. Duration
============================================


Just convert the desired duration direct to hexa code, it means that the value must be form 0 up to 255.



============================================
6. Serial information
============================================


Has as duration, just direct convert to hexa the serial number of item, but NOTE:

.the serial numbers consist on binary 4 to 7 (terms 7 to 14) so u must define this range even when serial its "0", ex: 00000000 = serial 0; 00000001 = serial 1; 000000FF = serial 255

.WARNING!! U must to make a validate item! Conflicted serial numbers will bug. Use value 0 (it means buyied in shop) in hexa code.



============================================
7. Excellent Atributes
============================================


There r two steps here, first:

Excellent informations are separated in 2 blocks, first one for opts form 1 upt to 3, and the second one for opts 4. There are 6 types of excellent atributes that by GAME CORE r automaticly converted for two kinds of items that r Weapons n Others.

To simply calculate then, use this:

For Weapons:

[Increases Mana after monster +mana/8] = +1
[Increases Live after monster +live/8] = +2
[Increase attacking(wizardry)speed +7] = +4
[Increase dmg +2%] = +8
[Increase dmg +level/20] = +16
[Execllent damage rate +10%] = +32

For Others:

[Increases Zen After hunt +40%] = +1
[Defense success rate +10%] = +2
[Reflect damage +5%] = +4
[Damage decrease +4%] = +8
[Increase Mana 4%] = +16
[Increase HP +4%] = +32

******OPT+16 = +64

ex: Weapon with all excellent and with opt3 (NOT OPT4) will be:
1+2+4+8+16+32 = 63 (separe this number)
Weapon with all excellent and with opt4 will be:
1+2+4+8+16+32 = 63+64 = 127 (separe this number)



Second Step:

Remember that we talk about loopback items? so, it means that we got 16 classes and each on has 32 types. This will give us a total of 512 possible items...

The way of game interpret the items that r above 256, its turning all follow items begin to "0" again, and FLAG on here (on excellent field) if it belongs for the 1st block, or make a loop and back to 0 in 2nd block.

So, if the field r a binary1 (FF) u got 256 values, first 0-127 r for first loopback and 128-255 for 2nd one. To simplify this, just +128 with the separeted number (mentioned above) if items belongs in 2nd block.

Take this overview:

---- first block (loopback) for items class 0 up to 7
0-63 - Excellent Atributes
64-127 - Excellent Atributes + opt4
---- second block (loopback) for items class 8 up to 15
128-191 - Excellent Atributes
192-255 - Excellent Atributes + opt4

============================================
8. Other 2 relacioned fields
============================================


I didnt discovered yet...
In some tryies, i note that even an EXACTLY item buyied on shop, in same time, some times made a different values on this fields n some times dont, so, it doesnt mean that realcioned with internal serial number, or date or whatever, but may be relacioned with "extra" excellent atributes, but i cant find the logical for this..



I hope that this informations can support peopple who find to make
ur on aplications, any doubts, just ask me.

An extra gift for this thread, i made an asp page that i got the items on warehouse and edit, by using a stored procedure that returns all separated fields. I manipulate every position making a loop for each possition (but its a little bit complex to say, i think)

Any way, if someone wanna try, i used this procedure:


============================================
CREATE PROCEDURE MSP_WarehouseItems

@contaID varchar(20),
@Position int

AS
BEGIN

SET @Position = @Position * 10

SELECT
CAST(CAST(SUBSTRING( Items, @Position+1, 10) As binary(1)) AS int) As Item,
CAST(CAST(SUBSTRING( Items, @Position+2, 10) As binary(1)) AS int) As SLOL,
CAST(CAST(SUBSTRING( Items, @Position+3, 10) As binary(1)) AS int) As Dur,
CAST(CAST(SUBSTRING( Items, @Position+4, 10) As binary(2)) AS int) As Ser1,
CAST(CAST(SUBSTRING( Items, @Position+6, 10) As binary(2)) AS int) As Ser2,
CAST(CAST(SUBSTRING( Items, @Position+8, 10) As binary(1)) AS int) As XLNT,
CAST(CAST(SUBSTRING( Items, @Position+9, 10) As binary(1)) AS int) As N1,
CAST(CAST(SUBSTRING( Items, @Position+10, 10) As binary(1)) AS int) As N2
FROM warehouse
WHERE (AccountID = @contaID)

END
GO
============================================


</html