Skip to content

SetPlayerItemPrice

Gives one of the player’s tagged items a price of its own - and puts it up for sale.

price is in Groschen, 0 to 1,000,000, in place of the class’s own: the game’s item panel shows it, and a shop that buys the item’s kind pays its sell factor of it (CreateShop). A tagged item without a price of its own is not for sale at all (a letter, a contract) - giving it one is how a mode lets players sell it. nil gives the class’s back and takes it off sale. The price belongs to the item: it travels with it and GetPlayerInventory lists it as price. A piece bought from a shop’s tagged row (SetShopTaggedItem) comes with the price it cost.

SetPlayerItemPrice(pid, id, price)
Parameter Type
pid number the player
id string the tagged item’s id
price number | nil Groschen; nil = the class’s own (not for sale)

boolean - false when the player holds no item with that id, or for a price outside 0..1,000,000

-- the tournament's prize: a sword of its own name, worth a fortune to a merchant
GivePlayerTaggedItem(winner, "longSwordDuel", "prize-" .. year, "Champion's blade", "Won at the tournament of " .. year .. ".")
SetPlayerItemPrice(winner, "prize-" .. year, 2500)

SetPlayerItemWeight · SetPlayerItemModel · SetShopTaggedItem · GivePlayerTaggedItem · GetPlayerInventory · the Items and inventory group of the index