// players can't cast "fly" spells unless in map 530. Has to be done a while after they get knocked into the air... void CastGravityLapseFly() { GUIDVector vGuids; m_creature->FillGuidsListFromThreatList(vGuids.getSource()); for (GUIDVector::const_iterator i = vGuids.begin();i != vGuids.end(); ++i) { Unit* pUnit = m_creature->GetMap()->GetUnit(*i); // Also needs an exception in spell system. if (pUnit && pUnit->GetTypeId() == TYPEID_PLAYER) pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE_FLY, true, 0, 0, m_creature->GetObjectGuid()); } }
void TeleportPlayersToSelf() { DoCastSpellIfCan(m_creature, SPELL_TELEPORT_CENTER, CAST_TRIGGERED); GUIDVector vGuids; m_creature->FillGuidsListFromThreatList(vGuids.getSource()); for (GUIDVector::const_iterator i = vGuids.begin();i != vGuids.end(); ++i) { Unit* pUnit = m_creature->GetMap()->GetUnit(*i); if (pUnit && pUnit->GetTypeId() == TYPEID_PLAYER) pUnit->CastSpell(pUnit, SPELL_TELEPORT_CENTER, true); } }
void RemoveGravityLapse() { GUIDVector vGuids; m_creature->FillGuidsListFromThreatList(vGuids.getSource()); for (GUIDVector::const_iterator i = vGuids.begin();i != vGuids.end(); ++i) { Unit* pUnit = m_creature->GetMap()->GetUnit(*i); if (pUnit && pUnit->GetTypeId() == TYPEID_PLAYER) { pUnit->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_FLY); pUnit->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_DOT); } } }