aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2025-12-25 16:16:16 +0100
committerShauren <shauren.trinity@gmail.com>2025-12-25 16:16:16 +0100
commit42ebe3b0dc71c915539e458e82e6eed226d79c39 (patch)
treeea4a3349fbcbcc3f7e28fa88b7215a90736a7836 /src/server/game/Spells
parentac266c45b1b24514cbc8a8d1d23119b0820582ae (diff)
Core/Spells: Use spell positivity to determine immunities instead of caster-target faction reaction
Diffstat (limited to 'src/server/game/Spells')
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp10
-rw-r--r--src/server/game/Spells/SpellInfo.cpp10
2 files changed, 8 insertions, 12 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 49aa00c14e0..25397d69d62 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -5856,7 +5856,7 @@ void AuraEffect::HandlePeriodicHealthFunnelAuraTick(Unit* target, Unit* caster)
if (!caster || !caster->IsAlive() || !target->IsAlive())
return;
- if (target->IsImmunedToAuraPeriodicTick(caster, GetSpellInfo(), &GetSpellEffectInfo()))
+ if (target->IsImmunedToAuraPeriodicTick(caster, this))
{
SendTickImmune(target, caster);
return;
@@ -5886,7 +5886,7 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const
if (!target->IsAlive())
return;
- if (target->IsImmunedToAuraPeriodicTick(caster, GetSpellInfo(), &GetSpellEffectInfo()))
+ if (target->IsImmunedToAuraPeriodicTick(caster, this))
{
SendTickImmune(target, caster);
return;
@@ -5946,7 +5946,7 @@ void AuraEffect::HandlePeriodicManaLeechAuraTick(Unit* target, Unit* caster) con
if (!caster || !caster->IsAlive() || !target->IsAlive() || target->GetPowerType() != powerType)
return;
- if (target->IsImmunedToAuraPeriodicTick(caster, GetSpellInfo(), &GetSpellEffectInfo()))
+ if (target->IsImmunedToAuraPeriodicTick(caster, this))
{
SendTickImmune(target, caster);
return;
@@ -6009,7 +6009,7 @@ void AuraEffect::HandleObsModPowerAuraTick(Unit* target, Unit* caster) const
if (!target->IsAlive() || !target->GetMaxPower(powerType))
return;
- if (target->IsImmunedToAuraPeriodicTick(caster, GetSpellInfo(), &GetSpellEffectInfo()))
+ if (target->IsImmunedToAuraPeriodicTick(caster, this))
{
SendTickImmune(target, caster);
return;
@@ -6047,7 +6047,7 @@ void AuraEffect::HandlePeriodicEnergizeAuraTick(Unit* target, Unit* caster) cons
if (!target->IsAlive() || !target->GetMaxPower(powerType))
return;
- if (target->IsImmunedToAuraPeriodicTick(caster, GetSpellInfo(), &GetSpellEffectInfo()))
+ if (target->IsImmunedToAuraPeriodicTick(caster, this))
{
SendTickImmune(target, caster);
return;
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp
index 700af4e4b90..185826c720b 100644
--- a/src/server/game/Spells/SpellInfo.cpp
+++ b/src/server/game/Spells/SpellInfo.cpp
@@ -3649,7 +3649,7 @@ void SpellInfo::ApplyAllSpellImmunitiesTo(Unit* target, SpellEffectInfo const& s
if (apply && HasAttribute(SPELL_ATTR1_IMMUNITY_PURGES_EFFECT))
{
- target->RemoveAppliedAuras([this, target, schoolImmunity](AuraApplication const* aurApp) -> bool
+ target->RemoveAppliedAuras([this, schoolImmunity](AuraApplication const* aurApp) -> bool
{
SpellInfo const* auraSpellInfo = aurApp->GetBase()->GetSpellInfo();
if (auraSpellInfo->Id == Id) // Don't remove self
@@ -3660,12 +3660,8 @@ void SpellInfo::ApplyAllSpellImmunitiesTo(Unit* target, SpellEffectInfo const& s
return false;
if (!CanDispelAura(auraSpellInfo))
return false;
- if (!HasAttribute(SPELL_ATTR1_IMMUNITY_TO_HOSTILE_AND_FRIENDLY_EFFECTS))
- {
- WorldObject const* existingAuraCaster = aurApp->GetBase()->GetWorldObjectCaster();
- if (existingAuraCaster && existingAuraCaster->IsFriendlyTo(target)) // Check spell vs aura possitivity
- return false;
- }
+ if (aurApp->IsPositive() && !HasAttribute(SPELL_ATTR1_IMMUNITY_TO_HOSTILE_AND_FRIENDLY_EFFECTS)) // Check spell vs aura possitivity
+ return false;
return true;
});
}