diff options
Diffstat (limited to 'src/server/scripts/Examples')
-rw-r--r-- | src/server/scripts/Examples/example_spell.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/server/scripts/Examples/example_spell.cpp b/src/server/scripts/Examples/example_spell.cpp index 028d016330c..2ac16878d13 100644 --- a/src/server/scripts/Examples/example_spell.cpp +++ b/src/server/scripts/Examples/example_spell.cpp @@ -99,6 +99,12 @@ class spell_ex_5581 : public SpellScriptLoader sLog->outString("Spell just finished hitting target!"); } + void FilterTargets(std::list<Unit*>& /*targetList*/) + { + // usually you want this call for Area Target spells + sLog->outString("Spell is about to add targets from targetList to final targets!"); + } + // register functions used in spell script - names of these functions do not matter void Register() { @@ -118,6 +124,8 @@ class spell_ex_5581 : public SpellScriptLoader OnHit += SpellHitFn(spell_ex_5581SpellScript::HandleOnHit); // bind handler to AfterHit event of the spell AfterHit += SpellHitFn(spell_ex_5581SpellScript::HandleAfterHit); + // bind handler to OnUnitTargetSelect event of the spell + //OnUnitTargetSelect += SpellUnitTargetFn(spell_ex_5581SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_CASTER); } }; |