Shop Promotion
A shop discount promotion
A temporary promotion that applies a discount to shop items. When active, all items in the target shop (or specific items if specified) have their buy/sell prices reduced by [discountPercent]. Optionally bound to criteria (e.g., only active during events) and auto-expires after [durationSeconds] (0 = permanent until manually removed).
Fields
| Field | Type | Default | Description |
|---|---|---|---|
targetShop | Ref<ShopDefinitionEntry> | — | The shop this promotion applies to. |
discountPercent | Double | 0.0 | Discount percentage (e.g., 20.0 = 20% off). Applied to both buy and sell prices. |
targetItemIndices | List<Int> | empty | Specific item indices this promotion applies to. Empty = all items. |
durationSeconds | Long | 0 | Duration in seconds before this promotion auto-expires. 0 = permanent. |
createdAt | Long | — | Timestamp when this promotion was created (auto-set). |
Common TypeWriter fields (criteria)
| Field | Type | Default | Description |
|---|---|---|---|
criteria | List< Criteria> | empty | Criteria that must be met for this promotion to be active. |
How to use it
- Choose the shop in
targetShop. - Set
discountPercent, for example20for 20% off. - Leave
targetItemIndicesempty for every item, or list the positions of items in the shop'sitems(from 0). - Add
criteriato make the promotion depend on a fact, for example during an event, anddurationSecondsto make it expire.0means it never expires.
The discount applies to the buy price and to the sell reward. Several active promotions on the same item are multiplied together. The has_promotion placeholder tells whether one applies.
Expiry
The duration counts from the createdAt timestamp (milliseconds since 1970) stored in the entry, not from the moment a player first sees the promotion.