From fb64da2182ddb732c44ab102c670fe3abf23188d Mon Sep 17 00:00:00 2001 From: megamage Date: Sun, 23 Nov 2008 12:30:34 -0600 Subject: *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 --- src/game/Spell.cpp | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) (limited to 'src') 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<