mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-15 20:52:22 -04:00
Scripts/Spells: Implemented UnitTargetHandler spell script hook, it can be used to filter area targeting spells
This commit is contained in:
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user