aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormegamage <none@none>2008-11-23 12:30:34 -0600
committermegamage <none@none>2008-11-23 12:30:34 -0600
commitfb64da2182ddb732c44ab102c670fe3abf23188d (patch)
tree5193119237d3b97251b6372fd11e97d5a32b1796
parent970f2cf8d31020243704e052591e64740c76f1ad (diff)
*SPELL_MISS_NONE when effect is dummy. This fix the bug that some dummy spells are checked for miss condition twice (still do not correct, should show combat log for triggered spell).
*SPELL_MISS_EVADE when original caster does not exist. --HG-- branch : trunk
-rw-r--r--src/game/Spell.cpp25
1 files changed, 8 insertions, 17 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 70a9ca94560..858ba23c49f 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -712,10 +712,17 @@ void Spell::AddUnitTarget(Unit* pVictim, uint32 effIndex)
target.processed = false; // Effects not apply on target
// Calculate hit result
- if(m_originalCaster)
+ if(m_spellInfo->Effect[effIndex] == SPELL_EFFECT_DUMMY)
+ target.missCondition = SPELL_MISS_NONE;
+ else 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
@@ -929,22 +936,6 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
SpellMissInfo missInfo = target->missCondition;
- //if target is immune to spell
- if (missInfo == SPELL_MISS_IMMUNE)
- {
- uint32 t_mask =0;
- for (uint32 i=0;i<3;i++)
- //and this spell triggers another spell (not aura)
- if (m_spellInfo->Effect[i]==SPELL_EFFECT_TRIGGER_SPELL)
- t_mask |=1<<i;
- if (t_mask)
- {
- //let the spell trigger it
- missInfo = SPELL_MISS_NONE;
- mask=t_mask;
- }
- }
-
// Need init unitTarget by default unit (can changed in code on reflect)
// Or on missInfo!=SPELL_MISS_NONE unitTarget undefined (but need in trigger subsystem)
unitTarget = unit;