Skip to content

CreateItemEffect ​

Inherits: Effect < DatabaseResource < Resource

Creates items and adds them to target entity's inventory or drops them in the world

Properties ​

intitem_id0
intquantity1
boolvalidate_item_existstrue
intitem_level0

Methods ​

voidspecific_effect_logic( effect_instance: EffectInstance )
voidcreate_item( effect_instance: EffectInstance )
voidon_stack_reapply( effect_instance: EffectInstance, old_stack_count: int, new_stack_count: int )
Stringget_editor_description()
Stringget_effect_description()
boolis_item_valid()
voidset_item( new_item_id: int, new_quantity: int = 1 )
boolis_one_off_application()

Property descriptions ​

Item Configuration

int item_id = 0 ​

Item ID to create (0 = no item)

int quantity = 1 ​

Quantity to create (must be positive)

Target

bool validate_item_exists = true ​

Whether to validate that the item ID exists in the database

int item_level = 0 ​

For an item that is generated (it rolls or scales): its item level. 0 = the level of the entity that gets it

Method descriptions ​

void specific_effect_logic( effect_instance: EffectInstance ) ​

What the effect does to its target when it is applied.

void create_item( effect_instance: EffectInstance ) ​

Makes the item and puts it in the bag of the target, or drops it in the world.

void on_stack_reapply( effect_instance: EffectInstance, old_stack_count: int, new_stack_count: int ) ​

Handle effect-specific stacking logic

String get_editor_description() ​

A short text for the effect editor that says what the effect does.

String get_effect_description() ​

The text of the effect for tooltips, with its values filled in.

bool is_item_valid() ​

Check if the configured item ID exists in the database

void set_item( new_item_id: int, new_quantity: int = 1 ) ​

Set the item and quantity

bool is_one_off_application() ​

What this effect does it does once, when it is applied: a loaded save does not do it again