[7883] Implemented new NPC extra flag CREATURE_FLAG_EXTRA_NOT_TAUNTABLE.

NPC with this flag is immune to apply aura SPELL_AURA_MOD_TAUNT and immune to SPELL_EFFECT_ATTACK_ME by default.

Signed-off-by: ApoC <apoc@nymfe.net>
This commit is contained in:
ApoC 2009-05-23 20:01:38 +02:00
parent 82c8428d78
commit 029b49dec8
3 changed files with 16 additions and 1 deletions

View file

@ -1577,6 +1577,20 @@ bool Creature::IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index)
if (GetCreatureInfo()->MechanicImmuneMask & (1 << (spellInfo->EffectMechanic[index] - 1)))
return true;
// Taunt immunity special flag check
if (GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NOT_TAUNTABLE)
{
// Taunt aura apply check
if (spellInfo->Effect[index] == SPELL_EFFECT_APPLY_AURA)
{
if (spellInfo->EffectApplyAuraName[index] == SPELL_AURA_MOD_TAUNT)
return true;
}
// Spell effect taunt check
else if (spellInfo->Effect[index] == SPELL_EFFECT_ATTACK_ME)
return true;
}
return Unit::IsImmunedToSpellEffect(spellInfo, index);
}