*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
This commit is contained in:
megamage
2008-11-23 12:30:34 -06:00
parent 970f2cf8d3
commit fb64da2182

View File

@@ -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;