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:
QAston
2011-09-25 13:29:50 +02:00
parent b07cc3751f
commit e949ad3adb
50 changed files with 1057 additions and 738 deletions
+5 -10
View File
@@ -282,7 +282,6 @@ class Spell
void EffectLearnPetSpell(SpellEffIndex effIndex);
void EffectWeaponDmg(SpellEffIndex effIndex);
void EffectForceCast(SpellEffIndex effIndex);
void EffectForceCastWithValue(SpellEffIndex effIndex);
void EffectTriggerSpell(SpellEffIndex effIndex);
void EffectTriggerMissileSpell(SpellEffIndex effIndex);
void EffectThreat(SpellEffIndex effIndex);
@@ -337,7 +336,6 @@ class Spell
void EffectUnlearnSpecialization(SpellEffIndex effIndex);
void EffectHealPct(SpellEffIndex effIndex);
void EffectEnergizePct(SpellEffIndex effIndex);
void EffectTriggerSpellWithValue(SpellEffIndex effIndex);
void EffectTriggerRitualOfSummoning(SpellEffIndex effIndex);
void EffectSummonRaFFriend(SpellEffIndex effIndex);
void EffectKillCreditPersonal(SpellEffIndex effIndex);
@@ -440,7 +438,7 @@ class Spell
void SendChannelStart(uint32 duration);
void SendResurrectRequest(Player* target);
void HandleEffects(Unit* pUnitTarget, Item* pItemTarget, GameObject* pGOTarget, uint32 i);
void HandleEffects(Unit* pUnitTarget, Item* pItemTarget, GameObject* pGOTarget, uint32 i, SpellEffectHandleMode mode);
void HandleThreatSpells();
SpellInfo const* const m_spellInfo;
@@ -539,6 +537,7 @@ class Spell
Item* itemTarget;
GameObject* gameObjTarget;
int32 damage;
SpellEffectHandleMode effectHandleMode;
// used in effects handlers
Aura* m_spellAura;
@@ -612,11 +611,8 @@ class Spell
void SearchChainTarget(std::list<Unit*> &unitList, float radius, uint32 unMaxTargets, SpellTargets TargetType);
WorldObject* SearchNearbyTarget(float range, SpellTargets TargetType, SpellEffIndex effIndex);
bool IsValidDeadOrAliveTarget(Unit const* target) const;
void CalculateDamageDoneForAllTargets();
int32 CalculateDamageDone(Unit* unit, const uint32 effectMask, float *multiplier);
void SpellDamageSchoolDmg(SpellEffIndex effIndex);
void SpellDamageWeaponDmg(SpellEffIndex effIndex);
void SpellDamageHeal(SpellEffIndex effIndex);
void HandleLaunchPhase();
void DoAllEffectOnLaunchTarget(TargetInfo& targetInfo, float* multiplier);
void PrepareTargetProcessing();
void FinishTargetProcessing();
@@ -630,7 +626,7 @@ class Spell
void LoadScripts();
SpellCastResult CallScriptCheckCastHandlers();
void PrepareScriptHitHandlers();
bool CallScriptEffectHandlers(SpellEffIndex effIndex);
bool CallScriptEffectHandlers(SpellEffIndex effIndex, SpellEffectHandleMode mode);
void CallScriptBeforeHitHandlers();
void CallScriptOnHitHandlers();
void CallScriptAfterHitHandlers();
@@ -661,7 +657,6 @@ class Spell
SpellInfo const* m_triggeredByAuraSpell;
bool m_skipCheck;
uint32 m_effectMask;
uint8 m_auraScaleMask;
ByteBuffer * m_effectExecuteData[MAX_SPELL_EFFECTS];