Skip to content

TakeItemsAction ​

Inherits: PlayerEventAction < EventAction < Resource

Action that takes items out of the bag of player(s): a toll, a payment, items handed over to an NPC. Quest items that are kept aside are taken too.

Properties ​

intitem_id0
intquantity1
boolall_or_nothingtrue

Methods ​

Stringget_player_function_description()
boolexecute_on_players( players: Array[Player] )
Dictionarysave()
voidload_data( data: Dictionary )

Property descriptions ​

int item_id = 0 ​

The item to take

int quantity = 1 ​

How many to take

bool all_or_nothing = true ​

Take nothing when the player has fewer than that (on), or take what they have (off). The action fails when nothing could be taken from a player

Method descriptions ​

String get_player_function_description() ​

The sentence the editor shows for the action, with {placeholders} for its values.

bool execute_on_players( players: Array[Player] ) ​

Takes the items from each player. With all or nothing set, nobody pays unless every player can. False when it fails.

Dictionary save() ​

The state of the action for a save.

void load_data( data: Dictionary ) ​

Restores the state of the action from a save.