d2s_save_item_format_1.13d.txt
80.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
-------------------------------------------------------------------------------
originally extracted from here:
http://www.coreyh.org/diablo-2-files/documentation/d2s_save_item_format_1.13d.html
-------------------------------------------------------------------------------
Diablo II Item Format
for Diablo II v1.13d Expansion Set: Lord of Destruction
Updated June 23, 2012
This file was originally written by Trevin Beattie, whose site is no more (his
latest version of this file is available here though).
Welcome!
Thanks for showing an interest in my Diablo II Item Format page. While you're
browsing, be sure to check out the preview of my game editor for unix+Motif. I
currently have the item editor in development!
Introduction
Having searched the web, I found very few references to the Diablo II .d2s file
format, and most of them covered the old (pre-1.08) version. Diablo II v1.09
has significantly changed the file format. I have started another page which
details the layout of the major parts of the .d2s file. This document focuses
specifically on the item structure β all those pieces of the file tagged "JM".
Rather than describe everything in terms of byte offsets, I'm going to define
the layout as a series of variable-length bit fields. This is a critical part
of the item format, because the position of many of the fields can change
depending on what comes before it. If I say a certain value is a 3-bit field
starting at bit position 150, for example, this translates to bits 6 and 7 of
the byte 18 and bit 0 of byte 19 in the data structure. You can read an
arbitrary bit field programatically using the following code (in C):
#define read_bits(start,size) \
((*((unsigned long *) &data[(start) / 8])
>> ((start) & 7)) & ((1 << (size)) - 1))
Item List Header
An item list begins with the following simple header:
ββββββββββ¬ββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Byte β Size β Contents β
βPositionβ β β
ββββββββββΌββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β0 β2 charsβIdentifier string "JM" { 0x4A, 0x4D } β
ββββββββββΌββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β βThe number of items your character has. This does not β
β2 β16 bitsβinclude gems or jewels which have been glued into socketed β
β β βitems. β
ββββββββββ΄ββββββββ΄βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Your item list ends with another 4-byte structure similar to the above, except
the second field is zero (i.e., { 0x4A, 0x4D, 0x00, 0x00 }).
In the Expansion Set, your hireling has his/her own item list. This list is
separated from yours by the 2-character identifier "jf". This is followed by an
item list header for the hireling, and then his/her items. The second item list
is not terminated with the same 4-byte structure as the first; instead, it is
followed by the 2-character identifier "kf".
Item Structure part 1: Simple Items
There are still many fields in the item structure which I haven't figured out
yet, but I'll leave placeholders for them in case I find out what they mean in
the future. All sizes are in bits unless otherwise specified.
ββββββββββ¬ββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Bit β Size β Contents β
βPositionβ β β
ββββββββββΌββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β0 β2 charsβIdentifier string "JM" { 0x4A, 0x4D } β
ββββββββββΌββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β16 β4 βunknown β
ββββββββββΌββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β20 β1 βItem has been identified β
ββββββββββΌββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β21 β6 βunknown β
ββββββββββΌββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β27 β1 βItem is Socketed β
ββββββββββΌββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β28 β1 βunknown β
ββββββββββΌββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β29 β1 βThis bit is set on items which you have picked up since the β
β β βlast time the game was saved. Why?... β
ββββββββββΌββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β30 β2 βunknown β
ββββββββββΌββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β32 β1 βItem is a Player Ear β
β β βThanks go to Mike of Denmark for identifying this bit. β
ββββββββββΌββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β β"Newbie" item. This bit is set on the weapon and shield yourβ
β33 β1 βcharacter is given when you start the game. Apparently, thisβ
β β βgives the item the property of having a repair cost of 1gp, β
β β βas well as a sell value of 1gp. β
ββββββββββΌββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β34 β3 βunknown β
ββββββββββΌββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β βItem is simple (only 111 bits {14 bytes} of item data) β
β37 β1 βThanks go to Guillaume Courtin of France for discovering theβ
β β βmeaning of this bit. β
ββββββββββΌββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β38 β1 βItem is Ethereal (Cannot be Repaired) β
ββββββββββΌββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β39 β1 βunknown; this bit is 1 on the items I've looked at β
ββββββββββΌββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β40 β1 βItem has been personalized (by Anya in Act V) β
ββββββββββΌββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β41 β1 βunknown β
ββββββββββΌββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β42 β1 βIt looks like this bit indicates the item has been given a β
β β βRune Word. β
ββββββββββΌββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β43 β15 βunknown; some of these bits may be set β
ββββββββββΌββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β βItem location. Actually, I have only seen a few values for β
β β βthese bits, so I'm not 100% certain of its validity. If you β
β β βsee any other value here, let me know what it is and where β
β β βthe item is located. β
β β ββββββββββββββ¬βββββββββββββββββββββββββββββββββββ β
β β ββ0 βItem is stored (see bit field 73) β β
β β ββββββββββββββΌβββββββββββββββββββββββββββββββββββ€ β
β β ββ1 βItem is equipped (somewhere on β β
β58 β3 ββ βyour body) β β
β β ββββββββββββββΌβββββββββββββββββββββββββββββββββββ€ β
β β ββ2 βItem is tucked in your belt (or β β
β β ββ βsash) β β
β β ββββββββββββββΌβββββββββββββββββββββββββββββββββββ€ β
β β ββ4 βItem is being moved (i.e., has β β
β β ββ βbeen picked up by the mouse). β β
β β ββββββββββββββΌβββββββββββββββββββββββββββββββββββ€ β
β β ββ6 βItem is glued into a socket. β β
β β ββββββββββββββ΄βββββββββββββββββββββββββββββββββββ β
ββββββββββΌββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β βIf the item is equipped, this field tells where it is. β
β β βPossible values are: β
β β ββββββββββββββ¬βββββββββββββββββββββββββββββββββββ β
β β ββ1 βhead (helmet) β β
β β ββββββββββββββΌβββββββββββββββββββββββββββββββββββ€ β
β β ββ2 βneck (amulet) β β
β β ββββββββββββββΌβββββββββββββββββββββββββββββββββββ€ β
β β ββ3 βtorso (armor) β β
β β ββββββββββββββΌβββββββββββββββββββββββββββββββββββ€ β
β β ββ4 βright hand (weapon) β β
β β ββββββββββββββΌβββββββββββββββββββββββββββββββββββ€ β
β β ββ5 βleft hand (shield) β β
β β ββββββββββββββΌβββββββββββββββββββββββββββββββββββ€ β
β β ββ6 βright finger (ring) β β
β61 β4 ββββββββββββββΌβββββββββββββββββββββββββββββββββββ€ β
β β ββ7 βleft finger (ring) β β
β β ββββββββββββββΌβββββββββββββββββββββββββββββββββββ€ β
β β ββ8 βwaist (belt) β β
β β ββββββββββββββΌβββββββββββββββββββββββββββββββββββ€ β
β β ββ9 βfeet (boots) β β
β β ββββββββββββββΌβββββββββββββββββββββββββββββββββββ€ β
β β ββ10 βhands (gloves) β β
β β ββββββββββββββΌβββββββββββββββββββββββββββββββββββ€ β
β β ββ11 βalternate right hand (Expansion β β
β β ββ βSet only) β β
β β ββββββββββββββΌβββββββββββββββββββββββββββββββββββ€ β
β β ββ12 βalternate left hand (Expansion Setβ β
β β ββ βonly) β β
β β ββββββββββββββ΄βββββββββββββββββββββββββββββββββββ β
ββββββββββΌββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β βColumn number of the left corner of the item, counting from β
β β β0. Your inventory has ten columns (numbered 0-9), your stashβ
β β βhas six, and the Horadric Cube has four. β
β β β β
β β βNote: Your belt is considered (for the purposes of the item β
β β βformat) to have no rows, but either 4, 8, 12, or 16 columns.β
β65 β4 βIf you prefer, you can divide this field and use the 2 bits β
β β βat position 67-68 for the row (but only for belts). β
β β β β
β β βNote 2: If the item is equipped, glued to a socket, or in β
β β βtransit, then this field appears to contain old data from β
β β βthe last time the item was stored. I.e., it may be non-zero,β
β β βbut the value is unused. β
ββββββββββΌββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β βRow number of the top of the item, counting from 0. Your β
β β βinventory has four rows (numbered 0-3), your stash has four β
β β βin normal characters or eight in Expansion Set characters, β
β β βand the Horadric Cube has four. (In the belt, this field is β
β69 β3 βalways zero.) β
β β β β
β β βNote: If the item is equipped, tucked in your belt, glued toβ
β β βa socket, or in transit, then this field appears to contain β
β β βold data from the last time the item was stored. I.e., it β
β β βmay be non-zero, but the value is unused. β
ββββββββββΌββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β72 β1 βSet Name Has Suffix (?) β
ββββββββββΌββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β βActually, bit 74 seems to always be 0, but since bits 73 andβ
β β β75 are related I just lump them all together. If the item isβ
β β βneither equipped nor in your belt, this field tells where itβ
β β βis. Possible values are: β
β β ββββββββββββββ¬βββββββββββββββββββββββββββββββββββ β
β β ββ0 βnot here (check bit field 58) β β
β β ββββββββββββββΌβββββββββββββββββββββββββββββββββββ€ β
β73 β3 ββ1 βinventory β β
β β ββββββββββββββΌβββββββββββββββββββββββββββββββββββ€ β
β β ββ4 βHoradric Cube β β
β β ββββββββββββββΌβββββββββββββββββββββββββββββββββββ€ β
β β ββ5 βstash β β
β β ββββββββββββββ΄βββββββββββββββββββββββββββββββββββ β
β β βIf you find an item having any other value in this field, β
β β βlet me know what the value is and the item's location! β
ββββββββββΌββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β βItem's type. The type is 3 lower-case letters or numbers β
β β βfollowed by a space; e.g., "amu " (Amulet) or "2hs " β
β β4 charsβ(Two-Handed Sword). I have started a list of item β
β76 β(8 bitsβidentifiers (not posted; sorry), but it is by no means β
β βea.) βcomplete; I'm sure I don't even have half of what's out β
β β βthere! β
β β βWarning: This field is not byte-aligned! It starts in the β
β β βmiddle of byte 9 and runs to the middle of byte 13. β
ββββββββββΌββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β βThe number of gems (or skulls or jewels) which have been β
β β βglued to this item (if socketed). There will be this many β
β108 β3 βadditional item structures for the gems immediately β
β β βfollowing this item, in the order that the gems were β
β β βinserted. β
ββββββββββ΄ββββββββ΄βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Item Variant: Player Ears
The following information was provided by Mike of Denmark.
If the item is a Player Ear, its structure is slightly different than the
Simple Items above. The last two fields in the Simple Item structure are
replaced by the following:
ββββββββββ¬ββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Bit β Size β Contents β
βPositionβ β β
ββββββββββΌββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β βCharacter class of the ear's former owner. The defined β
β β βclasses are: β
β β β 0 Amazon β
β β β 1 Sorceress β
β76 β3 β 2 Necromancer β
β β β 3 Paladin β
β β β 4 Barbarian β
β β β 5 Druid (Expansion character only) β
β β β 6 Assassin (Expansion character only) β
ββββββββββΌββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β79 β7 βCharacter level of the ear's former owner. β
ββββββββββΌββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β86 β7 βFirst character of the former owner's name. β
ββββββββββΌββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β93 β7 Γ N-1βSecond character of the former owner's name; Repeat until β
β β βyou get the whole name (15 characters maximum). β
ββββββββββΌββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β86 + 7 Γβ7 β0 (this indicates the end of the name) β
βN β β β
ββββββββββ΄ββββββββ΄βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Following the end of the name, the rest of the final byte will be padded with
0's if necessary, and the Player Ear structure ends there.
Item Structure part 2: Extended Items
By "extended items" I mean any items which are not simple. Simple items are
those which need no further information than that given above β such as gems,
potions, and small quest items β and their structure length is fixed at 14
bytes. Everything else has an extended structure with a possibly variable
length set of bit fields. First, I'll describe the part of the structure that
appears to be the same for all extended items. From that point on, there will
be no more "bit positions"; only "this field follows that field, if it exists".
ββββββββββ¬ββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Bit β Size β Contents β
βPositionβ β β
ββββββββββΌββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β βUnique identifier. Diablo II randomly generates a value for β
β β βthis field in order to discourage cheaters from "duping" β
β111 β32 βitems. Supposedly, if it detects more than one extended itemβ
β β βwith the same unique Id, it will delete the duplicates. (It β
β β βhasn't done that for me in single player mode, though.) β
ββββββββββΌββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β βThis appears to be the item's level; i.e., the level with β
β β βwhich the item was created (or 'dropped'). The item level isβ
β β βbased on the level of the monster who dropped it, the level β
β143 β7 βof the area you're in if found in a chest, or, in rare β
β β βcases, your characters level. The item level determines whatβ
β β βmodifiers are allowed on the item. β
β β βNote: this is just a theory at this point, but it seems to β
β β βhold for the items I've examined. β
ββββββββββΌββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β βItem quality. This field can be one of the following values,β
β β βwhich determines the quality-specific bit fields that β
β β βfollow: β
β β ββββββββββββββ¬βββββββββββββββββββββββββββββββββββ β
β β ββ1 βlow quality β β
β β ββββββββββββββΌβββββββββββββββββββββββββββββββββββ€ β
β β ββ2 βnormal β β
β β ββββββββββββββΌβββββββββββββββββββββββββββββββββββ€ β
β β ββ3 βhigh quality β β
β β ββββββββββββββΌβββββββββββββββββββββββββββββββββββ€ β
β150 β4 ββ4 βmagically enhanced β β
β β ββββββββββββββΌβββββββββββββββββββββββββββββββββββ€ β
β β ββ5 βpart of a set β β
β β ββββββββββββββΌβββββββββββββββββββββββββββββββββββ€ β
β β ββ6 βrare β β
β β ββββββββββββββΌβββββββββββββββββββββββββββββββββββ€ β
β β ββ7 βunique β β
β β ββββββββββββββΌβββββββββββββββββββββββββββββββββββ€ β
β β ββ8 βcrafted β β
β β ββββββββββββββ΄βββββββββββββββββββββββββββββββββββ β
β β βThanks go to Guillaume Courtin of France for finding the β
β β βvalue of crafted items. β
ββββββββββ΄ββββββββ΄βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
WARNING: DATA BELOW THIS POINT MAY CONTAIN ERRORS
Ring Data
After the above data, if the item is a ring, amulet, jewel, or charm, then it
has a 1 bit followed by three more bits. All other items (that I've seen) have
just a single 0 bit.
βββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Size β Contents β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β βIf this bit is set, the item has one of multiple pictures β
β βassociated with it; the next field determines which picture aβ
β1 βparticular item uses. If this bit is 0, the next field is β
β βabsent. The picture field is used for rings, amulets, jewels,β
β βand charms. β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββ€
β βPicture. Optional; only present if β β
β3 βthe previous bit is 1. This field β[Ring_of_the_Leech] β
β βchooses the particular graphic usedβ β
β βto display the ring. β β
βββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββ
From this point on, my information is very iffy.
Unknown Field
βββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Size β Contents β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β βThis bit apparently is set for certain class-specific β
β1 βExpansion Set items. It indicates the presence of the next β
β β11-bit field. If this bit is 0, the next field is absent. β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β βCredit for the discovery of this field's meaning goes β
β βentirely to Guillaume Courtin of France. Thanks! β
β βThis field indicates magic properties which are inherent in β
β βcertain class-specific items. A given class-specific item β
β βwill (almost) always start with the same set of properties, β
β βeven if its quality is "normal". Other quality ratings may β
β11 βadd more properties to the standard set. It appears that β
β βitems which will have this field are: β
β β β
β β β’ Amazon-only bows, spears, and javelins β
β β β’ Voodoo heads (Necromancer-only shields) β
β β β’ Paladin-only shields β
β β β’ Orbs (Sorceress-Only wands) β
βββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Low Quality Item Data
If the item is one of low quality, it has 3 more bits that give the quality
details:
βββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Size β Contents β
βββββββββββββββββΌβββββββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββ€
β βQuality: β β
β βββββββββ¬ββββββββββββββββββββ β β
β ββ0 βCrude β β β
β βββββββββΌββββββββββββββββββββ€ β β
β ββ1 βCracked β β β
β βββββββββΌββββββββββββββββββββ€ β β
β ββ2 βDamaged β β β
β βββββββββΌββββββββββββββββββββ€ β β
β3 ββ3 βLow Quality β β[Crude_Heavy_Boots] β
β βββββββββ΄ββββββββββββββββββββ β β
β βI haven't recorded any instances of β β
β βother values, but that doesn't mean β β
β βthere won't be any. Also, I'm β β
β βcertain the value has something to β β
β βdo with mods on an item's inherent β β
β β(non-recorded) properties, such as β β
β βweapon damage, but I haven't figuredβ β
β βout yet what the correlation is. β β
βββββββββββββββββ΄βββββββββββββββββββββββββββββββββββββ΄βββββββββββββββββββββββββ
Normal Item Data
Normal items have no extra quality data.
High Quality ("Superior") Item Data
If the item is one of high quality, it has 3 additional bits.
βββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Size β Contents β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β βunknown. I'm certain the value has something to do with mods β
β3 βon an item's inherent (non-recorded) properties, such as β
β βweapon damage, but I haven't figured out yet what the β
β βcorrelation is. β
βββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Magically Enhanced Item Data
[Sturdy_Spi] Magically enhanced items have two 11-bit fields representing the
item's prefix and suffix. Either one (but not both) may be omitted. The prefix
and suffix each are used in choosing the magical enhancements for an item
(although the enhancements are modifiable), and can also increase the minimum
level required to use them item and affect the item's color.
[Mesh_Belt_]
βββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Size β Contents β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β βItem prefix (i.e., "Gold" or "Tangerine"). I've started a β
β11 βlist of prefix identifiers, but it is very sparse at this β
β βtime. If this field is 0, the item has no prefix. β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β βItem suffix (i.e., "of Greed" or "of Life"). I've started a β
β11 βlist of suffix identifiers, but it is very sparse at this β
β βtime. If this field is 0, the item has no suffix. β
βββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Set Item Data
Set items have a 12-bit field containing the ID of the set. (Not the set
member, but the whole set.) The set member is identified by cross-referencing
the item type with the set Id. Also note that set items have an extra field
following the item-specific data.
βββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Size β Contents β
βββββββββββββββββΌββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββ€
β βSet identifier; i.e., allβ β
β βitems which are part of β β
β βthe set will have the β β
β βsame value in this field.β β
β βSince I've only β β
β βidentified a few set β β
β βitems, I'll give their β β
β βID's here: β β
β βββββββ¬ββββββββββββββ β β
β ββ2 βCleglaw's β β β
β ββ βBrace β β β
β βββββββΌββββββββββββββ€ β β
β ββ3 βIratha's β β β
β ββ βFinery β β β
β βββββββΌββββββββββββββ€ β β
β ββ4 βIsenhart's β β β
β12 ββ βArmory β β[Deaths_Hand_Leather_Gloves] β
β βββββββΌββββββββββββββ€ β β
β ββ6 βMilabrega's β β β
β ββ βRegalia β β β
β βββββββΌββββββββββββββ€ β β
β ββ7 βCathan's β β β
β ββ βTraps β β β
β βββββββΌββββββββββββββ€ β β
β ββ11 βBerserker's β β β
β ββ βArsenal β β β
β βββββββΌββββββββββββββ€ β β
β ββ12 βDeath's β β β
β ββ βDisguise β β β
β βββββββΌββββββββββββββ€ β β
β ββ13 βAngelic β β β
β ββ βRaiment β β β
β βββββββ΄ββββββββββββββ β β
βββββββββββββββββ΄ββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββ
Rare Item Data
[Loath_Song_Battle_Axe] This is by far the worst beast to decode. Rare items
have a variable number of bits before we get to the item contents, and this
number can vary anywhere from 55 to 88!
[Eagle_Mark_Amulet] Update 3/14/2002: EUREKA!! I've finally figured out the
variable fields!; See the table below.
βββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Size β Contents β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β8 βThis is the Id for the first word of the item's name (i.e., β
β β"Stone" or "Doom"). β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β8 βThis is the ID for the second word of the item's name (i.e., β
β β"Finger" or "Shroud"). β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β1 βIf this field is 1, the next 11-bit field is present. If 0, β
β βthe next field is absent. β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β βFirst magic prefix (optional). Although this "prefix" isn't β
β11 βactually shown in the item name, it is used in determining β
β βthe magical properties, required level, coloring, and other β
β βattributes of the rare item. β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β1 βIf this field is 1, the next 11-bit field is present. If 0, β
β βthe next field is absent. β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β βFirst magic suffix (optional). Although this "suffix" isn't β
β11 βactually shown in the item name, it is used in determining β
β βthe magical properties, required level, coloring, and other β
β βattributes of the rare item. β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β1 βIf this field is 1, the next 11-bit field is present. If 0, β
β βthe next field is absent. β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β11 βSecond magic prefix (optional) β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β1 βIf this field is 1, the next 11-bit field is present. If 0, β
β βthe next field is absent. β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β11 βSecond magic suffix (optional) β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β1 βIf this field is 1, the next 11-bit field is present. If 0, β
β βthe next field is absent. β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β11 βThird magic prefix (optional) β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β1 βIf this field is 1, the next 11-bit field is present. If 0, β
β βthe next field is absent. β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β11 βThird magic suffix (optional) β
βββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Unique Item Data
Unique items have an additional 12 bit field, which in most cases is the unique
item ID. The few exceptions are certain quest items (e.g., the Horadric Malus).
ββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Size β Contents β
ββββββββββββββββΌββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββ€
β βItem identifier. β β
β βSince I've only β β
β βidentified a few β β
β βunique items, I'll β β
β βgive their ID's β β
β βhere: β β
β ββββββββββ¬βββββββββββββ β
β ββ βUme's ββ β
β ββ13 βLament Grimββ β
β ββ βWand ββ β
β ββββββββββΌββββββββββββ€β β
β ββ31 βHellplague ββ β
β ββ βLong Sword ββ β
β ββββββββββΌββββββββββββ€β β
β ββ75 βWormskull ββ β
β ββ βBone Helm ββ β
β ββββββββββΌββββββββββββ€β β
β ββ βUndead ββ β
β ββ βCrown Crownββ β
β ββ77 β(no, that ββ β
β ββ βis not a ββ β
β ββ βtypo!) ββ β
β12 ββββββββββΌββββββββββββ€β[Hellplague] β
β ββ βGoldskin ββ β
β ββ91 βFull Plate ββ β
β ββ βMail ββ β
β ββββββββββΌββββββββββββ€β β
β ββ βNagelring ββ β
β ββ βRing (not aββ β
β ββ120 βtypo ββ β
β ββ βeither; I ββ β
β ββ βchecked) ββ β
β ββββββββββΌββββββββββββ€β β
β ββ123 βAmulet of ββ β
β ββ βthe Viper ββ β
β ββββββββββΌββββββββββββ€β β
β ββ125 βHoradric ββ β
β ββ βStaff ββ β
β ββββββββββΌββββββββββββ€β β
β ββ126 βHell Forge ββ β
β ββ βHammer ββ β
β ββββββββββΌββββββββββββ€β β
β ββ4095 β(other; ββ β
β ββ(0xFFF)βprobably a ββ β
β ββ βquest item)ββ β
β ββββββββββ΄βββββββββββββ β
ββββββββββββββββ΄ββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββ
Crafted Item Data
Crafted items appear to be coded exactly like rare items, having a rare name
(two parts) and six optional prefixes / suffixes.
βββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Size β Contents β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β8 βThis is the Id for the first word of the item's name (i.e., β
β β"Stone" or "Doom"). β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β8 βThis is the Id for the second word of the item's name (i.e., β
β β"Finger" or "Shroud"). β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β1 βIf this field is 1, the next 11-bit field is present. If 0, β
β βthe next field is absent. β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β βFirst magic prefix (optional). Although this "prefix" isn't β
β11 βactually shown in the item name, it is used in determining β
β βthe magical properties, required level, coloring, and other β
β βattributes of the crafted item. β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β1 βIf this field is 1, the next 11-bit field is present. If 0, β
β βthe next field is absent. β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β βFirst magic suffix (optional). Although this "suffix" isn't β
β11 βactually shown in the item name, it is used in determining β
β βthe magical properties, required level, coloring, and other β
β βattributes of the crafted item. β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β1 βIf this field is 1, the next 11-bit field is present. If 0, β
β βthe next field is absent. β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β11 βSecond magic prefix (optional) β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β1 βIf this field is 1, the next 11-bit field is present. If 0, β
β βthe next field is absent. β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β11 βSecond magic suffix (optional) β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β1 βIf this field is 1, the next 11-bit field is present. If 0, β
β βthe next field is absent. β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β11 βThird magic prefix (optional) β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β1 βIf this field is 1, the next 11-bit field is present. If 0, β
β βthe next field is absent. β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β11 βThird magic suffix (optional) β
βββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Rune Word
If the item has a rune word (indicated by bit 42 being set), there is an
additional field at this point.
βββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Size β Contents β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β βThis appears to be an index to the rune word, although I β
β12 βcan't say what the index is based on. The first rune word, β
β β"Ancient's Pledge", has a value of 27. The next rune word, β
β β"Black", has a value of 32. etc. β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β4 βUnknown; the value is 5 on all items I've looked at. β
βββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Personalization
The following segment is present if and only if the item is personalized (i.e.,
bit 40 is set). Only armor and weapons (except for quest items) can be
personalized.
βββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Size β Contents β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β7 βFirst character of the owner's name (just plain ASCII!) β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β7 βSecond character of the owner's name β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β7 Γ N-2 βRepeat until you get the whole name (15 characters maximum) β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β7 β0 (this indicates the end of the name) β
βββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Unknown Field MAYBE WROOOOONG
All items have this field between the personalization (if it exists) and the
item-specific data:
βββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Size β Contents β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β1 βunknown; this usually is 0, but is 1 on a Tome of Identify. β
β β(It's still 0 on a Tome of Townportal.) β
βββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Item Structure part 3: Item-Specific Data
The presence of the following fields depends on the item type. Fields which are
present will be stored in the order shown. Unfortunately there is no means of
telling which fields are present from the item data itself; you need to look up
the item type in a table to figure out whether it is a weapon, armor, or stack,
and read the fields accordingly.
Armor: Defense Rating
βββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Size β Contents β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β βDefense value +10. i.e., a defense rating of 23 would be β
β βstored in this field as 33; thus the maximum defense value β
β10 βyou can store is 1013 (although I haven't tried it). Note β
β βthat this is the base defense rating, before applying any β
β βmagical enhancements (i.e., the number shown in white). β
βββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Armor and Weapons: Durability
Even though stacked weapons don't show any durability rating in the game, they
still have two 8-bit fields in the same spot. This includes bombs (exploding
and gas potions). The values in such cases are very small, so I'm not sure what
they mean.
βββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Size β Contents β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β βMaximum Durability. Note that this is the base durability, β
β βbefore applying any magical enhancements (i.e., the number β
β8 βshown in white). β
β βNote: I've found an indestructable item, and it appears that β
β βin such a case the maximum durability field is zero! β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β βCurrent Durability. This may be greater than the maximum β
β8 βdurability if the item is magically enhanced. β
β βNote: I've found an indestructable item, and it appears that β
β βin such a case the current durability field is missing! β
βββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Armor and (non-stacked) Weapons: Sockets
The following field is present if and only if the item is socketed (i.e., bit
27 is set).
βββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Size β Contents β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββ€
β βNumber of sockets β β
β βNote that even though this field isβ β
β β4 bits wide, each item type has a β β
β4 βbuilt-in upper limit to the total β[Socketed_Mask] β
β βnumber of sockets. This limit is β β
β βbuilt into the game. The most I've β β
β βever seen is 6 for, e.g., a gothic β β
β βaxe. β β
βββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββ
Tomes:
Tomes have an extra 5 bits inserted at this point. I have no idea what purpose
they serve. It looks like the value is 0 on all of my tomes.
βββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Size β Contents β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β5 βunknown β
βββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Stacked Weapons, Quivers, Keys, and Tomes: Quantity
βββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Size β Contents β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β9 βQuantity β
βββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Item Structure part 3: Magical Enhancements
Item Structure part 2^bis: Set Item Data Revisited
Items which are part of a set have an additional 5 bits following the
item-specific data.
βββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Size β Contents β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β βThis appears to be an indicator of how many lists of magic β
β βproperties follows. The first list are the properties the β
β5 βitem has if you do not have any other members of the set. β
β βFollowing lists are applied once you equip other items in theβ
β βset. The value is 1 if there are two (total) property lists, β
β βor 3 if there are three property lists. β
βββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Following the item-specific data are a variable number of variable length bit
fields describing any magical enhancements placed on the item. Each property
begins with a 9-bit identifier. An identifier of 0x1FF (all 1's) indicates the
end of the property list ... except in the event the item belongs to a set, in
which case there will be another one or two groups of magical properties
following, depending on whether the set item data (above) is 1 or 3,
respectively. Also, if an item has been given a Rune Word, it appears that the
Rune Word's properties begin with a 0x1FF identifier (presumably to set them
apart from the item's normal properties... but I need to examine more items to
be certain.)
Because the number of bits (and fields) after the 9-bit identifier varies, I do
not give a field width here. Instead, check my table of magic properties for
field sizes. I'm sure it's not complete, but it does have most of the common
properties.
Following the last 9-bit value of 0x1FF, the rest of the final byte will be
padded with 0's if necessary, and the item structure ends there. For example,
if the item had 341 bits of data, the last (43^rd) byte will be 0x1F. If the
item had 248 bits of data, the last (31^st) byte will be 0xFF.