Core/Spells: Implement SPELL_AURA_MOD_BYPASS_ARMOR_FOR_CASTER

This commit is contained in:
Shocker
2011-11-26 22:22:11 +02:00
parent 96df0d27e5
commit 784a2fa29a
2 changed files with 9 additions and 1 deletions
+8
View File
@@ -1490,6 +1490,14 @@ uint32 Unit::CalcArmorReducedDamage(Unit* victim, const uint32 damage, SpellInfo
uint32 newdamage = 0;
float armor = float(victim->GetArmor());
// bypass enemy armor effectiveness by SPELL_AURA_BYPASS_ARMOR_FOR_CASTER
int32 auraEffectivenessReduction = 0;
AuraEffectList const & reductionAuras = victim->GetAuraEffectsByType(SPELL_AURA_BYPASS_ARMOR_FOR_CASTER);
for (AuraEffectList::const_iterator i = reductionAuras.begin(); i != reductionAuras.end(); ++i)
if ((*i)->GetCasterGUID() == GetGUID())
auraEffectivenessReduction += (*i)->GetAmount();
armor = CalculatePctN(armor, 100 - std::min(auraEffectivenessReduction, 100));
// Ignore enemy armor by SPELL_AURA_MOD_TARGET_RESISTANCE aura
armor += GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_TARGET_RESISTANCE, SPELL_SCHOOL_MASK_NORMAL);