aboutsummaryrefslogtreecommitdiff
path: root/src/game/Spell.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Spell.cpp')
-rw-r--r--src/game/Spell.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 00c47a5cc4e..a0cd094a27b 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -3076,6 +3076,7 @@ void Spell::_handle_immediate_phase()
if(!m_originalCaster)
return;
+ uint8 oldEffMask = m_effectMask;
// process ground
for(uint32 j = 0; j < 3; ++j)
{
@@ -3092,6 +3093,38 @@ void Spell::_handle_immediate_phase()
m_effectMask |= (1<<j);
}
}
+ if (oldEffMask != m_effectMask && m_UniqueTargetInfo.empty())
+ {
+ uint32 procAttacker = m_procAttacker;
+ if (!procAttacker)
+ {
+ bool positive = true;
+ for (uint8 i = 0; i< MAX_SPELL_EFFECTS; ++i)
+ // If at least one effect negative spell is negative hit
+ if (m_effectMask & (1<<i) && !IsPositiveEffect(m_spellInfo->Id, i))
+ {
+ positive = false;
+ break;
+ }
+ switch(m_spellInfo->DmgClass)
+ {
+ case SPELL_DAMAGE_CLASS_MAGIC:
+ if (positive)
+ procAttacker |= PROC_FLAG_SUCCESSFUL_POSITIVE_MAGIC_SPELL;
+ else
+ procAttacker |= PROC_FLAG_SUCCESSFUL_NEGATIVE_MAGIC_SPELL;
+ break;
+ case SPELL_DAMAGE_CLASS_NONE:
+ if (positive)
+ procAttacker |= PROC_FLAG_SUCCESSFUL_POSITIVE_SPELL_HIT;
+ else
+ procAttacker |= PROC_FLAG_SUCCESSFUL_NEGATIVE_SPELL_HIT;
+ break;
+ }
+ }
+ // Proc damage for spells which have only dest targets (2484 should proc 51486 for example)
+ m_originalCaster->ProcDamageAndSpell(0, procAttacker, 0, m_procEx | PROC_EX_NORMAL_HIT, 0, BASE_ATTACK, m_spellInfo, m_triggeredByAuraSpell);
+ }
}
void Spell::_handle_finish_phase()