void StartGrandChampionsAttack()
        {
            Creature* pGrandChampion1 = Unit::GetCreature(*me, uiVehicle1GUID);
            Creature* pGrandChampion2 = Unit::GetCreature(*me, uiVehicle2GUID);
            Creature* pGrandChampion3 = Unit::GetCreature(*me, uiVehicle3GUID);

            if (pGrandChampion1 && pGrandChampion2 && pGrandChampion3)
            {
                AggroAllPlayers(pGrandChampion1);
                AggroAllPlayers(pGrandChampion2);
                AggroAllPlayers(pGrandChampion3);
            }
        }
Пример #2
0
        void StartGrandChampionsAttack()
        {
		    //qui se nn si sta attenti con i guid nn aggrano
            Creature* pGrandChampion1 = Unit::GetCreature(*me, uiVehicle1GUID);
            Creature* pGrandChampion2 = Unit::GetCreature(*me, uiVehicle2GUID);
            Creature* pGrandChampion3 = Unit::GetCreature(*me, uiVehicle3GUID);

            if (pGrandChampion1 && pGrandChampion2 && pGrandChampion3)
            {
                AggroAllPlayers(pGrandChampion1);
                AggroAllPlayers(pGrandChampion2);
                AggroAllPlayers(pGrandChampion3);
            }
        }
       void UpdateAI(uint32 uiDiff)
        {
            ScriptedAI::UpdateAI(uiDiff);

            if (uiTimer <= uiDiff)
            {
                switch (uiPhase)
                {
                    case 1:
                        DoSummonGrandChampion(uiSecondBoss);
                        NextStep(10000, true);
                        break;
                    case 2:
                        DoSummonGrandChampion(uiThirdBoss);
                        NextStep(0, false);
                        break;
                    case 3:
                        if (!Champion1List.empty())
                        {
                            for (std::list<uint64>::const_iterator itr = Champion1List.begin(); itr != Champion1List.end(); ++itr)
                                if (Creature* summon = Unit::GetCreature(*me, *itr))
                                    AggroAllPlayers(summon);
                            NextStep(0, false);
                        }
                        break;
                }
            } else uiTimer -= uiDiff;

            if (!UpdateVictim())
                return;
        }
        void UpdateAI(const uint32 uiDiff)
        {
            if (!bDone && GrandChampionsOutVehicle(me))
            {
                bDone = true;

                if (pInstance && me->GetGUID() == pInstance->GetData64(DATA_GRAND_CHAMPION_1))
                    me->SetHomePosition(739.678f, 662.541f, 412.393f, 4.49f);
                else if (pInstance && me->GetGUID() == pInstance->GetData64(DATA_GRAND_CHAMPION_2))
                    me->SetHomePosition(746.71f, 661.02f, 411.69f, 4.6f);
                else if (pInstance && me->GetGUID() == pInstance->GetData64(DATA_GRAND_CHAMPION_3))
                    me->SetHomePosition(754.34f, 660.70f, 412.39f, 4.79f);

                if (pInstance)
                    pInstance->SetData(BOSS_GRAND_CHAMPIONS, IN_PROGRESS);

                EnterEvadeMode();
                bHome = true;
            }

            if (uiPhaseTimer <= uiDiff)
            {
                if (uiPhase == 1)
                {
                    AggroAllPlayers(me);
                    uiPhase = 0;
                }
            } else uiPhaseTimer -= uiDiff;

            if (!UpdateVictim() || me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT))
                return;

            if (uiEviscerateTimer <= uiDiff)
            {
                DoCast(me->getVictim(), SPELL_EVISCERATE);
                uiEviscerateTimer = 22000;
            } else uiEviscerateTimer -= uiDiff;

            if (uiFanKivesTimer <= uiDiff)
            {
                DoCastAOE(SPELL_FAN_OF_KNIVES, false);
                uiFanKivesTimer = 20000;
            } else uiFanKivesTimer -= uiDiff;

            if (uiPosionBottleTimer <= uiDiff)
            {
                if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
                    DoCast(pTarget, SPELL_POISON_BOTTLE);

                uiPosionBottleTimer = 19000;
            } else uiPosionBottleTimer -= uiDiff;

            DoMeleeAttackIfReady();
        }
Пример #5
0
    void SetData(uint32 uiType, uint32 uiData)
    {
        switch (uiType)
        {
            case DATA_START:
                if (GameObject* pGO = GameObject::GetGameObject(*me, pInstance->GetData64(DATA_MAIN_GATE)))
                    pInstance->HandleGameObject(pGO->GetGUID(),true);
			    if (GameObject* pGO = GameObject::GetGameObject(*me, pInstance->GetData64(DATA_MAIN_GATE1)))
                    pInstance->HandleGameObject(pGO->GetGUID(),false);	
                DoScriptText(SAY_START, me);			
                DoSummonGrandChampion(uiFirstBoss);
                NextStep(10000,false,1);
                break;
            case DATA_IN_POSITION: //movement done.		
		        me->SetUnitMovementFlags(MOVEMENTFLAG_WALK_MODE);			
                me->GetMotionMaster()->MovePoint(1,735.898, 651.961, 411.93);
				DoScriptText(SAY_START2, me);
                if (GameObject* pGO = GameObject::GetGameObject(*me, pInstance->GetData64(DATA_MAIN_GATE)))
                    pInstance->HandleGameObject(pGO->GetGUID(),false);
                NextStep(20000,false,3);
                break;
            case DATA_LESSER_CHAMPIONS_DEFEATED:
            {
                ++uiLesserChampions;
                std::list<uint64> TempList;
                if (uiLesserChampions == 3 || uiLesserChampions == 6)
                {
                    switch(uiLesserChampions)
                    {
                        case 3:
                            TempList = Champion2List;
                            break;
                        case 6:
                            TempList = Champion3List;
                            break;
                    }

                    for (std::list<uint64>::const_iterator itr = TempList.begin(); itr != TempList.end(); ++itr)
                        if (Creature* pSummon = Unit::GetCreature(*me, *itr))
                            AggroAllPlayers(pSummon);
                }else if (uiLesserChampions == 9)
                    StartGrandChampionsAttack();

                break;
            }
        }
    }
        void SetData(uint32 uiType, uint32 /*uiData*/)
        {
            switch (uiType)
            {
                case DATA_START:
                    DoSummonGrandChampion(uiFirstBoss);
                    NextStep(10000, false, 1);
                    break;
                case DATA_IN_POSITION: //movement done.
                    me->GetMotionMaster()->MovePoint(1, 735.81f, 661.92f, 412.39f);
                    if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_MAIN_GATE)))
                        instance->HandleGameObject(go->GetGUID(), false);
                    NextStep(10000, false, 3);
                    break;
                case DATA_LESSER_CHAMPIONS_DEFEATED:
                {
                    ++uiLesserChampions;
                    std::list<uint64> TempList;
                    if (uiLesserChampions == 3 || uiLesserChampions == 6)
                    {
                        switch (uiLesserChampions)
                        {
                            case 3:
                                TempList = Champion2List;
                                break;
                            case 6:
                                TempList = Champion3List;
                                break;
                        }

                        for (std::list<uint64>::const_iterator itr = TempList.begin(); itr != TempList.end(); ++itr)
                            if (Creature* summon = Unit::GetCreature(*me, *itr))
                                AggroAllPlayers(summon);
                    }else if (uiLesserChampions == 9)
                        StartGrandChampionsAttack();

                    break;
                }
            }
        }
Пример #7
0
        void SetData(uint32 uiType, uint32 /*uiData*/) override
        {
            switch (uiType)
            {
                case DATA_START:
                    if (GameObject* gate = ObjectAccessor::GetGameObject(*me, instance->GetData64(DATA_MAIN_GATE)))
                        instance->HandleGameObject(gate->GetGUID(),true);
                    if (GameObject* gate = ObjectAccessor::GetGameObject(*me, instance->GetData64(DATA_MAIN_GATE1)))
                        instance->HandleGameObject(gate->GetGUID(),false);
                    DoSummonGrandChampion(uiFirstBoss);
                    events.ScheduleEvent(EVENT_SUMMON_FACTION_2, 10000, 0, PHASE_INPROGRESS);
                    break;
                case DATA_LESSER_CHAMPIONS_DEFEATED:
                {
                    ++uiLesserChampions;
                    std::list<uint64> TempList;
                    if (uiLesserChampions == 3 || uiLesserChampions == 6)
                    {
                        switch(uiLesserChampions)
                        {
                            case 3:
                                TempList = Champion2List;
                                break;
                            case 6:
                                TempList = Champion3List;
                                break;
                        }

                        for(std::list<uint64>::const_iterator itr = TempList.begin(); itr != TempList.end(); ++itr)
                            if (Creature* summon = ObjectAccessor::GetCreature(*me, *itr))
                                AggroAllPlayers(summon);
                    } else if (uiLesserChampions == 9)
                        StartGrandChampionsAttack();
                    break;
                }
            }
        }
Пример #8
0
        void UpdateAI(const uint32 uiDiff)
        {
            if (!bDone && GrandChampionsOutVehicle(me))
            {
                bDone = true;

                if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_1))
                    me->SetHomePosition(739.678f, 662.541f, 412.393f, 4.49f);
                else if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_2))
                    me->SetHomePosition(746.71f, 661.02f, 411.69f, 4.6f);
                else if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_3))
                    me->SetHomePosition(754.34f, 660.70f, 412.39f, 4.79f);

                if (instance)
                    instance->SetData(BOSS_GRAND_CHAMPIONS, IN_PROGRESS);

                EnterEvadeMode();
                bHome = true;
            }

            if (uiPhaseTimer <= uiDiff)
            {
                if (uiPhase == 1)
                {
                    AggroAllPlayers(me);
                    uiPhase = 0;
                }
            }else uiPhaseTimer -= uiDiff;

            if (!UpdateVictim() || me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT))
                return;

            if (uiLightningArrowsTimer <= uiDiff)
            {
                DoCastAOE(SPELL_LIGHTNING_ARROWS, false);
                uiLightningArrowsTimer = 7000;
            } else uiLightningArrowsTimer -= uiDiff;

            if (uiShootTimer <= uiDiff)
            {
                if (Unit* target = SelectTarget(SELECT_TARGET_FARTHEST, 0, 30.0f))
                {
                    uiTargetGUID = target->GetGUID();
                    DoCast(target, SPELL_SHOOT);
                }
                uiShootTimer = 12000;
                uiMultiShotTimer = 3000;
                bShoot = true;
            } else uiShootTimer -= uiDiff;

            if (bShoot && uiMultiShotTimer <= uiDiff)
            {
                me->InterruptNonMeleeSpells(true);
                Unit* target = Unit::GetUnit(*me, uiTargetGUID);

                if (target && me->IsInRange(target, 5.0f, 30.0f, false))
                {
                    DoCast(target, SPELL_MULTI_SHOT);
                }
                else
                {
                    Map::PlayerList const& players = me->GetMap()->GetPlayers();
                    if (me->GetMap()->IsDungeon() && !players.isEmpty())
                    {
                        for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
                        {
                            Player* player = itr->getSource();
                            if (player && !player->isGameMaster() && me->IsInRange(player, 5.0f, 30.0f, false))
                            {
                                DoCast(player, SPELL_MULTI_SHOT);
                                break;
                            }
                        }
                    }
                }
                bShoot = false;
            } else uiMultiShotTimer -= uiDiff;

            DoMeleeAttackIfReady();
        }
Пример #9
0
        void UpdateAI(const uint32 uiDiff)
        {
            if (!bDone && GrandChampionsOutVehicle(me))
            {
                bDone = true;

                if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_1))
                    me->SetHomePosition(739.678f, 662.541f, 412.393f, 4.49f);
                else if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_2))
                    me->SetHomePosition(746.71f, 661.02f, 411.69f, 4.6f);
                else if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_3))
                    me->SetHomePosition(754.34f, 660.70f, 412.39f, 4.79f);

                if (instance)
                    instance->SetData(BOSS_GRAND_CHAMPIONS, IN_PROGRESS);

                EnterEvadeMode();
                bHome = true;
            }

            if (uiPhaseTimer <= uiDiff)
            {
                if (uiPhase == 1)
                {
                    AggroAllPlayers(me);
                    uiPhase = 0;
                }
            }else uiPhaseTimer -= uiDiff;

            if (!UpdateVictim() || me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT))
                return;

            if (uiChainLightningTimer <= uiDiff)
            {
                if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
                    DoCast(target, SPELL_CHAIN_LIGHTNING);

                uiChainLightningTimer = 16000;
            } else uiChainLightningTimer -= uiDiff;

            if (uiHealingWaveTimer <= uiDiff)
            {
                bool bChance = urand(0, 1);

                if (!bChance)
                {
                    if (Unit* pFriend = DoSelectLowestHpFriendly(40))
                        DoCast(pFriend, SPELL_HEALING_WAVE);
                } else
                    DoCast(me, SPELL_HEALING_WAVE);

                uiHealingWaveTimer = 12000;
            } else uiHealingWaveTimer -= uiDiff;

            if (uiEartShieldTimer <= uiDiff)
            {
                DoCast(me, SPELL_EARTH_SHIELD);

                uiEartShieldTimer = urand(30000, 35000);
            } else uiEartShieldTimer -= uiDiff;

            if (uiHexMendingTimer <= uiDiff)
            {
                DoCastVictim(SPELL_HEX_OF_MENDING, true);

                uiHexMendingTimer = urand(20000, 25000);
            } else uiHexMendingTimer -= uiDiff;

            DoMeleeAttackIfReady();
        }
Пример #10
0
        void UpdateAI(const uint32 uiDiff)
        {
            if (!bDone && GrandChampionsOutVehicle(me))
            {
                bDone = true;

                if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_1))
                    me->SetHomePosition(739.678f, 662.541f, 412.393f, 4.49f);
                else if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_2))
                    me->SetHomePosition(746.71f, 661.02f, 411.69f, 4.6f);
                else if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_3))
                    me->SetHomePosition(754.34f, 660.70f, 412.39f, 4.79f);

                if (instance)
                    instance->SetData(BOSS_GRAND_CHAMPIONS, IN_PROGRESS);

                EnterEvadeMode();
                bHome = true;
            }

            if (uiPhaseTimer <= uiDiff)
            {
                if (uiPhase == 1)
                {
                    AggroAllPlayers(me);
                    uiPhase = 0;
                }
            }else uiPhaseTimer -= uiDiff;

            if (uiFireBallTimer <= uiDiff)
            {
                if (me->getVictim())
                    DoCastVictim(SPELL_FIREBALL);
                uiFireBallTimer = 5000;
            } else uiFireBallTimer -= uiDiff;

            if (!UpdateVictim() || me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT))
                return;

            if (uiFireBallTimer <= uiDiff)
            {
                DoCastVictim(SPELL_FIREBALL);
                uiFireBallTimer = 5000;
            } else uiFireBallTimer -= uiDiff;

            if (uiPolymorphTimer <= uiDiff)
            {
                if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
                    DoCast(target, SPELL_POLYMORPH);
                uiPolymorphTimer = 8000;
            } else uiPolymorphTimer -= uiDiff;

            if (uiBlastWaveTimer <= uiDiff)
            {
                DoCastAOE(SPELL_BLAST_WAVE, false);
                uiBlastWaveTimer = 13000;
            } else uiBlastWaveTimer -= uiDiff;

            if (uiHasteTimer <= uiDiff)
            {
                me->InterruptNonMeleeSpells(true);

                DoCast(me, SPELL_HASTE);
                uiHasteTimer = 22000;
            } else uiHasteTimer -= uiDiff;

            DoMeleeAttackIfReady();
        }
Пример #11
0
        void UpdateAI(const uint32 uiDiff)
        {
            if (!bDone && GrandChampionsOutVehicle(me))
            {
                bDone = true;

                if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_1))
                    me->SetHomePosition(739.678f, 662.541f, 412.393f, 4.49f);
                else if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_2))
                    me->SetHomePosition(746.71f, 661.02f, 411.69f, 4.6f);
                else if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_3))
                    me->SetHomePosition(754.34f, 660.70f, 412.39f, 4.79f);

                EnterEvadeMode();
                bHome = true;
            }

            if (uiPhaseTimer <= uiDiff)
            {
                if (uiPhase == 1)
                {
                    AggroAllPlayers(me);
                    uiPhase = 0;
                }
            }else uiPhaseTimer -= uiDiff;

            if (!UpdateVictim() || me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT))
                return;

            if (uiInterceptTimer <= uiDiff)
            {
                Map::PlayerList const& players = me->GetMap()->GetPlayers();
                if (me->GetMap()->IsDungeon() && !players.isEmpty())
                {
                    for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
                    {
                        Player* player = itr->getSource();
                        if (player && !player->isGameMaster() && me->IsInRange(player, 8.0f, 25.0f, false))
                        {
                            DoResetThreat();
                            me->AddThreat(player, 5.0f);
                            DoCast(player, SPELL_INTERCEPT);
                            break;
                        }
                    }
                }
                uiInterceptTimer = 7000;
            } else uiInterceptTimer -= uiDiff;

            if (uiBladeStormTimer <= uiDiff)
            {
                DoCastVictim(SPELL_BLADESTORM);
                uiBladeStormTimer = urand(15000, 20000);
            } else uiBladeStormTimer -= uiDiff;

            if (uiMortalStrikeTimer <= uiDiff)
            {
                DoCastVictim(SPELL_MORTAL_STRIKE);
                uiMortalStrikeTimer = urand(8000, 12000);
            } else uiMortalStrikeTimer -= uiDiff;

            DoMeleeAttackIfReady();
        }
Пример #12
0
 void JustSummoned(Creature* summon) override
 {
     SummonList.push_back(summon->GetGUID());
     AggroAllPlayers(summon);
 }
Пример #13
0
 void UpdateAI(uint32 diff) override
 {
     if (!(thrallGUID || garroshGUID || varianGUID || proudmooreGUID || tirionGUID))
         return;
         
     events.Update(diff);
         
     while (uint32 eventId = events.ExecuteEvent())
     {
         switch (eventId)
         {
             case EVENT_INTRO_1:
                 instance->DoCastSpellOnPlayers(SPELL_HERALD_ARGENT);
                 Talk(SAY_INTRO_HERALD_1);
                 events.ScheduleEvent(EVENT_INTRO_2, 5000, 0, PHASE_INTRO);
                 break;
             case EVENT_INTRO_2:
                 if (Creature* tirion = ObjectAccessor::GetCreature(*me, tirionGUID))
                     tirion->AI()->Talk(SAY_INTRO_HERALD_2);
                 events.ScheduleEvent(EVENT_INTRO_3, 13000, 0, PHASE_INTRO);
                 break;
             case EVENT_INTRO_3:
                 if (instance->GetData(DATA_TEAM_IN_INSTANCE) == HORDE)
                 {
                     if (Creature* thrall = ObjectAccessor::GetCreature(*me, thrallGUID))
                         thrall->AI()->Talk(H_SAY_INTRO_HERALD_3);
                 }
                 else
                     if (Creature* varian = ObjectAccessor::GetCreature(*me, varianGUID))
                         varian->AI()->Talk(A_SAY_INTRO_HERALD_3);
                 events.ScheduleEvent(EVENT_INTRO_4, 4000, 0, PHASE_INTRO);
                 break;
             case EVENT_INTRO_4:
                 if (instance->GetData(DATA_TEAM_IN_INSTANCE) == HORDE)
                 {
                     if (Creature* garrosh = ObjectAccessor::GetCreature(*me, garroshGUID))
                         garrosh->AI()->Talk(H_SAY_INTRO_HERALD_4);
                 }
                 else
                     if (Creature* proudmoore = ObjectAccessor::GetCreature(*me, proudmooreGUID))
                         proudmoore->AI()->Talk(A_SAY_INTRO_HERALD_4);
                 events.ScheduleEvent(EVENT_INTRO_5, 4000, 0, PHASE_INTRO);
                 break;
             case EVENT_INTRO_5:
                 if (instance->GetData(DATA_TEAM_IN_INSTANCE) == HORDE)
                 {
                     if (Creature* varian = ObjectAccessor::GetCreature(*me, varianGUID))
                         varian->AI()->Talk(SAY_INTRO_HERALD_5);
                 }
                 else
                     if (Creature* garrosh = ObjectAccessor::GetCreature(*me, garroshGUID))
                         garrosh->AI()->Talk(SAY_INTRO_HERALD_5);
                 events.ScheduleEvent(EVENT_INTRO_6, 6000, 0, PHASE_INTRO);
                 break;
             case EVENT_INTRO_6:
                 if (instance->GetData(DATA_TEAM_IN_INSTANCE) == HORDE)
                 {
                     if (Creature* proudmoore = ObjectAccessor::GetCreature(*me, proudmooreGUID))
                         proudmoore->AI()->Talk(H_SAY_INTRO_HERALD_6);
                 }
                 else
                     if (Creature* thrall = ObjectAccessor::GetCreature(*me, thrallGUID))
                         thrall->AI()->Talk(A_SAY_INTRO_HERALD_6);
                 events.ScheduleEvent(EVENT_INTRO_7, 6000, 0, PHASE_INTRO);
                 break;
             case EVENT_INTRO_7:
                 if (Creature* tirion = ObjectAccessor::GetCreature(*me, tirionGUID))
                     tirion->AI()->Talk(SAY_INTRO_HERALD_7);
                 events.ScheduleEvent(EVENT_INTRO_8, 1000, 0, PHASE_INTRO);
                 break;
             case EVENT_INTRO_8:
                 me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
                 events.SetPhase(PHASE_INPROGRESS);
                 break;
             case EVENT_SUMMON_FACTION_2:
                 DoSummonGrandChampion(uiSecondBoss);
                 events.ScheduleEvent(EVENT_SUMMON_FACTION_3, 10000, 0, PHASE_INPROGRESS);
                 break;
             case EVENT_SUMMON_FACTION_3:
                 DoSummonGrandChampion(uiThirdBoss);
                 break;
             case EVENT_AGGRO_FACTION:
                 if (!Champion1List.empty())
                 {
                     for(std::list<uint64>::const_iterator itr = Champion1List.begin(); itr != Champion1List.end(); ++itr)
                         if (Creature* summon = ObjectAccessor::GetCreature(*me, *itr))
                             AggroAllPlayers(summon);
                 }
                 break;
             case EVENT_PALETRESS_1:
                 Talk(SAY_PALETRESS_INTRO_1);
                 Talk(SAY_PALETRESS_INTRO_2);
                 events.ScheduleEvent(EVENT_PALETRESS_2, 5000, 0, PHASE_INPROGRESS);
                 break;
             case EVENT_PALETRESS_2:
                 if (Creature* argentchamp = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_ARGENT_CHAMPION)))
                     argentchamp->AI()->Talk(SAY_PALETRESS_INTRO_3);
                 events.ScheduleEvent(EVENT_PALETRESS_3, 5000);
             case EVENT_PALETRESS_3:
                 if (Creature* argentchamp = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_ARGENT_CHAMPION)))
                     argentchamp->AI()->Talk(SAY_PALETRESS_INTRO_4);
                 events.CancelEvent(EVENT_PALETRESS_3);
                 break;
             case EVENT_EADRIC_1:
                 Talk(SAY_EADRIC_INTRO_1);
                 Talk(SAY_EADRIC_INTRO_2);
                 events.ScheduleEvent(EVENT_EADRIC_2, 5000);
                 break;
             case EVENT_EADRIC_2:
                 if (Creature* argentchamp = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_ARGENT_CHAMPION)))
                     argentchamp->AI()->Talk(SAY_EADRIC_INTRO_3);
                 break;
         }
     }
 }
        void SetData(uint32 type, uint32 data)
        {
            switch(type)
            {
            case BOSS_GRAND_CHAMPIONS:
                m_auiEncounter[0] = data;
                if (data == SPECIAL)
                {
                    for (std::list<uint64>::const_iterator itr = VehicleList.begin(); itr != VehicleList.end(); ++itr)
                        if (Creature* summon = instance->GetCreature(*itr))
                            summon->RemoveFromWorld();
                } else if (data == IN_PROGRESS)
                {
                    for (uint8 i=0; i<3; i++)
                        if (Creature* boss = instance->GetCreature(grandChampionGUID[i]))
                            AggroAllPlayers(boss);
                } else if (data == DONE)
                {
                    DoUpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, SPELL_ACHIEVEMENT_CHAMPIONS);
                    if (Creature* announcer =  instance->GetCreature(uiAnnouncerGUID))
                    {
                        announcer->GetMotionMaster()->MovePoint(0, 742.742f, 630.207f, 411.172f);
                        announcer->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
                        announcer->SummonGameObject(instance->IsHeroic()? GO_CHAMPIONS_LOOT_H : GO_CHAMPIONS_LOOT, 746.59f, 618.49f, 411.09f, 1.42f, 0, 0, 0, 0, 90000000);
                    }
                }
                break;
            case BOSS_ARGENT_CHALLENGE_E:
                m_auiEncounter[1] = data;
                if (data == DONE)
                {
                    if (Creature* announcer = instance->GetCreature(uiAnnouncerGUID))
                    {
                        DoUpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, SPELL_ACHIEVEMENT_EADRIC);
                        announcer->GetMotionMaster()->MovePoint(0, 742.742f, 630.207f, 411.172f);
                        announcer->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
                        announcer->SummonGameObject(instance->IsHeroic()? GO_EADRIC_LOOT_H : GO_EADRIC_LOOT, 746.59f, 618.49f, 411.09f, 1.42f, 0, 0, 0, 0, 90000000);
                    }
                }
                break;
            case BOSS_ARGENT_CHALLENGE_P:
                m_auiEncounter[2] = data;
                if (data == DONE)
                {
                    if (Creature* announcer = instance->GetCreature(uiAnnouncerGUID))
                    {
                        DoUpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, SPELL_ACHIEVEMENT_PALETRESS);
                        DoUpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, SPELL_ACHIEVEMENT_MEMORIES);
                        announcer->GetMotionMaster()->MovePoint(0, 742.742f, 630.207f, 411.172f);
                        announcer->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
                        announcer->SummonGameObject(instance->IsHeroic()? GO_PALETRESS_LOOT_H : GO_PALETRESS_LOOT, 746.59f, 618.49f, 411.09f, 1.42f, 0, 0, 0, 0, 90000000);
                    }
                }
                break;
            case BOSS_BLACK_KNIGHT:
                m_auiEncounter[3] = data;
                if (data == DONE)
                    DoUpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, SPELL_ACHIEVEMENT_BLACK_KNIGHT);
                break;
            case DATA_GRAND_CHAMPION_ENTRY:
                for (uint8 i=0; i<3; i++)
                {
                    if (grandChampionEntry[i] == 0)
                    {
                        grandChampionEntry[i] = data;
                        return;
                    }
                }
                break;
            case DATA_MEMORY_ENTRY:
                memoryEntry = data;
                break;
            case DATA_I_VE_HAD_WORSE:
                achievementHadWorse = (bool)data;
                break;
            }

            if (type != DATA_I_VE_HAD_WORSE)
            {
                if (data == DONE || data == FAIL)
                    HandleGameObject(GetData64(DATA_PORTCULLIS), true);
                else if (data == IN_PROGRESS)
                    HandleGameObject(GetData64(DATA_PORTCULLIS), false);

                if (data == DONE)
                    SaveToDB();
            }
        }
        void SetData(uint32 uiType, uint32 uiData)
        {
            switch(uiType)
            {
            case DATA_BLACK_KNIGHT:
                uiBlackKnightEvent = uiData;
                if (uiData == NOT_STARTED)
                {
                    if (Creature* pBlackKnight =  instance->GetCreature(uiBlackKnightGUID))
                    {
                        pBlackKnight->setFaction(35);
                        pBlackKnight->SetReactState(REACT_DEFENSIVE);
                        pBlackKnight->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
                    }
                }else if (uiData == IN_PROGRESS)
                {
                    if (Creature* pBlackKnight =  instance->GetCreature(uiBlackKnightGUID))
                    {
                        DoScriptText(SAY_BLACK_KNIGHT_1, pBlackKnight);
                    }
                }else if (uiData == DONE)
                {
                    if (Creature* pBlackKnight =  instance->GetCreature(uiBlackKnightGUID))
                    {
                        if (Creature* pAnnouncer =  instance->GetCreature(uiAnnouncerGUID))
                        {
                            if (Creature* pAnnouncer =  instance->GetCreature(uiAnnouncerGUID))
                            pBlackKnight->CastSpell(pAnnouncer,SPELL_DEATH_RESPITE,true);
                        }
                    }
                }
                break;
            case DATA_KNIGHT:
                uiBlackKnightEvent2 = uiData;
                if (uiData == NOT_STARTED)
                {
                    if (Creature* pBlackKnight =  instance->GetCreature(uiBlackKnightGUID))
                    {
                        pBlackKnight->SetOrientation(4.714f);

	    pBlackKnight->SetReactState(REACT_PASSIVE);
            pBlackKnight->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE);
                    }
                }else if (uiData == IN_PROGRESS)
                {
                    if (Creature* pBlackKnight =  instance->GetCreature(uiBlackKnightGUID))
                    {
                        DoScriptText(SAY_BLACK_KNIGHT_2, pBlackKnight);
                        if (Creature* pAnnouncer =  instance->GetCreature(uiAnnouncerGUID))
                        {
                            pAnnouncer->setDeathState(JUST_DIED);
                        }
                    }
                }else if (uiData == DONE)
                {
                    if (Creature* pBlackKnight =  instance->GetCreature(uiBlackKnightGUID))
                    {
                        pBlackKnight->setFaction(14);
                        pBlackKnight->SetReactState(REACT_AGGRESSIVE);
                        pBlackKnight->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
                        AggroAllPlayers(pBlackKnight);
                        if (Creature* pAnnouncer =  instance->GetCreature(uiAnnouncerGUID))
                        {
                            pAnnouncer->DisappearAndDie();
                            if (Creature* pGhoul = pAnnouncer->SummonCreature(NPC_RISEN_JAEREN,pAnnouncer->GetPositionX(),pAnnouncer->GetPositionY(),pAnnouncer->GetPositionZ(),pAnnouncer->GetOrientation()))
                            {
                                pGhoul->setFaction(14);
                                AggroAllPlayers(pGhoul);
                            }
                        }
                    }
                }
                break;
                case DATA_MOVEMENT_DONE:
                    uiMovementDone = uiData;
                    if (uiMovementDone == 3)
                    {
                        if (Creature* pAnnouncer =  instance->GetCreature(uiAnnouncerGUID))
                            pAnnouncer->AI()->SetData(DATA_IN_POSITION, 0);
                    }
                    break;
                case BOSS_GRAND_CHAMPIONS:
                    m_auiEncounter[0] = uiData;
                    if (uiData == IN_PROGRESS)
                    {
                        for (std::list<uint64>::const_iterator itr = VehicleList.begin(); itr != VehicleList.end(); ++itr)
                            if (Creature* summon = instance->GetCreature(*itr))
                                summon->RemoveFromWorld();
                    }else if (uiData == DONE)
                    {
                        ++uiGrandChampionsDeaths;
                        if (uiGrandChampionsDeaths >= 3)
                        {
                            if (Creature* pAnnouncer =  instance->GetCreature(uiAnnouncerGUID))
                            {
                            DoScriptText(SAY_START_1, pAnnouncer);
                                pAnnouncer->GetMotionMaster()->MovePoint(0,748.309f,619.487f,411.171f);
                                pAnnouncer->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
                                pAnnouncer->SummonGameObject(instance->IsHeroic()? GO_CHAMPIONS_LOOT_H : GO_CHAMPIONS_LOOT,746.59f,618.49f,411.09f,1.42f,0, 0, 0, 0,90000000);
                            }
                        }
                    }
                    break;
                case DATA_ARGENT_SOLDIER_DEFEATED:
                    uiArgentSoldierDeaths = uiData;
                    if (uiArgentSoldierDeaths == 9)
                    {
                        if (Creature* pBoss =  instance->GetCreature(uiArgentChampionGUID))
                        {
                            pBoss->GetMotionMaster()->MovePoint(0,746.88f,618.74f,411.06f);
                            pBoss->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE);
                        pBoss->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NOT_SELECTABLE);
                            pBoss->SetReactState(REACT_AGGRESSIVE);
                        AggroAllPlayers(pBoss);
                    }
                    if (Creature* pAnnouncer = instance->GetCreature(uiAnnouncerGUID))
                    {
                        DoScriptText(SAY_START_2, pAnnouncer);
                        }
                    }
                    break;
                case BOSS_ARGENT_CHALLENGE_E:
                    m_auiEncounter[1] = uiData;
                if (uiData == IN_PROGRESS)
                {
                    for(std::list<uint64>::const_iterator itr = VehicleList.begin(); itr != VehicleList.end(); ++itr)
                        if (Creature* summon = instance->GetCreature(*itr))
                            summon->RemoveFromWorld();
                }else if (uiData == DONE)
                    {
                    if (Creature* pAnnouncer = instance->GetCreature(uiAnnouncerGUID))
                    {
                     DoScriptText(SAY_START_1, pAnnouncer);

                        pAnnouncer->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
                        pAnnouncer->GetMotionMaster()->MovePoint(0,740.755f, 636.509f, 411.575f);
                        pAnnouncer->SummonGameObject(instance->IsHeroic()? GO_EADRIC_LOOT_H : GO_EADRIC_LOOT,746.59f,618.49f,411.09f,1.42f,0, 0, 0, 0,90000000);
                    }
                }
                    break;
                case BOSS_ARGENT_CHALLENGE_P:
                    m_auiEncounter[2] = uiData;
                if (uiData == IN_PROGRESS)
                {
                    for(std::list<uint64>::const_iterator itr = VehicleList.begin(); itr != VehicleList.end(); ++itr)
                        if (Creature* summon = instance->GetCreature(*itr))
                            summon->RemoveFromWorld();
                }else if (uiData == DONE)
                    {
                    if (Creature* pAnnouncer = instance->GetCreature(uiAnnouncerGUID))
                    {
                     DoScriptText(SAY_START_1, pAnnouncer);
                        pAnnouncer->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
                        pAnnouncer->GetMotionMaster()->MovePoint(0,740.755f, 636.509f, 411.575f);
                        pAnnouncer->SummonGameObject(instance->IsHeroic()? GO_PALETRESS_LOOT_H : GO_PALETRESS_LOOT,746.59f,618.49f,411.09f,1.42f,0, 0, 0, 0,90000000);
                    }
                }
                    break;
            }

            if (uiData == DONE)
                SaveToDB();
        }
Пример #16
0
        void SetData(uint32 type, uint32 data)
        {
            if (!instance)
                return;

            switch (type)
            {
                case DATA_START:
                    if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_MAIN_GATE)))
                        instance->HandleGameObject(go->GetGUID(), true);
                    if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_PORTCULLIS)))
                        instance->HandleGameObject(go->GetGUID(), false);
                    instance->SetData(DATA_MOVEMENT_DONE, 0);

                    DoScriptText(SAY_START, me);
                    DoSummonGrandChampion(firstBoss);
                    NextStep(10000, false, 1);
                    break;
                case DATA_IN_POSITION: // movement done.
                    me->GetMotionMaster()->MovePoint(1, 735.81f, 661.92f, 412.39f);
                    if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_MAIN_GATE)))
                        instance->HandleGameObject(go->GetGUID(), false);
                    NextStep(10000, false, 3);
                    break;
                case DATA_LESSER_CHAMPIONS_DEFEATED:
                {
                    ++lesserChampions;
                    std::list<uint64> tempList;
                    if (lesserChampions == 3 || lesserChampions == 6)
                    {
                        switch (lesserChampions)
                        {
                            case 3:
                                tempList = Champion2List;
                                break;
                            case 6:
                                tempList = Champion3List;
                                break;
                        }

                        for (std::list<uint64>::const_iterator itr = tempList.begin(); itr != tempList.end(); ++itr)
                            if (Creature* summon = Unit::GetCreature(*me, *itr))
                                AggroAllPlayers(summon);
                    }
                    else if (lesserChampions == 9)
                        StartGrandChampionsAttack();

                    break;
                }
                case DATA_GRAND_CHAMPIONS_DEFEATED:
                    defeatedGrandChampions = data;
                    if (defeatedGrandChampions == 3)
                    {
                        for (uint8 i = 0; i < 3; ++i)
                            if (Creature* GrandChampion = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_GRAND_CHAMPION_1 + i)))
                            {
                                switch (i)
                                {
                                    case 0: GrandChampion->SetHomePosition(739.678f, 662.541f, 412.393f, 4.6f); break;
                                    case 1: GrandChampion->SetHomePosition(746.71f, 661.02f, 411.69f, 4.6f); break;
                                    case 2: GrandChampion->SetHomePosition(754.34f, 660.70f, 412.39f, 4.6f); break;
                                }
                                GrandChampion->AI()->SetData(10, 0);
                            }

                        instance->SetData(BOSS_GRAND_CHAMPIONS, IN_PROGRESS);
                    }
                    break;
            }
        }
Пример #17
0
 void StartGrandChampionsAttack()
 {
     for (uint8 i = 0; i < 3; ++i)
         if (Creature* GrandChampion = ObjectAccessor::GetCreature(*me, instance ? instance->GetData64(DATA_GRAND_CHAMPION_1 + i) : 0))
             AggroAllPlayers(GrandChampion);
 }
Пример #18
0
 void JustSummoned(Creature* pSummon)
 {
     SummonList.push_back(pSummon->GetGUID());
     AggroAllPlayers(pSummon);
 }
Пример #19
0
        void SetData(uint32 uiType, uint32 uiData)
        {
            switch (uiType)
            {
                case DATA_START:
                    if (GameObject* pGO = GameObject::GetGameObject(*me, pInstance->GetData64(DATA_MAIN_GATE)))
                        pInstance->HandleGameObject(pGO->GetGUID(),true);
			        if (GameObject* pGO = GameObject::GetGameObject(*me, pInstance->GetData64(DATA_MAIN_GATE1)))
                        pInstance->HandleGameObject(pGO->GetGUID(),false);	
                    DoScriptText(SAY_START, me);			
                    DoSummonGrandChampion(uiFirstBoss);
    				
				    NextStep(10000,false,1);
                    break;
                case DATA_IN_POSITION: //movement done.		
		            me->SetUnitMovementFlags(MOVEMENTFLAG_WALKING);			
                    me->GetMotionMaster()->MovePoint(1, 735.898f, 651.961f, 411.93f);
				    DoScriptText(SAY_START2, me);
                    if (GameObject* pGO = GameObject::GetGameObject(*me, pInstance->GetData64(DATA_MAIN_GATE)))
                        pInstance->HandleGameObject(pGO->GetGUID(),false);
                    NextStep(20000,false,3);
                    break;
			    case DATA_RESET:
				    me->GetMotionMaster()->MovePoint(2, 746.626f, 618.54f, 411.09f);
    				
				    uiSummonTimes = 0;
				    uiPosition = 0;
				    uiLesserChampions = 0;

				    uiFirstBoss = 0;
				    uiSecondBoss = 0;
				    uiThirdBoss = 0;

				    uiArgentChampion = 0;

				    uiPhase = 0;
				    uiTimer = 0;

				    uiVehicle1GUID = 0;
				    uiVehicle2GUID = 0;
				    uiVehicle3GUID = 0;

				    Champion1List.clear();
				    Champion2List.clear();
				    Champion3List.clear();
    			
				    me->SetReactState(REACT_PASSIVE);
				    me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
				    me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
				    SetGrandChampionsForEncounter();
				    SetArgentChampion();

				    break;
                case DATA_LESSER_CHAMPIONS_DEFEATED:
                {
                    ++uiLesserChampions;
                    std::list<uint64> TempList;
                    if (uiLesserChampions == 3 || uiLesserChampions == 6)
                    {
                        switch(uiLesserChampions)
                        {
                            case 3:
                                TempList = Champion2List;
                                break;
                            case 6:
                                TempList = Champion3List;
                                break;
                        }

                        for(std::list<uint64>::const_iterator itr = TempList.begin(); itr != TempList.end(); ++itr)
                            if (Creature* pSummon = Unit::GetCreature(*me, *itr))
                                AggroAllPlayers(pSummon);
                    }else if (uiLesserChampions == 9)
                        StartGrandChampionsAttack();

                    break;
                }
            }
        }