From 5d37116ea68f6a5091df6e413ae923ee34a4dadd Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 30 Sep 2011 18:41:30 +0200 Subject: Core/Spells: Allow ProcessEvent hook to run in EffectSendEvent when spell caster is a player --- src/server/game/Spells/SpellEffects.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 540ee7720a1..b242e0dcfd2 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -62,6 +62,7 @@ #include "ScriptMgr.h" #include "GameObjectAI.h" #include "AccountMgr.h" +#include "InstanceScript.h" pEffect SpellEffects[TOTAL_SPELL_EFFECTS]= { @@ -2141,7 +2142,7 @@ void Spell::EffectSendEvent(SpellEffIndex effIndex) && effectHandleMode != SPELL_EFFECT_HANDLE_HIT) return; - Object* target = NULL; + WorldObject* target = NULL; // call events for target if present if (effectHandleMode == SPELL_EFFECT_HANDLE_HIT_TARGET) @@ -2162,7 +2163,9 @@ void Spell::EffectSendEvent(SpellEffIndex effIndex) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell ScriptStart %u for spellid %u in EffectSendEvent ", m_spellInfo->Effects[effIndex].MiscValue, m_spellInfo->Id); if (ZoneScript* zoneScript = m_caster->GetZoneScript()) - zoneScript->ProcessEvent(unitTarget, m_spellInfo->Effects[effIndex].MiscValue); + zoneScript->ProcessEvent(target, m_spellInfo->Effects[effIndex].MiscValue); + else if (InstanceScript* instanceScript = m_caster->GetInstanceScript()) // needed in case Player is the caster + instanceScript->ProcessEvent(target, m_spellInfo->Effects[effIndex].MiscValue); m_caster->GetMap()->ScriptsStart(sEventScripts, m_spellInfo->Effects[effIndex].MiscValue, m_caster, target); } -- cgit v1.2.3