From 297e28044eb986632fa29222fa87c6ce5e00d6e2 Mon Sep 17 00:00:00 2001 From: xfurry Date: Tue, 7 Jul 2015 22:11:57 +0100 Subject: [PATCH] [Core] Make use of attribute SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY. [cz2660] This will allow all spells that have this attribute to be casted on targets that are immune to certain types of damage or spells. This involves mostly spells that are part of a script or event. --- src/game/Object/Unit.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/Object/Unit.cpp b/src/game/Object/Unit.cpp index ce08e801..af01e84e 100644 --- a/src/game/Object/Unit.cpp +++ b/src/game/Object/Unit.cpp @@ -2644,7 +2644,7 @@ SpellMissInfo Unit::SpellHitResult(Unit* pVictim, SpellEntry const* spell, bool { return SPELL_MISS_EVADE; } // Check for immune - if (pVictim->IsImmuneToSpell(spell, this == pVictim)) + if (pVictim->IsImmuneToSpell(spell, this == pVictim) && !spell->HasAttribute(SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY)) { return SPELL_MISS_IMMUNE; } // All positive spells can`t miss @@ -2653,7 +2653,7 @@ SpellMissInfo Unit::SpellHitResult(Unit* pVictim, SpellEntry const* spell, bool { return SPELL_MISS_NONE; } // Check for immune (use charges) - if (pVictim->IsImmunedToDamage(GetSpellSchoolMask(spell))) + if (pVictim->IsImmunedToDamage(GetSpellSchoolMask(spell)) && !spell->HasAttribute(SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY)) { return SPELL_MISS_IMMUNE; } // Try victim reflect spell