STO file format

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

General Description
These files contain a description of the types of items and services available for sale in a given store, inn, tavern, or temple.

Detailed Description

Offset Size (datatype) Description
0x0000 4 (char array)

Signature (‘STOR’)

0x0004 4 (char array)

Version (‘V1.0’)

0x0008 4 (dword)

Type (0=Store, 1=Tavern, 2=Inn, 3=Temple, 5=Container)

0x000c 4 (strref)


0x0010 4 (dword)


  • bit 0: User allowed to buy
  • bit 1: User allowed to sell
  • bit 2: User allowed to identify items
  • bit 3: User allowed to steal
  • bit 4: User allowed to donate money
  • bit 5: User allowed to purchase cures
  • bit 6: User allowed to purchase drinks
  • bit 7: Unknown
  • bit 8: Unknown
  • bit 9: Quality 1 (tvrnqul0-3)
  • bit 10: Quality 2 (tvrnqul0-3)
  • bit 11: Unknown
  • bit 12: Buy Fenced Goods
  • bit 13: Reputation doesn’t affect prices (BGEE)
  • bit 14: Toggle item recharge (TobEx)
  • bit 15: User allowed to sell critical items (BGEE)
0x0014 4 (dword)

Store “sell price markup” (percentage of base price store charges for items)

0x0018 4 (dword)

Store “buy price markup” (percentage of base price store is willing to pay)

0x001c 4 (dword)

Depreciation rate

0x0020 2 (word)

% chance of steal failure

0x0022 2 (word)

Capacity (0=unlimited)

0x0024 8 (byte array)


0x002c 4 (dword)

Offset to items purchased section

0x0030 4 (dword)

Count of items in items purchased section

0x0034 4 (dword)

Offset to items for sale section

0x0038 4 (dword)

Count of items for sale

0x003c 4 (dword)


0x0040 4 (dword)

ID Price

0x0044 8 (resref)

Rumours (Tavern)

0x004c 4 (dword)

Offset to drinks section

0x0050 4 (dword)

Count of drinks

0x0054 8 (resref)

Rumours (Temple)

0x005c 4 (dword)

Room flags

  • bit 0: Peasant
  • bit 1: Merchant
  • bit 2: Noble
  • bit 3: Royal
0x0060 4 (dword)

Price of a peasant room

0x0064 4 (dword)

Price of a merchant room

0x0068 4 (dword)

Price of a noble room

0x006c 4 (dword)

Price of a royal room

0x0070 4 (dword)

Offset to cures section

0x0074 4 (dword)

Count of cures

0x0078 36 (byte array)


Offset Size (datatype) Description
0x0000 8 (resref)

Filename of ITM

0x0008 2 (word)

Item expiration time (replace with drained item)

0x000a 2 (word)

Quantity/Charges 1

0x000c 2 (word)

Quantity/Charges 2

0x000e 2 (word)

Quantity/Charges 3

0x0010 4 (dword)


  • bit 0: Identified
  • bit 1: Unstealable
  • bit 2: Stolen
  • bit 3: Undroppable
0x0014 4 (dword)

Amount of this item in stock

0x0018 4 (dword)

Infinite supply flag (0=limited stock, 1=infinite stock)

Items with this flag set are automatically shown as identified

Offset Size (datatype) Description
0x0000 8 (resref)

Rumour resource

0x0008 4 (strref)

Drink name strref

0x000c 4 (dword)

Drink price

0x0010 4 (dword)

Alcoholic strength

Offset Size (datatype) Description
0x0000 8 (resref)

Filename of SPL

0x0008 4 (dword)

Spell price

This is an array of dwords. These dwords indicate categories of items from the Item Types table.

These codes are used in store files to indicate which types of items they will buy. They are also used to determine which inventory slots the item is allowed to go into on the inventory screen and the sound the item makes when moved in the inventory.

Code Item type
0x00 Books/misc
0x01 Amulets and necklaces
0x02 Armor
0x03 Belts and girdles
0x04 Boots
0x05 Arrows
0x06 Bracers and gauntlets
0x07 Headgear (Helms, hats, and other head-wear)
0x08 Keys (not in Icewind Dale?)
0x09 Potions
0x0a Rings
0x0b Scrolls
0x0c Shields (not in IWD)
0x0d Food
0x0e Bullets (for a sling)
0x0f Bows
0x10 Daggers
0x11 Maces (in BG, this includes clubs)
0x12 Slings
0x13 Small swords
0x14 Large swords
0x15 Hammers
0x16 Morning stars
0x17 Flails
0x18 Darts
0x19 Axes (specifically, 1-handed axes -- halberds and 2-handed polearms not included)
0x1a Quarterstaff
0x1b Crossbow
0x1c Hand-to-hand weapons (fist, fist irons, punch daggers, etc)
0x1d Spears
0x1e Halberds (2-handed polearms)
0x1f Crossbow bolts
0x20 Cloaks and robes
0x21 Gold pieces (not an inventory item, but can appear as "monster dropped" treasure)
0x22 Gems
0x23 Wands
0x24 Containers/eye/broken armor
0x25 Books/Broken shields/bracelets
0x26 Familiars/Broken swords/earrings
0x27 Tattoos (PST)
0x28 Lenses (PST)
0x29 Bucklers/teeth
0x2a Candles
0x2c Clubs (IWD)
0x2f Large Shields (IWD)
0x31 Medium Shields (IWD)
0x32 Notes
0x35 Small Shields (IWD)
0x37 Telescopes (IWD)
0x38 Drinks (IWD)
0x39 Great Swords (IWD)
0x3a Container
0x3b Fur/pelt
0x3c Leather Armor
0x3d Studded Leather Armor
0x3e Chain Mail
0x3f Splint Mail
0x40 Half Plate
0x41 Full Plate
0x42 Hide Armor
0x43 Robe
0x45 Bastard Sword
0x46 Scarf
0x47 Food (IWD2)
0x48 Hat
0x49 Gauntlet