Example #1
0
    void JustDied(Unit* killer)
    {
        if (pInstance)
        {
            pInstance->SetData(DATA_MAL_GANIS_EVENT, DONE);

            // give achievement credit to players. criteria use spell 58630 which doesn't exist.
            if (pInstance)
                pInstance->DoUpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, 58630);
        }
    }
Example #2
0
    void JustDied(Unit* killer)
    {
        DoScriptText(SAY_DEATH,m_creature);

        if (pInstance)
        {
            // cast is not rewarding the achievement.
            // DoCast(SPELL_ACHIEVEMENT_CHECK);
            pInstance->DoUpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2, SPELL_ACHIEVEMENT_CHECK);

            pInstance->SetData(DATA_THARON_JA_EVENT, DONE);
        }
    }
Example #3
0
    void JustDied(Unit *victim)
    {
        DoScriptText(SAY_DEATH, me);
        _JustDied();

        me->setFaction(35);

        if (pInstance)
        {
            // Kill credit
            pInstance->DoUpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, 65074);
            // Knock on Wood
            if (EldersCount == 1)
                pInstance->DoCompleteAchievement(ACHIEVEMENT_KNOCK_ON_WOOD_1);
            // Knock, Knock on Wood 
            if (EldersCount == 2)
                pInstance->DoCompleteAchievement(ACHIEVEMENT_KNOCK_ON_WOOD_2);
            // Knock, Knock, Knock on Wood
            if (EldersCount == 3)
                pInstance->DoCompleteAchievement(ACHIEVEMENT_KNOCK_ON_WOOD_3);
            // Getting Back to Nature
            if (me->HasAura(SPELL_ATTUNED_TO_NATURE))
                if (me->GetAura(SPELL_ATTUNED_TO_NATURE, 0)->GetStackAmount() >= 25)
                    pInstance->DoCompleteAchievement(ACHIEVEMENT_BACK_TO_NATURE);
        }
        
        // Hard mode chest
        // Summon spells not works correctly, chest respawn is infinite
        Position pos;
        me->GetRandomNearPosition(pos, 10);

        switch (EldersCount)
        {
            case 0:
                //DoCast(RAID_MODE(RAID_10_0_SPELL_FREYA_CHEST, RAID_25_0_SPELL_FREYA_CHEST));
                me->SummonGameObject(RAID_MODE(194324, 194328), pos.m_positionX, pos.m_positionY, pos.m_positionZ, 0, 0, 0, 1, 0, 0);
                break;
            case 1:
                //DoCast(RAID_MODE(RAID_10_1_SPELL_FREYA_CHEST, RAID_25_1_SPELL_FREYA_CHEST));
                me->SummonGameObject(RAID_MODE(194325, 194329), pos.m_positionX, pos.m_positionY, pos.m_positionZ, 0, 0, 0, 1, 0, 0);
                break;
            case 2:
                //DoCast(RAID_MODE(RAID_10_2_SPELL_FREYA_CHEST, RAID_25_2_SPELL_FREYA_CHEST));
                me->SummonGameObject(RAID_MODE(194326, 194330), pos.m_positionX, pos.m_positionY, pos.m_positionZ, 0, 0, 0, 1, 0, 0);
                break;
            case 3:
                //DoCast(RAID_MODE(RAID_10_3_SPELL_FREYA_CHEST, RAID_25_3_SPELL_FREYA_CHEST));
                me->SummonGameObject(RAID_MODE(194327, 194331), pos.m_positionX, pos.m_positionY, pos.m_positionZ, 0, 0, 0, 1, 0, 0);
                break;
        }
    }
Example #4
0
    void JustDied(Unit* /*killer*/)
    {
        DoScriptText(SAY_DEATH,me);

        if (pInstance)
        {
            // clean morph on players
            Map::PlayerList const &PlayerList = pInstance->instance->GetPlayers();

            for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
                if (Player *pPlayer = i->getSource())
                    pPlayer->DeMorph();
            // cast is not rewarding the achievement.
            // DoCast(SPELL_ACHIEVEMENT_CHECK);
            pInstance->DoUpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2, SPELL_ACHIEVEMENT_CHECK);

            pInstance->SetData(DATA_THARON_JA_EVENT, DONE);
        }
    }
Example #5
0
 void JustDied(Unit *victim)
 {
     _JustDied();
     DoScriptText(SAY_DEATH, me);
     
     // Achievements
     if (pInstance)
     {
         // Kill credit
         pInstance->DoUpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2, 64899);
         // Getting Cold in Here
         if (!bMoreThanTwoIntenseCold)
             pInstance->DoCompleteAchievement(ACHIEVEMENT_COLD_IN_HERE);
         // I Could Say That This Cache Was Rare
         if (RareCache)
         {
             pInstance->DoCompleteAchievement(ACHIEVEMENT_THIS_CACHE_WAS_RARE);
             pInstance->SetData(DATA_HODIR_RARE_CHEST, GO_STATE_READY);
         }
     }
 }
Example #6
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();
    }