02-01-2018, 11:03 AM
Hello.
I've been looking further into how items are generated, saved and loaded from player files.
I will post more of my findings, but before I do that (hopefully later today)! There is this (which I am about to start working on again):
Slightly more organized. Hopefully it will help in explaining how items are generated and loaded in Diablo (patch v1.09).
I am not 100% clear on what I initially thought to be a 'randomized ID' tag; As it is clearly saved in the *.sv (SaVe file?).
It also seems that you are able to copy only the first 4 bytes of a Magic Helm and over-write another Helm successfully.
The "duplication" will not take place until the player has reloaded their file (the game saves it and writes to the hdd upon exiting a session).
I've been looking further into how items are generated, saved and loaded from player files.
I will post more of my findings, but before I do that (hopefully later today)! There is this (which I am about to start working on again):
Code:
ITEM STRING - ASCII string
ITEM STRING
- UNIDENTIFIED (String shown when the item is unidentified)
- IDENTIFIED (String shown when the item is identified)
ITEM DATA - Misc. data pertaining to the item-only (saving/loading for example)
ITEM DATUM
- ITEM HEADER (4 bytes stored in save files)
- ITEM MODIFIER (4 byte prefix/suffix string index look-up?)
ITEM FLAG - Optional routes for item data operations ("identified" for example)
ITEM FLAGS
- ITEM TYPE (FF FF FF FF = No item, 02 = Weapon, 04 = Helm)
- ITEM SPECIAL TYPE (00 = Normal, 01 = Magic, 02 = Unique)
- IDENTIFIED (00 = Unidentified, 01 = Identified)
- USABLE ITEM (00 = Unusable, 01 = Usable)
ITEM ATTRIBUTE - Modifies the item
ITEM ATTRIBUTES
- ARMOR
- DURABILITY
- MAXIMUM DURABILITY
- STR
- MAG
- DEX
- VIT
- LIGHT RADIUS (PERCENTAGE)
- CHANCE TO HIT (PERCENTAGE)
- DAMAGE (INTEGER)
- DAMAGE (ELEMENTAL?)
- DAMAGE (PERCENTAGE)
- SPELL LEVELS
- SPELL CHARGES
- HIT POINTS
- MANA POINTS
- RESISTANCES
- ATTACKER TAKES DAMAGE
- DAMAGE'S TARGETS ARMOR
- LOSE HIT POINTS OVER TIME
Code:
ITEM TYPE EXAMINED: Helm, Magic
04 bytes: ITEM DATA: Randomized ID
04 bytes: ITEM DATA: Magic prefix/postfix
04 bytes: ITEM FLAG: Type // FF FF FF FF = No item
04 bytes: ITEM DATA: Picked up at X
04 bytes: ITEM DATA: Picked up at Y
04 bytes: ???? (00 00 00 00)
04 bytes: ???? (rewrites self) dungeon ID it spawned on?
04 bytes: ???? (rewrites self) 0D 00 00 00
04 bytes: ???? (rewrites self) 0D 00 00 00
04 bytes: ???? (rewrites self) 60 00 00 00
04 bytes: ???? (rewrites self) 10 00 00 00
04 bytes: ???? 00 00 00 00
04 bytes: ???? (rewrites self) 01 00 00 00
04 bytes: ???? 00 00 00 00
04 bytes: ITEM FLAG: isIdentified 01 00 00 00
01 bytes: ITEM FLAG: Unique/Magic/Normal 01 = Magic, 02 = Unique, 03 = Normal
63 bytes: ITEM STRING: Item name (unidentified)
64 bytes: ITEM STRING: Item name (identified)
02 bytes: ITEM DATA: Item slot (Weapon, Shield, Jewelery, Helm) 00 04
02 bytes: ITEM ATTRIBUTE: 02 00 (damage/damage %/Chance-To-Hit %/Light %/etc)
04 bytes: ITEM DATA: Graphics index (5F 00 00 00)
04 bytes: ???? (does not rewrite self) 19 00 00 00
04 bytes: ITEM DATA: Selling price FF FF FF FF
04 bytes: ???? 00 00 00 00
04 bytes: ???? 00 00 00 00
04 bytes: ???? 00 00 00 00
04 bytes: ITEM ATTRIBUTE (Armor): FF 00 00 00
20 bytes: ???? 00 00 00 00
04 bytes: ITEM ATTRIBUTE (Durability): FF 00 00 00
04 bytes: ITEM ATTRIBUTE (Max durability): FF 00 00 00 // NOTE: If both the durability and maximum durability of an item are listed as "0xFF": The item is "Indestructible"
12 bytes: ???? 00 00 00 00
04 bytes: ITEM ATTRIBUTE: FF 00 00 00 (STR)
44 bytes: ???? 00 00 00 00
04 bytes: ???? (rewrites self) 00 01 00 00
24 bytes: ???? 00 00 00 00
04 bytes: ITEM ATTRIBUTE: FF 13 00 00
04 bytes: ???? (does not rewrite self) FF FF 00 00
04 bytes: ???? (does not rewrite self) 03 00 00 00
12 bytes: ???? 00 00 00 00
04 bytes: ITEM FLAG: Unusable item 01 00 00 00
04 bytes: ???? (does not rewrite self) FF 00 00 00
04 bytes: ???? 00 00 00 00
Slightly more organized. Hopefully it will help in explaining how items are generated and loaded in Diablo (patch v1.09).
I am not 100% clear on what I initially thought to be a 'randomized ID' tag; As it is clearly saved in the *.sv (SaVe file?).
It also seems that you are able to copy only the first 4 bytes of a Magic Helm and over-write another Helm successfully.
The "duplication" will not take place until the player has reloaded their file (the game saves it and writes to the hdd upon exiting a session).