コード例 #1
0
 void EnterCombat(Unit *who)
 {
     _EnterCombat();
     DoScriptText(SAY_AGGRO, me);
     balconyCount = 0;
     EnterPhaseGround();
 }
コード例 #2
0
ファイル: boss_noth.cpp プロジェクト: Aravu/Talador-Project
 void EnterCombat(Unit* /*who*/) override
 {
     _EnterCombat();
     Talk(SAY_AGGRO);
     balconyCount = 0;
     EnterPhaseGround();
 }
コード例 #3
0
 void DamageTaken(Unit* pKiller, uint32 &damage)
 {
     if (((me->GetHealth()*100)/me->GetMaxHealth()) < 50 && WasUnder == false)
     {
         WasUnder = true;
         EnterPhaseGround();
     }
 }
コード例 #4
0
 void EnterCombat(Unit* /*who*/)
 {
     _EnterCombat();
     DoScriptText(SAY_AGGRO, me);
     balconyCount = 0;
     events.ScheduleEvent(EVENT_BALCONY, 90000);
     EnterPhaseGround();
 }
コード例 #5
0
        void EnterToBattle(Unit* /*who*/)
        {
            _EnterToBattle();

            DoSendQuantumText(RAND(SAY_AGGRO_1, SAY_AGGRO_2, SAY_AGGRO_3), me);
            balconyCount = 0;
            EnterPhaseGround();
        }
コード例 #6
0
ファイル: boss_sapphiron.cpp プロジェクト: dsstest/ArkCORE
		void EnterCombat(Unit * /*who*/) {
			_EnterCombat();

			me->CastSpell(me, SPELL_FROST_AURA, true);

			events.ScheduleEvent(EVENT_BERSERK, 15 * 60000);
			EnterPhaseGround();

			CheckPlayersFrostResist();
		}
コード例 #7
0
            void EnterCombat(Unit* /*who*/) override
            {
                _EnterCombat();

                me->CastSpell(me, SPELL_FROST_AURA, true);

                events.ScheduleEvent(EVENT_BERSERK, 15 * MINUTE * IN_MILLISECONDS);
                EnterPhaseGround();

                CheckPlayersFrostResist();
            }
コード例 #8
0
ファイル: boss_sapphiron.cpp プロジェクト: FixCore/335source
		void EnterCombat(Unit* /*who*/) override
		{
			_EnterCombat();

			me->CastSpell(me, SPELL_FROST_AURA, true);

			DoCast(me, SPELL_CHECK_RESISTS);
			events.ScheduleEvent(EVENT_CHECK_RESISTS, 30 * IN_MILLISECONDS);
			events.ScheduleEvent(EVENT_BERSERK, 15 * MINUTE * IN_MILLISECONDS);
			EnterPhaseGround();
		}
コード例 #9
0
            void EnterCombat(Unit* /*who*/) override
            {
                _EnterCombat();

                me->CastSpell(me, SPELL_FROST_AURA, true);

                events.SetPhase(PHASE_GROUND);
                events.ScheduleEvent(EVENT_CHECK_RESISTS, Seconds(0));
                events.ScheduleEvent(EVENT_BERSERK, Minutes(15));
                EnterPhaseGround(true);
            }
コード例 #10
0
        void EnterCombat(Unit* /*who*/)
        {
            EnterPhaseGround();
            applySound();
            Talk(SAY_AGGRO);
            m_uiPowerTimer = 1000;

            if(me->GetMap()->IsHeroic())
            {
                me->SummonCreature(NPC_NEFARIAN_HELPER_HEROIC, 154.228f, -250.653f, 74.944f, 1.377f, TEMPSUMMON_MANUAL_DESPAWN);
                events.ScheduleEvent(EVENT_AGGRO_NEF, 8000, PHASE_GROUND);
            }

            if (instance)
            {
                instance->SetBossState(DATA_ATRAMEDES, IN_PROGRESS);
                instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me); // Add
            }

            _EnterCombat();
        }
コード例 #11
0
ファイル: boss_sapphiron.cpp プロジェクト: FixCore/335source
		void UpdateAI(uint32 diff) override
		{
			if (!_phase)
				return;

			events.Update(diff);

			if ((_phase != PHASE_BIRTH && !UpdateVictim()) || !CheckInRoom())
				return;

			if (_phase == PHASE_GROUND)
			{
				while (uint32 eventId = events.ExecuteEvent())
				{
					switch (eventId)
					{
					case EVENT_CHECK_RESISTS:
						DoCast(me, SPELL_CHECK_RESISTS);
						events.ScheduleEvent(EVENT_CHECK_RESISTS, 30 * IN_MILLISECONDS);
						return;
					case EVENT_BERSERK:
						Talk(EMOTE_ENRAGE);
						DoCast(me, SPELL_BERSERK);
						return;
					case EVENT_CLEAVE:
						DoCastVictim(SPELL_CLEAVE);
						events.ScheduleEvent(EVENT_CLEAVE, urand(5, 15) * IN_MILLISECONDS, 0, PHASE_GROUND);
						return;
					case EVENT_TAIL:
						DoCastAOE(SPELL_TAIL_SWEEP);
						events.ScheduleEvent(EVENT_TAIL, urand(5, 15) * IN_MILLISECONDS, 0, PHASE_GROUND);
						return;
					case EVENT_DRAIN:
						DoCastAOE(SPELL_LIFE_DRAIN);
						events.ScheduleEvent(EVENT_DRAIN, 24 * IN_MILLISECONDS, 0, PHASE_GROUND);
						return;
					case EVENT_BLIZZARD:
					{
						if (Creature* summon = DoSummon(NPC_BLIZZARD, me, 0.0f, urand(25, 30) * IN_MILLISECONDS, TEMPSUMMON_TIMED_DESPAWN))
							summon->GetMotionMaster()->MoveRandom(40);
						events.ScheduleEvent(EVENT_BLIZZARD, RAID_MODE(20, 7) * IN_MILLISECONDS, 0, PHASE_GROUND);
						break;
					}
					case EVENT_FLIGHT:
						if (HealthAbovePct(10))
						{
							_phase = PHASE_FLIGHT;
							events.SetPhase(PHASE_FLIGHT);
							me->SetReactState(REACT_PASSIVE);
							me->AttackStop();
							float x, y, z, o;
							me->GetHomePosition(x, y, z, o);
							me->GetMotionMaster()->MovePoint(1, x, y, z);
							return;
						}
						break;
					}
				}

				DoMeleeAttackIfReady();
			}
			else
			{
				if (uint32 eventId = events.ExecuteEvent())
				{
					switch (eventId)
					{
					case EVENT_CHECK_RESISTS:
						DoCast(me, SPELL_CHECK_RESISTS);
						events.ScheduleEvent(EVENT_CHECK_RESISTS, 30 * IN_MILLISECONDS);
						return;
					case EVENT_LIFTOFF:
						Talk(EMOTE_AIR_PHASE);
						me->SetDisableGravity(true);
						me->SetHover(true);
						events.ScheduleEvent(EVENT_ICEBOLT, 1500);
						_iceboltCount = RAID_MODE(2, 3);
						return;
					case EVENT_ICEBOLT:
					{
						std::vector<Unit*> targets;
						std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin();
						for (; i != me->getThreatManager().getThreatList().end(); ++i)
							if ((*i)->getTarget()->GetTypeId() == TYPEID_PLAYER && !(*i)->getTarget()->HasAura(SPELL_ICEBOLT))
								targets.push_back((*i)->getTarget());

						if (targets.empty())
							_iceboltCount = 0;
						else
						{
							std::vector<Unit*>::const_iterator itr = targets.begin();
							advance(itr, rand32() % targets.size());
							_iceblocks.insert(std::make_pair((*itr)->GetGUID(), ObjectGuid::Empty));
							DoCast(*itr, SPELL_ICEBOLT);
							--_iceboltCount;
						}

						if (_iceboltCount)
							events.ScheduleEvent(EVENT_ICEBOLT, 1 * IN_MILLISECONDS);
						else
							events.ScheduleEvent(EVENT_BREATH, 1 * IN_MILLISECONDS);
						return;
					}
					case EVENT_BREATH:
					{
						Talk(EMOTE_BREATH);
						DoCastAOE(SPELL_FROST_MISSILE);
						events.ScheduleEvent(EVENT_EXPLOSION, 8 * IN_MILLISECONDS);
						return;
					}
					case EVENT_EXPLOSION:
						CastExplosion();
						ClearIceBlock();
						events.ScheduleEvent(EVENT_LAND, 3 * IN_MILLISECONDS);
						return;
					case EVENT_LAND:
						me->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
						Talk(EMOTE_GROUND_PHASE);
						me->SetHover(false);
						me->SetDisableGravity(false);
						events.ScheduleEvent(EVENT_GROUND, 1500);
						return;
					case EVENT_GROUND:
						EnterPhaseGround();
						return;
					case EVENT_BIRTH:
						me->SetVisible(true);
						me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
						me->SetReactState(REACT_AGGRESSIVE);
						return;
					}
				}
			}
		}
コード例 #12
0
        void UpdateAI(const uint32 diff)
        {
            if (!phase)
                return;

            events.Update(diff);

            if ((phase != PHASE_BIRTH && !UpdateVictim()) || !CheckInRoom())
                return;

            if (CanTheHundredClub)
            {
                if (CheckFrostResistTimer <= diff)
                {
                    CheckPlayersFrostResist();
                    CheckFrostResistTimer = (rand() % 5 + 5) * 1000;
                } else CheckFrostResistTimer -= diff;
            }

            if (phase == PHASE_GROUND)
            {
                while (uint32 eventId = events.ExecuteEvent())
                {
                    switch (eventId)
                    {
                        case EVENT_BERSERK:
                            DoScriptText(EMOTE_ENRAGE, me);
                            DoCast(me, SPELL_BERSERK);
                            return;
                        case EVENT_CLEAVE:
                            DoCast(me->getVictim(), SPELL_CLEAVE);
                            events.ScheduleEvent(EVENT_CLEAVE, 5000+rand()%10000, 0, PHASE_GROUND);
                            return;
                        case EVENT_TAIL:
                            DoCastAOE(SPELL_TAIL_SWEEP);
                            events.ScheduleEvent(EVENT_TAIL, 5000+rand()%10000, 0, PHASE_GROUND);
                            return;
                        case EVENT_DRAIN:
                            DoCastAOE(SPELL_LIFE_DRAIN);
                            events.ScheduleEvent(EVENT_DRAIN, 24000, 0, PHASE_GROUND);
                            return;
                        case EVENT_BLIZZARD:
                        {
                            //DoCastAOE(SPELL_SUMMON_BLIZZARD);
                            if (Creature* summon = DoSummon(MOB_BLIZZARD, me, 0.0f, urand(25000, 30000), TEMPSUMMON_TIMED_DESPAWN))
                                summon->GetMotionMaster()->MoveRandom(40);
                            events.ScheduleEvent(EVENT_BLIZZARD, RAID_MODE(20000, 7000), 0, PHASE_GROUND);
                            break;
                        }
                        case EVENT_FLIGHT:
                            if (HealthAbovePct(10))
                            {
                                phase = PHASE_FLIGHT;
                                events.SetPhase(PHASE_FLIGHT);
                                me->SetReactState(REACT_PASSIVE);
                                me->AttackStop();
                                float x, y, z, o;
                                me->GetHomePosition(x, y, z, o);
                                me->GetMotionMaster()->MovePoint(1, x, y, z);
                                return;
                            }
                            break;
                    }
                }

                DoMeleeAttackIfReady();
            }
            else
            {
                if (uint32 eventId = events.ExecuteEvent())
                {
                    switch (eventId)
                    {
                        case EVENT_LIFTOFF:
                            me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
                            me->SetLevitate(true);
                            me->SendMovementFlagUpdate();
                            events.ScheduleEvent(EVENT_ICEBOLT, 1500);
                            iceboltCount = RAID_MODE(2, 3);
                            return;
                        case EVENT_ICEBOLT:
                        {
                            std::vector<Unit*> targets;
                            std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin();
                            for (; i != me->getThreatManager().getThreatList().end(); ++i)
                                if ((*i)->getTarget()->GetTypeId() == TYPEID_PLAYER && !(*i)->getTarget()->HasAura(SPELL_ICEBOLT))
                                    targets.push_back((*i)->getTarget());

                            if (targets.empty())
                                iceboltCount = 0;
                            else
                            {
                                std::vector<Unit*>::const_iterator itr = targets.begin();
                                advance(itr, rand()%targets.size());
                                iceblocks.insert(std::make_pair((*itr)->GetGUID(), 0));
                                DoCast(*itr, SPELL_ICEBOLT);
                                --iceboltCount;
                            }

                            if (iceboltCount)
                                events.ScheduleEvent(EVENT_ICEBOLT, 1000);
                            else
                                events.ScheduleEvent(EVENT_BREATH, 1000);
                            return;
                        }
                        case EVENT_BREATH:
                        {
                            DoScriptText(EMOTE_BREATH, me);
                            DoCastAOE(SPELL_FROST_MISSILE);
                            events.ScheduleEvent(EVENT_EXPLOSION, 8000);
                            return;
                        }
                        case EVENT_EXPLOSION:
                            CastExplosion();
                            ClearIceBlock();
                            events.ScheduleEvent(EVENT_LAND, 3000);
                            return;
                        case EVENT_LAND:
                            me->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
                            me->SetLevitate(false);
                            me->SendMovementFlagUpdate();
                            events.ScheduleEvent(EVENT_GROUND, 1500);
                            return;
                        case EVENT_GROUND:
                            EnterPhaseGround();
                            return;
                        case EVENT_BIRTH:
                            me->SetVisible(true);
                            me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
                            me->SetReactState(REACT_AGGRESSIVE);
                            return;
                    }
                }//if (uint32 eventId = events.ExecuteEvent())
            }//if (phase == PHASE_GROUND)
        }
コード例 #13
0
    void UpdateAI(const uint32 diff)
    {
        if (!UpdateCombatState() || !CheckInRoom())
            return;

        events.Update(diff);

        while(uint32 eventId = events.ExecuteEvent())
        {
            switch(eventId)
            {
                case EVENT_CURSE:
                    DoCastAOE(SPELL_CURSE_PLAGUEBRINGER);
                    events.ScheduleEvent(EVENT_CURSE, 20000+rand()%10000);
                    return;
                case EVENT_WARRIOR:
                    DoScriptText(SAY_SUMMON, me);
                    SummonUndead(MOB_WARRIOR, HEROIC(2,3));
                    events.ScheduleEvent(EVENT_WARRIOR, 30000);
                    return;
                case EVENT_BLINK:
                    DoCastAOE(SPELL_CRIPPLE, true);
                    DoCastAOE(SPELL_BLINK);
                    DoResetThreat();
                    events.ScheduleEvent(EVENT_BLINK, 20000+rand()%10000);
                    return;
                case EVENT_BALCONY:
                    me->SetReactState(REACT_PASSIVE);
                    me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
                    me->AttackStop();
                    me->RemoveAllAuras();
                    me->NearTeleportTo(TELE_X, TELE_Y, TELE_Z, TELE_O);
                    events.Reset();
                    events.ScheduleEvent(EVENT_WAVE, 2000);
                    waveCount = 0;
                    return;
                case EVENT_WAVE:
                    DoScriptText(SAY_SUMMON, me);
                    switch(balconyCount)
                    {
                        case 0: SummonUndead(MOB_CHAMPION, HEROIC(2,4)); break;
                        case 1: SummonUndead(MOB_CHAMPION, HEROIC(1,2));
                                SummonUndead(MOB_GUARDIAN, HEROIC(1,2)); break;
                        case 2: SummonUndead(MOB_GUARDIAN, HEROIC(2,4)); break;
                        default:SummonUndead(MOB_CHAMPION, HEROIC(5,10));
                                SummonUndead(MOB_GUARDIAN, HEROIC(5,10));break;
                    }
                    ++waveCount;
                    events.ScheduleEvent(waveCount < 2 ? EVENT_WAVE : EVENT_GROUND, 34000);
                    return;
                case EVENT_GROUND:
                {
                    ++balconyCount;
                    float x, y, z, o;
                    me->GetHomePosition(x, y, z, o);
                    me->NearTeleportTo(x, y, z, o);
                    EnterPhaseGround();
                    return;
                }
            }
        }

        if (me->HasReactState(REACT_AGGRESSIVE))
            DoMeleeAttackIfReady();
    }
コード例 #14
0
        void UpdateAI(const uint32 diff)
        {
            if (!UpdateVictim() || me->HasUnitState(UNIT_STATE_CASTING))
                return;

            if (Creature* Onyxia = me->FindNearestCreature(NPC_ONYXIA, 150.0f, true))
                if (Onyxia && !Onyxia->isInCombat() && said == false)
                {
                    Talk(SAY_AVOID_WIPE);
                    said = true;
                }

            if (phase == PHASE_GROUND && m_uiDistanceCheckTimer <= diff)
            {
                if (me->FindNearestCreature(NPC_ONYXIA, 50.0f, true) && onyxiaAlive && !me->HasAura(SPELL_CHILDREN_OF_DEATHWING_ONY))
                    me->AddAura(SPELL_CHILDREN_OF_DEATHWING_ONY, me);
                else if (!me->FindNearestCreature(NPC_ONYXIA, 50.0f, true) && onyxiaAlive)
                    if(me->HasAura(SPELL_CHILDREN_OF_DEATHWING_ONY))
                       me->RemoveAura(SPELL_CHILDREN_OF_DEATHWING_ONY);

                m_uiDistanceCheckTimer = 5000;
            }
            else m_uiDistanceCheckTimer -= diff;

            if (phase == PHASE_GROUND && m_uiOnyxiaCheckTimer <= diff && !secondPhase)
            {
                if (me->FindNearestCreature(NPC_ONYXIA, 150.0f, true))
                    onyxiaAlive = true;
                else
                {
                    onyxiaAlive = false;
                    Talk(SAY_AIR_PHASE);
                    if(me->HasAura(SPELL_CHILDREN_OF_DEATHWING_ONY))
                       me->RemoveAura(SPELL_CHILDREN_OF_DEATHWING_ONY);
                    events.ScheduleEvent(EVENT_LIFTOFF, 5000, PHASE_GROUND);
                    secondPhase = true;
                }

                m_uiOnyxiaCheckTimer = 5000;
            }
            else m_uiOnyxiaCheckTimer -= diff;

            if (phase == PHASE_FLIGHT && m_uiChromaticCheckTimer <= diff && !finalPhase)
            {
                if (!me->FindNearestCreature(NPC_CHROMATIC_PROTO, 150.0f, true))
                    events.ScheduleEvent(EVENT_LAND, 2000, PHASE_FLIGHT);
                finalPhase = true;

                m_uiChromaticCheckTimer = 5000;
            }
            else m_uiChromaticCheckTimer -= diff;

            events.Update(diff);

            while (uint32 eventId = events.ExecuteEvent())
            {
                switch (eventId)
                {
                    case EVENT_ELECTROCUTE:
                        if(electrocute == true)
                        {
                            DoCast(me, SPELL_ELECTROCUTE);
                            electrocute = false;
                        }
                        break;

                    case EVENT_INTRO:
                        me->HandleEmote(EMOTE_ONESHOT_LIFTOFF);
                        me->SetDisableGravity(true);
                        me->SendMovementFlagUpdate();
                        me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0x02);
                        me->GetMotionMaster()->MovePoint(1, -126.518f, -233.342f, 36.358f); // Position on top of raid.
                        break;

                    case EVENT_INTRO2:
                        Talk(SAY_AGGRO);
                        events.ScheduleEvent(EVENT_HAIL_OF_BONES, 100);
                        break;

                    case EVENT_HAIL_OF_BONES:
                        DoCast(me, SPELL_HAIL_OF_BONES);
                        break;

                    case EVENT_MOVE:
                        me->GetMotionMaster()->MovePoint(1, -100.123f, -221.522f, 7.156f); // Move down.
                        events.ScheduleEvent(EVENT_LANDING, 8000);                        
                        break;
            
                    case EVENT_LANDING:
                        me->HandleEmote(EMOTE_ONESHOT_LAND);
                        me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, 0x02);
                        me->SetDisableGravity(false);
                        me->SendMovementFlagUpdate();
                        EnterPhaseGround();
                        me->GetMotionMaster()->MoveChase(me->GetVictim());
                        me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
                        break;

                    case EVENT_SHADOWFLAME_BREATH:
                        Talk(SAY_SHADOWFLAME);
                        DoCastVictim(SPELL_SHADOWFLAME_BREATH);   
                        events.ScheduleEvent(EVENT_SHADOWFLAME_BREATH, urand(10000, 12000));
                        break;
                         
                    case EVENT_SHADOW_COWARDICE:
                        if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true))
                            DoCast(target, SPELL_SHADOW_COWARDICE);                 
                        events.ScheduleEvent(EVENT_SHADOW_COWARDICE, urand(9000, 10000));
                        break;

                    case EVENT_LIFTOFF:
                        Talk(SAY_AIR_PHASE_2);
                        if(GameObject* elevator = me->FindNearestGameObject(207834, 200.0f))
                            elevator->SetGoState(GO_STATE_READY);

                        me->HandleEmote(EMOTE_ONESHOT_LIFTOFF);
                        me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0x02);
                        me->SetDisableGravity(true);
                        me->SendMovementFlagUpdate();
                        events.ScheduleEvent(EVENT_FLIGHT, 1500);
                        events.ScheduleEvent(EVENT_AIR, 2000);
                        break;

                    case EVENT_FLIGHT:
                        me->SetReactState(REACT_PASSIVE);
                        me->AttackStop();
                        me->GetMotionMaster()->MovePoint(1, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + 30.0f);
                        break;

                    case EVENT_AIR:
                        EnterPhaseAir();
                        break;

                    case EVENT_SUMMON_CHROMATIC:
                        me->SummonCreature(NPC_CHROMATIC_PROTO, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation(), TEMPSUMMON_MANUAL_DESPAWN);
                        break;

                    case EVENT_SHADOWFLAME_BARRAGE:
                        if(Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 200.0f, true))
                            DoCast(target, SPELL_SHADOWFLAME_BARRAGE);
                        events.ScheduleEvent(EVENT_SHADOWFLAME_BARRAGE, urand(8000, 11000));
                        break;

                    case EVENT_LAND:
                        me->HandleEmote(EMOTE_ONESHOT_LAND);
                        me->SetDisableGravity(false);
                        me->SendMovementFlagUpdate();
                        me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, 0x02);
                        events.ScheduleEvent(EVENT_RETURN, 1000);
                        events.ScheduleEvent(EVENT_GROUND, 1500);
                        break;

                    case EVENT_RETURN:
                        me->SetReactState(REACT_PASSIVE);
                        me->AttackStop();
                        me->GetMotionMaster()->MovePoint(1, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() - 30.0f);
                        break;
            
                    case EVENT_GROUND:
                        EnterPhaseFinal();
                        me->SetReactState(REACT_AGGRESSIVE);
                        AttackStart(me->GetVictim());
                        me->GetMotionMaster()->MoveChase(me->GetVictim());
                        if(GameObject* elevator = me->FindNearestGameObject(207834, 200.0f))
                            elevator->SetGoState(GO_STATE_ACTIVE);

                        Talk(SAY_FINAL_PHASE);
                        break;

                    case EVENT_TAIL_LASH:
                        DoCast(me, SPELL_TAIL_LASH);
                        events.ScheduleEvent(EVENT_TAIL_LASH, urand(8000, 11000));
                        break;

                    case EVENT_SHADOWBLAZE:
                        if(Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 200.0f, true))
                            DoCast(target, SPELL_SHADOWBLAZE_SPARK);
                        events.ScheduleEvent(EVENT_TAIL_LASH, urand(18000, 21000));
                        break;

                    case EVENT_REVIVE_SKELETONS:
                    {
                        std::list<Creature*> creatures;
                        GetCreatureListWithEntryInGrid(creatures, me, 41918, 200.0f);

                        if (!creatures.empty())
                        for (std::list<Creature*>::iterator iter = creatures.begin(); iter != creatures.end(); ++iter)
                        {
                            DoCast((*iter), SPELL_ANIMATE_BONES, true);
                            (*iter)->SetReactState(REACT_AGGRESSIVE);
                            (*iter)->RemoveAura(SPELL_DIE_VISUAL);
                        }
                    }
                        break;
                }
            }

            if (phase == PHASE_GROUND || phase == PHASE_FINAL)
                DoMeleeAttackIfReady();
        }
コード例 #15
0
 void EnterCombat(Unit * /*who*/)
 {
     EnterPhaseGround();
     DoScriptText(SAY_AGGRO, me);
 }
コード例 #16
0
			void EnterCombat(Unit * /*who*/)
			{
				EnterPhaseGround();
				Talk(SAY_AGGRO);
			}
コード例 #17
0
        void UpdateAI(uint32 diff) override
        {
            if (!UpdateVictim())
                return;

            events.Update(diff);

            if (me->HasUnitState(UNIT_STATE_CASTING))
                return;

            while (uint32 eventId = events.ExecuteEvent())
            {
                switch (eventId)
                {
                    case EVENT_CURSE:
                    {
                        DoCastAOE(SPELL_CURSE);
                        events.ScheduleEvent(EVENT_CURSE, urand(50, 70) * IN_MILLISECONDS, 0, PHASE_GROUND);
                        break;
                    }
                    case EVENT_WARRIOR:
                        Talk(SAY_SUMMON);
                        Talk(EMOTE_SUMMON);
                        
                        CastSummon(RAID_MODE(2, 3), 0, 0);

                        events.ScheduleEvent(EVENT_WARRIOR, 40 * IN_MILLISECONDS, 0, PHASE_GROUND);
                        break;
                    case EVENT_BLINK:
                        DoCastAOE(SPELL_CRIPPLE, true);
                        DoCastAOE(SPELL_BLINK);
                        DoResetThreat();
                        justBlinked = true;

                        events.ScheduleEvent(EVENT_BLINK, 40000, 0, PHASE_GROUND);
                        break;
                    case EVENT_BALCONY:
                        events.SetPhase(PHASE_BALCONY);
                        me->SetReactState(REACT_PASSIVE);
                        me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE);
                        me->AttackStop();
                        me->StopMoving();
                        me->RemoveAllAuras();

                        events.ScheduleEvent(EVENT_BALCONY_TELEPORT, 3 * IN_MILLISECONDS, 0, PHASE_BALCONY);
                        events.ScheduleEvent(EVENT_WAVE, urand(5 * IN_MILLISECONDS, 8 * IN_MILLISECONDS), 0, PHASE_BALCONY);

                        uint8 secondsBalcony;
                        switch (balconyCount)
                        {
                            case 0:
                                secondsBalcony = 70;
                                break;
                            case 1:
                                secondsBalcony = 97;
                                break;
                            case 2:
                            default:
                                secondsBalcony = 120;
                                break;
                        }
                        events.ScheduleEvent(EVENT_GROUND, secondsBalcony * IN_MILLISECONDS, 0, PHASE_BALCONY);
                        break;
                    case EVENT_BALCONY_TELEPORT:
                        Talk(EMOTE_TELEPORT_1);
                        DoCastAOE(SPELL_TELEPORT);
                        break;
                    case EVENT_WAVE:
                        Talk(EMOTE_SUMMON_WAVE);
                        switch (balconyCount)
                        {
                            case 0:
                                CastSummon(0, RAID_MODE(2, 4), 0);
                                break;
                            case 1:
                                CastSummon(0, RAID_MODE(1, 2), RAID_MODE(1, 2));
                                break;
                            case 2:
                                CastSummon(0, 0, RAID_MODE(2, 4));
                                break;
                            default:
                                CastSummon(0, RAID_MODE(5, 10), RAID_MODE(5, 10));
                                break;
                        }
                        events.ScheduleEvent(EVENT_WAVE, urand(30, 45) * IN_MILLISECONDS, 0, PHASE_BALCONY);
                        break;
                    case EVENT_GROUND:
                        ++balconyCount;
                        
                        DoCastAOE(SPELL_TELEPORT_BACK);
                        Talk(EMOTE_TELEPORT_2);

                        EnterPhaseGround();
                        break;
                    case EVENT_GROUND_ATTACKABLE:
                        me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE);
                        me->SetReactState(REACT_AGGRESSIVE);
                        break;
                }
            }

            if (events.IsInPhase(PHASE_GROUND))
            {
                /* workaround for movechase breaking after blinking
                   without this noth would just stand there unless his current target moves */
                if (justBlinked && me->GetVictim() && !me->IsWithinMeleeRange(me->EnsureVictim())) 
                {
                    me->GetMotionMaster()->Clear();
                    me->GetMotionMaster()->MoveChase(me->EnsureVictim());
                    justBlinked = false;
                }
                else
                    DoMeleeAttackIfReady();
            }
        }
コード例 #18
0
		void EnterCombat(Unit * /*who*/)
		{
			EnterPhaseGround();
		}
コード例 #19
0
            void UpdateAI(uint32 diff) override
            {
                events.Update(diff);

                if (!events.IsInPhase(PHASE_BIRTH) && !UpdateVictim())
                    return;

                if (events.IsInPhase(PHASE_GROUND))
                {
                    while (uint32 eventId = events.ExecuteEvent())
                    {
                        switch (eventId)
                        {
                            case EVENT_CHECK_RESISTS:
                                DoCast(me, SPELL_CHECK_RESISTS);
                                events.Repeat(Seconds(30));
                                return;
                            case EVENT_GROUND:
                                EnterPhaseGround(false);
                                return;
                            case EVENT_BERSERK:
                                Talk(EMOTE_ENRAGE);
                                DoCast(me, SPELL_BERSERK);
                                return;
                            case EVENT_CLEAVE:
                                DoCastVictim(SPELL_CLEAVE);
                                events.ScheduleEvent(EVENT_CLEAVE, randtime(Seconds(5), Seconds(15)), 0, PHASE_GROUND);
                                return;
                            case EVENT_TAIL:
                                DoCastAOE(SPELL_TAIL_SWEEP);
                                events.ScheduleEvent(EVENT_TAIL, randtime(Seconds(7), Seconds(10)), 0, PHASE_GROUND);
                                return;
                            case EVENT_DRAIN:
                                if (events.IsInPhase(PHASE_FLIGHT))
                                    _delayedDrain = true;
                                else
                                    CastDrain();
                                return;
                            case EVENT_BLIZZARD:
                                DoCastAOE(SPELL_SUMMON_BLIZZARD);
                                events.ScheduleEvent(EVENT_BLIZZARD, RAID_MODE(Seconds(20), Seconds(7)), 0, PHASE_GROUND);
                                break;
                            case EVENT_FLIGHT:
                                if (HealthAbovePct(10))
                                {
                                    _delayedDrain = false;
                                    events.SetPhase(PHASE_FLIGHT);
                                    me->SetReactState(REACT_PASSIVE);
                                    me->AttackStop();
                                    float x, y, z, o;
                                    me->GetHomePosition(x, y, z, o);
                                    me->GetMotionMaster()->MovePoint(1, x, y, z);
                                    return;
                                }
                                break;
                        }
                    }

                    DoMeleeAttackIfReady();
                }
                else
                {
                    if (uint32 eventId = events.ExecuteEvent())
                    {
                        switch (eventId)
                        {
                            case EVENT_CHECK_RESISTS:
                                DoCast(me, SPELL_CHECK_RESISTS);
                                events.Repeat(Seconds(30));
                                return;
                            case EVENT_LIFTOFF:
                            {
                                Talk(EMOTE_AIR_PHASE);
                                if (Creature* buffet = DoSummon(NPC_WING_BUFFET, me, 0.0f, 0, TEMPSUMMON_MANUAL_DESPAWN))
                                    _buffet = buffet->GetGUID();
                                me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
                                me->SetHover(true);
                                events.ScheduleEvent(EVENT_ICEBOLT, Seconds(7), 0, PHASE_FLIGHT);

                                _iceboltTargets.clear();
                                std::list<Unit*> targets;
                                SelectTargetList(targets, RAID_MODE(2, 3), SELECT_TARGET_RANDOM, 200.0f, true);
                                for (Unit* target : targets)
                                    if (target)
                                        _iceboltTargets.push_back(target->GetGUID());
                                return;
                            }
                            case EVENT_ICEBOLT:
                            {
                                if (_iceboltTargets.empty())
                                {
                                    events.ScheduleEvent(EVENT_BREATH, Seconds(2), 0, PHASE_FLIGHT);
                                    return;
                                }
                                ObjectGuid target = _iceboltTargets.back();
                                if (Player* pTarget = ObjectAccessor::GetPlayer(*me, target))
                                    if (pTarget->IsAlive())
                                        DoCast(pTarget, SPELL_ICEBOLT);
                                _iceboltTargets.pop_back();

                                if (_iceboltTargets.empty())
                                    events.ScheduleEvent(EVENT_BREATH, Seconds(2), 0, PHASE_FLIGHT);
                                else
                                    events.Repeat(Seconds(3));
                                return;
                            }
                            case EVENT_BREATH:
                            {
                                Talk(EMOTE_BREATH);
                                DoCastAOE(SPELL_FROST_MISSILE);
                                events.ScheduleEvent(EVENT_EXPLOSION, Seconds(8), 0, PHASE_FLIGHT);
                                return;
                            }
                            case EVENT_EXPLOSION:
                                DoCastAOE(SPELL_FROST_BREATH);
                                DoCastAOE(SPELL_FROST_BREATH_ANTICHEAT);
                                events.ScheduleEvent(EVENT_LAND, Seconds(3) + Milliseconds(500), 0, PHASE_FLIGHT);
                                return;
                            case EVENT_LAND:
                                if (_delayedDrain)
                                    CastDrain();
                                if (Creature* cBuffet = ObjectAccessor::GetCreature(*me, _buffet))
                                {
                                    cBuffet->DespawnOrUnsummon(1 * IN_MILLISECONDS);
                                    _buffet.Clear();
                                }
                                me->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
                                Talk(EMOTE_GROUND_PHASE);
                                me->SetHover(false);
                                events.SetPhase(PHASE_GROUND);
                                events.ScheduleEvent(EVENT_GROUND, Seconds(3) + Milliseconds(500), 0, PHASE_GROUND);
                                return;
                            case EVENT_BIRTH:
                                me->SetVisible(true);
                                me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
                                me->SetReactState(REACT_AGGRESSIVE);
                                return;
                        }
                    }
                }
            }
コード例 #20
0
ファイル: boss_noth.cpp プロジェクト: Aravu/Talador-Project
        void UpdateAI(uint32 diff) override
        {
            if (!UpdateVictim() || !CheckInRoom())
                return;

            events.Update(diff);

            if (me->HasUnitState(UNIT_STATE_CASTING))
                return;

            while (uint32 eventId = events.ExecuteEvent())
            {
                switch (eventId)
                {
                    case EVENT_CURSE:
                        DoCastAOE(SPELL_CURSE_PLAGUEBRINGER);
                        events.ScheduleEvent(EVENT_CURSE, urand(50000, 60000));
                        return;
                    case EVENT_WARRIOR:
                        Talk(SAY_SUMMON);
                        SummonUndead(NPC_WARRIOR, RAID_MODE(2, 3));
                        events.ScheduleEvent(EVENT_WARRIOR, 30000);
                        return;
                    case EVENT_BLINK:
                        DoCastAOE(SPELL_CRIPPLE, true);
                        DoCastAOE(SPELL_BLINK);
                        DoResetThreat();
                        events.ScheduleEvent(EVENT_BLINK, 40000);
                        return;
                    case EVENT_BALCONY:
                        me->SetReactState(REACT_PASSIVE);
                        me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
                        me->AttackStop();
                        me->RemoveAllAuras();
                        me->NearTeleportTo(Teleport.GetPositionX(), Teleport.GetPositionY(), Teleport.GetPositionZ(), Teleport.GetOrientation());
                        events.Reset();
                        events.ScheduleEvent(EVENT_WAVE, urand(2000, 5000));
                        waveCount = 0;
                        return;
                    case EVENT_WAVE:
                        Talk(SAY_SUMMON);
                        switch (balconyCount)
                        {
                            case 0:
                                SummonUndead(NPC_CHAMPION, RAID_MODE(2, 4));
                                break;
                            case 1:
                                SummonUndead(NPC_CHAMPION, RAID_MODE(1, 2));
                                SummonUndead(NPC_GUARDIAN, RAID_MODE(1, 2));
                                break;
                            case 2:
                                SummonUndead(NPC_GUARDIAN, RAID_MODE(2, 4));
                                break;
                            default:
                                SummonUndead(NPC_CHAMPION, RAID_MODE(5, 10));
                                SummonUndead(NPC_GUARDIAN, RAID_MODE(5, 10));
                                break;
                        }
                        ++waveCount;
                        events.ScheduleEvent(waveCount < 2 ? EVENT_WAVE : EVENT_GROUND, urand(30000, 45000));
                        return;
                    case EVENT_GROUND:
                    {
                        ++balconyCount;
                        float x, y, z, o;
                        me->GetHomePosition(x, y, z, o);
                        me->NearTeleportTo(x, y, z, o);
                        events.ScheduleEvent(EVENT_BALCONY, 110000);
                        EnterPhaseGround();
                        return;
                    }
                }
            }

            if (me->HasReactState(REACT_AGGRESSIVE))
                DoMeleeAttackIfReady();
        }
コード例 #21
0
ファイル: boss_lockmaw.cpp プロジェクト: 814077430/ArkCORE
 void EnterCombat(Unit* /*Who*/)
 {
     DoZoneInCombat();
     EnterPhaseGround();
 }
コード例 #22
0
 void EnterCombat(Unit * /*who*/)
 {
     EnterPhaseGround();
     me->MonsterYell(SAY_AGGRO, 0, 0);
 }
コード例 #23
0
ファイル: boss_lockmaw.cpp プロジェクト: 814077430/ArkCORE
 void EnterCombat(Unit* /*who*/) 
 {
     me->MonsterYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
     DoCast(me, SPELL_H_FURY);
     EnterPhaseGround();
 }
コード例 #24
0
ファイル: boss_noth.cpp プロジェクト: Firearm/TrinityCore
        void UpdateAI(const uint32 diff)
        {
            if (!UpdateVictim() || !CheckInRoom())
                return;

            _DoAggroPulse(diff);
            events.Update(diff);

            while (uint32 eventId = events.ExecuteEvent())
            {
                switch (eventId)
                {
                    case EVENT_CURSE:
                        if(!me->IsNonMeleeSpellCasted(false))
                        {
                            DoCastAOE(SPELL_CURSE_PLAGUEBRINGER);
                        events.ScheduleEvent(EVENT_CURSE, urand(50000, 60000));
                        }
                        return;
                    case EVENT_WARRIOR:
                        DoScriptText(SAY_SUMMON, me);
                        SummonUndead(MOB_WARRIOR, RAID_MODE(2, 3));
                        events.ScheduleEvent(EVENT_WARRIOR, 30000);
                        return;
                    case EVENT_BLINK:
                        if(!me->IsNonMeleeSpellCasted(false))
                        {
                            DoCastAOE(SPELL_CRIPPLE, true);
                            DoCastAOE(SPELL_BLINK);
                            DoResetThreat();
                            events.ScheduleEvent(EVENT_BLINK, 20000);
                        }
                        return;
                    case EVENT_BALCONY:
                        me->SetReactState(REACT_PASSIVE);
                        me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
                        me->AttackStop();
                        me->RemoveAllAuras();
                        me->NearTeleportTo(TELE_X, TELE_Y, TELE_Z, TELE_O);
                        me->getThreatManager().resetAllAggro();
                        events.Reset();
                        events.ScheduleEvent(EVENT_WAVE, 10000);
                        waveCount = 0;
                        return;
                    case EVENT_WAVE:
                        DoScriptText(SAY_SUMMON, me);
                        switch (balconyCount)
                        {
                            case 0: SummonUndead(MOB_CHAMPION, RAID_MODE(2, 4)); break;
                            case 1: SummonUndead(MOB_CHAMPION, RAID_MODE(1, 2));
                                    SummonUndead(MOB_GUARDIAN, RAID_MODE(1, 2)); break;
                            case 2: SummonUndead(MOB_GUARDIAN, RAID_MODE(2, 4)); break;
                            default:SummonUndead(MOB_CHAMPION, RAID_MODE(5, 10));
                                    SummonUndead(MOB_GUARDIAN, RAID_MODE(5, 10));break;
                        }
                        ++waveCount;
                        events.ScheduleEvent(waveCount < 2 ? EVENT_WAVE : EVENT_GROUND, 30000);
                        return;
                    case EVENT_GROUND:
                    {
                        ++balconyCount;
                        float x, y, z, o;
                        me->GetHomePosition(x, y, z, o);
                        me->NearTeleportTo(x, y, z, o);
                        events.ScheduleEvent(EVENT_BALCONY, 110000);
                        EnterPhaseGround();
                        return;
                    }
                }
            }

            if(balconyCount > 3)
            {
                if(!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE) && !me->HasAura(SPELL_BERSERK))
                    DoCast(me,SPELL_BERSERK,true);
            }

            if (me->HasReactState(REACT_AGGRESSIVE))
                DoMeleeAttackIfReady();
        }
コード例 #25
0
        void UpdateAI(uint32 diff)
        {
            if (!UpdateVictim() || me->HasUnitState(UNIT_STATE_CASTING))
                return;

            if (!phase)
                return;

            if (m_uiPowerTimer <= diff)
            {
               instance->NormaliseAltPower();
            }
            else m_uiPowerTimer -= diff;

            events.Update(diff);

            if (phase == PHASE_GROUND) // Ground phase
            {
                ThreatContainer::StorageType const &threatlist = me->getThreatManager().getThreatList();

                while (uint32 eventId = events.ExecuteEvent())
                {
                    switch (eventId)
                    {
                        case EVENT_AGGRO_NEF:
                            if (Creature* nefarianHelperheroic = me->FindNearestCreature(NPC_NEFARIAN_HELPER_HEROIC, 150.0f, true))
                            nefarianHelperheroic->AI()->Talk(28);
                            return;

                        case EVENT_SONAR_PULSE:
                            DoCast(me, SPELL_SONAR_PULSE);
                            me->SummonCreature(NPC_SONAR_PULSES, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 1.5f, TEMPSUMMON_TIMED_DESPAWN, 30000);
                            me->SummonCreature(NPC_SONAR_PULSES, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 3.0f, TEMPSUMMON_TIMED_DESPAWN, 30000);
                            me->SummonCreature(NPC_SONAR_PULSES, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 4.5f, TEMPSUMMON_TIMED_DESPAWN, 30000);
                            me->SummonCreature(NPC_SONAR_PULSES, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 6.0f, TEMPSUMMON_TIMED_DESPAWN, 30000);   
                            events.ScheduleEvent(EVENT_SONAR_PULSE, 50000);
                            break;

                        case EVENT_MODULATION:
                            DoCast(me, SPELL_MODULATION);
                            for (ThreatContainer::StorageType::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
                                if (Unit* unit = Unit::GetUnit(*me, (*itr)->getUnitGuid()))
                                    unit->SetPower(POWER_ALTERNATE_POWER, unit->GetPower(POWER_ALTERNATE_POWER) + 7);

                            events.ScheduleEvent(EVENT_MODULATION, 20000);
                            break;

                        case EVENT_SONIC_BREATH:
                             if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true))
                            {
                                target->AddAura(SPELL_TRACKING, target);
                                DoCast(target, SPELL_SONIC_BREATH);
                            }
                            events.ScheduleEvent(EVENT_REMOVE_TRACKING, 8500);                            
                            events.ScheduleEvent(EVENT_SONIC_BREATH, 40000);
                            break;

                        case EVENT_REMOVE_TRACKING:
                            if(instance)
                                instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_TRACKING);
                            return;

                        case EVENT_SEARING_FLAMES:
                            Talk(SAY_SEARING);
                            DoCast(me, SPELL_SEARING_FLAMES);                       
                            events.ScheduleEvent(EVENT_SEARING_FLAMES, 50000);
                            break;

                        case EVENT_LIFTOFF:
                            Talk(SAY_AIR_PHASE);
                            me->HandleEmote(EMOTE_ONESHOT_LIFTOFF);
                            me->SetDisableGravity(true);
                            events.ScheduleEvent(EVENT_FLIGHT, 1500);
                            events.ScheduleEvent(EVENT_AIR, 2000);
                            return;
                            
                        case EVENT_FLIGHT:
                            me->SetReactState(REACT_PASSIVE);
                            me->AttackStop();
                            me->GetMotionMaster()->MovePoint(1, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + 20.0f);
                            return;

                        case EVENT_AIR:
                            EnterPhaseAir();
                            return;

                        case EVENT_FIEND:
                            me->SummonCreature(NPC_OBNOXIOUS_FIEND, 93.767f, -224.105f, 74.911f, 6.26f, TEMPSUMMON_CORPSE_DESPAWN, 3000);
                            if (Creature* nefarianHelperheroic = me->FindNearestCreature(NPC_NEFARIAN_HELPER_HEROIC, 150.0f, true))
                                nefarianHelperheroic->AI()->Talk(27);                                
                            events.ScheduleEvent(EVENT_FIEND, 38500);
                            break;
                    }
                }

                DoMeleeAttackIfReady();
            }
            else if (phase == PHASE_FLIGHT) // Air phase
            {
                std::list<Unit*> targets;
                ThreatContainer::StorageType const &m_threatlist = me->getThreatManager().getThreatList();

                // if has vertigo, remove all roaring flame npc's wait 8 sec then get player who rang gong.
                if (me->HasAura(SPELL_VERTIGO))
                    events.ScheduleEvent(EVENT_ROARING_FLAME_SUMMON, 8000, PHASE_FLIGHT);

                if (uint32 eventId = events.ExecuteEvent())
                {
                    switch (eventId)
                    {
                        case EVENT_ROARING_FLAME_SUMMON:
                            for (ThreatContainer::StorageType::const_iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i)
                            {
                                Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid());
                                if (unit && unit->HasAura(SPELL_NOISY)) // You rang? :)
                                {
                                    me->SummonCreature(NPC_ROARING_FLAME_TARGET, unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 30000);
                                }
                                else
                                {                                
                                     if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true))
                                        me->SummonCreature(NPC_ROARING_FLAME_TARGET, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 30000);
                                }
                            }        
                            events.ScheduleEvent(EVENT_ROARING_FLAME, 500);
                            return;

                        case EVENT_ROARING_FLAME:
                            if (Unit* roaring = me->FindNearestCreature(NPC_ROARING_FLAME_TARGET, 100.0f))
                                DoCast(roaring, SPELL_ROARING_FLAME_BREATH_DUMMY);
                            return;

                        case EVENT_SONAR_BOMB:
                            SelectTargetList(targets, RAID_MODE(3, 6), SELECT_TARGET_RANDOM, 100.0f, true);
                            if (!targets.empty())
                                for (std::list<Unit*>::iterator itr = targets.begin(); itr != targets.end(); ++itr)
                                    DoCast(*itr, SPELL_SONAR_BOMB);                     
                            events.ScheduleEvent(EVENT_SONAR_BOMB, 18000);
                            break;

                        case EVENT_LAND:
                            me->HandleEmote(EMOTE_ONESHOT_LAND);
                            me->SetDisableGravity(false);
                            events.ScheduleEvent(EVENT_RETURN, 1000);
                            events.ScheduleEvent(EVENT_GROUND, 1500);
                            return;

                        case EVENT_RETURN:
                            me->SetReactState(REACT_PASSIVE);
                            me->AttackStop();
                            me->GetMotionMaster()->MovePoint(1, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() - 20.0f);
                            return;
                            
                        case EVENT_GROUND:
                            EnterPhaseGround();
                            return;
                    }
                }
            }            
        }