Core/Spells: Implemented CAST_FLAG_IMMUNITY

This commit is contained in:
Shauren committed 2015-06-30 11:44:11 +02:00
1 parent 879af88d21
commit efad3a3123
4 files changed
+34 -4

No files matched your search

+21 -1
View File
@@ -11136,6 +11136,26 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo) const
return false;
}
uint32 Unit::GetSchoolImmunityMask() const
{
uint32 mask = 0;
SpellImmuneList const& mechanicList = m_spellImmune[IMMUNITY_SCHOOL];
for (SpellImmuneList::const_iterator itr = mechanicList.begin(); itr != mechanicList.end(); ++itr)
mask |= itr->type;
return mask;
}
uint32 Unit::GetMechanicImmunityMask() const
{
uint32 mask = 0;
SpellImmuneList const& mechanicList = m_spellImmune[IMMUNITY_MECHANIC];
for (SpellImmuneList::const_iterator itr = mechanicList.begin(); itr != mechanicList.end(); ++itr)
mask |= (1 << itr->type);
return mask;
}
bool Unit::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) const
{
if (!spellInfo || !spellInfo->Effects[index].IsEffect())
@@ -16464,7 +16484,7 @@ void Unit::KnockbackFrom(float x, float y, float speedXY, float speedZ)
data << float(-speedZ); // Z Movement speed (vertical)
player->GetSession()->SendPacket(&data);
if (player->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) || player->HasAuraType(SPELL_AURA_FLY))
player->SetCanFly(true, true);
}