Understand hex code for items 1.02Q

Results 1 to 23 of 23
  1. #1
    Valued Member Z80 is offline
    MemberRank
    Jul 2004 Join Date
    Belo Horizonte, BrazilLocation
    120Posts

    Understand hex code for items 1.02Q

    Hi folks,

    I know its not a brand new thingy, but I put all together in a nice working sheet,
    so its a big help, when you are trying to adapt your website or other tools you made to mange your server, for the new items of season 2, which you will find in goe's release 06/04 for example.

    Thanks to goe for his great release, liselotte for the best English item(kor).txt, CZF for the editor 1.5, and all reagzoners which are sharing knowledge ^^!

    Use the attached word document or just have a look here:
    Pos 1-2 (byte 0): Item Type
    Pos 3-4 (byte 1): Level, Options, Luck, Skill
    Pos 5-6 (byte 2): Durability
    Pos 7-14 (byte3-6): Serial Number
    Pos 15-16 (byte 7): Excellent Options, Options >+3
    Pos 17-18 (byte 8): Ancient items
    Pos 19-20 (byte 9): Item Index
    Pos 21-32 (byte 10-15): Unknown
    Last edited by Z80; 14-06-07 at 07:58 PM. Reason: error correction


  2. #2
    Account Upgraded | Title Enabled! themad is offline
    MemberRank
    Dec 2004 Join Date
    BulgariaLocation
    1,018Posts

    Re: [Guide] Understand hex code for items 1.02Q

    A good guide, tnx, but you have some mishaps.
    Lets try it again, this time my way:)

    Use the attached word document or just have a look here:
    Byte 1-2: Item ID
    Byte 3-4: Level, Option(0-12), Luck, Skill
    Byte 5-6: Durability
    Byte 7-14: SN
    Byte 15-16: Excellent Opts, Additional Option(12~28)
    Byte 17-18: Ancient Data
    Byte 19-20: Item Index
    Byte 21-32: Blank Zero data

    there is now "17 byte" for the simple reason that it cannot exist. The minimum length of a binary string is "FF" (2 varchar symbols which is equal to 1varbin string)

    The item id and item index are the same as the once in item(kor).txt with a minor differences in the types (12,13 and 14) and four of the shields (Legendary, Chaos and two more i don't remember at this time)

    further more the excellent options coding are not correct (in your doc file)
    00 = not excellent
    01 = Increase Zen +40%
    02 = Defense Success rate +10%
    04 = Reflect Damage +5%
    08 = Damage Decrease +4%
    10 = Increase Mana +4%
    20 = Increase HP +4%
    <- NOT !

    Correct ->
    01 = Increase Zen +40%
    02 = Defense Success rate +10%
    04 = Reflect Damage +5%
    08 = Damage Decrease +4%
    16 = Increase Mana +4%
    32 = Increase HP +4%


    Also the level byte is calculated by (ItemLevel*8)
    The item type is calculated by (ItemIndex*16)
    And the skill adds 128 to the value , not 8

    about people wondering how to convert int into binary here's the function's u'll need to do it (php and mssql)

    php:
    PHP Code:
    //Int -> Bin
    sprintf("%02X"$INTVALUE00);
    //Bin -> Int
    hexdec(bin2hex($BinaryValue)); 
    mssql:
    Code:
    -- For Int -> Bin
    cast(IntValue as varbinary(1))
    OR 
    convert(varbinary(1), Int Value);
    
    -- For Bin>Int
    cast(IntValue as int)
    OR 
    convert(int, Bin Value);
    gl

  3. #3
    Valued Member Z80 is offline
    MemberRank
    Jul 2004 Join Date
    Belo Horizonte, BrazilLocation
    120Posts

    Re: [Guide] Understand hex code for items 1.02Q

    If you woulf read carefully, you would have noticed, that I wrote: Calculate in hex ^^
    So, where is the point??
    If you would check the items in the db, you would see that i.e. exc. opt. Increase HP 4% is stored as "20" of course in hex!
    The items are stored in hex NOT in dec. This causes confusion to most pelople...
    And why converting to dec. and then reconverting to hex...???
    Anyway, thx for your comments and the php adds.

  4. #4
    Account Upgraded | Title Enabled! themad is offline
    MemberRank
    Dec 2004 Join Date
    BulgariaLocation
    1,018Posts

    Re: [Guide] Understand hex code for items 1.02Q

    Quote Originally Posted by Z80 View Post
    If you woulf read carefully, you would have noticed, that I wrote: Calculate in hex ^^
    So, where is the point??
    If you would check the items in the db, you would see that i.e. exc. opt. Increase HP 4% is stored as "20" of course in hex!
    The items are stored in hex NOT in dec. This causes confusion to most pelople...
    And why converting to dec. and then reconverting to hex...???
    Anyway, thx for your comments and the php adds.
    I don't see the point of working in hex when its item kor is in txt and its easy to decode it by a simple formula in int..but nvm, its my opinion, you have yours.. :)

  5. #5
    Valued Member Z80 is offline
    MemberRank
    Jul 2004 Join Date
    Belo Horizonte, BrazilLocation
    120Posts

    Re: [Guide] Understand hex code for items 1.02Q

    Don't get me wrong. I really appreciate your post, because it shows a different point of view, and we all can learn from that.
    Why I dont want to convert in dec?
    Simple: in hex I have simple additions, without passing through conversion and reconversion with multiplying, and at least what for me counts, are the values in the db and they are in hex.:sweatdrop

  6. #6
    Account Upgraded | Title Enabled! themad is offline
    MemberRank
    Dec 2004 Join Date
    BulgariaLocation
    1,018Posts

    Re: [Guide] Understand hex code for items 1.02Q

    Quote Originally Posted by Z80 View Post
    Don't get me wrong. I really appreciate your post, because it shows a different point of view, and we all can learn from that.
    Why I dont want to convert in dec?
    Simple: in hex I have simple additions, without passing through conversion and reconversion with multiplying, and at least what for me counts, are the values in the db and they are in hex.:sweatdrop
    I'm not :) I'm not getting it all (maybe i'm retarded, happens)
    can you explain how will you cr8 an item like this (step by step)

    Mace +12+20+skill+luck+excellent damage+hp/kill

  7. #7
    Enthusiast żulik is offline
    MemberRank
    Aug 2006 Join Date
    37Posts

    Re: [Guide] Understand hex code for items 1.02Q

    Byte 21-32: Blank Zero data

    Maybe this can be a space for Jewel of Harmony options.

  8. #8
    Valued Member Areskoi is offline
    MemberRank
    Nov 2006 Join Date
    143Posts

    Re: [Guide] Understand hex code for items 1.02Q

    Item options are wrong. To make +4 to +16 and +20 to +28 options you should add 01h-03h to 03-04 bytes. But the difference for options larger than +16 is in 40h item in 15-16 bytes. There are some more pitfalls in items codes, but it's easy to find and understand them.

    Mace +12+20+skill+luck+excellent damage+hp/kill

    01-02: 40h
    03-04: 08h*Ch=60h (+12lvl) + 04h (+luck) + 80h (+skill) + 01h (+20 opt [see also 14-15 bytes C0h value]) = E5h
    05-06: 00h (durability)
    07-14: 00h (serial)
    15-16: 40h (+opt > +16) + 20h (+excellent dmg) + 02h (+hp/kill) = 62h
    17-20: 00h

    Result: 40E50000000000620000

  9. #9
    Account Upgraded | Title Enabled! coles12 is offline
    MemberRank
    Apr 2007 Join Date
    495Posts

    Re: [Guide] Understand hex code for items 1.02Q

    looks hard to do

  10. #10
    Account Upgraded | Title Enabled! themad is offline
    MemberRank
    Dec 2004 Join Date
    BulgariaLocation
    1,018Posts

    Re: [Guide] Understand hex code for items 1.02Q

    Quote Originally Posted by Areskoi View Post
    Item options are wrong. To make +4 to +16 and +20 to +28 options you should add 01h-03h to 03-04 bytes. But the difference for options larger than +16 is in 40h item in 15-16 bytes. There are some more pitfalls in items codes, but it's easy to find and understand them.

    Mace +12+20+skill+luck+excellent damage+hp/kill

    01-02: 40h
    03-04: 08h*Ch=60h (+12lvl) + 04h (+luck) + 80h (+skill) + 01h (+20 opt [see also 14-15 bytes C0h value]) = E5h
    05-06: 00h (durability)
    07-14: 00h (serial)
    15-16: 40h (+opt > +16) + 20h (+excellent dmg) + 02h (+hp/kill) = 62h
    17-20: 00h

    Result: 40E50000000000620000
    o.0
    00E10001B138CF620020000000000000
    this is the result of the item......
    i would guess yours is a season I item code..but still the 2nd hex couple is not correct.

  11. #11
    Valued Member Areskoi is offline
    MemberRank
    Nov 2006 Join Date
    143Posts

    Re: [Guide] Understand hex code for items 1.02Q

    Quote Originally Posted by themad View Post
    o.0
    00E10001B138CF620020000000000000
    this is the result of the item......
    i would guess yours is a season I item code..but still the 2nd hex couple is not correct.
    For S2 code is: 00E50000000000620020000000000000
    Check it in CzF Editor 1.5. So E5h is correct code and E1h is code for item without luck.

  12. #12
    Account Upgraded | Title Enabled! themad is offline
    MemberRank
    Dec 2004 Join Date
    BulgariaLocation
    1,018Posts

    Re: [Guide] Understand hex code for items 1.02Q

    Quote Originally Posted by Areskoi View Post
    For S2 code is: 00E50000000000620020000000000000
    Check it in CzF Editor 1.5. So E5h is correct code and E1h is code for item without luck.
    yep, my bad..just checked it w/ my editor o.0... i rly forgot to put luck on the item ;) i though i didn't writedown luck ^_^

  13. #13
    Valued Member Z80 is offline
    MemberRank
    Jul 2004 Join Date
    Belo Horizonte, BrazilLocation
    120Posts

    Re: [Guide] Understand hex code for items 1.02Q

    Quote Originally Posted by Areskoi View Post
    Item options are wrong. To make +4 to +16 and +20 to +28 options you should add 01h-03h to 03-04 bytes. But the difference for options larger than +16 is in 40h item in 15-16 bytes. There are some more pitfalls in items codes, but it's easy to find and understand them.

    Mace +12+20+skill+luck+excellent damage+hp/kill

    01-02: 40h
    03-04: 08h*Ch=60h (+12lvl) + 04h (+luck) + 80h (+skill) + 01h (+20 opt [see also 14-15 bytes C0h value]) = E5h
    05-06: 00h (durability)
    07-14: 00h (serial)
    15-16: 40h (+opt > +16) + 20h (+excellent dmg) + 02h (+hp/kill) = 62h
    17-20: 00h

    Result: 40E50000000000620000
    You are absolutely right! I was not carefully enough with the options.
    I reuploaded the word document, and I think its now clearer and without mistakes. (hope so ^^)http://www.minasoptics.com.br/forum/...emshexcode.doc

  14. #14
    Valued Member Areskoi is offline
    MemberRank
    Nov 2006 Join Date
    143Posts

    Re: [Guide] Understand hex code for items 1.02Q

    Quote Originally Posted by Z80 View Post
    You are absolutely right! I was not carefully enough with the options.
    I reuploaded the word document, and I think its now clearer and without mistakes. (hope so ^^)http://www.minasoptics.com.br/forum/...emshexcode.doc
    Nope. You wrote in doc that you add 04h to 15-16 bytes for options larger than +16. But you should add 40h. It was a first mistake. The second mistake: codes at 01-02 positions are not unique. Check it yourself. For example look at Divine Sword of Archangel and Divine Armor. Both of them have 13h in 01-02 bytes. So the difference between the same codes at these positions is in 80h item in 15-16 bytes.

  15. #15
    Valued Member Z80 is offline
    MemberRank
    Jul 2004 Join Date
    Belo Horizonte, BrazilLocation
    120Posts

    Re: [Guide] Understand hex code for items 1.02Q

    Quote Originally Posted by Areskoi View Post
    Nope. You wrote in doc that you add 04h to 15-16 bytes for options larger than +16. But you should add 40h. It was a first mistake. The second mistake: codes at 01-02 positions are not unique. Check it yourself. For example look at Divine Sword of Archangel and Divine Armor. Both of them have 13h in 01-02 bytes. So the difference between the same codes at these positions is in 80h item in 15-16 bytes.
    2 things:
    1) you might got the wrong document. During the upload I had some troubles, so I decided to upload the document to my forum and I realized that I had switched the numbers 40 to 04 but I changed that immediately. You were to fast with downloading ^^

    2) The items in byte 0 are o course "unique". You will identify an item with 2 bytes: First byte 9, the item index, which you will also find in your item(kor).txt as the first and single number at the beginning of each group (8 for example for armors) - and, second byte 0, the item type, which is the first column in your item(kor).txt.

  16. #16
    Valued Member Areskoi is offline
    MemberRank
    Nov 2006 Join Date
    143Posts

    Re: [Guide] Understand hex code for items 1.02Q

    Quote Originally Posted by Z80 View Post
    2) The items in byte 0 are o course "unique". You will identify an item with 2 bytes: First byte 9, the item index, which you will also find in your item(kor).txt as the first and single number at the beginning of each group (8 for example for armors) - and, second byte 0, the item type, which is the first column in your item(kor).txt.
    Just take any editor and check yourself. As I said AA sword and Divine armor. They both have 13h in 01-02 bytes.

  17. #17
    Valued Member Z80 is offline
    MemberRank
    Jul 2004 Join Date
    Belo Horizonte, BrazilLocation
    120Posts

    Re: [Guide] Understand hex code for items 1.02Q

    Quote Originally Posted by Areskoi View Post
    Just take any editor and check yourself. As I said AA sword and Divine armor. They both have 13h in 01-02 bytes.
    Dude, I think you don

  18. #18
    Valued Member Areskoi is offline
    MemberRank
    Nov 2006 Join Date
    143Posts

    Re: [Guide] Understand hex code for items 1.02Q

    [QUOTE=Z80;2335381]Dude, I think you don

  19. #19
    Account Upgraded | Title Enabled! themad is offline
    MemberRank
    Dec 2004 Join Date
    BulgariaLocation
    1,018Posts

    Re: [Guide] Understand hex code for items 1.02Q

    Quote Originally Posted by Areskoi View Post
    You do not understand me. When I'm talking about bytes I do not mean computer bytes but positions of hexademical codes in full item code. And I mean only S1 codes. Look at this:
    Code:
    Position:                 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20
    Divine Armor:              1  3  0  0  0  0  0  0  0  0  0  0  0  0  8  0  0  0  0  0
    Divine Sword of Archangel: 1  3  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
    It's for S1! There is nothing to do with your 9th byte in S1. But for S2 you are right.
    Not true, when the item category is over 6 or 7 (maybe even 5,8 not sure) it automatically increases the 9th bit with 128 (dec) and 80h hex, thats whats the difference between the divine armor and divine sword of aa.
    In season II the 9th bit is led to the pure item category (instead of all itemid and cat. being all in one bit, they made it better) and it is..
    btw i'm kind of confused now..for season I wasn't it the 8th bit or was it then 9th? Em..

  20. #20
    Valued Member Z80 is offline
    MemberRank
    Jul 2004 Join Date
    Belo Horizonte, BrazilLocation
    120Posts

    Re: [Guide] Understand hex code for items 1.02Q

    Themad is right. And there are some ugly "side effects" when you are using S2 items with type > 31! Byte 3 (pos. 7-8) get corrupted, because it will be overwritten with hF9. I am not sure if today any server or client can handle this.
    I remember, when those servers were released, we had those "Bronze Armor" effect, when the armor with item type 32 became bronze, 33 dragon ^^.
    Fen$x had patch for this problem. But you had to do this with ollydebug during the run time of the server, which is really just for freaks...

    See attached the Itemhex Code for items with length 20.
    Attached Files Attached Files

  21. #21
    Account Upgraded | Title Enabled! TheJAZZman is offline
    MemberRank
    Apr 2007 Join Date
    United-SALocation
    319Posts

    Re: [Guide] Understand hex code for items 1.02Q

    wow, you guys are awesome! Thanks - the guide is great, but the discussion adds a lot too - this will help tons!!

    Great job! 10/10

  22. #22
    Novice Muarg is offline
    MemberRank
    Mar 2008 Join Date
    2Posts

    Re: [Guide] Understand hex code for items 1.02Q

    I want the same guide but for 0.97

    Please if anyone could help me..

  23. #23
    Proficient Member EviLHeaD is offline
    MemberRank
    Mar 2008 Join Date
    Lorencia, 123 123Location
    185Posts

    Re: [Guide] Understand hex code for items 1.02Q

    can someone tell me how i add hp rec to wings through the drop command.

    thx



Advertisement