mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[7111] Fixes in Spell Effect immunes
Correct totem immunes for dot/leech/Fear/Transform auras (immune only to effect) Correct log if all effects immuned by Effect Immune Move check for IMMUNITY_STATE to Unit::IsImmunedToSpellEffect Signed-off-by: DiSlord <dislord@nomail.com>
This commit is contained in:
parent
c9ae3b8b5c
commit
17004d59d4
11 changed files with 61 additions and 53 deletions
|
|
@ -8157,19 +8157,32 @@ bool Unit::IsImmunedToSpell(SpellEntry const* spellInfo)
|
|||
return false;
|
||||
}
|
||||
|
||||
bool Unit::IsImmunedToSpellEffect(uint32 effect, uint32 mechanic) const
|
||||
bool Unit::IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index) const
|
||||
{
|
||||
//If m_immuneToEffect type contain this effect type, IMMUNE effect.
|
||||
uint32 effect = spellInfo->Effect[index];
|
||||
SpellImmuneList const& effectList = m_spellImmune[IMMUNITY_EFFECT];
|
||||
for (SpellImmuneList::const_iterator itr = effectList.begin(); itr != effectList.end(); ++itr)
|
||||
if(itr->type == effect)
|
||||
return true;
|
||||
|
||||
SpellImmuneList const& mechanicList = m_spellImmune[IMMUNITY_MECHANIC];
|
||||
for (SpellImmuneList::const_iterator itr = mechanicList.begin(); itr != mechanicList.end(); ++itr)
|
||||
if(itr->type == mechanic)
|
||||
return true;
|
||||
uint32 mechanic = spellInfo->EffectMechanic[index];
|
||||
if (mechanic)
|
||||
{
|
||||
SpellImmuneList const& mechanicList = m_spellImmune[IMMUNITY_MECHANIC];
|
||||
for (SpellImmuneList::const_iterator itr = mechanicList.begin(); itr != mechanicList.end(); ++itr)
|
||||
if(itr->type == mechanic)
|
||||
return true;
|
||||
}
|
||||
|
||||
uint32 aura = spellInfo->EffectApplyAuraName[index];
|
||||
if (aura)
|
||||
{
|
||||
SpellImmuneList const& list = m_spellImmune[IMMUNITY_STATE];
|
||||
for(SpellImmuneList::const_iterator itr = list.begin(); itr != list.end(); ++itr)
|
||||
if(itr->type == aura)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue