示例#1
0
 void WaypointReached(uint32 uiPointId)
 {
     switch (uiPointId)
     {
         case 7:
             if (Creature* creature = GetClosestCreatureWithEntry(me, CREATURE_TRIBUNAL_OF_THE_AGES, 100.0f))
             {
                 if (!creature->isAlive())
                     creature->Respawn();
                 CAST_AI(mob_tribuna_controller::mob_tribuna_controllerAI, creature->AI())->UpdateFacesList();
                 uiControllerGUID = creature->GetGUID();
             }
             break;
         case 13:
             DoScriptText(SAY_EVENT_INTRO_1, me);
             SetEscortPaused(true);
             JumpToNextStep(20000);
             break;
         case 17:
             DoScriptText(SAY_EVENT_INTRO_2, me);
             if (instance)
                 instance->HandleGameObject(instance->GetData64(DATA_GO_TRIBUNAL_CONSOLE), true);
             me->SetStandState(UNIT_STAND_STATE_KNEEL);
             SetEscortPaused(true);
             JumpToNextStep(8500);
             break;
         case 18:
             SetEscortPaused(true);
             break;
     }
  }
示例#2
0
 void WaypointReached(uint32 waypointId) override
 {
     switch (waypointId)
     {
         case 7:
             if (Creature* creature = GetClosestCreatureWithEntry(me, NPC_TRIBUNAL_OF_THE_AGES, 100.0f))
             {
                 if (!creature->IsAlive())
                     creature->Respawn();
                 ENSURE_AI(npc_tribuna_controller::npc_tribuna_controllerAI, creature->AI())->UpdateFacesList();
                 uiControllerGUID = creature->GetGUID();
             }
             break;
         case 13:
             Talk(SAY_EVENT_INTRO_1);
             instance->SetBossState(DATA_TRIBUNAL_OF_AGES, IN_PROGRESS);
             SetEscortPaused(true);
             JumpToNextStep(20000);
             // @todo: There should be a pause here and a gossip should start the next step.
             break;
         case 17:
             Talk(SAY_EVENT_INTRO_2);
             instance->HandleGameObject(instance->GetGuidData(DATA_GO_TRIBUNAL_CONSOLE), true);
             me->SetStandState(UNIT_STAND_STATE_KNEEL);
             SetEscortPaused(true);
             JumpToNextStep(8500);
             break;
         case 18:
             SetEscortPaused(true);
             break;
     }
  }
示例#3
0
        void WaypointReached(uint32 waypointId)
        {
            switch (waypointId)
            {
                case 7:
                    if (instance)
                    {
                        if (Creature* pController = Unit::GetCreature((*me), instance->GetData64(DATA_TRIBUNAL_CONTROLLER)))
                        {
                            if (!pController->isAlive())
                                pController->Respawn();

                            uiControllerGUID = pController->GetGUID();

                            CAST_AI(mob_tribuna_controller::mob_tribuna_controllerAI, pController->AI())->activatedByBrann = true;
                        }
                    }
                    break;
                case 13:
                    DoScriptText(SAY_EVENT_INTRO_1, me);
                    SetEscortPaused(true);
                    JumpToNextStep(20000);
                    break;
                case 17:
                    DoScriptText(SAY_EVENT_INTRO_2, me);
                    if (instance)
                        instance->HandleGameObject(instance->GetData64(DATA_GO_TRIBUNAL_CONSOLE), true);
                    me->SetStandState(UNIT_STAND_STATE_KNEEL);
                    SetEscortPaused(true);
                    JumpToNextStep(8500);
                    break;
                case 18:
                    SetEscortPaused(true);
                    break;
            }
         }
示例#4
0
        void UpdateEscortAI(const uint32 uiDiff)
        {
            if (uiPhaseTimer <= uiDiff)
            {
                switch (uiStep)
                {
                    case 1:
                        if (instance)
                        {
                            if (instance->GetData(DATA_BRANN_EVENT) != NOT_STARTED)
                                return;
                            instance->SetData(DATA_BRANN_EVENT, IN_PROGRESS);
                        }
                        bIsBattle = false;
                        DoScriptText(SAY_ESCORT_START, me);
                        SetRun(true);
                        JumpToNextStep(0);
                        break;
                    case 3:
                        SetEscortPaused(false);
                        JumpToNextStep(0);
                        break;
                    case 5:
                        if (instance)
                            if (Creature* temp = (Unit::GetCreature(*me, instance->GetData64(DATA_ABEDNEUM))))
                                DoScriptText(SAY_EVENT_INTRO_3_ABED, temp);
                            JumpToNextStep(8500);
                        break;
                    case 6:
                        DoScriptText(SAY_EVENT_A_1, me);
                        JumpToNextStep(6500);
                        break;
                    case 7:
                        if (instance)
                            if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_KADDRAK)))
                                DoScriptText(SAY_EVENT_A_2_KADD, temp);
                            JumpToNextStep(12500);
                        break;
                    case 8:
                        DoScriptText(SAY_EVENT_A_3, me);
                        if (instance)
                            instance->HandleGameObject(instance->GetData64(DATA_GO_KADDRAK), true);
                        if (Creature* temp = Unit::GetCreature(*me, uiControllerGUID))
                            CAST_AI(mob_tribuna_controller::mob_tribuna_controllerAI, temp->AI())->bKaddrakActivated = true;
                        JumpToNextStep(5000);
                        break;
                    case 9:
                        me->SetReactState(REACT_PASSIVE);
                        SpawnDwarf(1);
                        JumpToNextStep(20000);
                        break;
                    case 10:
                        DoScriptText(SAY_EVENT_B_1, me);
                        JumpToNextStep(6000);
                        break;
                    case 11:
                        if (instance)
                            if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_MARNAK)))
                                DoScriptText(SAY_EVENT_B_2_MARN, temp);
                        SpawnDwarf(1);
                        JumpToNextStep(20000);
                        break;
                    case 12:
                        DoScriptText(SAY_EVENT_B_3, me);
                        if (instance)
                            instance->HandleGameObject(instance->GetData64(DATA_GO_MARNAK), true);
                        if (Creature* temp = Unit::GetCreature(*me, uiControllerGUID))
                            CAST_AI(mob_tribuna_controller::mob_tribuna_controllerAI, temp->AI())->bMarnakActivated = true;
                        JumpToNextStep(10000);
                        break;
                    case 13:
                        SpawnDwarf(1);
                        JumpToNextStep(10000);
                        break;
                    case 14:
                        SpawnDwarf(2);
                        JumpToNextStep(20000);
                        break;
                    case 15:
                        DoScriptText(SAY_EVENT_C_1, me);
                        SpawnDwarf(1);
                        JumpToNextStep(10000);
                        break;
                    case 16:
                        SpawnDwarf(2);
                        JumpToNextStep(20000);
                        break;
                    case 17:
                        if (instance)
                            if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_ABEDNEUM)))
                                DoScriptText(SAY_EVENT_C_2_ABED, temp);
                            SpawnDwarf(1);
                        JumpToNextStep(20000);
                        break;
                    case 18:
                        DoScriptText(SAY_EVENT_C_3, me);
                        if (instance)
                            instance->HandleGameObject(instance->GetData64(DATA_GO_ABEDNEUM), true);
                        if (Creature* temp = Unit::GetCreature(*me, uiControllerGUID))
                            CAST_AI(mob_tribuna_controller::mob_tribuna_controllerAI, temp->AI())->bAbedneumActivated = true;
                        JumpToNextStep(5000);
                        break;
                    case 19:
                        SpawnDwarf(2);
                        JumpToNextStep(10000);
                        break;
                    case 20:
                        SpawnDwarf(1);
                        JumpToNextStep(15000);
                        break;
                    case 21:
                        DoScriptText(SAY_EVENT_D_1, me);
                        SpawnDwarf(3);
                        JumpToNextStep(20000);
                        break;
                    case 22:
                        if (instance)
                            if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_ABEDNEUM)))
                                DoScriptText(SAY_EVENT_D_2_ABED, temp);
                        SpawnDwarf(1);
                        JumpToNextStep(5000);
                        break;
                    case 23:
                        SpawnDwarf(2);
                        JumpToNextStep(15000);
                        break;
                    case 24:
                        DoScriptText(SAY_EVENT_D_3, me);
                        SpawnDwarf(3);
                        JumpToNextStep(5000);
                        break;
                    case 25:
                        SpawnDwarf(1);
                        JumpToNextStep(5000);
                        break;
                    case 26:
                        SpawnDwarf(2);
                        JumpToNextStep(10000);
                        break;
                    case 27:
                        if (instance)
                            if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_ABEDNEUM)))
                                DoScriptText(SAY_EVENT_D_4_ABED, temp);
                        SpawnDwarf(1);
                        JumpToNextStep(10000);
                        break;
                    case 28:
                        me->SetReactState(REACT_DEFENSIVE);
                        DoScriptText(SAY_EVENT_END_01, me);
                        me->SetStandState(UNIT_STAND_STATE_STAND);
                        if (instance)
                            instance->HandleGameObject(instance->GetData64(DATA_GO_SKY_FLOOR), true);
                        if (Creature* temp = Unit::GetCreature(*me, uiControllerGUID))
                            temp->DealDamage(temp, temp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
                        bIsBattle = true;
                        SetEscortPaused(false);
                        JumpToNextStep(6500);
                        break;
                    case 29:
                        DoScriptText(SAY_EVENT_END_02, me);
                        if (instance)
                            instance->SetData(DATA_BRANN_EVENT, DONE);
                        me->CastSpell(me, SPELL_REWARD_ACHIEVEMENT, true);
                        JumpToNextStep(5500);
                        break;
                    case 30:
                        if (instance)
                            if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_ABEDNEUM)))
                                DoScriptText(SAY_EVENT_END_03_ABED, temp);
                        JumpToNextStep(8500);
                        break;
                    case 31:
                        DoScriptText(SAY_EVENT_END_04, me);
                        JumpToNextStep(11500);
                        break;
                    case 32:
                        if (instance)
                            if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_ABEDNEUM)))
                                DoScriptText(SAY_EVENT_END_05_ABED, temp);
                            JumpToNextStep(11500);
                        break;
                    case 33:
                        DoScriptText(SAY_EVENT_END_06, me);
                        JumpToNextStep(4500);
                        break;
                    case 34:
                        if (instance)
                            if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_ABEDNEUM)))
                                DoScriptText(SAY_EVENT_END_07_ABED, temp);
                            JumpToNextStep(22500);
                        break;
                    case 35:
                        DoScriptText(SAY_EVENT_END_08, me);
                        JumpToNextStep(7500);
                        break;
                    case 36:
                        if (instance)
                            if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_KADDRAK)))
                                DoScriptText(SAY_EVENT_END_09_KADD, temp);
                        JumpToNextStep(18500);
                        break;
                    case 37:
                        DoScriptText(SAY_EVENT_END_10, me);
                        JumpToNextStep(5500);
                        break;
                    case 38:
                        if (instance)
                            if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_KADDRAK)))
                                DoScriptText(SAY_EVENT_END_11_KADD, temp);
                            JumpToNextStep(20500);
                        break;
                    case 39:
                        DoScriptText(SAY_EVENT_END_12, me);
                        JumpToNextStep(2500);
                        break;
                    case 40:
                        if (instance)
                            if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_KADDRAK)))
                                DoScriptText(SAY_EVENT_END_13_KADD, temp);
                        JumpToNextStep(19500);
                        break;
                    case 41:
                        DoScriptText(SAY_EVENT_END_14, me);
                        JumpToNextStep(10500);
                        break;
                    case 42:
                        if (instance)
                            if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_MARNAK)))
                                DoScriptText(SAY_EVENT_END_15_MARN, temp);
                            JumpToNextStep(6500);
                        break;
                    case 43:
                        DoScriptText(SAY_EVENT_END_16, me);
                        JumpToNextStep(6500);
                        break;
                    case 44:
                        if (instance)
                            if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_MARNAK)))
                                DoScriptText(SAY_EVENT_END_17_MARN, temp);
                            JumpToNextStep(25500);
                        break;
                    case 45:
                        DoScriptText(SAY_EVENT_END_18, me);
                        JumpToNextStep(23500);
                        break;
                    case 46:
                        if (instance)
                            if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_MARNAK)))
                                DoScriptText(SAY_EVENT_END_19_MARN, temp);
                            JumpToNextStep(3500);
                        break;
                    case 47:
                        DoScriptText(SAY_EVENT_END_20, me);
                        JumpToNextStep(8500);
                        break;
                    case 48:
                        if (instance)
                            if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_ABEDNEUM)))
                                DoScriptText(SAY_EVENT_END_21_ABED, temp);
                            JumpToNextStep(5500);
                        break;
                    case 49:
                    {
                        if (instance)
                        {
                            instance->HandleGameObject(instance->GetData64(DATA_GO_KADDRAK), false);
                            instance->HandleGameObject(instance->GetData64(DATA_GO_MARNAK), false);
                            instance->HandleGameObject(instance->GetData64(DATA_GO_ABEDNEUM), false);
                            instance->HandleGameObject(instance->GetData64(DATA_GO_SKY_FLOOR), false);
                        }
                        Player* player = GetPlayerForEscort();
                        if (player)
                            player->GroupEventHappens(QUEST_HALLS_OF_STONE, me);
                        me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
                        JumpToNextStep(180000);
                        break;
                    }
                    case 50:
                        SetEscortPaused(false);
                        break;
                }
            } else uiPhaseTimer -= uiDiff;

            if (!bIsLowHP && HealthBelowPct(30))
            {
                DoScriptText(SAY_LOW_HEALTH, me);
                bIsLowHP = true;
            }
            else if (bIsLowHP && !HealthBelowPct(30))
                bIsLowHP = false;

            if (!UpdateVictim())
                return;

            DoMeleeAttackIfReady();
        }
示例#5
0
        void UpdateAI(const uint32 diff)
        {
            //Return since we have no target
            if (!UpdateVictim())
                return;

            if (Phase == 1 && HealthBelowPct(20))
            {
                Phase = 2;
                DoScriptText(SAY_PHASE_2, me);
            }

            if (HealthBelowPct(2))
            {
                me->SummonGameObject(GAMEOBJECT_GIVE_OF_THE_OBSERVER, 1634.258667f, -295.101166f, 417.321381f, 0, 0, 0, 0, 0, 0);

                // All of them. or random?
                DoScriptText(SAY_DEATH_1, me);
                DoScriptText(SAY_DEATH_2, me);
                DoScriptText(SAY_DEATH_3, me);
                DoScriptText(SAY_DEATH_4, me);
                DoScriptText(SAY_DEATH_5, me);

                me->DisappearAndDie();

                if (instance)
                    instance->SetData(BOSS_ALGALON, DONE);

                return;
            }

            if (Phase == 1)
            {
                if (!Summon)
                {
                    if (uiPhase_timer <= diff)
                    {
                        switch (uiStep)
                        {
                            case 1:
                                DoScriptText(SAY_SUMMON_1, me);
                                JumpToNextStep(3000);
                                break;
                            case 2:
                                DoScriptText(SAY_SUMMON_2, me);
                                JumpToNextStep(3000);
                                break;
                            case 3:
                                DoScriptText(SAY_SUMMON_3, me);
                                JumpToNextStep(3000);
                                break;
                            case 4:
                                DoScriptText(SAY_ENGADED_FOR_FIRTS_TIME, me);
                                JumpToNextStep(3000);
                                break;
                            case 5:
                                me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
                                me->SetReactState(REACT_AGGRESSIVE);
                                Summon = true;
                                break;
                        }
                    } else uiPhase_timer -= diff;

                    return;
                }

                if (QuantumStrike_Timer <= diff)
                {
                    DoCast(me->getVictim(), RAID_MODE(SPELL_QUANTUM_STRIKE, H_SPELL_QUANTUM_STRIKE), true);

                    QuantumStrike_Timer = urand(4000, 14000);
                } else QuantumStrike_Timer -= diff;

                if (BigBang_Timer <= diff)
                {
                    DoScriptText(RAND(SAY_BIG_BANG_1, SAY_BIG_BANG_2), me);
                    DoCast(me->getVictim(), RAID_MODE(SPELL_BIG_BANG, H_SPELL_BIG_BANG), true);

                    BigBang_Timer = 90000;
                } else BigBang_Timer -= diff;

                if (Ascend_Timer <= diff)
                {
                    DoCast(me->getVictim(), SPELL_ASCEND, true);

                    Ascend_Timer = 480000;
                } else Ascend_Timer -= diff;

                if (PhasePunch_Timer <= diff)
                {
                    DoCast(me->getVictim(), SPELL_PHASE_PUNCH, true);

                    PhasePunch_Timer = 8000;
                } else PhasePunch_Timer -= diff;

                if (CosmicSmash_Timer <= diff)
                {
                    DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0), RAID_MODE(SPELL_COSMIC_SMASH, H_SPELL_COSMIC_SMASH), true);

                    CosmicSmash_Timer = urand(30000, 60000);
                } else CosmicSmash_Timer -= diff;

                if (Berserk_Timer <= diff)
                {
                    DoScriptText(SAY_BERSERK, me);
                    DoCast(me->getVictim(), SPELL_BERSERK, true);

                    Berserk_Timer = 360000;
                } else Berserk_Timer -= diff;

                DoMeleeAttackIfReady();

                EnterEvadeIfOutOfCombatArea(diff);
            }

            if (Phase == 2)
            {
                if (Enrage)
                {
                    if (Ascend_Timer <= diff)
                    {
                        DoCast(me, SPELL_ASCEND);
                        DoScriptText(SAY_BERSERK, me);
                        Ascend_Timer = urand(360000, 365000);
                        Enrage = false;
                    } else Ascend_Timer -= diff;
                }
            }

            DoMeleeAttackIfReady();
        }
示例#6
0
 void UpdateAI(const uint32 diff)
 {
     if (_stepTimer <= diff)
     {
         switch (_variation)
         {
             case 1:
                 switch (_step)
                 {
                     case 0:
                         me->MonsterSay(MEK_1_0, LANG_UNIVERSAL, NULL);
                         JumpToNextStep(5000);
                         break;
                     case 1:
                         me->MonsterSay(MEK_1_1, LANG_UNIVERSAL, NULL);
                         JumpToNextStep(5000);
                         break;
                     case 2:
                         _listener->MonsterSay(LIS_1_0, LANG_UNIVERSAL, NULL);
                         JumpToNextStep(3000);
                         break;
                     case 3:
                         if (Creature* Pad = me->FindNearestCreature(NPC_SUMMONING_PAD, 1.0f, true))
                             Pad->DespawnOrUnsummon();
                         CastCredit();
                         break;
                 }
                 break;
             case 2:
                 switch (_step)
                 {
                     case 0:
                         me->MonsterSay(MEK_2_0, LANG_UNIVERSAL, NULL);
                         JumpToNextStep(5000);
                         break;
                     case 1:
                         me->MonsterSay(MEK_2_1, LANG_UNIVERSAL, NULL);
                         JumpToNextStep(5000);
                         break;
                     case 2:
                         me->MonsterSay(MEK_2_2, LANG_UNIVERSAL, NULL);
                         JumpToNextStep(5000);
                         break;
                     case 3:
                         _listener->MonsterSay(LIS_2_0, LANG_UNIVERSAL, NULL);
                         JumpToNextStep(3000);
                         break;
                     case 4:
                         if (Creature* Pad = me->FindNearestCreature(NPC_SUMMONING_PAD, 1.0f, true))
                             Pad->DespawnOrUnsummon();
                         CastCredit();
                         break;
                 }
                 break;
             case 3:
                 switch (_step)
                 {
                     case 0:
                         me->MonsterSay(MEK_3_0, LANG_UNIVERSAL, NULL);
                         JumpToNextStep(7000);
                         break;
                     case 1:
                         me->MonsterSay(MEK_3_1, LANG_UNIVERSAL, NULL);
                         JumpToNextStep(3000);
                         break;
                     case 2:
                         me->MonsterSay(MEK_3_2, LANG_UNIVERSAL, NULL);
                         JumpToNextStep(3000);
                         break;
                     case 3:
                         _listener->MonsterSay(LIS_3_0, LANG_UNIVERSAL, NULL);
                         JumpToNextStep(3000);
                         break;
                     case 4:
                         if (Creature* Pad = me->FindNearestCreature(NPC_SUMMONING_PAD, 1.0f, true))
                             Pad->DespawnOrUnsummon();
                         CastCredit();
                         break;
                 }
                 break;
         }
     }
     else
         _stepTimer -= diff;
 }
示例#7
0
 void UpdateAI(const uint32 diff)
 {
     if (_stepTimer <= diff)
     {
         switch (_step)
         {
             case 0:
                 me->MonsterSay(STEAM_0, LANG_UNIVERSAL, NULL);
                 JumpToNextStep(5000);
                 break;
             case 1:
                 me->MonsterSay(STEAM_1, LANG_UNIVERSAL, NULL);
                 JumpToNextStep(5000);
                 break;
             case 2:
                 me->MonsterSay(STEAM_2, LANG_UNIVERSAL, NULL);
                 JumpToNextStep(5000);
                 break;
             case 3:
                 me->MonsterSay(STEAM_3, LANG_UNIVERSAL, NULL);
                 JumpToNextStep(5000);
                 break;
             case 4:
                 me->MonsterSay(STEAM_4, LANG_UNIVERSAL, NULL);
                 JumpToNextStep(1000);
                 break;
             case 5:
                 ForceEmote(EMOTE_ONESHOT_SALUTE);
                 JumpToNextStep(1500);
                 break;
             case 6:
                 ForceEmote(EMOTE_ONESHOT_NONE);
                 JumpToNextStep(3000);
             case 7:
                 me->MonsterSay(STEAM_5, LANG_UNIVERSAL, NULL);
                 JumpToNextStep(5000);
                 break;
             case 8:
                 me->MonsterSay(STEAM_6, LANG_UNIVERSAL, NULL);
                 JumpToNextStep(5000);
                 break;
             case 9:
                 me->MonsterSay(STEAM_7, LANG_UNIVERSAL, NULL);
                 JumpToNextStep(5000);
                 break;
             case 10:
                 me->MonsterSay(STEAM_8, LANG_UNIVERSAL, NULL);
                 JumpToNextStep(1000);
                 break;
             case 11:
                 ForceEmote(EMOTE_ONESHOT_ROAR);
                 JumpToNextStep(2000);
                 break;
             case 12:
                 ForceEmote(EMOTE_ONESHOT_NONE);
                 JumpToNextStep(3000);
                 break;
             case 13:
                 me->MonsterSay(STEAM_9, LANG_UNIVERSAL, NULL);
                 JumpToNextStep(5000);
                 break;
             case 14:
                 me->MonsterSay(STEAM_10, LANG_UNIVERSAL, NULL);
                 JumpToNextStep(5000);
                 break;
             case 15:
                 me->MonsterSay(STEAM_11, LANG_UNIVERSAL, NULL);
                 JumpToNextStep(5000);
                 break;
             case 16:
                 me->MonsterSay(STEAM_12, LANG_UNIVERSAL, NULL);
                 JumpToNextStep(1000);
                 break;
             case 17:
                 ForceEmote(EMOTE_ONESHOT_CHEER);
                 JumpToNextStep(1500);
                 break;
             case 18:
                 ForceEmote(EMOTE_ONESHOT_NONE);
                 JumpToNextStep(3000);
                 break;
             case 19:
                 me->MonsterSay(STEAM_13, LANG_UNIVERSAL, NULL);
                 JumpToNextStep(5000);
                 break;
             case 20:
                 me->MonsterSay(STEAM_14, LANG_UNIVERSAL, NULL);
                 JumpToNextStep(5000);
                 break;
             case 21:
                 me->MonsterSay(STEAM_15, LANG_UNIVERSAL, NULL);
                 JumpToNextStep(5000);
                 break;
             case 22:
                 me->MonsterSay(STEAM_16, LANG_UNIVERSAL, NULL);
                 JumpToNextStep(1000);
                 break;
             case 23:
                 ForceEmote(EMOTE_ONESHOT_DANCE);
                 JumpToNextStep(2500);
                 break;
             case 24:
                 ForceEmote(EMOTE_ONESHOT_NONE);
                 JumpToNextStep(3000);
                 break;
             case 25:
                 me->MonsterSay(STEAM_17, LANG_UNIVERSAL, NULL);
                 JumpToNextStep(5000);
                 break;
             case 26:
                 me->MonsterSay(STEAM_18, LANG_UNIVERSAL, NULL);
                 JumpToNextStep(5000);
                 break;
         }
     }
     else
         _stepTimer -= diff;
 }
示例#8
0
    void UpdateEscortAI(const uint32 uiDiff)
    {
        if (uiPhaseTimer <= uiDiff)
        {
            switch (uiStep)
            {
                case 1:
                    if (pInstance)
                    {
                        if (pInstance->GetData(DATA_BRANN_EVENT) != NOT_STARTED)
                            return;
                        pInstance->SetData(DATA_BRANN_EVENT, IN_PROGRESS);
                    }
                    bIsBattle = false;
                    DoScriptText(SAY_ESCORT_START, m_creature);
                    SetRun(true);
                    JumpToNextStep(0);
                    break;
                case 3:
                    SetEscortPaused(false);
                    JumpToNextStep(0);
                    break;
                case 5:
                    if (pInstance)
                        if (Creature* pTemp = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ABEDNEUM))))
                            DoScriptText(SAY_EVENT_INTRO_3_ABED, pTemp);
                        JumpToNextStep(8500);
                    break;
                case 6:
                    DoScriptText(SAY_EVENT_A_1, m_creature);
                    JumpToNextStep(6500);
                    break;
                case 7:
                    if (pInstance)
                        if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_KADDRAK)))
                            DoScriptText(SAY_EVENT_A_2_KADD, pTemp);
                        JumpToNextStep(12500);
                    break;
                case 8:
                    DoScriptText(SAY_EVENT_A_3, m_creature);
                    if (pInstance)
                        pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_KADDRAK),true);
                    if (Creature* pTemp = Unit::GetCreature(*m_creature, uiControllerGUID))
                        CAST_AI(mob_tribuna_controllerAI, pTemp->AI())->bKaddrakActivated = true;
                    JumpToNextStep(5000);
                    break;
                case 9:
                    m_creature->SetReactState(REACT_PASSIVE);
                    SpawnDwarf(1);
                    JumpToNextStep(20000);
                    break;
                case 10:
                    DoScriptText(SAY_EVENT_B_1, m_creature);
                    JumpToNextStep(6000);
                    break;
                case 11:
                    if (pInstance)
                        if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_MARNAK)))
                            DoScriptText(SAY_EVENT_B_2_MARN, pTemp);
                    SpawnDwarf(1);
                    JumpToNextStep(20000);
                    break;
                case 12:
                    DoScriptText(SAY_EVENT_B_3, m_creature);
                    if (pInstance)
                        pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_MARNAK),true);
                    if (Creature* pTemp = Unit::GetCreature(*m_creature, uiControllerGUID))
                        CAST_AI(mob_tribuna_controllerAI, pTemp->AI())->bMarnakActivated = true;
                    JumpToNextStep(10000);
                    break;
                case 13:
                    SpawnDwarf(1);
                    JumpToNextStep(10000);
                    break;
                case 14:
                    SpawnDwarf(2);
                    JumpToNextStep(20000);
                    break;
                case 15:
                    DoScriptText(SAY_EVENT_C_1, m_creature);
                    SpawnDwarf(1);
                    JumpToNextStep(10000);
                    break;
                case 16:
                    SpawnDwarf(2);
                    JumpToNextStep(20000);
                    break;
                case 17:
                    if (pInstance)
                        if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ABEDNEUM)))
                            DoScriptText(SAY_EVENT_C_2_ABED, pTemp);
                        SpawnDwarf(1);
                    JumpToNextStep(20000);
                    break;
                case 18:
                    DoScriptText(SAY_EVENT_C_3, m_creature);
                    if (pInstance)
                        pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_ABEDNEUM),true);
                    if (Creature* pTemp = Unit::GetCreature(*m_creature, uiControllerGUID))
                        CAST_AI(mob_tribuna_controllerAI, pTemp->AI())->bAbedneumActivated = true;
                    JumpToNextStep(5000);
                    break;
                case 19:
                    SpawnDwarf(2);
                    JumpToNextStep(10000);
                    break;
                case 20:
                    SpawnDwarf(1);
                    JumpToNextStep(15000);
                    break;
                case 21:
                    DoScriptText(SAY_EVENT_D_1, m_creature);
                    SpawnDwarf(3);
                    JumpToNextStep(20000);
                    break;
                case 22:
                    if (pInstance)
                        if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ABEDNEUM)))
                            DoScriptText(SAY_EVENT_D_2_ABED, pTemp);
                    SpawnDwarf(1);
                    JumpToNextStep(5000);
                    break;
                case 23:
                    SpawnDwarf(2);
                    JumpToNextStep(15000);
                    break;
                case 24:
                    DoScriptText(SAY_EVENT_D_3, m_creature);
                    SpawnDwarf(3);
                    JumpToNextStep(5000);
                    break;
                case 25:
                    SpawnDwarf(1);
                    JumpToNextStep(5000);
                    break;
                case 26:
                    SpawnDwarf(2);
                    JumpToNextStep(10000);
                    break;
                case 27:
                    if (pInstance)
                        if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ABEDNEUM)))
                            DoScriptText(SAY_EVENT_D_4_ABED, pTemp);
                    SpawnDwarf(1);
                    JumpToNextStep(10000);
                    break;
                case 28:
                    m_creature->SetReactState(REACT_DEFENSIVE);
                    DoScriptText(SAY_EVENT_END_01, m_creature);
                    m_creature->SetStandState(UNIT_STAND_STATE_STAND);
                    if (pInstance)
                        pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_SKY_FLOOR),true);
                    if (Creature* pTemp = Unit::GetCreature(*m_creature, uiControllerGUID))
                        pTemp->DealDamage(pTemp, pTemp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
                    bIsBattle = true;
                    SetEscortPaused(false);
                    JumpToNextStep(6500);
                    break;
                case 29:
                    DoScriptText(SAY_EVENT_END_02, m_creature);
                    if (pInstance)
                    {
                        pInstance->SetData(DATA_BRANN_EVENT, DONE);

                        // Achievement criteria is with spell 59046 which does not exist.
                        // There is thus no way it can be given by casting the spell on the players.
                        pInstance->DoUpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, 59046);

                        if (!bHasBeenDamaged)
                            pInstance->DoCompleteAchievement(ACHIEV_BRANN_SPANKIN_NEW);
                    }
                    
                    JumpToNextStep(5500);
                    break;
                case 30:
                    if (pInstance)
                        if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ABEDNEUM)))
                            DoScriptText(SAY_EVENT_END_03_ABED, pTemp);
                    JumpToNextStep(8500);
                    break;
                case 31:
                    DoScriptText(SAY_EVENT_END_04, m_creature);
                    JumpToNextStep(11500);
                    break;
                case 32:
                    if (pInstance)
                        if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ABEDNEUM)))
                            DoScriptText(SAY_EVENT_END_05_ABED, pTemp);
                        JumpToNextStep(11500);
                    break;
                case 33:
                    DoScriptText(SAY_EVENT_END_06, m_creature);
                    JumpToNextStep(4500);
                    break;
                case 34:
                    if (pInstance)
                        if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ABEDNEUM)))
                            DoScriptText(SAY_EVENT_END_07_ABED, pTemp);
                        JumpToNextStep(22500);
                    break;
                case 35:
                    DoScriptText(SAY_EVENT_END_08, m_creature);
                    JumpToNextStep(7500);
                    break;
                case 36:
                    if (pInstance)
                        if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_KADDRAK)))
                            DoScriptText(SAY_EVENT_END_09_KADD, pTemp);
                    JumpToNextStep(18500);
                    break;
                case 37:
                    DoScriptText(SAY_EVENT_END_10, m_creature);
                    JumpToNextStep(5500);
                    break;
                case 38:
                    if (pInstance)
                        if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_KADDRAK)))
                            DoScriptText(SAY_EVENT_END_11_KADD, pTemp);
                        JumpToNextStep(20500);
                    break;
                case 39:
                    DoScriptText(SAY_EVENT_END_12, m_creature);
                    JumpToNextStep(2500);
                    break;
                case 40:
                    if (pInstance)
                        if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_KADDRAK)))
                            DoScriptText(SAY_EVENT_END_13_KADD, pTemp);
                    JumpToNextStep(19500);
                    break;
                case 41:
                    DoScriptText(SAY_EVENT_END_14, m_creature);
                    JumpToNextStep(10500);
                    break;
                case 42:
                    if (pInstance)
                        if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_MARNAK)))
                            DoScriptText(SAY_EVENT_END_15_MARN, pTemp);
                        JumpToNextStep(6500);
                    break;
                case 43:
                    DoScriptText(SAY_EVENT_END_16, m_creature);
                    JumpToNextStep(6500);
                    break;
                case 44:
                    if (pInstance)
                        if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_MARNAK)))
                            DoScriptText(SAY_EVENT_END_17_MARN, pTemp);
                        JumpToNextStep(25500);
                    break;
                case 45:
                    DoScriptText(SAY_EVENT_END_18, m_creature);
                    JumpToNextStep(23500);
                    break;
                case 46:
                    if (pInstance)
                        if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_MARNAK)))
                            DoScriptText(SAY_EVENT_END_19_MARN, pTemp);
                        JumpToNextStep(3500);
                    break;
                case 47:
                    DoScriptText(SAY_EVENT_END_20, m_creature);
                    JumpToNextStep(8500);
                    break;
                case 48:
                    if (pInstance)
                        if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ABEDNEUM)))
                            DoScriptText(SAY_EVENT_END_21_ABED, pTemp);
                        JumpToNextStep(5500);
                    break;
                case 49:
                {
                    if (pInstance)
                    {
                        pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_KADDRAK),false);
                        pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_MARNAK),false);
                        pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_ABEDNEUM),false);
                        pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_SKY_FLOOR),false);
                    }
                    Player* pPlayer = GetPlayerForEscort();
                    if (pPlayer)
                        pPlayer->GroupEventHappens(QUEST_HALLS_OF_STONE, m_creature);
                    m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
                    JumpToNextStep(180000);
                    break;
                }
                case 50:
                    SetEscortPaused(false);
                    break;
            }
        } else uiPhaseTimer -= uiDiff;

        if (!bIsLowHP && HealthBelowPct(30))
        {
            DoScriptText(SAY_LOW_HEALTH, m_creature);
            bIsLowHP = true;
        } 
        else if (bIsLowHP && !HealthBelowPct(30))
            bIsLowHP = false;

        if (!UpdateVictim())
            return;

        DoMeleeAttackIfReady();
    }
示例#9
0
        void UpdateAI(const uint32 diff)
        {
            if (!UpdateVictim())
                return;

            if (phase == 1 && HealthBelowPct(20))
            {
                phase = 2;
                DoScriptText(SAY_PHASE_2, me);
                summons.DespawnAll();
                events.CancelEvent(EVENT_COLLAPSINGSTAR);
                events.CancelEvent(EVENT_LIVINGCONSTELLATION);
                events.ScheduleEvent(EVENT_DARKMATTER, 5*IN_MILLISECONDS);

                // summon 4 unstable black holes
                for (uint8 i = 0; i < 4; ++i)
                    me->SummonCreature(CREATURE_BLACK_HOLE, collapsingLocations[i]);
            }

            if (HealthBelowPct(2))
            {
                me->SummonGameObject(GO_GIFT_OF_THE_OBSERVER, 1634.258667f, -295.101166f,417.321381f,0,0,0,0,0,0);

                // All of them. or random?
                DoScriptText(SAY_DEATH_1, me);
                DoScriptText(SAY_DEATH_2, me);
                DoScriptText(SAY_DEATH_3, me);
                DoScriptText(SAY_DEATH_4, me);
                DoScriptText(SAY_DEATH_5, me);

                me->DisappearAndDie();
                _JustDied();
                return;
            }

            if (!summon)
            {
                if (stepTimer <= diff)
                {
                    switch (step)
                    {
                        case 1:
                            DoScriptText(SAY_SUMMON_1, me);
                            JumpToNextStep(7500);
                            break;
                        case 2:
                            DoScriptText(SAY_SUMMON_2, me);
                            JumpToNextStep(6000);
                            break;
                        case 3:
                            DoScriptText(SAY_SUMMON_3, me);
                            JumpToNextStep(11000);
                            break;
                        case 4:
                            DoScriptText(SAY_ENGAGED_FOR_FIRST_TIME, me);
                            JumpToNextStep(11000);
                            break;
                        case 5:
                            DoScriptText(SAY_AGGRO, me);
                            JumpToNextStep(7000);
                            break;
                        case 6:
                            me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
                            me->SetReactState(REACT_AGGRESSIVE);
                            SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_ID_OFF_HAND, EQUIP_NO_CHANGE);
                            summon = true;
                            break;
                    }
                } else stepTimer -= diff;
                return;
            }

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

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

            while (uint32 eventId = events.ExecuteEvent())
            {
                switch (eventId)
                {
                    case EVENT_BIGBANG:
                        DoScriptText(RAND(SAY_BIG_BANG_1, SAY_BIG_BANG_2), me);
                        DoCast(RAID_MODE(SPELL_BIG_BANG_10, SPELL_BIG_BANG_25));
                        events.ScheduleEvent(EVENT_BIGBANG, 90*IN_MILLISECONDS);
                        break;
                    case EVENT_PHASEPUNCH:
                        DoCast(me->getVictim(), SPELL_PHASE_PUNCH, true);
                        events.ScheduleEvent(EVENT_PHASEPUNCH, 15*IN_MILLISECONDS);
                        break;
                    case EVENT_QUANTUMSTRIKE:
                        DoCast(me->getVictim(), RAID_MODE(SPELL_QUANTUM_STRIKE_10, SPELL_QUANTUM_STRIKE_25));
                        events.ScheduleEvent(EVENT_QUANTUMSTRIKE, urand(4*IN_MILLISECONDS, 14*IN_MILLISECONDS));
                        break;
                    case EVENT_COSMICSMASH:
                        DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0), RAID_MODE(SPELL_COSMIC_SMASH_10, SPELL_COSMIC_SMASH_25));
                        events.ScheduleEvent(EVENT_COSMICSMASH, 25*IN_MILLISECONDS);
                        break;
                    case EVENT_COLLAPSINGSTAR:
                        DoScriptText(SAY_SUMMON_COLLAPSING_STAR, me);
                        for (uint8 i = starCount; i < 4; ++i)
                            me->SummonCreature(CREATURE_COLLAPSING_STAR, collapsingLocations[i], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3*IN_MILLISECONDS);
                        events.ScheduleEvent(EVENT_COLLAPSINGSTAR, 45*IN_MILLISECONDS);
                        break;
                    case EVENT_LIVINGCONSTELLATION:
                        for (uint8 i = 0; i < 3; ++i)
                            me->SummonCreature(CREATURE_LIVING_CONSTELLATION, constellationLocations[i], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1*IN_MILLISECONDS);
                        events.ScheduleEvent(EVENT_LIVINGCONSTELLATION, 50*IN_MILLISECONDS);
                        break;
                    case EVENT_DARKMATTER:
                        for (uint8 i = 0; i < 4; ++i)
                            me->SummonCreature(CREATURE_UNLEASHED_DARK_MATTER, collapsingLocations[i], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3*IN_MILLISECONDS);
                        events.ScheduleEvent(EVENT_DARKMATTER, 20*IN_MILLISECONDS);
                        break;
                    case EVENT_BERSERK:
                        DoScriptText(SAY_BERSERK, me);
                        DoCast(me, SPELL_BERSERK, true);
                        events.ScheduleEvent(EVENT_ASCEND, 3*IN_MILLISECONDS);
                        break;
                    case EVENT_ASCEND:
                        DoCast(SPELL_ASCEND);
                        events.ScheduleEvent(EVENT_ASCEND, 10*IN_MILLISECONDS);
                        break;
                    default:
                        break;
                }
            }

            DoMeleeAttackIfReady();
            //EnterEvadeIfOutOfCombatArea(diff);
        }
示例#10
0
        void UpdateEscortAI(const uint32 uiDiff)
        {
            if (uiPhaseTimer <= uiDiff)
            {
                switch (uiStep)
                {
                    case 1:
                        if (instance)
                        {
                            if (instance->GetData(DATA_BRANN_EVENT) != NOT_STARTED)
                                return;
                            instance->SetData(DATA_BRANN_EVENT, IN_PROGRESS);
                        }
                        bIsBattle = false;
                        DoScriptText(SAY_ESCORT_START, me);
                        SetRun(true);
                        JumpToNextStep(0);
                        break;
                    case 3:
                        SetEscortPaused(false);
                        JumpToNextStep(0);
                        break;
                    case 5:
                        if (instance)
                            if (Creature* temp = (Unit::GetCreature(*me, instance->GetData64(DATA_ABEDNEUM))))
                                DoScriptText(SAY_EVENT_INTRO_3_ABED, temp);
                            JumpToNextStep(8500);
                        break;
                    case 6:
                        DoScriptText(SAY_EVENT_A_1, me);
                        JumpToNextStep(6500);
                        break;
                    case 7:
                        if (instance)
                            if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_KADDRAK)))
                                DoScriptText(SAY_EVENT_A_2_KADD, temp);
                            JumpToNextStep(12500);
                        break;
                    case 8:
                        DoScriptText(SAY_EVENT_A_3, me);
                        if (instance)
                            if (GameObject* goKaddrak = instance->instance->GetGameObject(instance->GetData64(DATA_GO_KADDRAK)))
                            {
                                goKaddrak->SetGoAnimProgress(0);
                                goKaddrak->SendCustomAnim(goKaddrak->GetGoAnimProgress());
                            }

                        if (Creature* temp = Unit::GetCreature(*me, uiControllerGUID))
                            CAST_AI(mob_tribuna_controller::mob_tribuna_controllerAI, temp->AI())->bKaddrakActivated = true;
                        JumpToNextStep(5000);
                        break;
                    case 9:
                        me->SetReactState(REACT_PASSIVE);
                        SpawnDwarf(1);
                        JumpToNextStep(20000);
                        break;
                    case 10:
                        DoScriptText(SAY_EVENT_B_1, me);
                        JumpToNextStep(6000);
                        break;
                    case 11:
                        if (instance)
                            if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_MARNAK)))
                                DoScriptText(SAY_EVENT_B_2_MARN, temp);
                        SpawnDwarf(1);
                        JumpToNextStep(20000);
                        break;
                    case 12:
                        DoScriptText(SAY_EVENT_B_3, me);
                        if (instance)
                            if (GameObject* goMarnak = instance->instance->GetGameObject(instance->GetData64(DATA_GO_MARNAK)))
                            {
                                goMarnak->SetGoAnimProgress(0);
                                goMarnak->SendCustomAnim(goMarnak->GetGoAnimProgress());
                            }

                        if (Creature* temp = Unit::GetCreature(*me, uiControllerGUID))
                            CAST_AI(mob_tribuna_controller::mob_tribuna_controllerAI, temp->AI())->bMarnakActivated = true;
                        JumpToNextStep(10000);
                        break;
                    case 13:
                        SpawnDwarf(1);
                        JumpToNextStep(10000);
                        break;
                    case 14:
                        SpawnDwarf(2);
                        JumpToNextStep(20000);
                        break;
                    case 15:
                        DoScriptText(SAY_EVENT_C_1, me);
                        SpawnDwarf(1);
                        JumpToNextStep(10000);
                        break;
                    case 16:
                        SpawnDwarf(2);
                        JumpToNextStep(20000);
                        break;
                    case 17:
                        if (instance)
                            if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_ABEDNEUM)))
                                DoScriptText(SAY_EVENT_C_2_ABED, temp);
                            SpawnDwarf(1);
                        JumpToNextStep(20000);
                        break;
                    case 18:
                        DoScriptText(SAY_EVENT_C_3, me);
                        if (instance)
                            if (GameObject* goAbedneum = instance->instance->GetGameObject(instance->GetData64(DATA_GO_ABEDNEUM)))
                            {
                                goAbedneum->SetGoAnimProgress(0);
                                goAbedneum->SendCustomAnim(goAbedneum->GetGoAnimProgress());
                            }

                        if (Creature* temp = Unit::GetCreature(*me, uiControllerGUID))
                            CAST_AI(mob_tribuna_controller::mob_tribuna_controllerAI, temp->AI())->bAbedneumActivated = true;
                        JumpToNextStep(5000);
                        break;
                    case 19:
                        SpawnDwarf(2);
                        JumpToNextStep(10000);
                        break;
                    case 20:
                        SpawnDwarf(1);
                        JumpToNextStep(15000);
                        break;
                    case 21:
                        DoScriptText(SAY_EVENT_D_1, me);
                        SpawnDwarf(3);
                        JumpToNextStep(20000);
                        break;
                    case 22:
                        if (instance)
                            if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_ABEDNEUM)))
                                DoScriptText(SAY_EVENT_D_2_ABED, temp);
                        SpawnDwarf(1);
                        JumpToNextStep(5000);
                        break;
                    case 23:
                        SpawnDwarf(2);
                        JumpToNextStep(15000);
                        break;
                    case 24:
                        DoScriptText(SAY_EVENT_D_3, me);
                        SpawnDwarf(3);
                        JumpToNextStep(5000);
                        break;
                    case 25:
                        SpawnDwarf(1);
                        JumpToNextStep(5000);
                        break;
                    case 26:
                        SpawnDwarf(2);
                        JumpToNextStep(10000);
                        break;
                    case 27:
                        if (instance)
                            if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_ABEDNEUM)))
                                DoScriptText(SAY_EVENT_D_4_ABED, temp);
                        SpawnDwarf(1);
                        JumpToNextStep(10000);
                        break;
                    case 28:
                        me->SetReactState(REACT_DEFENSIVE);
                        DoScriptText(SAY_EVENT_END_01, me);
                        me->SetStandState(UNIT_STAND_STATE_STAND);

                        DespawnDwarf();

                        if (instance)
                        {
                            instance->HandleGameObject(instance->GetData64(DATA_GO_SKY_FLOOR), true);
                            instance->HandleGameObject(instance->GetData64(DATA_GO_KADDRAK), true);
                            instance->HandleGameObject(instance->GetData64(DATA_GO_MARNAK), true);
                            instance->HandleGameObject(instance->GetData64(DATA_GO_ABEDNEUM), true);
                        }

                        if (Creature* temp = Unit::GetCreature(*me, uiControllerGUID))
                        {
                            CAST_AI(mob_tribuna_controller::mob_tribuna_controllerAI, temp->AI())->activatedByBrann = false;
                            temp->DealDamage(temp, temp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
                        }
                        bIsBattle = true;
                        SetEscortPaused(false);
                        JumpToNextStep(6500);
                        break;
                    case 29:
                    {
                        DoScriptText(SAY_EVENT_END_02, me);
                        if (instance)
                        {
                            instance->SetData(DATA_BRANN_EVENT, DONE);

                            // Achievement criteria is with spell 59046 which does not exist.
                            // There is thus no way it can be given by casting the spell on the players.
                            instance->UpdateEncounterState(ENCOUNTER_CREDIT_CAST_SPELL, 59046, me);
                        }

                        me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
                        me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);

                        Player* player = GetPlayerForEscort();
                        if (player)
                            player->GroupEventHappens(QUEST_HALLS_OF_STONE, me);

                        JumpToNextStep(5500);
                        break;
                    }
                    case 30:
                        if (instance)
                            if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_ABEDNEUM)))
                                DoScriptText(SAY_EVENT_END_03_ABED, temp);
                        JumpToNextStep(8500);
                        break;
                    case 31:
                        DoScriptText(SAY_EVENT_END_04, me);
                        JumpToNextStep(11500);
                        break;
                    case 32:
                        if (instance)
                            if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_ABEDNEUM)))
                                DoScriptText(SAY_EVENT_END_05_ABED, temp);
                            JumpToNextStep(11500);
                        break;
                    case 33:
                        DoScriptText(SAY_EVENT_END_06, me);
                        JumpToNextStep(4500);
                        break;
                    case 34:
                        if (instance)
                            if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_ABEDNEUM)))
                                DoScriptText(SAY_EVENT_END_07_ABED, temp);
                            JumpToNextStep(22500);
                        break;
                    case 35:
                        DoScriptText(SAY_EVENT_END_08, me);
                        JumpToNextStep(7500);
                        break;
                    case 36:
                        if (instance)
                            if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_KADDRAK)))
                                DoScriptText(SAY_EVENT_END_09_KADD, temp);
                        JumpToNextStep(18500);
                        break;
                    case 37:
                        DoScriptText(SAY_EVENT_END_10, me);
                        JumpToNextStep(5500);
                        break;
                    case 38:
                        if (instance)
                            if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_KADDRAK)))
                                DoScriptText(SAY_EVENT_END_11_KADD, temp);
                            JumpToNextStep(20500);
                        break;
                    case 39:
                        DoScriptText(SAY_EVENT_END_12, me);
                        JumpToNextStep(2500);
                        break;
                    case 40:
                        if (instance)
                            if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_KADDRAK)))
                                DoScriptText(SAY_EVENT_END_13_KADD, temp);
                        JumpToNextStep(19500);
                        break;
                    case 41:
                        DoScriptText(SAY_EVENT_END_14, me);
                        JumpToNextStep(10500);
                        break;
                    case 42:
                        if (instance)
                            if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_MARNAK)))
                                DoScriptText(SAY_EVENT_END_15_MARN, temp);
                            JumpToNextStep(6500);
                        break;
                    case 43:
                        DoScriptText(SAY_EVENT_END_16, me);
                        JumpToNextStep(6500);
                        break;
                    case 44:
                        if (instance)
                            if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_MARNAK)))
                                DoScriptText(SAY_EVENT_END_17_MARN, temp);
                            JumpToNextStep(25500);
                        break;
                    case 45:
                        DoScriptText(SAY_EVENT_END_18, me);
                        JumpToNextStep(23500);
                        break;
                    case 46:
                        if (instance)
                            if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_MARNAK)))
                                DoScriptText(SAY_EVENT_END_19_MARN, temp);
                            JumpToNextStep(3500);
                        break;
                    case 47:
                        DoScriptText(SAY_EVENT_END_20, me);
                        JumpToNextStep(8500);
                        break;
                    case 48:
                        if (instance)
                            if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_ABEDNEUM)))
                                DoScriptText(SAY_EVENT_END_21_ABED, temp);
                            JumpToNextStep(5500);
                        break;
                    case 49:
                    {
                        if (instance)
                        {
                            instance->HandleGameObject(instance->GetData64(DATA_GO_TRIBUNAL_CONSOLE), false);
                            instance->HandleGameObject(instance->GetData64(DATA_GO_KADDRAK), false);
                            instance->HandleGameObject(instance->GetData64(DATA_GO_MARNAK), false);
                            instance->HandleGameObject(instance->GetData64(DATA_GO_ABEDNEUM), false);
                            instance->HandleGameObject(instance->GetData64(DATA_GO_SKY_FLOOR), false);
                        }
                        JumpToNextStep(180000);
                        break;
                    }
                    case 50:
                        SetEscortPaused(false);
                        break;
                }
            } else uiPhaseTimer -= uiDiff;

            if (!bIsLowHP && HealthBelowPct(30))
            {
                DoScriptText(SAY_LOW_HEALTH, me);
                bIsLowHP = true;
            }
            else if (bIsLowHP && !HealthBelowPct(30))
                bIsLowHP = false;

            if (!UpdateVictim())
                return;

            DoMeleeAttackIfReady();
        }
示例#11
0
        void UpdateAI(const uint32 diff)
        {
            //Return since we have no target
            if (!UpdateVictim())
                return;

            if ((me->GetHealth()*100 / me->GetMaxHealth()) < 20 && Phase == 1)
            {
                Phase = 2;
                DoScriptText(SAY_PHASE_2, me);
            }

            if ((me->GetHealth()*100 / me->GetMaxHealth()) < 2)
            {
                me->SummonGameObject(GAMEOBJECT_GIVE_OF_THE_OBSERVER, 1634.258667, -295.101166,417.321381,0,0,0,0,0,-10);

                DoScriptText(SAY_DEATH_1, me);
                DoScriptText(SAY_DEATH_2, me);
                DoScriptText(SAY_DEATH_3, me);
                DoScriptText(SAY_DEATH_4, me);

                me->DisappearAndDie();

                _JustDied();

            }

            if (Phase == 1)
            {
                if (!Summon)
                {
                    if (uiPhase_timer <= diff)
                    {
                        switch(uiStep)
                        {
                            case 1: DoScriptText(SAY_SUMMON1, me); break; JumpToNextStep(3000);
                            case 2: DoScriptText(SAY_SUMMON2, me); break; JumpToNextStep(3000);
                            case 3: DoScriptText(SAY_SUMMON3, me); break; JumpToNextStep(3000);
                            case 4: DoScriptText(SAY_ENGADED_FOR_FIRTS_TIME, me); break; JumpToNextStep(3000);
                            case 5: DoScriptText(SAY_AGGRO, me); break;
                            case 6: me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); break;
                            case 7: me->SetReactState(REACT_AGGRESSIVE); break;
                        }
                    }else uiPhase_timer -= diff;
                }

                if(QuantumStrike_Timer <= diff)
                {
                    DoCast(me->getVictim(), m_bIsHeroicMode ? H_SPELL_QUANTUM_STRIKE : SPELL_QUANTUM_STRIKE, true);

                    QuantumStrike_Timer = 4000 + rand()%10000;
                }else QuantumStrike_Timer -= diff;

                if(BigBang_Timer <= diff)
                {
                    DoScriptText(RAND(SAY_BIG_BANG_1,SAY_BIG_BANG_2), me);
                    DoCast(me->getVictim(), m_bIsHeroicMode ? H_SPELL_BIG_BANG : SPELL_BIG_BANG, true);

                    BigBang_Timer = 90000;
                }else BigBang_Timer -= diff;

                if(Ascend_Timer <= diff)
                {
                    DoCast(me->getVictim(),SPELL_ASCEND, true);

                    Ascend_Timer = 480000;
                }else Ascend_Timer -= diff;

                if(PhasePunch_Timer <= diff)
                {
                    DoCast(me->getVictim(),SPELL_PHASE_PUNCH, true);

                    PhasePunch_Timer = 8000;
                }else PhasePunch_Timer -= diff;

                if(CosmicSmash_Timer <= diff)
                {
                    DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), m_bIsHeroicMode ? H_SPELL_COSMIC_SMASH : SPELL_COSMIC_SMASH, true);

                    CosmicSmash_Timer = urand(30000, 60000);
                }else CosmicSmash_Timer -= diff;

                if(Berserk_Timer <= diff)
                {
                    DoScriptText(SAY_BERSERK, me);
                    DoCast(me->getVictim(),SPELL_BERSERK, true);

                    Berserk_Timer = 360000;
                }else Berserk_Timer -= diff;

                DoMeleeAttackIfReady();

                EnterEvadeIfOutOfCombatArea(diff);
            }

            if (Phase == 2)
            {
                if (Enrage)
                {
                    if (Ascend_Timer  <= diff)
                    {
                        DoCast(me, SPELL_ASCEND);
                        DoScriptText(SAY_BERSERK, me);
                        Ascend_Timer = 360000 + rand()%5000;
                        Enrage = false;
                    } else Ascend_Timer -= diff;
                }
            }

            DoMeleeAttackIfReady();
        }