--HG--
branch : trunk
This commit is contained in:
Anubisss
2010-01-20 21:16:28 +01:00
6 changed files with 17 additions and 19 deletions
+2 -2
View File
@@ -1620,12 +1620,12 @@ bool Creature::IsImmunedToSpell(SpellEntry const* spellInfo)
return Unit::IsImmunedToSpell(spellInfo);
}
bool Creature::IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index, bool checkMechanic) const
bool Creature::IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index) const
{
if (GetCreatureInfo()->MechanicImmuneMask & (1 << (spellInfo->EffectMechanic[index] - 1)))
return true;
return Unit::IsImmunedToSpellEffect(spellInfo, index, checkMechanic);
return Unit::IsImmunedToSpellEffect(spellInfo, index);
}
SpellEntry const *Creature::reachWithSpellAttack(Unit *pVictim)
+1 -1
View File
@@ -448,7 +448,7 @@ class TRINITY_DLL_SPEC Creature : public Unit, public GridObject<Creature>
bool canCreatureAttack(Unit const *pVictim, bool force = true) const;
bool IsImmunedToSpell(SpellEntry const* spellInfo);
// redefine Unit::IsImmunedToSpell
bool IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index, bool checkMechanic) const;
bool IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index) const;
// redefine Unit::IsImmunedToSpellEffect
bool isElite() const
{
+2 -2
View File
@@ -145,7 +145,7 @@ void Totem::UnSummon()
AddObjectToRemoveList();
}
bool Totem::IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index, bool checkMechanic) const
bool Totem::IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index) const
{
// TODO: possibly all negative auras immune?
if(GetEntry() == 5925)
@@ -160,5 +160,5 @@ bool Totem::IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index, bo
default:
break;
}
return Creature::IsImmunedToSpellEffect(spellInfo, index, checkMechanic);
return Creature::IsImmunedToSpellEffect(spellInfo, index);
}
+1 -1
View File
@@ -54,7 +54,7 @@ class Totem : public Minion
void UpdateAttackPowerAndDamage(bool /*ranged*/ ) {}
void UpdateDamagePhysical(WeaponAttackType /*attType*/) {}
bool IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index, bool checkMechanic) const;
bool IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index) const;
protected:
TotemType m_type;
+4 -6
View File
@@ -10743,8 +10743,9 @@ bool Unit::IsImmunedToSpell(SpellEntry const* spellInfo)
for (int i=0;i<3;++i)
{
// State/effect immunities applied by aura expect full spell immunity
// However function also check for mechanic, so ignore that for now
if (IsImmunedToSpellEffect(spellInfo, i, false))
// Ignore effects with mechanic, they are supposed to be checked separately
if (!spellInfo->EffectMechanic[i])
if (IsImmunedToSpellEffect(spellInfo, i))
return true;
}
@@ -10761,7 +10762,7 @@ bool Unit::IsImmunedToSpell(SpellEntry const* spellInfo)
return false;
}
bool Unit::IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index, bool checkMechanic) const
bool Unit::IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index) const
{
if (!spellInfo)
return false;
@@ -10772,8 +10773,6 @@ bool Unit::IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index, boo
if (itr->type == effect)
return true;
if (checkMechanic)
{
if (uint32 mechanic = spellInfo->EffectMechanic[index])
{
SpellImmuneList const& mechanicList = m_spellImmune[IMMUNITY_MECHANIC];
@@ -10781,7 +10780,6 @@ bool Unit::IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index, boo
if (itr->type == spellInfo->EffectMechanic[index])
return true;
}
}
if (uint32 aura = spellInfo->EffectApplyAuraName[index])
{
+1 -1
View File
@@ -1824,7 +1824,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
// redefined in Creature
bool IsImmunedToDamage(SpellSchoolMask meleeSchoolMask);
bool IsImmunedToDamage(SpellEntry const* spellInfo);
virtual bool IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index, bool checkMechanic=true) const;
virtual bool IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index) const;
// redefined in Creature
uint32 CalcNotIgnoreDamageRedunction( uint32 damage, SpellSchoolMask damageSchoolMask);
uint32 CalcArmorReducedDamage(Unit* pVictim, const uint32 damage, SpellEntry const *spellInfo, WeaponAttackType attackType=MAX_ATTACK);