Skip to main content

Item types

ItemType · 1 byte, type_raw of ItemRuntime, sign-extended when compared

Items · Magic · The engine in ten minutes

An item's type selects its shared properties in ItemTypeRuntime and lets the game look for a particular kind of item. The enumeration names only the types that the examined code or scripts single out; it is not a complete list: all 64 types of the original file are in the item catalogue.

typedef enum ItemType {
ITEM_TYPE_LONG_SWORD = 0x01, /* Long swords; one of value 1 or more is taken when Insal leaves. */
ITEM_TYPE_SHORT_SWORD = 0x02, /* Short swords; taken instead when no long sword qualifies. */
ITEM_TYPE_SKULL = 0x06, /* Skulls; tested as the held item by level scripts (level 7). */
ITEM_TYPE_BOW = 0x07, /* Long and composite bows; their ammunition is ITEM_TYPE_ARROW. */
ITEM_TYPE_FEMUR = 0x08, /* Femurs; tested as the held item by level scripts (level 7). */
ITEM_TYPE_SLING = 0x0e, /* Sling; its ammunition is ITEM_TYPE_ROCK. */
ITEM_TYPE_ARROW = 0x10, /* Arrows; taken from the hands, then the quiver; the only type a niche gives to the quiver. */
ITEM_TYPE_HORN = 0x11, /* Horns; tested by value as the last used item on level 5 (the four winds). */
ITEM_TYPE_ROCK = 0x12, /* Rocks; taken from the first inventory slot holding one. */
ITEM_TYPE_SPELL_SPHERE = 0x1a, /* The Fire Sphere and magic dust; used up when their spell is cast. */
ITEM_TYPE_SHIELD = 0x1b, /* Shields; one of the two types counted by the defense in a hand. */
ITEM_TYPE_LOCK_PICKS = 0x1c, /* Lock picks; tested as the held item at the pickable locks of ten levels. */
ITEM_TYPE_SPELLBOOK = 0x1d, /* Spellbook; carrying one lets a character recover mage spells while resting. */
ITEM_TYPE_HOLY_SYMBOL = 0x1e, /* Cleric and paladin holy symbols; needed to recover cleric spells and to heal while resting. */
ITEM_TYPE_RATIONS = 0x1f, /* Iron Rations, Rations and rotten food; the only type eaten; up to three of value 0 or more are taken when Insal leaves. */
ITEM_TYPE_BONES = 0x21, /* Sets of bones; their value selects a character preset for resurrection. */
ITEM_TYPE_MAGE_SCROLL = 0x22, /* Scroll searched when a mage copies a spell into the spellbook; used up when cast. */
ITEM_TYPE_CLERIC_SCROLL = 0x23, /* Cleric scrolls; used up when cast. */
ITEM_TYPE_PARCHMENT = 0x24, /* Parchments and tomes; tested as the held item by level scripts (level 8). */
ITEM_TYPE_STONE_ITEM = 0x25, /* The Stone Cross, Dagger, Gem, Necklace, Sphere...; tested as the held item on levels 3, 6 and 14. */
ITEM_TYPE_KEY = 0x26, /* Keys, and the Tooth and Tuning Fork; filtered by item-removal scripts. */
ITEM_TYPE_POTION = 0x27, /* Potions; up to three of value 1 are taken when Insal leaves. */
ITEM_TYPE_GEM = 0x28, /* Gems and the tropelet seed; filtered by item-removal scripts. */
ITEM_TYPE_QUEST_ITEM = 0x2e, /* Coins, the Mantis Idol, the parts of Talon...; values 5 and 6 removed by SCRIPT_SPECIAL_EVENT_REMOVE_QUEST_ITEMS. */
ITEM_TYPE_RING = 0x2f, /* Rings, searched in inventory slots 25 and 26 with a given value: 1 Wizardry, 2 Sustenance, 3 Feather Fall. */
ITEM_TYPE_WAND = 0x30, /* Wands usable by mages; lose a charge when used. */
ITEM_TYPE_MEDUSA_SHIELD = 0x39, /* The Medusa Shield; the other type counted by the defense in a hand. */
ITEM_TYPE_SPELL_AMULET = 0x3a, /* An amulet of kind ITEM_KIND_CLERIC_SCROLL, only a template in the original data; used up when cast. */
ITEM_TYPE_CRYSTAL_HAMMER = 0x3c, /* The Crystal Hammer; tested as the last used item on level 6. */
ITEM_TYPE_WAND_ANY_CLASS = 0x3e, /* Wands usable by every class; lose a charge when used. */
ITEM_TYPE_STICKY_PAPER = 0x3f /* Sticky Paper; counted in a block by a level 15 script. */
} ItemType;

All types of the original file​

The 64 types of the original ITEMTYPE.DAT, with their properties and the names of their items, are in the item catalogue, and grouped by kind on the same page.

Where it is used​

  • Defense. In a hand, only ITEM_TYPE_SHIELD and ITEM_TYPE_MEDUSA_SHIELD count; see what worn items change.1

  • Launchers. ITEM_TYPE_BOW fires ITEM_TYPE_ARROW, ITEM_TYPE_SLING fires ITEM_TYPE_ROCK; see throwing and launching items.2

  • Spells cast from items. ITEM_TYPE_SPELL_SPHERE, ITEM_TYPE_MAGE_SCROLL, ITEM_TYPE_CLERIC_SCROLL and ITEM_TYPE_SPELL_AMULET are used up; ITEM_TYPE_WAND and ITEM_TYPE_WAND_ANY_CLASS lose a charge; other types are kept; see spells cast from items.3

  • Food. Only ITEM_TYPE_RATIONS is eaten; see food and other uses.

  • Wizardry. An ITEM_TYPE_RING of value 1 doubles a mage's spell slots of levels 4 and 5; see what worn items change.4

  • Copying a mage spell. The game searches the inventory for an ITEM_TYPE_MAGE_SCROLL whose value_raw is the spell; see Magic.5

  • Damage. Damage flags can cancel damage when the target carries an ITEM_TYPE_RING with value 3.4

  • Food. The food update searches for an ITEM_TYPE_RING with value 2, without effect; see food.4

  • Resting. A character recovers its used cleric spells only while it carries an ITEM_TYPE_HOLY_SYMBOL, and its mage spells only with an ITEM_TYPE_SPELLBOOK; healers need a holy symbol too. The rest's food step searches for an ITEM_TYPE_RING with value 2, again without effect; see resting.6

  • Insal's departure takes long or short swords, rations, potions and rings from the party; see Insal leaves.7

  • Special events. Special event 5 deletes the party's items of type ITEM_TYPE_QUEST_ITEM.8

  • Scripts select items by type when they move, delete or count items: see move instruction targets, item removal targets and item properties in conditions.

Sources​

Locations refer to the game executable reference.

Footnotes​

  1. Recompute a character's defense. ↩

  2. Use a launcher, the launcher ammunition and the wall-click dispatchers (niches). ↩

  3. Cast a spell from an item and eat the item in hand. ↩

  4. Ring search. ↩ ↩2 ↩3

  5. Scroll copying and inventory search by type and value. ↩

  6. Rest and spells left to recover, with the inventory search by type and value. ↩

  7. Insal leaves and remove items from the party. ↩

  8. Special event handler and delete items by type and value. ↩