PDA

View Full Version : Question on Item_struc


mByte
04-19-2002, 06:16 PM
In the class part of the packet how do you parse this?

i pull it into a webpage and so far I got

0 = All Casters (Mag/Nec/Ench/Wiz)
255 = All

but what about the other combos?

is there a place I can look in the code or do you have a snipit laying around?

mByte

Lurker_005
04-19-2002, 07:02 PM
As I understand it class and race should be binary bit type flags. from the hex blob data 0x09 = 1001 binary , so the clases represented by the 1st and 4th binary digit can use the item.

I don't know what the binary digits map to, but it may be the same order as class and race for spawn... MAY BE....

mByte
04-20-2002, 06:46 AM
the plane flew right over my head im gonna try the race first see if that solves my prob

but first im gonna go to the movies

Lurker_005
04-20-2002, 07:48 AM
ok lets try this again.

in item structure there is a hexdecimal value for race, and one for class

0x00 thru 0xff for 32 bits

ok 0x09 is 00000000000000000000000000001001

so asuming the order of the values follows the class numbers...
1 warrior
2 cleric
3 paladin
4 ranger ect

Then the hex value above = warrior and ranger usable (1 and 4 starting at the right)

mByte
04-20-2002, 05:24 PM
here is my code on the php page that pulls the class.

$itemCLASS = hexdec(bin2hex(substr($row[0],208,1)));

this returns a value i was asuming was correct but wasnt i get alot of " 0 " results for single class's or caster group

so how do i get 1001 or 0x00

Lurker_005
04-20-2002, 07:01 PM
I don't know php code :(
It looks like your returning a decimal value, at some point you will need to check the bit values of that.

also is that returning the offset in the record after converting the escape sequences in the blob like /0 to hex value 0 do you need to use the unpack() function mentioned in another thread.

I'm really a bad one to answer this, I only know enought to be dangerous :p you can try asking Windcatcher or Lyenu X`Arie having done admin tools they should be better to help you out.