ItemDefinitionEnchantScroll ​
Inherits: ItemDefinition < DatabaseResource < Resource
Enchantment scrolls that can permanently or temporarily enhance equipment items Uses effects system for actual enchantment functionality
Properties ​
int | enchant_effect_id | |
float | enchant_duration | -1.0 |
bool | override_effect_duration | true |
Array[int] | allowed_equipment_types | [] |
bool | allows_weapons | false |
bool | allows_any_equipment | false |
String | enchant_category | "general" |
bool | conflicts_with_category | false |
bool | consume_on_use | true |
Methods ​
bool | can_use( user: Entity, item_instance: ItemInstance = null ) |
bool | execute_use( user: Entity, item_instance: ItemInstance ) |
String | get_use_action_name( _item_instance: ItemInstance ) |
bool | can_enchant_equipment( equipment_definition: ItemDefinitionEquipment ) |
bool | can_enchant_item_instance( item_instance: ItemInstance ) |
bool | apply_enchantment_to_item( target_item: ItemInstance, user: Entity = null ) |
String | get_enchant_source() |
String | get_compatible_equipment_types_text() |
bool | targets_weapons() |
bool | targets_armor() |
Array[Dictionary] | validate_enchant_scroll() |
bool | use_enchant_scroll( scroll_item: ItemInstance, target_equipment: ItemInstance, user: Entity ) |
Property descriptions ​
int enchant_effect_id ​
The effect applied when this enchantment scroll is used on equipment
float enchant_duration = -1.0 ​
Duration override for all effects (-1 = permanent, >0 = temporary in seconds)
bool override_effect_duration = true ​
Whether to override individual effect durations (scroll is king)
Target Restrictions
Array[int] allowed_equipment_types = [] ​
Array of equipment type IDs this enchantment can be applied to
bool allows_weapons = false ​
Whether this enchantment can be applied to weapons specifically
bool allows_any_equipment = false ​
Whether this enchantment can be applied to any equipment if no specific types are set
Enchantment Categories
String enchant_category = "general" ​
Category of enchantment for organization and conflict resolution
bool conflicts_with_category = false ​
Whether this enchantment conflicts with others in the same category
Consumption
bool consume_on_use = true ​
Whether this scroll is consumed when used
Method descriptions ​
bool can_use( user: Entity, item_instance: ItemInstance = null ) ​
Check if the enchant scroll can be used
bool execute_use( user: Entity, item_instance: ItemInstance ) ​
Execute enchant scroll usage - this would trigger the enchanting UI/process The actual enchanting logic would be handled by the enchanting system
String get_use_action_name( _item_instance: ItemInstance ) ​
Get display name for enchant scroll action
bool can_enchant_equipment( equipment_definition: ItemDefinitionEquipment ) ​
Check if this enchantment can be applied to a specific equipment item
bool can_enchant_item_instance( item_instance: ItemInstance ) ​
Check if this enchantment can be applied to a specific equipment item instance
bool apply_enchantment_to_item( target_item: ItemInstance, user: Entity = null ) ​
Apply this enchantment to a target equipment item instance New single enchant system - replaces existing enchants
String get_enchant_source() ​
Get the source identifier for this enchant scroll
String get_compatible_equipment_types_text() ​
Get a list of compatible equipment types for display
bool targets_weapons() ​
Check if this enchantment targets weapons
bool targets_armor() ​
Check if this enchantment targets armor
Array[Dictionary] validate_enchant_scroll() ​
Validate the enchantment scroll configuration
bool use_enchant_scroll( scroll_item: ItemInstance, target_equipment: ItemInstance, user: Entity ) ​
Apply this enchant scroll to target equipment This is the main entry point for the enchanting system