Items
Home · The engine in ten minutes · ItemRuntime ·
ItemTypeRuntime
In brief
Items are entries of one table of 600, whose initial content is read from ITEM.DAT. Items of the same kind share an item type loaded from ITEMTYPE.DAT, which says which inventory slots accept them, which classes can use them, how much damage they do and what using them does. Each character has 27 inventory slots. Worn armour, shields, bracers and a ring set a character's defense; using an item depends on its kind: an attack, a spell, a potion, a text, food. Items lying in a block form piles; a thrown item flies half a block at a time and falls where its flight ends. The whole item table is saved with the game.
Where item data comes from
| Data | Loaded from | Kept as |
|---|---|---|
| Individual items | ITEM.DAT records | ItemRuntime entries |
| Item names | ITEM.DAT name slots | Two name indices per item: before and after identification |
| Shared item-type properties | ITEMTYPE.DAT | ItemTypeRuntime entries |
An item's own fields say where it is, whether it is identified, cursed or
magical, and its value, whose meaning depends on its kind: the enchantment
of a weapon or piece of armour, the spell of a scroll, the potion or the
wand's spell, the food points of a ration. Its type gives everything shared:
the slots it fits, the classes allowed, the damage dice, the defense
adjustment, how many hands it needs and its ItemKind,
which decides what using it does.12
Item names
An unidentified item shows its first name, an identified one its second. When the second name is empty, the game builds the name from the item's kind and value:3
| Kind | Name of an identified item |
|---|---|
| Worn items and weapons (kinds 0 to 3) | "+n name", or "n Cursed name" for a negative value; the plain name for 0. |
ITEM_KIND_MAGE_SCROLL, ITEM_KIND_CLERIC_SCROLL | "Mage Scroll of …" or "Cleric Scroll of …" with the full name of the spell definition. |
ITEM_KIND_RING | "Ring of" Adornment, Wizardry, Sustenance or Feather Fall. |
ITEM_KIND_POTION | "Potion of" Giant Strength, Healing, Extra Healing, Poison, Vitality, Speed, Invisibility or Cure Poison. |
ITEM_KIND_WAND | "Wand of" Stick, Lightning, Frost, Curing, Fireball, Magic Missile or Dispel Magic; a wand of value 5 keeps its first name. |
The ring names are read from a list of six entries without checking the value, so a ring whose value is beyond the list takes a name from the lists that follow it. Identified, the Crimson Ring, of value 10, would be named "Ring of Vitality", a potion's word. A ring held in a hand can be identified by Improved Identify. A faithful reimplementation reads the names as one continuous list.
The pages of this chapter
| Page | What it covers |
|---|---|
| The inventory | The 27 slots, moving and equipping items, the selected character, two hands. |
| What worn items change | Defense, the rings that act while worn, what a monster can take. |
| Using items | What each kind of item does when used; food, books, texts and horns. |
| Potions, scrolls and wands | Potions, spells cast from items, wand charges. |
| On the floor and in the air | Piles and niches, taking and dropping, throwing and launching. |
| Where an item is | Locations, new items, level changes and saves, scripts. |
| The item types | The 64 types and what their items share. |
| Kinds, slots and records | Types by kind and by slot mask; templates and flag bytes. |
| Weapons, armour and food | Enchantments, named weapons, rations and bones. |
| Scrolls and parchments | The spells of the scrolls and the texts of the parchments. |
| Potions, wands, rings and amulets | The values that select their effects. |
| Keys, gems and quest items | The objects the level scripts test. |
Sources
Locations refer to the game executable reference.