Skip to content

SetPlayerItemQuality

Sets the quality of every item of a class the player carries.

A reward, a smith’s work, a restore: every item of the class in the player’s bag - worn or not - takes quality (1..4, I..IV) in the server’s records at once, and their game sets it a moment later. Each item keeps its condition’s percent of the new quality’s best. A quality past what the class can be is its best; the player’s game then says the quality it holds. A GivePlayerItem of the class still on its way is made at it too.

The id of one of the player’s tagged items (GivePlayerTaggedItem) in place of the class sets that one item alone. It answers 1.

SetPlayerItemQuality(pid, item, quality)
Parameter Type
pid number the player
item string | number the item’s name, id, English name or GUID - or a tagged item’s id
quality number the quality, 1..4

number - how many items were set (0 when they carry none, the item is not in the catalogue, or the quality is 0)

-- the master smith's work: the player's sword made a masterwork
SetPlayerItemQuality(pid, "longSwordDuel", 4)

GetPlayerItemQuality · SetPlayerItemHealth · GivePlayerItem · the Items and inventory group of the index