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 (data type) 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) Name
0x0010 4 (dword) Flags
  • 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 (bytes)
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) Lore
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 (bytes)

Offset Size (data type) 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) Flags
  • 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)
Note: Items with this flag set are automatically shown as identified

Offset Size (data type) Description
0x0000 8 (resref) Rumour resource
0x0008 4 (strref) Drink name strref
0x000c 4 (dword) Drink price
0x0010 4 (dword) Alcoholic strength

Offset Size (data type) 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 category codes table. The category code can also be found inside the ITM file for an itm.

These codes are used in store files to indicate which types of items they will buy. They are also be 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
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 Short swords
0x0014 Long swords (in BG, this includes 2-handed and bastard 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 Bag/eye/broken armor
0x0025 Broken shield/bracelet
0x0026 Broken sword/earring
0x0027 Tattoos (PST)
0x0028 Lenses(PST)
0x0029 Buckler/teeth
0x002a Candle
0x002c Clubs(IWD)
0x002f Large Shield(IWD)
0x0031 Medium Shield(IWD)
0x0032 Notes
0x0035 Small Shield(IWD)
0x0037 Telescope(IWD)
0x0038 Drink(IWD)
0x0039 Great Sword(IWD)
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
0x0045 Bastard Sword
0x0046 Scarf
0x0047 Food(IWD2)
0x0048 Hat
0x0049 Gauntlet