[Help] 97d Item Hex

goldenfox

Member
Joined
Oct 17, 2010
Messages
47
Reaction score
3
Hi Guys, I'm new to editing items and I would like to understand how to get the correct item type / index of an item. Please check given example below. Many thanks.


PHP:
[/FONT]

[FONT=courier new]// 00000000CFD38C001301 [00][00][00][00CFD38C][00][1301]: Kris normal
// 007F0000CFD3B17F2000 [00][7F][00][00CFD3B1][7F][2000]: Kris exec
// 00000000CFD3D6807400 [00][00][00][00CFD3D6][80][7400]: Bronze armor normal
// 007F0000CFD3FAFF0000 [00][7F][00][00CFD3FA][FF][0000]: Bronze armor exec
// 005B0000CFD404FF0100 [00][5B][00][00CFD404][FF][0100]: Bronze armor exec
// 87000000CFD41F80E000 [87][00][00][00CFD41F][80][E000]: Twisting slash orb
// 90000000CFD421801F00 [90][00][00][00CFD421][80][1F00]: Fire slash orb
// 005B0000CFD4067F0500 [00][5B][00][00CFD406][7F][0500]: Kris exec[/FONT]

[FONT=courier new]// actual item.txt: type / index
// Kris           :  0 / 0
// Bronze armor   :  8 / 0
// fire slash     : 12 / 16
// twisting slash : 12 / 7[/FONT]

[FONT=courier new]

I'm puzzled as to how ex. fire slash got type 12/index 16 but in HEX it's 90.
 
Last edited:
This script will help you understand how the item id and type are represented in the hex. This is only for old seasons.

PHP:
<form method="post">

   <input type="text" name="item_hex"/>
  <input type="submit" value="show item" />
</form>

<?php


if(isset($_POST['item_hex'])){
   
$type   = hexdec(substr($_POST['item_hex'], 0, 1));
$id     = hexdec(substr($_POST['item_hex'], 1, 1));
$offset = hexdec(substr($_POST['item_hex'], 14, 2));
if (($type % 2) <> 0) {
     $id = "1" . $id;
     $type--;
}
if ($offset >= 128) {
     $type += 16;
}
$type /= 2;

    echo "Item type:" . $type . "\n Item Id:". $id;  
}
 
Last edited:
  • Like
Reactions: goldenfox
@r00tme, thanks a lot! :D

Few changes that worked on my 97D+99i items.txt may come in handy for future searches.
PHP:
if (($type % 2) <> 0) {
        if ($type == 15) $id += 16;
        if ($type != 15 && ($offset == 0 || $offset >= 128)) $id += 16;    
        $type--;
}
 
Last edited: