--- title: "ITM file format" regenerate: true --- {% include relurl.html %}
ITM file format

Applies to:
BG1, BG1: TotS, BG2, BG2: ToB, IWD, IWD:HoW, IWD:TotL, BGEE

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.
NB. A creature must meet the minimum stat requirements to be able to converse with an item.

Overall structure:

{% assign offset_header_name = "itmv1_Header" %} {% assign offset_header_display_name = "Header" %} {% assign offsets = site.data.file_formats.itm_v1.header %} {% include offset_table.html %} {% assign offset_header_name = "itmv1_Extended_Header" %} {% assign offset_header_display_name = "Extended Header" %} {% assign offset_header_desc = "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 TOOLTIP.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." %} {% assign offsets = site.data.file_formats.itm_v1.extended_header %} {% include offset_table.html %} {% assign offset_header_name = "itmv1_Feature_Block" %} {% assign offset_header_display_name = "Feature Block" %} {% assign offset_header_desc = "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. The engine appears to roll a probability for each valid target type, rather than one probability per attack." %} {% assign offsets = site.data.file_formats.itm_v1.feature_block %} {% include offset_table.html %}

Header Flags

Bit Byte 1 Byte 2 Byte 3 Byte 4
0 Unsellable (critical item)
  • In BG1 and IWD, this flag does not affect whether the item can be sold or disintegrated. See BIT11 instead.
  • On EE games, Stores can buy critical items if they are flagged as Can buy Critical, provided they can buy its itemtype.
  • Will also cause the item to be moved into Player1's Inventory if the character who has it leaves the party on their own.
Silver
  • Determines how the weapon interacts with opcode #120.
Unused Undispellable
1 Two-handed
  • Forces Two-handed weapon style and attack animation.
  • Disables off-hand: attacks and equipped effects.
Cold iron
  • Determines how the weapon interacts with opcode #120.
Unused Toggle critical hit aversion (BGEE, TobEx)
  • Keep in mind that if you set this bit to 1 for an ITM whose Item type is Headgear, then you'll toggle off the Critical hit aversion.
2 Movable / Droppable Stolen (unsellable) / Off-handed
  • Set offhand animations for 0x5###-0x6### animId series (excluding 0x64##) when weapon placed in offhand.
  • Forces Dual-Wield animation (overrides BIT1).
Unused Unused
3 Displayable
  • Item will show up on the ground (when dropped). Setting the Ground Icon to "" (empty) still uses a default icon, this gets around that. It can still be clicked on and picked up.
  • The default icon if the Ground Icon is "" (empty) is a small bag "GSACK01.BAM", the icon without the Displayable flag is a 1x1 invisible pixel.
Conversable / unsellable
  • In BG1 and IWD, this flag prevents the item from being sold and is not about dialogs. This includes placement into a bag of holding.
  • Dialog can be initiated with the weapon through right-clicking in the Inventory.
  • Item needs to be listed in ITEMDIAL.2DA as: (Item ResRef) (Label StrRef) (Dialog ResRef).
    • Label StrRef is the label that will be on the button when right-clicking.
Unused Unused
4 Cursed
  • Determines how the item interacts with opcode #26.
  • The item cannot be unequipped.
  • Cursed weapons override the Magical Weapon slot.
Fake two-handed (BGEE)
  • Forces Two-handed animation.
Unused Unused
5 Cannot scribe to spellbook (scrolls)
  • Whether a scroll can be "Copy Note" to journal or "Write Magic" to spell book is determined by its ability headers. Setting this bit doesn't alter it either way.
  • It doesn't prevent a "clone" from getting a duplicate (opcode #236*p2=2).
  • It doesn't prevent the CopyGroundPilesTo() action from moving them.
  • In original BG1, it was set on every item except for the Identify Scroll.
  • In BGEE/SoD, only a few (16) random items added by Beamdog don't have it set, as well as the Identify and Chromatic Orb scrolls.
Forbid off-hand weapon (BGEE)
  • Disables Two-Weapon Style.
  • Does not disable off-hand equipped effects.
  • In Magical Weapon Slot: Disables off-hand (Attacks only).
Unused Unused
6 Magical
  • Determines how the weapon interacts with opcode #120.
  • Has no relation to the Enchantment field. Both function independently.
Usable in inventory (PSTEE) Unused Unused
7 Left-handed
  • Disables off-hand: attacks and equipped effects.
  • Disables Two-Weapon Style (Inventory display is incorrect though).
Adamantine (BGEE) Unused Unused
{% include item_types.html %}
Header Usability

Bit Byte 1 Byte 2 Byte 3 Byte 4
0 Chaotic... Cleric/Mage Fighter/Mage/Thief Dwarf
1 ...Evil Cleric/Thief Fighter/Thief Half-Elf
2 ...Good Cleric/Ranger Mage Halfling
3 ...Neutral Fighter Mage/Thief Human
4 Lawful... Fighter/Druid Paladin Gnome
5 Neutral... Fighter/Mage Ranger Monk
6 Bard Fighter/Cleric Thief Druid
7 Cleric Fighter/Mage/Cleric Elf Half-Orc

Note: PSTEE uses ITM V1.1 usability flags.

Header Animation

Value (ASCII) Value (Hex) BG/IWD Description BG2 Description Enhanced Editions Description
"  " 2020h No animation No animation No animation
2A 3241h Leather Armor Leather Armor Leather Armor
2W 3257h Robe Robe Robe
3A 3341h Chainmail Chainmail Chainmail
3W 3357h Robe (alternate 1) Robe (alternate 1) Robe (alternate 1)
4A 3441h Plate Mail Plate Mail Plate Mail
4W 3457h Robe (alternate 2) Robe (alternate 2) Robe (alternate 2)
AX 4158h Axe Axe Axe
BS 4253h n/a n/a Shortbow
BW 4257h Bow Bow Longbow
C0 4330h n/a n/a Small Shield (alternate 1)
C1 4331h n/a n/a Medium Shield (alternate 1)
C2 4332h n/a n/a Large Shield (alternate 1)
C3 4333h n/a n/a Medium Shield (alternate 2)
C4 4334h n/a n/a Small Shield (alternate 2)
C5 4335h n/a n/a Large Shield (alternate 2)
C6 4336h n/a n/a Large Shield (alternate 3)
C7 4337h n/a n/a Medium Shield (alternate 3)
CB 4342h Crossbow Crossbow Crossbow
CL 434Ch Club Club Club
D1 4431h Buckler Buckler Buckler
D2 4432h Shield (Small) Shield (Small) Shield (Small)
D3 4433h Shield (Medium) Shield (Medium) Shield (Medium)
D4 4434h Shield (Large) Shield (Large) Shield (Large)
DD 4444h Dagger Dagger Dagger
F0 4630h n/a n/a Flail (alternate 1)
F1 4631h n/a n/a Flail (alternate 2)
F2 4632h n/a n/a Flaming Short Sword
F3 4634h n/a n/a Flail (alternate 3)
FL 464Ch Flail Flail Flail
FS 4653h Flame Sword Flame Sword Flaming Long Sword
GS 4753h n/a n/a Glowing Staff
H0 4830h Helmet: Small Vertical Horns Helmet: Full Helmet: Smooth
H1 4831h Helmet: Large Horizontal Horns Helmet: Large Horizontal Horns, Spiked Crest Helmet: Five Horns
H2 4832h Helmet: Feather Wings Helmet: Narrow Wings Helmet: Feather Wings
H3 4833h Helmet: Top Plume Helmet: Curved Horns Helmet: Curved Sidebars
H4 4834h Helmet: Dragon Wings Helmet: Top Plume Helmet: Horned, Plume
H5 4835h Helmet: Feather Sideburns Helmet: Single Crest Helmet: Center Crest
H6 4836h Helmet: Large Curved Horns (incorrect paperdoll, unused) Helmet: Large Curved Horns (incorrect paperdoll, unused) Helmet: Large Curved Horns (incorrect paperdoll, unused)
J0 4A30h n/a n/a Helmet: Smooth
J1 4A31h n/a n/a Helmet: Five Horns
J2 4A32h n/a n/a Helmet: Feather Wings with Spike
J3 4A33h n/a n/a Helmet: Curved Sidebars
J4 4A34h n/a n/a Helmet: Small Horns, Plume
J5 4A35h n/a n/a Helmet: Center Crest
J6 4A36h n/a n/a Helmet: Smooth, Two Small Horns
J7 4A37h n/a n/a Helmet: Large Horizontal Horns
J8 4A38h n/a n/a Helmet: Feather Wings without Spike
J9 4A39h n/a n/a Helmet: Full Face, Large Horns, Plume
JA 4A41h n/a n/a Helmet: Dragon Wings, Plume
JB 4A42h n/a n/a Circlet
JC 4A43h n/a n/a Helmet: Dragon Wings
HB 4842h Halberd Halberd Halberd
M2 4D32h n/a n/a Mace (alternate)
MC 4D43h Mace Mace Mace
MS 4D53h Morning Star Morning Star Morning Star
Q2 5132h n/a n/a Quarterstaff (alternate 1)
Q3 5133h n/a n/a Quarterstaff (alternate 2)
Q4 5134h n/a n/a Quarterstaff (alternate 3)
QS 5153h Quarterstaff Quarterstaff Quarterstaff
S0 5330h n/a n/a One-Handed Sword: Bastard
S1 5331h One-Handed Sword: Bastard/Broad/Long/Scimitar One-Handed Sword: Bastard/Broad/Long One-Handed Sword: Broad/Long
S2 5332h Twp-Handed Sword Twp-Handed Sword Twp-Handed Sword
S3 5333h n/a One-Handed Sword: Katana One-Handed Sword: Katana
SC 5343h n/a One-Handed Sword: Scimitar One-Handed Sword: Scimitar
SL 534Ch Sling Sling Sling
SP 5350h Spear Spear Spear
SS 5353h One-Handed Sword: Short One-Handed Sword: Short One-Handed Sword: Short
WH 5748h War Hammer War Hammer War Hammer
ZW 5A57h n/a n/a Wings (female)

Header Kit Usability

Bit Byte 1 Byte 2 Byte 3 Byte 4
0 Cleric of Talos Stalker Ranger Diviner Beserker Fighter
1 Cleric of Helm Beastmaster Ranger Enchanter Wizardslayer Fighter
2 Cleric of Lathlander Assassin Thief Illusionist Kensai Fighter
3 Totemic Druid Bounty Hunter Thief Invoker Cavalier Paladin
4 Shapeshifter Druid Swashbuckler Thief Necromancer Inquisiter Paladin
5 Avenger Druid Blade Bard Transmuter Undead Hunter Paladin
6 Barbarian Jester Bard All (no kit) Abjurer
7 Wildmage Skald Bard Ferlain Conjurer

Header Proficiency

Value (hex) Description
00h None
59h Bastard Sword
5Ah Long Sword
5Bh Short Sword
5Ch Axe
5Dh Two-Handed Sword
5Eh Katana
5Fh Scimitar/Wakizashi/Ninja-To
60h Dagger
61h War Hammer
62h Spear
63h Halberd
64h Flail/Morningstar
65h Mace
66h Quarterstaff
67h Crossbow
68h Long Bow
69h Short Bow
6Ah Darts
6Bh Sling
6Ch Blackjack
6Dh Gun
6Eh Martial Arts
6Fh Two-Handed Weapon Skill
70h Sword and Shield Skill
71h Single Weapon Skill
72h Two Weapon skill
73h Club
74h Extra Proficiency 2
75h Extra Proficiency 3
76h Extra Proficiency 4
77h Extra Proficiency 5
78h Extra Proficiency 6
79h Extra Proficiency 7
7Ah Extra Proficiency 8
7Bh Extra Proficiency 9
7Ch Extra Proficiency 10
7Dh Extra Proficiency 11
7Eh Extra Proficiency 12
7Fh Extra Proficiency 13
80h Extra Proficiency 14
81h Extra Proficiency 15
82h Extra Proficiency 16
83h Extra Proficiency 17
84h Extra Proficiency 18
85h Extra Proficiency 19
86h Extra Proficiency 20

Extended Header MeleeAnimation

Value Word 1 Value Word 2 Value Word 3 Data
00h 14h 50h Dagger
0Ah 19h 41h Short Sword
32h 32h 00h Long Sword, Bastard Sword, Scimitar, Battle Axe, Warhammer, Club, Mace, Flail, Morning Star
3Ch 28h 00h Two-Handed Sword
00h 23h 41h Halberd
00h 00h 64h Spear
0Ah 46h 14h Staff
00h 00h 00h Any Missile Weapon (Bow, Arrow, CrossBow, Bolt, Sling, Bullet, Throwing Axe, Dart, Throwing Dagger, etc.)
22h 21h 21h Any Non-Weapon Item (Amulets, Rings, Wands, etc.)

Extension Header Flags

Bit Byte 1 Byte 2 Byte 3 Byte 4
0 Add strength bonus Unknown Unknown Unknown
1 Breakable Breaks Sanctuary / Invisibility (EE games) Unknown ToBEx: Toggle backstab
2 Damage strength bonus (BGEE split bit 0) Hostile Unknown EE/ToBEx: Cannot target invisible
3 THAC0 strength bonus (BGEE split bit 0) Recharge after resting Unknown Unknown
4 Unknown Unknown Unknown Unknown
5 Unknown Unknown Unknown Unknown
6 Unknown Unknown Unknown Unknown
7 Unknown Unknown Unknown Unknown