* Better implement 202 SPELL_AURA_IGNORE_COMBAT_RESULT based on SpellClassMask

Signed-off-by: DiSlord <dislord@nomail.com>
This commit is contained in:
DiSlord 2008-12-16 23:25:27 +03:00
parent a33a7f67f7
commit 668c3d4b4c

View file

@ -2307,24 +2307,24 @@ MeleeHitOutcome Unit::RollPhysicalOutcomeAgainst (Unit const *pVictim, WeaponAtt
{ {
// Increase from SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL aura // Increase from SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL aura
crit_chance += GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL, spellInfo->SchoolMask); crit_chance += GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL, spellInfo->SchoolMask);
// Ignore combat result aura
if( dodge_chance != 0.0f ) // if dodge chance is already 0, ignore talents for speed
{
AuraList const& mCanNotBeDodge = GetAurasByType(SPELL_AURA_IGNORE_COMBAT_RESULT); AuraList const& mCanNotBeDodge = GetAurasByType(SPELL_AURA_IGNORE_COMBAT_RESULT);
for(AuraList::const_iterator i = mCanNotBeDodge.begin(); i != mCanNotBeDodge.end(); ++i) for(AuraList::const_iterator i = mCanNotBeDodge.begin(); i != mCanNotBeDodge.end(); ++i)
{ {
// can't be dodged rogue finishing move if (!(*i)->isAffectedOnSpell(spellInfo))
if((*i)->GetModifier()->m_miscvalue == VICTIMSTATE_DODGE) continue;
// can't be dodged
switch((*i)->GetModifier()->m_miscvalue)
{ {
if(spellInfo->SpellFamilyName==SPELLFAMILY_ROGUE && (spellInfo->SpellFamilyFlags & SPELLFAMILYFLAG_ROGUE__FINISHING_MOVE)) case MELEE_HIT_DODGE: dodge_chance = 0.0f; break;
{ case MELEE_HIT_BLOCK: block_chance = 0.0f; break;
dodge_chance = 0.0f; case MELEE_HIT_PARRY: parry_chance = 0.0f; break;
default:
DEBUG_LOG("Spell %u SPELL_AURA_IGNORE_COMBAT_RESULT have unhandled state %d", (*i)->GetId(), (*i)->GetModifier()->m_miscvalue);
break; break;
} }
} }
} }
}
}
// Spellmods // Spellmods
if(Player* modOwner = GetSpellModOwner()) if(Player* modOwner = GetSpellModOwner())