for Diablo II v1.09 and the Diablo II ExpansionSet: Lord of Destruction
- Hit 99 in 1.09 on a glasscannon multishot zon., switched over to hc and got a sorceress up to 97 before getting bored and quitting in early 1.10. I was about pvp in sc, moved to hc right when the ith bugged rune weapons came out and level 9's could kill me with ease. I started playing in 1.04 i think.
- Diablo 2 Character Planner. Choose class, stats, items and skills and then save your character so you can link to it.
Updated April 2, 2004
visitors since
Introduction
Level: Your character's level. This value must be in the range 1-99 (and is therefore always present, even on a new character) and should be the same as byte 43 in the file header. Experience (missing on a new character) The amount of experience your character has.
I started out with just a page on the item format. However,after starting a new GUI-basedsaved game editor, and doing even more research on the 'unknown'fields in the .d2s file, I discovered much more informationon the rest of the file that isn't available anywhere else. SoI'm publishing my findings.
File Header
(Note: all values larger than a byte are stored in x86little-endian order -- i.e., least significant byte first. A'short' is 2 bytes long, and a 'long' is 4 byteslong. Values starting with '0x' are given in hexadecimalnotation; otherwise they are decimal.)
Byte Position | Size | Contents | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | long | File header. This must be the value 0xaa55aa55. | ||||||||||||||||||||||||||||||
4 | long | File version. The following values are known: 71 v1.00 through v1.06 87 v1.07 or Expansion Set v1.08 89 standard game v1.08 92 v1.09 (both the standard game and theExpansion Set.) This document only covers version 92 of the file format. | ||||||||||||||||||||||||||||||
8 | long | File size. | ||||||||||||||||||||||||||||||
12 | long | Checksum. If you attempt to hack the file without storingthe correct checksum afterwards, your game will fail toload! Fortunately, the checksum algorithm is a relativelysimple one. After clearing the checksum field, you add up thevalues of all the bytes in the file, rotating the running total onebit to the left before adding each byte. Then store the resultin this field. Thanks go to the Shadowmaster forpublishing the checksum code. | ||||||||||||||||||||||||||||||
16 | long | Unknown; the value can be either 0 or 1 | ||||||||||||||||||||||||||||||
20 | 16 chars | Charactername. The name may be up to 15 characters long;the rest of the field must be padded with null bytes. Remember the rules for Diablo II character names: 2-15 characters,containing only upper and lower case letters (A-Z), with the possibleaddition of one dash ( - ) or underscore ( _ ) as long as it is notthe first or last character of the name. | ||||||||||||||||||||||||||||||
36 | byte |
Note: the 'died' bit apparently indicates that your characterhas died at some point in the past. It is never cleared when youresume the game. To find out whether your character is currentlydead, I think you need to look in the itemlist below to see if there is some corpse data. Thanks go to Guillaume Courtin of France for pointing out theHardcore bit while I was busy with other things. | ||||||||||||||||||||||||||||||
37 | byte | Character progression. This number tells (sort of) howmany acts you have completed from all difficulty levels. Itappears to be incremented when you kill the final demon in an act --i.e., Andarial, Duriel, Mephisto, and Diablo / Baal. There's acatch to that last one: in an Expansion game, the value isnot incremented after killing Diablo, but is incremented by 2after killing Baal. (The reason is unknown.) So it skipsthe values 4, 9, and 14. I believe this value is used in determining your character'stitle. The title is one of the following values (depending onthe character class' gender):
| ||||||||||||||||||||||||||||||
38 | 2 bytes | unknown | ||||||||||||||||||||||||||||||
40 | byte | Character class. The defined classes are: 0 Amazon 1 Sorceress 2 Necromancer 3 Paladin 4 Barbarian 5 Druid (Expansion character only) 6 Assassin (Expansion characteronly) | ||||||||||||||||||||||||||||||
41 | 2 bytes | unknown; I've only seen the values { 16, 30 }here. | ||||||||||||||||||||||||||||||
43 | byte | Character's level. This is the level shown on the characterselection screen, but it should equal the level given in the character statistics section. | ||||||||||||||||||||||||||||||
44 | long | unknown | ||||||||||||||||||||||||||||||
48 | long | Time stamp. This is in the standard time() formatof the number of seconds which have elapsed since midnight, January 1,1970 (UTC). | ||||||||||||||||||||||||||||||
52 | long | unknown | ||||||||||||||||||||||||||||||
56 | 16 longs | Thanks go to Ronnie Brohn for pointing out thissection. These are the skillID's assigned to the hotkeys for Skill 1 throughSkill 16. (Note that Skills 8 and above is onlyavailable in the Expansion Set.) If a skill hotkey is notassigned to a skill, the value is 0xffff. Hotkey definitions are stored in the character.keyfile. The structure of that file is not covered by this document(and I see no need to modify it outside of the game.) | ||||||||||||||||||||||||||||||
120 | long | The action assigned to the left mouse button. The value ofthis field is a skillID. | ||||||||||||||||||||||||||||||
124 | long | The action assigned to the right mouse button. | ||||||||||||||||||||||||||||||
128 | long | In an Expansion character, the action assigned to the alternateleft mouse button. (The button assignments are swapped when youswap weapons.) | ||||||||||||||||||||||||||||||
132 | long | In an Expansion character, the action assigned to the alternateright mouse button. | ||||||||||||||||||||||||||||||
136 | 32 bytes | unknown | ||||||||||||||||||||||||||||||
168 | 3 bytes | These bytes indicate which difficulty the character isplaying. The first byte corresponds to Normal, the secondNightmare, and the third Hell. If the value is zero, thecharacter is not playing at that level. Otherwise, the valuelooks like this:
| ||||||||||||||||||||||||||||||
171 | long | Map ID. This value looks like a random number, but itcorresponds with one of the longwords found in thecharacter.map file, according to the difficulty beingplayed. | ||||||||||||||||||||||||||||||
175 | short | unknown | ||||||||||||||||||||||||||||||
177 | short | uncertain; it looks like this is set on an Expansioncharacter whose mercenary has died. | ||||||||||||||||||||||||||||||
179 | 4 bytes | This looks like a random ID for your mercenary. It is 0 ifyou have never had a mercenary. If your mercenary has died or(in the standard game) been left behind when you move on to the nextact, this field is still set to the last mercenary you had. | ||||||||||||||||||||||||||||||
183 | 2 bytes | This is a numerical index into the game's language-dependentstring table for mercenary names. There is a separate list foreach type of mercenary (Rogue Scout, Desert Mercenary, EasternSorceror, and Barbarian). I've written up a list of mercenary names forthe English 1.09 patch. | ||||||||||||||||||||||||||||||
185 | short | This code determines the difficulty level and act where yourmercenary is found, as well as the attribute of your mercenary(i.e., Cold, Fire, Lightning). I have a list of the mercenarycodes appended to the end of the mercenary name list. | ||||||||||||||||||||||||||||||
187 | long | Your mercenary's experience points. | ||||||||||||||||||||||||||||||
191 | 144 bytes | unknown |
Quest Completion Data
The quest data begins with the following header:
Byte Position | Size | Contents |
---|---|---|
335 | 4 chars | The string identifier 'Woo!'. (I guess somebodyat Blizzard had a sense of humor. :) |
339 | 6 bytes | unknown; I always see the bytes { 6, 0, 0, 0, 42, 1 }here. |
The header is followed by three structures, one for each difficultylevel. Remember, the byte offsets given here are offsetsinto the structure; the first structure is at offset 345 in thefile.
Although there is some variation in the meaning of the bits perquest, some of the bits appear to have constant meaning.
Bit 0 indicates the quest is complete. If bit 0 is clear butthe rest of the field is non-zero, then the quest has been started,but not finished.
Bit 1 generally means you have completed the requirements for thequest (i.e., killed the boss demon), and all that's left is to collectthe reward -- for example, 'Charsi will imbue an item with magicalpower.' Not all quests have this option. If this bit isset, bit 0 must be clear.
Bit 2 is often set when an NPC gives you a quest.
Bit 12 is set when you have seen the swirling fire animation thatcloses a quest icon.
Bit 13 indicates the quest was completed in the current game; whenyou save the game and then reload it, all bit 13's are cleared.
Byte Position | Size | Contents | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | short | This field contains a 1 if you have been introduced (by Warriv) toAct I. | ||||||||||||||||||||
2 | 6 shorts | These fields contain quest completion data for each quest inAct I.
| ||||||||||||||||||||
14 | short | uncertain; I think this gets set to a non-zero value after youtravel from Act I to Act II. | ||||||||||||||||||||
16 | short | This field contains a 1 if you have been introduced (by Jerhyn) toAct II. | ||||||||||||||||||||
18 | 6 shorts | These fields contain quest completion data for each quest inAct II.
| ||||||||||||||||||||
30 | short | uncertain; I think this gets set to a non-zero value after youtravel from Act II to Act III. | ||||||||||||||||||||
32 | short | This field contains a 1 if you have been introduced (by Hratli) toAct III. | ||||||||||||||||||||
34 | 6 shorts | These fields contain quest completion data for each quest inAct III.
| ||||||||||||||||||||
46 | short | uncertain; I think this gets set to a non-zero value after youtravel from Act III to Act IV. | ||||||||||||||||||||
48 | short | This field contains a 1 if you have been introduced to ActIV. | ||||||||||||||||||||
50 | 3 shorts | These fields contain quest completion data for each quest inAct IV. Note that there are only three quests here, as opposedto 6 for the first three Acts.
| ||||||||||||||||||||
56 | short | uncertain; I think this gets set to a non-zero value after youtravel from Act IV to Act V in an Expansion game, but I havenot yet verified this assumption. It appears tobe zero after completing a standard game. | ||||||||||||||||||||
58 | 3 shorts | unknown; maybe act IV has 6 fields for quests after all, eventhough only 3 are used? | ||||||||||||||||||||
64 | short | unknown; in an Expansion character, this was set to 1 aftercompleting Terror's End and talking to Cain in act IV | ||||||||||||||||||||
66 | 2 shorts | unknown | ||||||||||||||||||||
70 | 6 shorts | These fields contain quest completion data for each quest inAct V.
| ||||||||||||||||||||
82 | 7 shorts | unknown |
Waypoint Data
The waypoint data begins with the following header:
Byte Position | Size | Contents |
---|---|---|
633 | 2 chars | The string identifier 'WS'. |
635 | 6 bytes | unknown |
The header is followed by three structures, one for each difficultylevel. Remember, the byte offsets given here are offsetsinto the structure; the first structure is at offset 641 in thefile.
Byte Position | Size | Contents |
---|---|---|
0 | 2 bytes | unknown; I always see the values { 2, 1 } here. |
2 | 5 bytes | Waypoints. This is a bitfield, with one bit assigned to eachwaypoint in LSB order -- so bit 0 in the Rogue Encampment waypoint forAct I. The first waypoint in every Act is activated as soon asyou enter that Act. There are 9 waypoints (bits) in each of ActsI, II, and III, and 3 waypoints (bits) in Act IV, so the last waypointbefore Diablo (River of Flame) is bit 29 (since we start counting from0). The first waypoint for Act V follows at bit 30, andcontinues to the last (ninth) waypoint in Act V at bit 38. |
7 | 17 bytes | unknown |
NPC Introductions
My data on the next section is very sketchy... help?
Byte Position | Size | Contents | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
714 | 2 chars | The string identifier 'w4'. | ||||||||||||||||
716 | 1 byte | unknown | ||||||||||||||||
717 | 1 byte |
| ||||||||||||||||
718 | 1 byte |
| ||||||||||||||||
719 | 1 byte |
| ||||||||||||||||
720 | 1 byte |
| ||||||||||||||||
721 | 1 byte |
| ||||||||||||||||
722 | 3 bytes | unknown | ||||||||||||||||
725 | 8 bytes | Introductions repeated for Nightmare difficulty. | ||||||||||||||||
733 | 8 bytes | Introductions repeated for Hell difficulty. | ||||||||||||||||
741 | 1 byte | It would appear that bits 1-6 of byte 741 get setafter you take the caravan to Act II in Normal difficulty. Bit 7of byte 741 through bit 1 of byte 743 get set after you sail to ActIII. On entering Act IV, bits 2, 5, 6, & 7 of byte 743 andbits 0, 3, & 4 of byte 744 get set. When you return to a previous act and talk to the NPC's, these bitsare cleared. You have yet to be welcomed back by:
| ||||||||||||||||
742 | 1 byte |
| ||||||||||||||||
743 | 1 byte |
| ||||||||||||||||
744 | 1 byte |
| ||||||||||||||||
745 | 4 bytes | unknown | ||||||||||||||||
749 | 8 bytes | Greetings repeated for Nightmare difficulty. | ||||||||||||||||
757 | 8 bytes | Greetings repeated for Hell difficulty. |
Character Statistics
The character statistics begin with the following header:
Byte Position | Size | Contents | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
765 | 2 chars | The string identifier 'gf'. | ||||||||||||||||||||||||||||||||||
767 | short | This bit field indicates the presence or absence of eachparticular statistic. If the bit is 0, the correspondingstatistic is zero and not stored in the file. If the bit is 1,the statistic has a long value stored in the file. Notethat many of the statistics are never zero, so they will always bepresent; but there is a bit assigned to them nonetheless. Thebits are assigned as follows:
|
From this point on, the contents of the file are (more or less)variable, because the contents of the statistics section areoptional.
Field | Details | ||||||
---|---|---|---|---|---|---|---|
Strength | These fields are self-explanatory. They are alwayspresent. Remember, all values are stored aslongs. | ||||||
Energy | |||||||
Dexterity | |||||||
Vitality | |||||||
Stat Points Remaining (optional) | The number of Stat Points earned but not distributed. | ||||||
Skill Choices Remaining (optional) | The number of Skill Choices earned but not distributed. | ||||||
Life (current) | These fieldsare (usually) always present. (There is an exception: if yourcharacter is dead, the current Life field will be gone!) Theyare also not plain integer values! Instead, eachfield is a fixed-point binary number, with a 24-bit integer part andan 8-bit fraction part. For example, if the life (current) fieldcontained the value 0x020ac0, then to get the amount of life remainingyou would take that value and divide by 256.0 to get 522.75 (roundingthe number to an integer for display ... although I'm not certain inwhich direction the number is rounded). Note that the currentamount of life (/mana /stamina) may be more than the base amount,because the base does not take into account any blessings bestowed bymagical items you are carrying. | ||||||
Life (base) | |||||||
Mana (current) | |||||||
Mana (base) | |||||||
Stamina (current) | |||||||
Stamina (base) | |||||||
Level | Your character's level. This value must be in the range 1-99(and is therefore always present, even on a new character) and shouldbe the same as byte 43 in the fileheader. | ||||||
Experience (missing on a newcharacter) | The amount of experience your character has. If you haven'tkilled a single monster in the game, your experience will be 0, andthis field is not stored. Otherwise, this field is alwayspresent. | ||||||
Gold in Inventory (optional) | The amount of gold you are carrying. Just as a helpfulreminder, the maximum amount of gold you may carry is directlyproportional to your level, at 10,000 gold per level. Thus, a newcharacter can only carry 10,000 gold pieces (which is still a lot, ifyou think about it, even if each piece is smaller than a dime:), but a level 99 character (the limit) can carry nearly amillion in gold (990,000). | ||||||
Gold in Stash (optional) | The amount of gold you have stowed away. Just as ahelpful reminder, the maximum amount of gold you may store in thestash is related to your level as follows:
|
Character Skills
The character skills section begins with the 2-characterheader, 'if'. This is followed by 30 bytes, each bytecorresponding to one of the character's special skills. To savespace, I'll list the skills in a separate table.
Item List
The next major section of the .d2s file is the itemlist. It begins with the following header:
Size | Contents |
---|---|
2 chars | The string identifier 'JM'. |
short | The number of items your character has. This includes itemsequipped, tucked in your belt, stored in your inventory, stored inyour stash, and hidden in the Horadric Cube. It doesnot, however, include gems, runes, or jewels which have beeninserted into a socketed item. (Those are counted as part of theitem.) |
This header is followed by a list of items. The format of theitems is way beyond the scope of this document; referto my Item Format pagefor a detailed description.
After the list of items, you will find another item list headersimilar to the one shown above; only this time the item count will be0. Usually. It looks like if your character has died,then the item count in this second header will be 1, and 12 bytes of(unknown) data will follow, after which there will be anotherheader and item list for items on your corpse. Sadly, I haven'tdied often enough to test this theory, much less figure out what thoseextra bytes mean.
Diablo 2 Level 99 Character Codes List
If you have an Expansion character, then the corpse item list willbe followed by the 2-character header 'jf'. Ifand only if you have a mercenary (alive or dead), thisheader is followed by an item list header and (possibly empty) itemlist containing items equipped on the mercenary. This item listis followed by the trailer characters 'kf'.
If you have a necromancer, it is possible for you to have an IronGolem that is preserved when your game is saved and restored. TheIron Golem is based on an item. Following the mercenary item list,there will be a single byte that is 0 if there is no golem, or 1 ifthere is. If there is a golem, this byte is followed by a singleitem. Note that this appears to be available only on Expansioncharacters.
Diablo 2 Level 99
The End
Diablo 2 Level 99 Character Codes 2020
Please send any additions or corrections to me using myweb-based mail form.