SetActorPocket
Gives an NPC actor pockets a thief may take from.
items is a list of {class = ..., amount = ..., health = ...} (class an item class, name or id; health 0 to 100, 100
when absent) and money Groschen:
the “Rob” prompt shows on the actor while pickpocketing is on (with the rules’ actors = false it still shows, and the server
refuses every ask) and the offer is made from them, with
the rules’ max_items and max_stack; the money is offered as one entry, whole up to the rules’ money_cap. Every take shrinks
the pockets; the mode refills them. nil takes the pockets away (no prompt on the actor; a session on it ends); an empty list
is an actor with empty pockets - the thief is told there is nothing to take. An item class that is not in the item catalogue is
left out. The actor’s state key pocket is the server’s (see the group’s description) - this call writes it. false when
actorId is not an NPC actor.
Syntax
Section titled “Syntax”SetActorPocket(actorId, items [, money])| Parameter | Type | |
|---|---|---|
actorId |
number | the NPC actor |
items |
table | the stacks in its pockets - {{class, amount, health}, ...}; nil takes the pockets away |
money |
number | Groschen in its purse (optional) |
Returns
Section titled “Returns”boolean - false when there is no such actor
Example
Section titled “Example”-- the merchant carries a loaf and a few coinslocal merchant = CreateActor(nil, x, y, z, 0, "Merchant")SetActorPocket(merchant, {{class = "bread", amount = 2}}, 12.5)See also
Section titled “See also”GetActorPocket · SetPickpocketing · CreateActor · the Pickpocketing group of the index
