aboutsummaryrefslogtreecommitdiff
path: root/src/game/Spell.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2008-11-23 14:42:32 -0600
committermegamage <none@none>2008-11-23 14:42:32 -0600
commit32b78f767c6ae8107e8e04fa5c3e33bbe01d3efa (patch)
tree3be7d513ac4809d9c8f6fdf8d84113e258f9c383 /src/game/Spell.cpp
parent8d687761bcea04c9d9d4add8699df5e48ec0d546 (diff)
*Fix a bug in 307. Only the trigger effect should be applied but not the whole spell.
*Restore build in Linux. *Change "Added aura" log to level: detail. --HG-- branch : trunk
Diffstat (limited to 'src/game/Spell.cpp')
-rw-r--r--src/game/Spell.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 858ba23c49f..5cdbef26eed 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -712,17 +712,11 @@ void Spell::AddUnitTarget(Unit* pVictim, uint32 effIndex)
target.processed = false; // Effects not apply on target
// Calculate hit result
- if(m_spellInfo->Effect[effIndex] == SPELL_EFFECT_DUMMY)
- target.missCondition = SPELL_MISS_NONE;
- else if(m_originalCaster)
+ if(m_originalCaster)
target.missCondition = m_originalCaster->SpellHitResult(pVictim, m_spellInfo, m_canReflect);
else
target.missCondition = SPELL_MISS_EVADE; //SPELL_MISS_NONE;
- if(target.missCondition == SPELL_MISS_IMMUNE // Mass Dispel
- && m_spellInfo->Effect[effIndex] == SPELL_EFFECT_TRIGGER_SPELL)
- target.missCondition = SPELL_MISS_NONE;
-
if (target.missCondition == SPELL_MISS_NONE)
++m_countOfHit;
else
@@ -947,6 +941,16 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
if (target->reflectResult == SPELL_MISS_NONE) // If reflected spell hit caster -> do all effect on him
DoSpellHitOnUnit(m_caster, mask);
}
+ else //TODO: This is a hack. need fix
+ {
+ uint32 tempMask = 0;
+ for(uint32 i = 0; i < 3; ++i)
+ if(m_spellInfo->Effect[i] == SPELL_EFFECT_DUMMY
+ || m_spellInfo->Effect[i] == SPELL_EFFECT_TRIGGER_SPELL)
+ tempMask |= 1<<i;
+ if(tempMask &= mask)
+ DoSpellHitOnUnit(unit, tempMask);
+ }
// Do triggers only on miss/resist/parry/dodge
if (missInfo!=SPELL_MISS_NONE)