ITEMTYPE.DAT field reference
File page · Format catalogue · Schema source
This page is generated from the Kaitai schema ITEMTYPE_DAT.ksy each time the site is built. The schema is the authoritative description; statements are established unless marked inferred or unknown, and the evidence is listed on the file page (see the reading guide).
- Schema: Eye of the Beholder II DOS item type data
- Byte order: little-endian
- Schema license:
MIT
Description
ITEMTYPE.DAT describes the properties shared by all items of a type: where they can be carried or worn, which classes can use them, how many hands they need, their damage dice, their defense adjustment and their kind, which decides what using them does. It holds a 16-bit count followed by 16-byte records; the type of an ITEM.DAT item indexes this table. The game copies the records into memory, where they can change; see ItemTypeRuntime. See the format overview.
The game reads the count and copies each record into its item-type table, at 16 × type. Fields are used by name formatting, the placement check, the use of an item by kind, the class check, the hand checks, the damage dice and the defense recomputation. See items and inventory for the rules.
The game reads none of usage_mask_raw, damage_bonus_b_raw, unknown_0d or the bits of properties_raw above 0x80, apart from one whole-word comparison noted below; it only loads, saves and restores them.
Unknown: the signedness of several fields, and versions other than the single original file.
File structure
| Field | Type | Size, repetition and constraints |
|---|---|---|
num_types | u2 | — |
types | item_type | repeated num_types times |
trailing_unknown | bytes to end of stream | — |
num_types
Number of 16-byte item-type records that follow.
types
Type properties in index order, copied into memory.
trailing_unknown
Trailing bytes, unknown; none in the original file.
Type item_type
One item-type record, indexed by the type of an ITEM.DAT item. The rules that use its fields are described in items and inventory.
| Field | Type | Size, repetition and constraints |
|---|---|---|
inventory_slot_mask | u2 | — |
usage_mask_raw | u2 | — |
defense_adjustment_raw | s1 | — |
character_class_mask | u1 | — |
hand_requirement_raw | u1 | — |
damage_dice_count_a | s1 | — |
damage_die_sides_a | s1 | — |
damage_bonus_a | s1 | — |
damage_dice_count_b | s1 | — |
damage_die_sides_b | s1 | — |
damage_bonus_b_raw | s1 | — |
unknown_0d | u1 | — |
properties_raw | u2 | — |
inventory_slot_mask
An item fits an inventory slot when this mask shares a bit with the slot's mask in the executable; the bits are described by InventorySlotMask. In the original file every type that has a nonzero mask has the hand bit 0x0008; the conjured-weapon types 51 to 56 have 0. The mask of each type of the original file is listed in the item catalogue.
usage_mask_raw
Never read by the game; the conjured-weapon type routine writes 0 there, and the loader and saved games copy it. In the original file it is a subset of inventory_slot_mask in all 64 types (equal in 34). Its intended meaning, if any, is unknown.
defense_adjustment_raw
The defense recomputation adds it, as a byte, to the character's defense (byte +0x1f) for an item of kind 0 worn as body armour or bracers, or a shield (types 27 and 57) in a hand, and subtracts the item's value; values above 0x7f therefore act as negative numbers. The value -30 marks a free conjured-weapon type. The helmet type's adjustment is never read; see what worn items change.
character_class_mask
ANDed with a mask selected by the character's class in the usability check; see CharacterClassMask.
hand_requirement_raw
Read by the hand checks. With 2 in the first hand, the second hand cannot be used; a weapon (kinds 1 to 3) with a nonzero value cannot be used from the second hand; values other than 0 and 2 act as 1. See two hands.
damage_dice_count_a
Number of dice in the first damage branch.
damage_die_sides_a
Sides per die in the first damage branch.
damage_bonus_a
Added to the roll by both damage branches, including the one that uses dice B.
damage_dice_count_b
Number of dice in the alternate damage branch.
damage_die_sides_b
Sides per die in the alternate damage branch.
damage_bonus_b_raw
The bonus of dice B (inferred from its position). Never read by the game: the damage routine adds damage_bonus_a to both profiles, and the conjured-weapon type routine writes the same value in both bonus bytes; see the damage profiles.
unknown_0d
Never read or written by the game except when whole records are loaded, saved and restored; 0 in all 64 types of the original file. Its intended meaning, if any, is unknown.
properties_raw
The low seven bits are the item's kind, described by ItemKind: they select what using the item does (21 cases, 0 to 20), how its name is built and whether it counts for the defense. The types of each kind of the original file are listed with the items of the game. Bit 0x80 marks the items a monster can take from an inventory; in the original file types 1, 2, 4, 5, 9 to 12, 15, 19 to 21, 24, 25, 27, 28, 42, 43, 47, 48, 57, 58 and 62 have it; see what a monster can take. Bits 0x0100 to 0x8000 are 0 in the original file and tested nowhere; the only read of the whole word, in a check for a holy symbol in a hand that nothing calls, compares it with 6.