Skip to content

SetShopBuyPrice

What a shop pays for one item class, whatever its sell factor says.

price is Groschen a piece for item (any key of the item catalogue), bought even when the shop buys nothing else (sellFactor 0) or the item’s category is not one it buys, and paid as it is - above the shop’s own price too, if the mode wants it so; 0 = the shop never buys that class; nil takes the rule off (back to the factor). The Sell tab and the trade screen follow at once.

SetShopBuyPrice(shop, item, price)
Parameter Type
shop number the shop
item string | number the item’s name, id, English name or GUID
price number | nil Groschen a piece; 0 = never; nil = no rule

boolean - false for an unknown item or shop

-- the tanner: hides at a fixed price, nothing else
local tanner = CreateShop("Tanner", 0, 300)
SetShopBuyPrice(tanner, "skin_roe", 25)
SetShopBuyPrice(tanner, "skin_hare", 6)

GetShopBuyPrice · SetShopBuyCategories · CreateShop · the Shops and vendors group of the index