fix(Core/Spell): spell immunity system and new separate immunities table (#24956)

Co-authored-by: ariel- <ariel-@users.noreply.github.com>
Co-authored-by: Keader <keader.android@gmail.com>
Co-authored-by: Shauren <shauren.trinity@gmail.com>
This commit is contained in:
sogladev
2026-03-22 23:36:35 +01:00
committed by GitHub
parent 0e0ff86e3e
commit a90570a2de
26 changed files with 1655 additions and 914 deletions

View File

@@ -856,7 +856,7 @@ void Spell::EffectTriggerSpell(SpellEffIndex effIndex)
SpellInfo const* spell = iter->second->GetBase()->GetSpellInfo();
// Pounce Bleed shouldn't be removed by Cloak of Shadows.
if (spell->GetAllEffectsMechanicMask() & 1 << MECHANIC_BLEED)
if (spell->GetAllEffectsMechanicMask() & (UI64LIT(1) << MECHANIC_BLEED))
return;
bool dmgClassNone = false;
@@ -1889,7 +1889,7 @@ void Spell::EffectEnergize(SpellEffIndex effIndex)
if (!unitTarget->IsAlive())
return;
if (unitTarget->HasUnitState(UNIT_STATE_ISOLATED))
if (unitTarget->IsImmunedToAuraPeriodicTick(m_caster, m_spellInfo))
{
m_caster->SendSpellDamageImmune(unitTarget, GetSpellInfo()->Id);
return;
@@ -3681,7 +3681,7 @@ void Spell::EffectHealMaxHealth(SpellEffIndex /*effIndex*/)
if (!unitTarget || !unitTarget->IsAlive())
return;
if (unitTarget->HasUnitState(UNIT_STATE_ISOLATED))
if (unitTarget->IsImmunedToAuraPeriodicTick(m_caster, m_spellInfo))
{
m_caster->SendSpellDamageImmune(unitTarget, GetSpellInfo()->Id);
return;
@@ -5152,7 +5152,7 @@ void Spell::EffectDispelMechanic(SpellEffIndex effIndex)
continue;
if (roll_chance_i(aura->CalcDispelChance(unitTarget, !unitTarget->IsFriendlyTo(m_caster))))
{
if ((aura->GetSpellInfo()->GetAllEffectsMechanicMask() & (1 << mechanic)))
if ((aura->GetSpellInfo()->GetAllEffectsMechanicMask() & (UI64LIT(1) << mechanic)))
{
dispel_list.push(std::make_pair(aura->GetId(), aura->GetCasterGUID()));