Core/Spells: Implement SPELL_AURA_MOD_BYPASS_ARMOR_FOR_CASTER
This commit is contained in:
1 parent
96df0d27e5
commit
784a2fa29a
2 files changed
+9
-1
No files matched your search
@@ -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);
|
||||
|
||||
|
||||
Reference in new issue
Block a user