- summary: What one item costs in an NPC shop, who may buy it, and how many each character may buy per restock period.
- area: Game.Common
What one item costs in an NPC shop, who may buy it, and how many each character may buy per restock period.
Kind struct · Area Game.Common
The sale terms of one item on an NPC shop's shelf. The item itself (template
and effects) is in the enclosing ItemMinimalInformation.
CHECK ItemToSellInNpcShop.buy_criterion AND THE PURCHASE ALLOWANCE BEFORE
YOU BUY. The client treats an item whose allowance is used up as not buyable,
and its "only show possible purchases" filter hides an item whose criterion the
character fails.
The allowance:
- ItemToSellInNpcShop.total_buyable of zero or less means there is no
limit.
- Otherwise the character may still buy
total_buyable - already_bought (never less than zero) until the allowance
restocks; ItemToSellInNpcShop.restock_recurrence says when.
The price is per unit, in the shop's currency: kamas, unless
ExchangeNpcShopStartedEvent.token_id names a token item.
Not sent on its own — it is only ever reached as ItemMinimalInformation.item_to_sell_in_npc_shop, inside ExchangeNpcShopStartedEvent.objects. proven
Used by
Fields
| # | Field | Type | Meaning | You set it |
|---|---|---|---|---|
| 1 | price | int64 | The price of one unit. (kamas, or units of the token item when ExchangeNpcShopStartedEvent.token_id is non-zero) Observed: 40 | never |
| 2 | buy_criterion | string | The condition the character must meet to buy the item, in the game's item-criterion syntax. The client parses it with its item-criterion parser. With the shop's "only show possible purchases" filter on, an item is shown only if the character meets it (and, in a token shop, holds at least the price in tokens). | never |
| 3 | total_buyable | int32 | How many of this item one character may buy per restock period. Range: <= 0 means unlimited Observed: -1Named after the client property that receives it (TradeStockItemData.totalBuyable). The client shows 'remaining/total' beside the item only when this is positive. | never |
| 5 | already_bought | int32 | How many of this item the character has already bought in the current restock period. Named after the client field that receives it (TradeStockItemData.alreadyBought). Remaining allowance = max(total_buyable - already_bought, 0); it only matters when total_buyable is positive. | never |
| 6 | restock_recurrence | type not documented yet | How often the purchase allowance resets. Named after the client property that receives it (TradeStockItemData.restockRecurrence). 1 resets daily: the client draws a one-day calendar beside the allowance. It draws a seven-day calendar for every other value, so 0 and 2 cannot be told apart from the client; 2 is probably weekly. | never |