Core/Spells: spell effect handling improvements
* Call spell effect handlers in 4 modes: - SPELL_EFFECT_HANDLE_LAUNCH - called when spell is launched (cast just finished) - SPELL_EFFECT_HANDLE_LAUNCH_TARGET - called when spell is launched for each target in spell target map - SPELL_EFFECT_HANDLE_HIT - called when spell hits its destination - SPELL_EFFECT_HANDLE_HIT_TARGET - called when spell hits it's target from spell target map *Correctly implement SPELL_EFFECT_TRIGGER_SPELL, SPELL_EFFECT_TRIGGER_SPELL_WITH_VALUE, SPELL_EFFECT_TRIGGER_MISSILE_SPELL_WITH_VALUE, SPELL_EFFECT_TRIGGER_MISSILE_SPELL *Remove spell system hacks which became obsolete with this commit Core/SpellScripts: add OnEffectLaunch, OnEffectLaunchTarget, OnEffectHit, OnEffectHitTarget hooks for new effect handle modes and remove OnEffect hook. A generic rule of thumb how to update your scripts (will work for nearly all cases) for spell system noobs: if your spell script used GetHitXXXX function, you need to use OnEffectHitTarget, otherwise use OnEffectHit
This commit is contained in:
1 parent
b07cc3751f
commit
e949ad3adb
50 files changed
+1057
-738
No files matched your search
@@ -157,7 +157,7 @@ public:
|
||||
void Register()
|
||||
{
|
||||
// add dummy effect spell handler to Blessing of Faith
|
||||
OnEffect += SpellEffectFn(spell_pal_blessing_of_faith_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
OnEffectHitTarget += SpellEffectFn(spell_pal_blessing_of_faith_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -235,7 +235,7 @@ public:
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffect += SpellEffectFn(spell_pal_guarded_by_the_light_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
OnEffectHitTarget += SpellEffectFn(spell_pal_guarded_by_the_light_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -289,7 +289,7 @@ public:
|
||||
void Register()
|
||||
{
|
||||
// add dummy effect spell handler to Holy Shock
|
||||
OnEffect += SpellEffectFn(spell_pal_holy_shock_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
OnEffectHitTarget += SpellEffectFn(spell_pal_holy_shock_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -317,7 +317,7 @@ public:
|
||||
void Register()
|
||||
{
|
||||
// add dummy effect spell handler to Judgement of Command
|
||||
OnEffect += SpellEffectFn(spell_pal_judgement_of_command_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
OnEffectHitTarget += SpellEffectFn(spell_pal_judgement_of_command_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user