Item file (items.000) structure
===============================
All integers in the file are either 32-bit signed or 8-bit unsigned.
In the tables below "var" length denotes a variable-length field.
Arrays will start with a length field, followed by a number of records equal
to the length field. i.e if length is 0, then no array follows.
The item file is a header, followed by an array of items, with the following structure:
Field | Len | Notes
------------|-----|-------------------------
head | 4 | Always = -101
num_special | 4 | Number of "special" items
len_ids | 4 | Length of ID array
ids | var | Signed 32-bit int array of len_ids length
id_check | 4 | Last ID in ids, repeated
len_items | 4 | Number of items in the list that follows
items | var | Array of len_items item records
The ids array will contain some place holders with ID of 0, and these
ids don't appear in the items list.
Item record structure
---------------------
Field | Len | Notes
------------|-----|-------------------------
| 1 | Always 0
id | 4 | Item ID
is_special | 1 | Boolean. 1 if item is "special" (wearable)
special | var | Special record (see below)
len_title | 4 | Length of following string
title | var | Item title
damage | 12 | (Min, Max, Bonus) damage
armor | 4 | Armor rating
charm_slots | 4 | Number of charm slots
durability | 8 | (Max, Current) durability
? | 4 | ? Seems to always be zero
? | 4 | ? Equals 1 for 7 items, else 0
? | 4 | ? Equals 1 for 34 items, 2 for 1, else 0
boosts | 24 | Bonus to (vit, mag, off, def, sight, hearing)
resistances | 16 | Add (lightning, poison, fire, spirit) resistance
id_level | 4 | Identify level needed. Usually = special.rank.
identified | 1 | Boolean. 1 if item identified
speed | 4 | Bonus to speed
kind | 4 | Item category. (Not the same as equipped slot.)
required | 16 | Required attributes (str, agl, int, con)
bonuses | 16 | Bonus to attributes (str, agl, int, con)
len_title | 4 | Length of following string
title | var | Item title
len_charms | 4 | Number of charms
charms | var | Array of charm records
len_props | 4 | Number of properties
properties | var | Array of property records
### Charm and Property record structure
Field | Len | Notes
---------|-----|-------------------------
len_name | 4 | Length of following string
name | var | Property or charm name
val | 4 | Value of property or charm
end | 1 | Allways zero. Marks end of property record
Special record structure
------------------------
Field | Len | Notes
------------|-----|-------------------------
? | 4 | ? always equal 0 ?
len_skills | 4 | Number of skill records
skills | var | Array of skill records (132-bytes each)
? | 4 |
len_title | 4 | Length of following string
title | var | Item title
len_name | 4 | Length of following string
name | var | Name of special item
? | 4 | -1 for most. 0 for bows and crossbows?
slot | 4 | Item slot taken (i.e. legs, head, weapon, etc.)
is_2h | 1 | Boolean for Two-Handed?
is_bow | 1 | Boolean for Ranged? Seems to be 1 if bow.
? | 4 | Seems to always be 0.
rank | 4 | Item rank (determines name color)
? | 1 | ? Seems to always be 1
damage | 12 | (Min, Max, Bonus) damage
armor | 4 | Armor rating
? | 4 | ? seems to always be 0
durability | 8 | (Max, Current) durability
? | 61 | All zeros, except 3 items
kind | 4 | Item category
required | 16 | Required attributes (str, agl, int, con)
bonuses | 16 | ? Bonus to attributes (str, agl, int, con)
len_title | 4 | Length of following string
title | var | Item title
is_2h | 1 | Seems to always match is_2h
is_bow | 1 | Seems to always match is_bow
? | 6 | Seems to always be 0.
has_props | 4 | Equals 1 if a special props record follows
props | var | Only one item has this. Record is detailed below
### Special properties structure
Field | Len | Notes
------------|-----|-------------------------
len_list1 | 4 | Length of first property list
len_list2 | 4 | Length of second property list
? | 4 | ?
? | 4 | ?
? | 4 | ?
list1 | var | Array of (p32_string, int) pairs
list2 | var | Array of (p32_string, int) pairs
len_title | 4 | Length of following string
title | var | Item title