Skip to content

SetCorpseItems

What a corpse holds from now on - the list anyone who searches it takes from.

Replaces the corpse’s list. A class is any key of the item catalogue; the money is the item class money in tenths of a Groschen ({class = "money", amount = 150} is 15 Groschen). With items on it the corpse gets the game’s loot prompt on every screen that keeps it ([combat] loot_bodies not "none"); an empty list takes the prompt away. Nothing is taken from the player - move things with SetPlayerInventory / EmptyPlayerInventory in the same call, or they are on the corpse and on the player both.

SetCorpseItems(corpse, items)
Parameter Type
corpse number the corpse’s id
items table a list of {class=, amount=}, as GetPlayerInventory returns it

boolean - false when there is no such corpse

function OnPlayerCorpse(pid, corpse)
SetCorpseItems(corpse, GetPlayerInventory(pid)) -- everything stays with the body
EmptyPlayerInventory(pid)
end

GetCorpseItems · OnPlayerCorpse · EmptyPlayerInventory · the Combat group of the index