Appearance
sdk.shop_qty
NPC shop amounts. One formula for recover, commerce, and the action graph. Buy is remaining-to-target. A cached count must be recomputed against have immediately before the packet; never send target-have from a stale snapshot.
lua
local M = require("sdk.shop_qty")buy
function · buy(target, have)
Target mode: how many more to buy so have reaches target.
buy_amount
function · buy_amount(mode, target, have)
mode: target (default) | exact | all. all-buy is not a restock.
sell_amount
function · sell_amount(mode, configured, have)
mode: target keeps configured, exact sells min(configured, have), all sells have.