diff options
author | Shauren <shauren.trinity@gmail.com> | 2011-01-21 23:42:51 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2011-01-21 23:42:51 +0100 |
commit | c2690f748bcc42a1818b90336e81fb586588dd1e (patch) | |
tree | 86c513b372d3a75455b442a8bf856ac38570801f /src/server/scripts/Examples | |
parent | 76e4b6dda48c7ac20b2b6bfc874fd89deea9398b (diff) |
Scripts/Spells: Implemented UnitTargetHandler spell script hook, it can be used to filter area targeting spells
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); } }; |