void UpdateAI(const uint32 diff) { if(!pInstance) return; if(!JiustYell && pInstance->GetData(DATA_DRAKOS_EVENT) == DONE) { DoScriptText(SAY_SPAWN, me); JiustYell = true; } if(!started && pInstance->GetData(DATA_CENTRIFUGE_CONSTRUCT_EVENT) == 10) { me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->RemoveAllAuras(); me->SetReactState(REACT_AGGRESSIVE); started=true; } //Return since we have no target if (!started || !UpdateVictim()) return; if(uiEnergizeCore_Timer <= diff) { DoCast(me->getVictim(),SPELL_ENERGIZE_CORES); uiEnergizeCore_Timer = 10000; } else uiEnergizeCore_Timer -= diff; DoMeleeAttackIfReady(); std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList(); std::list<HostileReference*>::const_iterator i = m_threatlist.begin(); for (i = m_threatlist.begin(); i!= m_threatlist.end(); ++i) { Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid()); if (pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER) ) { Vehicle* v = pUnit->GetVehicle(); if(v) { pUnit->ExitVehicle(); v->Dismiss(); DoCast(pUnit,SPELL_PARACHUTE); } } } }
void DismountPlayers() { std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList(); std::list<HostileReference*>::const_iterator i = m_threatlist.begin(); for (i = m_threatlist.begin(); i!= m_threatlist.end(); ++i) { Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid()); if (pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER) ) { Vehicle* v = pUnit->GetVehicle(); if(v) { pUnit->ExitVehicle(); v->Dismiss(); DoCast(pUnit,SPELL_PARACHUTE); } } } }