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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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;

View file

@ -1826,7 +1826,7 @@ public:
[[nodiscard]] bool HasShapeshiftAura() const { return HasAuraType(SPELL_AURA_MOD_SHAPESHIFT); }
[[nodiscard]] bool HasDecreaseSpeedAura() const { return HasAuraType(SPELL_AURA_MOD_DECREASE_SPEED); }
[[nodiscard]] bool HasPacifyAura() const { return HasAuraType(SPELL_AURA_MOD_PACIFY); }
[[nodiscard]] bool HasIgnoreTargetResistAura() const { return HasAuraType(SPELL_AURA_MOD_IGNORE_TARGET_RESIST); }
[[nodiscard]] bool HasIgnoreTargetResistModifiersAura() const { return HasAuraType(SPELL_AURA_MOD_IGNORE_TARGET_RESIST_MODIFIERS); }
[[nodiscard]] bool HasIncreaseMountedSpeedAura() const { return HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_SPEED); }
[[nodiscard]] bool HasIncreaseMountedFlightSpeedAura() const { return HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED); }

View file

@ -329,7 +329,7 @@ enum AuraType
SPELL_AURA_266 = 266,
SPELL_AURA_MOD_IMMUNE_AURA_APPLY_SCHOOL = 267,
SPELL_AURA_MOD_ATTACK_POWER_OF_STAT_PERCENT = 268,
SPELL_AURA_MOD_IGNORE_TARGET_RESIST = 269,
SPELL_AURA_MOD_IGNORE_TARGET_RESIST_MODIFIERS = 269, // Sanctified Wrath, reduces effectiveness of a target's damage reduction effects like Shield Wall
SPELL_AURA_MOD_ABILITY_IGNORE_TARGET_RESIST = 270, // Possibly need swap vs 195 aura used only in 1 spell Chaos Bolt Passive
SPELL_AURA_MOD_DAMAGE_FROM_CASTER = 271,
SPELL_AURA_IGNORE_MELEE_RESET = 272,

View file

@ -494,7 +494,7 @@ public:
case SPELL_AURA_266: return "SPELL_AURA_266";
case SPELL_AURA_MOD_IMMUNE_AURA_APPLY_SCHOOL: return "SPELL_AURA_MOD_IMMUNE_AURA_APPLY_SCHOOL";
case SPELL_AURA_MOD_ATTACK_POWER_OF_STAT_PERCENT: return "SPELL_AURA_MOD_ATTACK_POWER_OF_STAT_PERCENT";
case SPELL_AURA_MOD_IGNORE_TARGET_RESIST: return "SPELL_AURA_MOD_IGNORE_TARGET_RESIST";
case SPELL_AURA_MOD_IGNORE_TARGET_RESIST_MODIFIERS: return "SPELL_AURA_MOD_IGNORE_TARGET_RESIST_MODIFIERS";
case SPELL_AURA_MOD_ABILITY_IGNORE_TARGET_RESIST: return "SPELL_AURA_MOD_ABILITY_IGNORE_TARGET_RESIST";
case SPELL_AURA_MOD_DAMAGE_FROM_CASTER: return "SPELL_AURA_MOD_DAMAGE_FROM_CASTER";
case SPELL_AURA_IGNORE_MELEE_RESET: return "SPELL_AURA_IGNORE_MELEE_RESET";