Skip to main content

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

FieldTypeDefaultDescription
targetShopRef<ShopDefinitionEntry>—The shop this promotion applies to.
discountPercentDouble0.0Discount percentage (e.g., 20.0 = 20% off). Applied to both buy and sell prices.
targetItemIndicesList<Int>emptySpecific item indices this promotion applies to. Empty = all items.
durationSecondsLong0Duration in seconds before this promotion auto-expires. 0 = permanent.
createdAtLong—Timestamp when this promotion was created (auto-set).
Common TypeWriter fields (criteria)
FieldTypeDefaultDescription
criteriaList< Criteria>emptyCriteria that must be met for this promotion to be active.

How to use it​

  1. Choose the shop in targetShop.
  2. Set discountPercent, for example 20 for 20% off.
  3. Leave targetItemIndices empty for every item, or list the positions of items in the shop's items (from 0).
  4. Add criteria to make the promotion depend on a fact, for example during an event, and durationSeconds to make it expire. 0 means 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.