Stoneshard Wiki

Merchant Stock and Repairs

A merchant's shelf is not a permanent list: each person has an assortment and a stock size, the goods of a batch are generated when that person restocks, and the batch only becomes visible when you open the trade window. The trade panel tells you which goods the merchant is interested in, which equipment tiers to expect, and how long until the next restock, while repairs are a separate paid service that only some merchants offer. This page covers stock, restocking and repairs themselves; price composition, reputation tiers, stolen goods rules and caravan upgrades belong to their own articles.

Contents

Overview

A merchant's goods come from an assortment: it is defined by categories and by individual items, and its entries can be added or replaced according to reputation tiers, completed quests and caravan upgrades. The stock size decides how many goods a batch contains; merchants in the same settlement have different assortments and sizes, so their shelves differ.

Restocking runs on a schedule: settlements have their own cycles and individual merchants may have cycles of their own, with the game advancing that check by the hour. The default behaviour replaces the whole batch while the other removes only part of it; repairs are separate from stock, shown as a button on the trade panel only for merchants that offer the service.

The composition of buying and selling prices and the supply/demand accounting are covered by the item pricing article; use the trading tool to compare actual amounts.

Official panel text

The same-release panel text table writes the trade hover panel fields as "Interested in:", "Equipment Tier:", "Restocks in:", "Can Repair:", "Repairs Price:" in English, and the Chinese column renders the same five fields as 「商品种类偏好:」「装备层阶:」「补货时间:」「可以维修/修补:」「维修/修补价格:」. Both sets are quoted here exactly as written.

The value after "Restocks in:" is shown in days: the panel converts the remaining time into days and writes a number followed by the official unit "day / days", while the Chinese column uses 「天」; with less than a day left it shows the official wording "less than a day" (「一天之内」). The panel therefore shows an approximate remaining time rather than an exact restock moment.

The repair button's hover text comes from the same table as well: it reads "Repair items", rendered as 「修理物品」 in Chinese, according to the material that merchant works with. Whether the "Can Repair:" and "Repairs Price:" rows carry content depends on whether that merchant offers the repair service.

Restock cycles

Each settlement keeps a settlement restock cycle of its own: an hourly time check looks at the hours passed since the last settlement restock, and once they reach that cycle the settlement restock runs and marks the merchants of that settlement for restocking.

Checked examples, not a complete table: 48 hours for the ordinary settlements, 24 hours for Brynn, 72 hours for Denbrie, and 0 for the brewery, which means it never performs a settlement restock. The rhythm therefore differs between settlements and places.

Merchants may also have a restock cycle of their own, of varying length; a merchant that does not set one simply follows its settlement, because having none is the default. The panel's "Restocks in:" value takes whichever comes first, the merchant cycle or the settlement cycle, and converts it into days.

How restocking works

Restocking has two behaviours. The default one replaces the whole batch: the merchant's current goods records are cleared and the next batch is generated from the assortment and the stock size, so what arrives is a completely fresh batch of goods.

The other behaviour takes goods off the shelf: only part of the current batch is removed, and per-item checks rotate roughly half of them out rather than a fixed share. The positions freed by the removed goods are counted back into that merchant's available stock slots so the next batch can fill them.

A merchant's funds have a restock timer of their own, enabled by only a few merchants; the funds entry is not part of the rotation above and is handled separately.

When goods are generated and what happens to sold ones

The contents of a batch are generated when you open the trade window: the game re-runs that merchant's assortment definition, adds goods one by one up to the stock size, and rolls a random durability for freshly generated equipment. When the window closes, the items on the shelf are written back into the merchant's goods records and the freed stock-slot count is updated as well.

The assortment itself is recomputed every time the trade window opens, so changes coming from reputation tiers, completed quests and caravan upgrades take effect the next time you open it.

Sold goods do not come back on their own: after the sale the item is no longer in that merchant's goods records, and only the next restock generates new goods. A whole-batch restock is a fresh batch rather than the same item returning, and this page does not claim that repeated restocks can produce one particular item on demand.

Items registered as unique stock follow a further rule: buying one records it in that merchant's saved list, later generation skips it, and it therefore never appears again after being sold.

Reputation, quests and the caravan

Reputation tiers change the stock side: reputation perks carry modifiers for both stock size and equipment tier, the equipment tier has a ceiling of its own, and modifiers stack only within that ceiling. Stock size itself is the sum of the merchant's own base range, the location modifier and personal modifiers; the tiers and trade favorability are covered by the reputation article.

The caravan's trade upgrade raises a merchant's stock size; the upgrade tree itself is covered by the caravan article.

Some quests write a stock-size or personal repair-price modifier for one particular merchant; those changes belong to the person and quest articles and are not listed one by one here.

Repairs

Repairs are an optional service: it is off by default and switched on merchant by merchant, so the repair button appears on the trade panel only for those who offer it; most general merchants and inns do not.

The button's hover text follows the material that merchant works with, such as metal, wood, cloth and leather. Whether an item can be repaired is decided by several conditions at once: its material must be one that merchant works with, while unidentified items, items already at full durability, items of the wrong material and items marked as stolen at that location cannot be repaired.

One repair fills the item's durability completely rather than buying durability in proportion; the fee goes to that merchant and is recorded in the character's spending.

The price is built from four inputs: the item's tier, the share of durability that is missing, the item's base value and that merchant's own repair-price parameter; they are multiplied together, rounded, and given a minimum floor. The same item therefore costs different amounts at different merchants and at different missing durability; this page publishes neither the expression nor the per-merchant parameters, so check the exact amount on the trade panel or in the trading tool.

Some quests and caravan-related effects adjust that parameter; those modifiers belong to the person, quest and caravan articles and are not repeated here.

Documented gaps

These are not closed by the same-release data and are not asserted here (documented gaps): the exact basis of the repair price shown to the player, that is whether the repair parameter used by the panel and the item's base value are the same field; whether supplies and consumables restock through the same flow; the exact ratio behind the "roughly half" rotation; the complete list of per-merchant cycles and which settlement each of those merchants belongs to; whether the quest-level equipment-tier modifier has any writer; the total number of goods generated in one restock; and whether the random state used for generation is reproducible for a player, since this page does not claim that a particular item can be produced on demand.

One code observation belongs here as well: the settlement situation modifiers of the same release do list an entry for the restock cycle and an entry for the repair price, while the same-release script that reads situation modifiers and computes a merchant's trading parameters does not consume those two keys. This is an observation from reading the export; this page does not conclude that situations have no effect on these values, and does not trace every consumer of situation modifiers.

References

Game version 0.9.4.25

  1. 0.9.4.25 trade panel text table gml_GlobalScript_table_text (accepted categories, equipment tier, restock time, repair material and repair price fields, the restock time unit and under-a-day wording, and the repair button hover text; twelve language columns)
  2. 0.9.4.25 panel and loading chain gml_Object_o_textLoader_Other_25, gml_Object_o_hoverTradeModifierOffers_Other_20, gml_GlobalScript_scr_npc_restock_time_get (the three panel lists come from that table; the remaining time is converted from an hour difference into days)
  3. 0.9.4.25 merchant profile defaults and a repair-capable profile gml_Object_o_NPC_Create_0, gml_Object_o_npc_smith_osbrook_Create_0, gml_GlobalScript_scr_npc_stock_size_init (repair service off by default, whole-batch restock, no individual cycle, settlement-driven restock; stock size base range)
  4. 0.9.4.25 repair entry point and eligibility gml_Object_o_trade_inventory_Other_10, gml_Object_o_skill_repair_item_master_Other_20, gml_Object_o_skill_repair_item_master_Other_11 (panel button and material hover text; unidentified, full durability, wrong material and locally stolen items blocked; one repair fills durability and pays the merchant)
  5. 0.9.4.25 repair price inputs gml_Object_o_inv_slot_Step_0 (item tier, missing durability share, item base value and the merchant repair parameter multiplied, rounded and floored)
  6. 0.9.4.25 restock triggers and behaviours gml_GlobalScript_scr_timeEveryHourTrigger, gml_GlobalScript_scr_settlementRestock, gml_GlobalScript_scr_npc_restock (hourly settlement cycle check; whole-batch replacement and partial rotation, whole batch by default; funds have their own timer)
  7. 0.9.4.25 settlement restock cycles gml_Object_o_globalmap_settlement_Create_0, gml_Object_o_globalmap_brynn_Create_0, gml_Object_o_globalmap_denbrie_Other_10, gml_Object_o_globalmap_brewery_Create_0
  8. 0.9.4.25 batch generation and unique stock gml_Object_o_NPC_Other_24, gml_Object_o_trade_inventory_Other_13, gml_GlobalScript_scr_trade_item, gml_GlobalScript_scr_selling_loot_singular_stock (generated when the trade window opens, written back on close, sold goods do not return, unique stock skipped once bought)
  9. 0.9.4.25 stock size and tier modifiers gml_GlobalScript_scr_trade_parametrs_update, gml_GlobalScript_scr_settlementReputationPerkGetModifiers, gml_GlobalScript_scr_npc_lines_carpenter_scripts, gml_GlobalScript_scr_npc_lines_mann_healer (reputation perks, the caravan trade upgrade and quest-written stock size or repair price modifiers)
  10. 0.9.4.25 settlement situation modifier data gml_GlobalScript_scr_settlementSituationGetModifiers (lists restock cycle and repair price modifier entries; the same-release trading parameter script does not read those two keys, recorded as an observation)
Back to top