Pokémon SDK Wiki
Credits

Give an item

Give an item from an event

Command

To give an item from an event you can use the following command :

add_item(id, no_delete)

Parameters are:

Hovewer, there are also more specific commands for some actions :

To pick items from the ground :

pick_item(item_id, count, no_delete)

Parameters are:

To give an item thanks to a NPC :

give_item(item_id, count)

Parameters are:

This command shows an "item got" message and plays a music effect if available.

Examples

Item on the ground giving a Potion:

pick_item(:potion)

or

pick_item(17)

NPC giving a TM (and that should not be removed):

give_item(:tm01, true)

or

give_item(328, true)

Silently give an item

Command

You can add an item to the bag without notification using the following command:

$bag.add_item(id, quantity)

The parameters are :

Examples

Add 5 potions:

$bag.add_item(:potion, 5)

or

$bag.add_item(17, 5)

Drop an item from the bag

Command

To drop an item, use the following command:

$bag.drop_item(id, quantity)

Parameters are:

Examples

Drop a potion :

$bag.drop_item(:potion, 1)

or

$bag.drop_item(17, 1)

To Know if the Player has an item

To know if the Player has a particular item in his bag, use the Command:

$bag.has_item?(id)

The id parameter is the item ID which should be in the bag.

Check if the player has an item

To check if the player has an item in the bag, you can use the command:

quantite = $bag.item_quantity(id)

The parameter id is the ID of the item.