ITM file format

Applies to:
IWD2

General Description
This file format describes an "item". Items include weapons, armor, books, scrolls, rings and more. Items can have attached abilties, occuring either when a target creature it hit, or when the item is equipped. ITM files have a similar structure to SPL files.

Header: Size = 114 Bytes Ext. Header: Size = 56 Bytes Feature Block: Size = 48 Bytes

Detailed Description
ITM files consist of a main header, zero or more extended headers (each containing zero or more feature blocks) and zero or more casting feature blocks. All the feature blocks are stored as a continuous data segment, with each extended header containing an offset into this data, and the main header containing an offset into this data for the casting feature blocks.

Overall structure:



Offset Size (datatype) Description
0x0000 4 (char array) Signature ('ITM ')
0x0004 4 (char array) Version ('V2.0')
0x0008 4 (strref) Unidentified Name (strref)
0x000c 4 (strref) Identified Name (strref)
0x0010 8 (resref) Replacement item (ITM)
0x0018 4 (dword) Flags
0x001c 2 (word) Item type
0x001e 1*4 (byte) Usability bitmask
0x0022 2 (char array) Weapon animation
0x0024 2 (word) Min Level
0x0026 2 (word) Min Strength
0x0028 1 (byte) Min Strength Bonus (unused in BG1)
Note: A strength of 19 or above is considered to have a Strength Bonus of 0, and would therefore not be able to equip any weapon with a Strength Bonus restriction.
0x0029 1 (byte) Kit usability 1/4
0x002a 1 (byte) Min Intelligence
0x002b 1 (byte) Kit usability 2/4
0x002c 1 (byte) Min Dexterity
0x002d 1 (byte) Kit usability 3/4
0x002e 1 (byte) Min Wisdom
0x002f 1 (byte) Kit usability 4/4
0x0030 1 (byte) Min Constitution
0x0031 1 (byte) Weapon proficiency
0x0032 2 (word) Min Charisma
0x0034 4 (dword) Price
0x0038 2 (word) Stack amount
0x003a 8 (resref) Inventory icon (BAM)
0x0042 2 (word) Lore to ID
0x0044 8 (resref) Ground icon (BAM)
0x004c 4 (dword) Weight
0x0050 4 (strref) Unidentified Description (strref)
0x0054 4 (strref) Identified Description (strref)
0x0058 8 (resref) Description icon (BAM)
0x0060 4 (dword) Enchantment
0x0064 4 (dword) Offset to extended headers
0x0068 2 (word) Count of extended headers
0x006a 4 (dword) Offset to feature blocks
0x006e 2 (word) Index into equipping feature blocks
0x0070 2 (word) Count of equipping feature blocks
0x0072 16 (byte)
Unknown


Items can have several "abilities" that correspond to an action the item can do (e.g. melee attacks, projectile attacks, spell-casting etc.). Each of these abilities is specified through an extended header. Only the first three extended headers can have charges (extended headers further than this use the charges of the first extended header). Tooltips for item abilities are set through tooltips.2da.

NB. For items to be stackable, they must contain at least one extension header, even if it is empty.
NB. For an attack type of projectile, if the projectile type is set to 1,2 or 3, the weapon will use the attack speed of the ammunition.

Offset Size (datatype) Description
0x0000 1 (char) Attack type
  • 0 = None
  • 1 = Melee
  • 2 = Projectile
  • 3 = Magic
  • 4 = Launcher
0x0001 1 (char) ID Req.
  • bit 0: ID Required
  • bit 1: Non-ID Required
0x0002 1 (char) Location
  • 0 = None
  • 1 = Weapon
  • 2 = Spell
  • 3 = Equipment
  • 4 = Innate
0x0003 1 (char) Alternative dice sides
0x0004 8 (resref) Use icon
0x000c 1 (char) Target type
  • 0 = Invalid (cannot be selected)
  • 1 = Creature
  • 2 = Crash
  • 3 = Character potrait
  • 4 = Area
  • 5 = Self
  • 6 = Crash
  • 7 = None (Self, ignores game pause)
0x000d 1 (char) Target count
0x000e 2 (word) Range
0x0010 1 (byte) Projectile type
  • 0 = None
  • 1 = Arrow
  • 2 = Bolt
  • 3 = Bullet
0x0011 1 (byte) Alternative dice thrown
0x0012 1 (byte) Speed
0x0013 1 (byte) Alternative damage bonus
0x0014 2 (word) THAC0 bonus
0x0016 1 (byte) Dice sides
0x0017 1 (byte) Primary type
0x0018 1 (byte) Dice thrown
0x0019 1 (byte) Secondary type
0x001a 2 (word) Damage bonus
0x001c 2 (word) Damage type
  • 0 = None
  • 1 = Piercing/Magic
  • 2 = Blunt
  • 3 = Slashing
  • 4 = Ranged
  • 5 = Fists
  • 6 = Piercing/Blunt (more)
  • 7 = Piercing/Slashing (more)
  • 8 = Blunt/Slashing (less)
  • 9 = Blunt missile
0x001e 2 (word) Count of feature blocks
0x0020 2 (word) Index into feature blocks
0x0022 2 (word) Charges
0x0024 2 (word) Charge depletion behaviour
  • 0 = Don't vanish
  • 1 = Expended
  • 2 = Expended (w/o sound)
  • 3 = Recharge each day
0x0026 2 (word) Flags
0x0028 2 (word) Attack type
  • 0 = Normal
  • 1 = Bypass armor
  • 2 = Keen
0x002a 2 (word) Projectile animation (projectl.ids/missile.ids)
0x002c 2*3 (word) Melee animation
0x0032 2 (word) Bow/Arrow qualifier (0=No, 1=Yes)
0x0034 2 (word) Crossbow/Bolt qualifier (0=No, 1=Yes)
0x0036 2 (word) Misc. Projectile qualifier (0=No, 1=Yes)


Any action carried out by an item is done by feature blocks, each of which holds an effect number as well as targetting and timing information.

Offset Size (datatype) Description
0x0000 2 (word) Opcode number
0x0002 1 (char) Target type
  • 0 = None
  • 1 = Self (pre-projectile)
  • 2 = Pre-target
  • 3 = Party
  • 4 = Everyone (inc. party)
  • 5 = Everyone (excl. party)
  • 6 = Everyone matching specific value of caster (or Party if cast by party member)
  • 7 = Everyone matching specific value of target
  • 8 = Everyone (excl. caster)
  • 9 = Self (post-projectile)
0x0003 1 (char) Power
0x0004 4 (dword) Parameter 1
0x0008 4 (dword) Parameter 2
0x000c 1 (char) Timing mode
  • 0 = Duration
  • 1 = Permanent
  • 2 = While equipped
  • 3 = Delayed Duration
  • 4 = Delayed
  • 5 = Delayed (transforms to 8)
  • 6 = Duration?
  • 7 = Permanent?
  • 8 = Permanent (unsaved)
  • 9 = Permanent (after Death)
  • 10 = Trigger
  • 4096 = Absolute duration
0x000d 1 (char) Resistance

The default behaviour is that effects cannot be dispelled and ignore resistance.
  • bit 0: Can be dispelled, affected by resistance
  • bit 1: Ignores resistance (when used in combination with bit 0)

This can also be presented in the more traditional way:
  • 0 = Nonmagical
  • 1 = Can be dispelled/Affected by resistance
  • 2 = Cannot be dispelled/Ignores resistance
  • 3 = Can be dispelled/Ignores resistance
0x000e 4 (dword) Duration
0x0012 1 (char) Probability 1
0x0013 1 (char) Probability 2
0x0014 8 (resref) Resource
0x001c 4 (dword) Dice Thrown
0x0020 4 (dword) Dice Sides
0x0024 4 (dword) Saving throw type
  • bit 0: Spells
  • bit 1: Breathe
  • bit 2: Death
  • bit 3: Wands
  • bit 4: Polymorph
NB. If more than 1 saving throw type is specified, the target rolls against their best save.
0x0028 4 (dword) Saving throw bonus
0x002c 4 (dword) Special



Header Flags

Bit Byte 1 Byte 2 Byte 3 Byte 4
0 Unsellable (critical item, kept on ground) Silver Unknown Unknown
1 Two-handed Cold-Iron Unknown Unknown
2 Movable Stolen (unsellable) Unknown Unknown
3 Displayable Cannot place in carryable container Unknown Unknown
4 Cursed Pulsating Unknown Unknown
5 Unknown Unknown Unknown Unknown
6 Magical Unknown Unknown Unknown
7 Bow Unknown Unknown Unknown

Header Item Type

The item type of an item affects the pick-up/put-down sound when moving the item in the inventory, whether stores will buy the item and the ability buttons shown on the item description screen.

Code Item type
0x0000 Books/misc
0x0001 Amulets and necklaces
0x0002 Armor
0x0003 Belts and girdles
0x0004 Boots
0x0005 Arrows
0x0006 Bracers and gauntlets
0x0007 Helms, hats, and other head-wear
0x0008 Keys (not in Icewind Dale?)
0x0009 Potions
0x000a Rings
0x000b Scrolls
0x000c Shields (not in IWD)
0x000d Food
0x000e Bullets (for a sling)
0x000f Bows
0x0010 Daggers
0x0011 Maces (in BG, this includes clubs)
0x0012 Slings
0x0013 Small swords
0x0014 Large swords
0x0015 Hammers
0x0016 Morning stars
0x0017 Flails
0x0018 Darts
0x0019 Axes (specifically, 1-handed axes -- halberds and 2-handed polearms not included)
0x001a Quarterstaff
0x001b Crossbow
0x001c Hand-to-hand weapons (fist, fist irons, punch daggers, etc)
0x001d Spears
0x001e Halberds (2-handed polearms)
0x001f Crossbow bolts
0x0020 Cloaks and robes
0x0021 Gold pieces (not an inventory item, but can appear as "monster dropped" treasure)
0x0022 Gems
0x0023 Wands
0x0024 Containers
0x0025 Books
0x0026 Familiars
0x0027 Tattoos (PST)
0x0028 Lenses (PST)
0x0029 Bucklers/teeth
0x002a Candles
0x002b Child body
0x002c Clubs
0x002d Female body
0x002e Key
0x002f Large Shields
0x0030 Male body
0x0031 Medium Shields
0x0032 Notes
0x0033 Rods
0x0034 Skulls
0x0035 Small Shields
0x0036 Spider body
0x0037 Telescopes
0x0038 Drinks
0x0039 Great Swords
0x003a Container
0x003b Fur/pelt
0x003c Leather Armor
0x003d Studded Leather Armor
0x003e Chain Mail
0x003f Splint Mail
0x0040 Half Plate
0x0041 Full Plate
0x0042 Hide Armor
0x0043 Robe
0x0044 Scale Mail
0x0045 Bastard Sword
0x0046 Scarf
0x0047 Food
0x0048 Hat
0x0049 Gauntlet

Header Usability

Bit Byte 1 Byte 2 Byte 3 Byte 4
0 Barbarian Rogue Lawful Dwarf
1 Bard Sorcerer Neutral Half-Elf
2 Cleric Wizard Unknown Halfling
3 Druid Unknown Unknown Human
4 Fighter Chaotic Unknown Gnome
5 Monk Evil Unknown Half-Orc
6 Paladin Good Unknown Unknown
7 Ranger ... Neutral Elf Unknown

Kit usability

Bit Byte 1 Byte 2 Byte 3 Byte 4
0 Unused Cleric of Lathander Diviner Paladin of Ilmater
1 Unused Cleric of Selune Enchanter Paladin of Helm
2 Unused Cleric of Helm Illusionist Paladin of Mystra
3 Unused Cleric of Oghma Evoker Monk of the Old Order
4 Unused Cleric of Tempus Necromancer Monk of the Broken Ones
5 Unused Cleric of Bane Transmuter Monk of the Dark Moon
6 Unused Cleric of Mask Generalist mage Abjurer
7 Unused Cleric of Talos Cleric of Ilmater Conjurer

Extension Header Flags

Bit Byte 1 Byte 2
0 Add strength bonus Unknown
1 Breakable Unknown
2 Unknown Hostile
3 Unknown Recharges
4 Unknown Unknown
5 Unknown Unknown
6 Unknown Unknown
7 Unknown Unknown