Overview
Modifiers are metaskills that trigger at specific points in the spell lifecycle. They can:- Modify spell variables (damage, cooldown, range, etc.)
- Execute custom logic on spell cast, damage, or cooldown events
- Stack multiple times for increased effect
- Be dynamically added or removed during gameplay
- Have priority-based execution order
How It Works
The modifier system uses a map-based architecture:- Modifiers are stored in
caster.modifier_mapwith their parameters - When triggered, modifiers are filtered by trigger type
- Filtered modifiers are sorted by priority (highest first)
- Each modifier metaskill executes in order
modifier_handler.yml:118
Adding Modifiers
Unique identifier for this modifier. Used for removal and stacking.
The metaskill to execute when this modifier triggers. Cannot be inline - must reference a skill ID.
When this modifier should execute. Available triggers:
PRECAST- Before spell evaluationPRE_CAST- Before spell executionCAST- After spell castPRE_DAMAGE- Before damage calculationDAMAGE- After damage dealtWEAPON_HIT- On melee weapon hitABILITY_HIT- On ability hitCRITICAL_DAMAGE- On critical hitCOOLDOWN_END- When cooldown expiresCOOLDOWN_RESET- When cooldown manually reset
Execution order - higher priority executes first. Priority levels:
1- LOWEST2- LOW3- MEDIUM4- HIGH5- SPELL SELECT6- SPELL EXECUTION7- MONITOR
Numerical parameter for stacking modifiers. Can be used to scale effects within the modifier metaskill.By default, stacks will not override unless new stacks > old stacks.
Basic Example
Add a damage-boosting modifier that reduces warmup:modifier_handler.yml:254
Triggering Modifiers
Manually trigger modifiers at any point:spell_handler.yml:54
Removing Modifiers
Remove by name:Stacking System
Modifiers with the same name can stack. Use thestacks parameter to scale effects:
modifier_handler.yml:247
Risk of Rain Style Items
Create a modular item system where items add modifiers:Modifier Chain Example
Multiple modifiers executing in priority order:modifier_handler.yml:232
Temporary Modifiers with Auras
Combine modifiers with auras for temporary buffs:modifier_handler.yml:280
Important Warnings
Advanced: Insertion Sort
Modifiers are sorted using insertion sort for deterministic ordering:modifier_handler.yml:163
Debugging
Enable debug mode to see modifier execution:Map Data Structure
Modifiers are stored in this format:Related Systems
- Spell Casting Handler - Uses modifiers for spell behavior
- Damage Core - Triggers PRE_DAMAGE and DAMAGE modifiers