fix(Core/Unit): Sanctified Wrath calculations SPELL_AURA_MOD_IGNORE_TARGET_RESIST (#25400)

Co-authored-by: From: ariel- <ariel-@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
sogladev
2026-04-15 13:02:45 +02:00
committed by GitHub
parent 66ede70908
commit 854b9832eb
4 changed files with 22 additions and 45 deletions

View File

@@ -2238,20 +2238,11 @@ uint32 Unit::CalcArmorReducedDamage(Unit const* attacker, Unit const* victim, co
if (Player* modOwner = attacker->GetSpellModOwner())
modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_IGNORE_ARMOR, armor);
AuraEffectList const& ResIgnoreAurasAb = attacker->GetAuraEffectsByType(SPELL_AURA_MOD_ABILITY_IGNORE_TARGET_RESIST);
for (AuraEffectList::const_iterator j = ResIgnoreAurasAb.begin(); j != ResIgnoreAurasAb.end(); ++j)
{
if ((*j)->GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL
&& (*j)->IsAffectedOnSpell(spellInfo))
armor = std::floor(AddPct(armor, -(*j)->GetAmount()));
}
AuraEffectList const& ResIgnoreAuras = attacker->GetAuraEffectsByType(SPELL_AURA_MOD_IGNORE_TARGET_RESIST);
for (AuraEffectList::const_iterator j = ResIgnoreAuras.begin(); j != ResIgnoreAuras.end(); ++j)
{
if ((*j)->GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL)
armor = std::floor(AddPct(armor, -(*j)->GetAmount()));
}
// Apply ability-specific ignore target resist effects for physical damage (armor)
AuraEffectList const& targetIgnoreRes = attacker->GetAuraEffectsByType(SPELL_AURA_MOD_ABILITY_IGNORE_TARGET_RESIST);
for (AuraEffect const* aurEff : targetIgnoreRes)
if (aurEff->GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL && aurEff->IsAffectedOnSpell(spellInfo))
armor = std::floor(AddPct(armor, -aurEff->GetAmount()));
// Apply Player CR_ARMOR_PENETRATION rating and buffs from stances\specializations etc.
if (attacker->IsPlayer())
@@ -2399,8 +2390,6 @@ void Unit::CalcAbsorbResist(DamageInfo& dmgInfo, bool Splited)
return true;
});
damageResisted -= damageResisted * (mult - 1.0f);
mult = attacker->GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_IGNORE_TARGET_RESIST, schoolMask);
damageResisted -= damageResisted * (mult - 1.0f);
}
// pussywizard:
@@ -8986,21 +8975,15 @@ uint32 Unit::SpellDamageBonusTaken(Unit* caster, SpellInfo const* spellProto, ui
TakenTotalMod = 1.0f;
}
// xinef: sanctified wrath talent
if (caster && TakenTotalMod < 1.0f && caster->HasIgnoreTargetResistAura())
// Sanctified Wrath (bypass damage reduction)
if (caster && TakenTotalMod < 1.0f && caster->HasIgnoreTargetResistModifiersAura())
{
float ignoreModifier = 1.0f - TakenTotalMod;
bool addModifier = false;
AuraEffectList const& ResIgnoreAuras = caster->GetAuraEffectsByType(SPELL_AURA_MOD_IGNORE_TARGET_RESIST);
for (AuraEffectList::const_iterator j = ResIgnoreAuras.begin(); j != ResIgnoreAuras.end(); ++j)
if ((*j)->GetMiscValue() & spellProto->SchoolMask)
{
ApplyPct(ignoreModifier, (*j)->GetAmount());
addModifier = true;
}
float damageModifier = 1.0f - TakenTotalMod;
for (AuraEffect const* aurEff : caster->GetAuraEffectsByType(SPELL_AURA_MOD_IGNORE_TARGET_RESIST_MODIFIERS))
if (aurEff->GetMiscValue() & spellProto->SchoolMask)
AddPct(damageModifier, -aurEff->GetAmount());
if (addModifier)
TakenTotalMod += ignoreModifier;
TakenTotalMod = 1.0f - damageModifier;
}
float tmpDamage = (float(pdamage) + TakenTotal) * TakenTotalMod;
@@ -10448,21 +10431,15 @@ uint32 Unit::MeleeDamageBonusTaken(Unit* attacker, uint32 pdamage, WeaponAttackT
TakenTotalMod = 1.0f;
}
// xinef: sanctified wrath talent
if (TakenTotalMod < 1.0f && attacker->HasIgnoreTargetResistAura())
// Sanctified Wrath (bypass damage reduction)
if (TakenTotalMod < 1.0f && attacker->HasIgnoreTargetResistModifiersAura())
{
float ignoreModifier = 1.0f - TakenTotalMod;
bool addModifier = false;
AuraEffectList const& ResIgnoreAuras = attacker->GetAuraEffectsByType(SPELL_AURA_MOD_IGNORE_TARGET_RESIST);
for (AuraEffectList::const_iterator j = ResIgnoreAuras.begin(); j != ResIgnoreAuras.end(); ++j)
if ((*j)->GetMiscValue() & damageSchoolMask)
{
ApplyPct(ignoreModifier, (*j)->GetAmount());
addModifier = true;
}
float damageModifier = 1.0f - TakenTotalMod;
for (AuraEffect const* aurEff : attacker->GetAuraEffectsByType(SPELL_AURA_MOD_IGNORE_TARGET_RESIST_MODIFIERS))
if (aurEff->GetMiscValue() & damageSchoolMask)
AddPct(damageModifier, -aurEff->GetAmount());
if (addModifier)
TakenTotalMod += ignoreModifier;
TakenTotalMod = 1.0f - damageModifier;
}
float tmpDamage = (float(pdamage) + TakenFlatBenefit) * TakenTotalMod;