Skip to content

Instantly share code, notes, and snippets.

@tobmaps
Created July 21, 2011 10:12
Show Gist options
  • Save tobmaps/1096911 to your computer and use it in GitHub Desktop.
Save tobmaps/1096911 to your computer and use it in GitHub Desktop.
Anti-Magic Shield
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 17200e6..887fdb7 100755
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -11764,9 +11764,8 @@ bool Unit::IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index) con
// Check for immune to application of harmful magical effects
AuraEffectList const& immuneAuraApply = GetAuraEffectsByType(SPELL_AURA_MOD_IMMUNE_AURA_APPLY_SCHOOL);
for (AuraEffectList::const_iterator iter = immuneAuraApply.begin(); iter != immuneAuraApply.end(); ++iter)
- if (spellInfo->Dispel == DISPEL_MAGIC && // Magic debuff
- ((*iter)->GetMiscValue() & GetSpellSchoolMask(spellInfo)) && // Check school
- !IsPositiveEffect(spellInfo->Id, index)) // Harmful
+ if (!(GetAllSpellMechanicMask(spellInfo) & IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK) && // Only spells with these mechanics
+ (*iter)->GetMiscValue() & GetSpellSchoolMask(spellInfo)) // Check school
return true;
}
@TGM
Copy link

TGM commented Sep 23, 2011

Shouldn't this make you immune to stun and fear?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment