aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/server/game/Spells/SpellEffects.cpp7
1 files changed, 5 insertions, 2 deletions
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);
}