diff --git a/_data/file_formats/item_types.yml b/_data/file_formats/item_types.yml new file mode 100644 index 00000000..0ba53307 --- /dev/null +++ b/_data/file_formats/item_types.yml @@ -0,0 +1,148 @@ +- code: '0x00' + type: Books/misc +- code: '0x01' + type: Amulets and necklaces +- code: '0x02' + type: Armor +- code: '0x03' + type: Belts and girdles +- code: '0x04' + type: Boots +- code: '0x05' + type: Arrows +- code: '0x06' + type: Bracers and gauntlets +- code: '0x07' + type: Headgear (Helms, hats, and other head-wear) +- code: '0x08' + type: Keys (not in Icewind Dale?) +- code: '0x09' + type: Potions +- code: '0x0a' + type: Rings +- code: '0x0b' + type: Scrolls +- code: '0x0c' + type: Shields (not in IWD) +- code: '0x0d' + type: Food +- code: '0x0e' + type: Bullets (for a sling) +- code: '0x0f' + type: Bows +- code: '0x10' + type: Daggers +- code: '0x11' + type: Maces (in BG, this includes clubs) +- code: '0x12' + type: Slings +- code: '0x13' + type: Small swords +- code: '0x14' + type: Large swords +- code: '0x15' + type: Hammers +- code: '0x16' + type: Morning stars +- code: '0x17' + type: Flails +- code: '0x18' + type: Darts +- code: '0x19' + type: Axes (specifically, 1-handed axes -- halberds and 2-handed polearms not included) +- code: '0x1a' + type: Quarterstaff +- code: '0x1b' + type: Crossbow +- code: '0x1c' + type: Hand-to-hand weapons (fist, fist irons, punch daggers, etc) +- code: '0x1d' + type: Spears +- code: '0x1e' + type: Halberds (2-handed polearms) +- code: '0x1f' + type: Crossbow bolts +- code: '0x20' + type: Cloaks and robes +- code: '0x21' + type: Gold pieces (not an inventory item, but can appear as "monster dropped" treasure) +- code: '0x22' + type: Gems +- code: '0x23' + type: Wands +- code: '0x24' + type: Containers/eye/broken armor +- code: '0x25' + type: Books/Broken shields/bracelets +- code: '0x26' + type: Familiars/Broken swords/earrings +- code: '0x27' + type: Tattoos (PST) +- code: '0x28' + type: Lenses (PST) +- code: '0x29' + type: Bucklers/teeth +- code: '0x2a' + type: Candles +- code: '0x2b' + type: Unknown +- code: '0x2c' + type: Clubs (IWD) +- code: '0x2d' + type: Unknown +- code: '0x2e' + type: Unknown +- code: '0x2f' + type: Large Shields (IWD) +- code: '0x30' + type: Unknown +- code: '0x31' + type: Medium Shields (IWD) +- code: '0x32' + type: Notes +- code: '0x33' + type: Unknown +- code: '0x34' + type: Unknown +- code: '0x35' + type: Small Shields (IWD) +- code: '0x36' + type: Unknown +- code: '0x37' + type: Telescopes (IWD) +- code: '0x38' + type: Drinks (IWD) +- code: '0x39' + type: Great Swords (IWD) +- code: '0x3a' + type: Container +- code: '0x3b' + type: Fur/pelt +- code: '0x3c' + type: Leather Armor +- code: '0x3d' + type: Studded Leather Armor +- code: '0x3e' + type: Chain Mail +- code: '0x3f' + type: Splint Mail +- code: '0x40' + type: Half Plate +- code: '0x41' + type: Full Plate +- code: '0x42' + type: Hide Armor +- code: '0x43' + type: Robe +- code: '0x44' + type: Unknown +- code: '0x45' + type: Bastard Sword +- code: '0x46' + type: Scarf +- code: '0x47' + type: Food (IWD2) +- code: '0x48' + type: Hat +- code: '0x49' + type: Gauntlet diff --git a/_data/file_formats/sto_v1/cure.yml b/_data/file_formats/sto_v1/cure.yml new file mode 100644 index 00000000..cf8d5f02 --- /dev/null +++ b/_data/file_formats/sto_v1/cure.yml @@ -0,0 +1,5 @@ +- desc: Filename of SPL + type: resref +- desc: Spell price + type: dword + offset: 0x8 diff --git a/_data/file_formats/sto_v1/drink.yml b/_data/file_formats/sto_v1/drink.yml new file mode 100644 index 00000000..20103337 --- /dev/null +++ b/_data/file_formats/sto_v1/drink.yml @@ -0,0 +1,9 @@ +- desc: Rumour resource + type: resref +- desc: Drink name strref + type: strref +- desc: Drink price + type: dword +- desc: Alcoholic strength + type: dword + offset: 0x10 diff --git a/_data/file_formats/sto_v1/header.yml b/_data/file_formats/sto_v1/header.yml new file mode 100644 index 00000000..9b38ecdf --- /dev/null +++ b/_data/file_formats/sto_v1/header.yml @@ -0,0 +1,106 @@ +- desc: Signature ('STOR') + type: char array + length: 4 + +- desc: Version ('V1.0') + type: char array + length: 4 + +- desc: Type (0=Store, 1=Tavern, 2=Inn, 3=Temple, 5=Container) + type: dword + +- desc: name + type: strref + +- desc: | + 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]({{ "/file_formats/ie_formats/itm_v1.htm#Header_Flags_BIT0" | prepend: relurl }}) items** (BGEE) + type: dword + +- desc: Store "sell price markup" (percentage of base price store charges for items) + type: dword + +- desc: Store "buy price markup" (percentage of base price store is willing to pay) + type: dword + +- desc: Depreciation rate + type: dword + +- desc: "% chance of steal failure" + type: word + +- desc: Capacity (0=unlimited) + type: word + +- desc: Unknown + type: byte array + length: 8 + +- desc: Offset to [items purchased](#storv1_0_Buy) section + type: dword +- desc: Count of items in [items purchased](#storv1_0_Buy) section + type: dword + +- desc: Offset to [items for sale](#storv1_0_Sale) section + type: dword +- desc: Count of [items for sale](#storv1_0_Sale) + type: dword + +- desc: Lore + type: dword + +- desc: ID Price + type: dword + +- desc: Rumours (Tavern) + type: resref + +- desc: Offset to [drinks](#storv1_0_Drink) section + type: dword +- desc: Count of [drinks](#storv1_0_Drink) + type: dword + +- desc: Rumours (Temple) + type: resref + +- desc: | + Room flags + - bit 0: Peasant + - bit 1: Merchant + - bit 2: Noble + - bit 3: Royal + type: dword + +- desc: Price of a peasant room + type: dword +- desc: Price of a merchant room + type: dword +- desc: Price of a noble room + type: dword +- desc: Price of a royal room + type: dword + +- desc: Offset to [cures](#storv1_0_Cure) section + type: dword +- desc: Count of [cures](#storv1_0_Cure) + type: dword + +- desc: Unknown + type: byte array + length: 36 + offset: 0x78 diff --git a/_data/file_formats/sto_v1/item.yml b/_data/file_formats/sto_v1/item.yml new file mode 100644 index 00000000..a88e957f --- /dev/null +++ b/_data/file_formats/sto_v1/item.yml @@ -0,0 +1,25 @@ +- desc: Filename of ITM + type: resref +- desc: Item expiration time (replace with drained item) + type: word +- desc: Quantity/Charges 1 + type: word +- desc: Quantity/Charges 2 + type: word +- desc: Quantity/Charges 3 + type: word +- desc: | + Flags + - bit 0: Identified + - bit 1: Unstealable + - bit 2: Stolen + - bit 3: **Undroppable** + type: dword +- desc: Amount of this item in stock + type: dword +- desc: | + Infinite supply flag (0=limited stock, 1=infinite stock) + + Items with this flag set are automatically shown as identified + type: dword + offset: 0x18 diff --git a/_includes/item_types.html b/_includes/item_types.html new file mode 100644 index 00000000..4ad80db0 --- /dev/null +++ b/_includes/item_types.html @@ -0,0 +1,37 @@ +
+
Item Types
+
+
+ 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.
+
+ + + + + + + + + + + + + {% for item in site.data.file_formats.item_types %} + + + + {% if item.type == "Unknown" %} + {% assign type = '
Unknown
' %} + {% else %} + {% assign type = item.type %} + {% endif %} + + + + {% endfor %} + +
CodeItem type
{{ item.code }}{{ type }}
+
diff --git a/file_formats/ie_formats/sto_v1.htm b/file_formats/ie_formats/sto_v1.htm index 9cd6a554..611a8f98 100644 --- a/file_formats/ie_formats/sto_v1.htm +++ b/file_formats/ie_formats/sto_v1.htm @@ -2,693 +2,61 @@ title: "STO file format" regenerate: true --- -
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
-
- Overall structure
-
-
  • Header -
  • Items for sale -
  • Drinks for sale -
  • Cures for sale -
  • Items purchased here
  • -
    -
    -
    - -
    Header
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    OffsetSize (data type)Description
    0x00004 (char array)Signature ('STOR')
    0x00044 (char array)Version ('V1.0')
    0x00084 (dword)Type (0=Store, 1=Tavern, 2=Inn, 3=Temple, 5=Container)
    0x000c4 (strref)Name
    0x00104 (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)
    • -
    -
    0x00144 (dword)Store "sell price markup" (percentage of base price store charges for items)
    0x00184 (dword)Store "buy price markup" (percentage of base price store is willing to pay)
    0x001c4 (dword)Depreciation rate
    0x00202 (word)% chance of steal failure
    0x00222 (word)Capacity (0=unlimited)
    0x00248 (bytes)
    Unknown
    0x002c4 (dword)Offset to items purchased section
    0x00304 (dword)Count of items in items purchased section
    0x00344 (dword)Offset to items for sale section
    0x00384 (dword)Count of items for sale
    0x003c4 (dword)Lore
    0x00404 (dword)ID Price
    0x00448 (resref)Rumours (Tavern)
    0x004c4 (dword)Offset to drinks section
    0x00504 (dword)Count of drinks
    0x00548 (resref)Rumours (Temple)
    0x005c4 (dword)Room flags -
      -
    • bit 0: Peasant
    • -
    • bit 1: Merchant
    • -
    • bit 2: Noble
    • -
    • bit 3: Royal
    • -
    -
    0x00604 (dword)Price of a peasant room
    0x00644 (dword)Price of a merchant room
    0x00684 (dword)Price of a noble room -
    0x006c4 (dword)Price of a royal room
    0x00704 (dword)Offset to cures section
    0x00744 (dword)Count of cures
    0x007836 (bytes)
    Unknown
    -
    -
    -
    STOR V1.0 Items for Sale
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    OffsetSize (data type)Description
    0x00008 (resref)Filename of ITM
    0x00082 (word)Item expiration time (replace with drained item)
    0x000a2 (word)Quantity/Charges 1
    0x000c2 (word)Quantity/Charges 2
    0x000e2 (word)Quantity/Charges 3
    0x00104 (dword)Flags -
      -
    • bit 0: Identified
    • -
    • bit 1: Unstealable
    • -
    • bit 2: Stolen
    • -
    • bit 3: Undroppable
    • -
    -
    0x00144 (dword)Amount of this item in stock
    0x00184 (dword)Infinite supply flag (0=limited stock, 1=infinite stock)
    - Note: Items with this flag set are automatically shown as identified -
    -
    -
    +
    STO file format
    +
    +
    Applies to:
    +
    BG1, BG1: TotS, BG2, BG2: ToB, IWD, BGEE
    +
    -
    STOR V1.0 Drinks for Sale
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    OffsetSize (data type)Description
    0x00008 (resref)Rumour resource
    0x00084 (strref)Drink name strref
    0x000c4 (dword)Drink price
    0x00104 (dword)Alcoholic strength
    -
    -
    +
    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.
    +
    +
    -
    STOR V1.0 Cures for Sale
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - -
    OffsetSize (data type)Description
    0x00008 (resref)Filename of SPL
    0x00084 (dword)Spell price
    -
    -
    - -
    STOR V1.0 Items Purchased Here
    -
    -
    - 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.
    -
    -
    - -
    Item category codes
    -
    -
    - 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.
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    CodeItem type
    0x0000Books/misc
    0x0001Amulets and necklaces
    0x0002Armor
    0x0003Belts and girdles
    0x0004Boots
    0x0005Arrows
    0x0006Bracers and gauntlets
    0x0007Helms, hats, and other head-wear
    0x0008Keys (not in Icewind Dale?)
    0x0009Potions
    0x000aRings
    0x000bScrolls
    0x000cShields (not in IWD)
    0x000dFood
    0x000eBullets (for a sling)
    0x000fBows
    0x0010Daggers
    0x0011Maces (in BG, this includes clubs)
    0x0012Slings
    0x0013Short swords
    0x0014Long swords (in BG, this includes 2-handed and bastard swords)
    0x0015Hammers
    0x0016Morning stars
    0x0017Flails
    0x0018Darts
    0x0019Axes (specifically, 1-handed axes -- halberds and 2-handed polearms - not included)
    0x001aQuarterstaff
    0x001bCrossbow
    0x001cHand-to-hand weapons (fist, fist irons, punch daggers, etc)
    0x001dSpears
    0x001eHalberds (2-handed polearms)
    0x001fCrossbow bolts
    0x0020Cloaks and robes
    0x0021Gold pieces (not an inventory item, but can appear as "monster - dropped" treasure)
    0x0022Gems
    0x0023Wands
    0x0024Bag/eye/broken armor
    0x0025Broken shield/bracelet
    0x0026Broken sword/earring
    0x0027Tattoos (PST)
    0x0028Lenses(PST)
    0x0029Buckler/teeth
    0x002aCandle
    0x002b
    Unknown
    0x002cClubs(IWD)
    0x002d
    Unknown
    0x002e
    Unknown
    0x002fLarge Shield(IWD)
    0x0030
    Unknown
    0x0031Medium Shield(IWD)
    0x0032Notes
    0x0033
    Unknown
    0x0034
    Unknown
    0x0035Small Shield(IWD)
    0x0036
    Unknown
    0x0037Telescope(IWD)
    0x0038Drink(IWD)
    0x0039Great Sword(IWD)
    0x003aContainer
    0x003bFur/pelt
    0x003cLeather Armor
    0x003dStudded Leather Armor
    0x003eChain Mail
    0x003fSplint Mail
    0x0040Half Plate
    0x0041Full Plate
    0x0042Hide Armor
    0x0043Robe
    0x0044
    Unknown
    0x0045Bastard Sword
    0x0046Scarf
    0x0047Food(IWD2)
    0x0048Hat
    0x0049Gauntlet
    -
    +
    Detailed Description
    +
    + Overall structure
    +
    +
  • Header
  • +
  • Items for sale
  • +
  • Drinks for sale
  • +
  • Cures for sale
  • +
  • Items purchased here
  • +
    + +{% assign offset_header_name = "storv1_0_Header" %} +{% assign offset_header_display_name = "Header" %} +{% assign offsets = site.data.file_formats.sto_v1.header %} +{% include offset_table.html %} + +{% assign offset_header_name = "storv1_0_Sale" %} +{% assign offset_header_display_name = "Items for sale" %} +{% assign offsets = site.data.file_formats.sto_v1.item %} +{% include offset_table.html %} + +{% assign offset_header_name = "storv1_0_Drink" %} +{% assign offset_header_display_name = "Drinks" %} +{% assign offsets = site.data.file_formats.sto_v1.drink %} +{%include offset_table.html %} + +{% assign offset_header_name = "storv1_0_Cure" %} +{% assign offset_header_display_name = "Cures" %} +{% assign offsets = site.data.file_formats.sto_v1.cure %} +{% include offset_table.html %} + +
    + STOR V1.0 Items Purchased Here +
    +
    +
    + This is an array of dwords. These dwords indicate categories of items from the + Item Types table. +
    +
    +{% include item_types.html %}