Skip to content

SetShopTaggedItem

Puts one of your tagged items on the shelf - a prize, a charter, a key - under its own name.

item is a tagged entry as GetPlayerInventory lists one: class (any key of the item catalogue), id, name, text, weight - plus price (Groschen a piece) and amount (how many: 1 by default, -1 unlimited, 0 takes the row off). The shop shows the row under its name, and every piece sold is a tagged item with that id, name, text and weight, worth the price it cost (SetPlayerItemPrice: a shop that buys its kind takes it back at its sell factor). A player holds one item of an id, so one who has it already is refused (“you have one already”); give each row an id of its own for items every player should own apart. The row is its id: set again, it changes. OnPlayerBuy names the id.

SetShopTaggedItem(shop, item)
Parameter Type
shop number the shop
item table {class=, id=, name=, text=, weight=, price=, amount=}

boolean - false for no shop, an unknown class, an empty id or a negative price

-- the herald sells one charter to every guild master
SetShopTaggedItem(herald, {class = "letter_BergovRychtarTroskovice", id = "guild-charter", name = "Guild charter",
text = "Granted by the town council.", price = 300, amount = -1})

RemoveShopTaggedItem · SetShopItem · GetShopItems · GivePlayerTaggedItem · SetPlayerItemPrice · the Shops and vendors group of the index