Example #1
0
 void EnterCombat(Unit *who)
 {
     DoScriptText(SAY_AGGRO, m_creature);
     DoCast(m_creature,SPELL_BAT_FORM);
     pInstance->SetData(DATA_JEKLIKEVENT, IN_PROGRESS);
 }
    void UpdateAI(const uint32 diff)
    {
        if (pInstance)
        {
            if (!leotherasGUID)
                leotherasGUID = pInstance->GetData64(DATA_LEOTHERAS);

            if (!me->isInCombat() && pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER))
            {
                Unit *victim = NULL;
                victim = Unit::GetUnit(*me, pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER));
                if (victim)
                    AttackStart(victim);
            }
        }

        if (!UpdateVictim())
        {
            CastChanneling();
            return;
        }

        if (pInstance && !pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER))
        {
            EnterEvadeMode();
            return;
        }

        if (Mindblast_Timer <= diff)
        {
            Unit *pTarget = NULL;
            pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);

            if (pTarget)DoCast(pTarget, SPELL_MINDBLAST);

            Mindblast_Timer = 10000 + rand()%5000;
        } else Mindblast_Timer -= diff;

        if (Earthshock_Timer <= diff)
        {
            Map* pMap = me->GetMap();
            Map::PlayerList const &PlayerList = pMap->GetPlayers();
            for (Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr)
            {
                if (Player* i_pl = itr->getSource())
                {
                    bool isCasting = false;
                    for (uint8 i = 0; i < CURRENT_MAX_SPELL; ++i)
                        if (i_pl->GetCurrentSpell(i))
                            isCasting = true;

                    if (isCasting)
                    {
                        DoCast(i_pl, SPELL_EARTHSHOCK);
                        break;
                    }
                }
            }
            Earthshock_Timer = 8000 + rand()%7000;
        } else Earthshock_Timer -= diff;
        DoMeleeAttackIfReady();
    }
Example #3
0
 void EnterCombat(Unit* who)
 {
     pInstance->SetData(DATA_ATTUMEN_EVENT, IN_PROGRESS);
 }
 void JustReachedHome() override
 {
     if (m_pInstance)
         m_pInstance->SetData(TYPE_SEPETHREA, FAIL);
 }
 void StartEvent()
 {
     DoScriptText(SAY_AGGRO, me);
     if (pInstance)
         pInstance->SetData(DATA_LEOTHERASTHEBLINDEVENT, IN_PROGRESS);
 }
    void UpdateAI(const uint32 diff)
    {
        if (!EventBegun)
            return;

        if ((me->GetHealth()*100 / me->GetMaxHealth()) < 15 && !HasYelledOnce)
        {
            DoScriptText(SAY_LOW_HEALTH, me);
            HasYelledOnce = true;
        }

        if (ShadeGUID && !StartCombat)
        {
            Creature* Shade = (Unit::GetCreature((*me), ShadeGUID));
            if (Shade && Shade->isAlive())
            {
                if (CAST_AI(boss_shade_of_akamaAI, Shade->AI())->IsBanished)
                {
                    if (CastSoulRetrieveTimer <= diff)
                    {
                        DoCast(Shade, SPELL_AKAMA_SOUL_CHANNEL);
                        CastSoulRetrieveTimer = 60000;
                    } else CastSoulRetrieveTimer -= diff;
                }
                else
                {
                    me->InterruptNonMeleeSpells(false);
                    StartCombat = true;
                }
            }
        }

        if (ShadeHasDied && (WayPointId == 1))
        {
            if (pInstance)
                pInstance->SetData(DATA_SHADEOFAKAMAEVENT, DONE);
            me->GetMotionMaster()->MovePoint(WayPointId, AkamaWP[1].x, AkamaWP[1].y, AkamaWP[1].z);
            ++WayPointId;
        }

        if (!ShadeHasDied && StartCombat)
        {
            if (CheckTimer <= diff)
            {
                if (ShadeGUID)
                {
                    Creature* Shade = Unit::GetCreature((*me), ShadeGUID);
                    if (Shade && !Shade->isAlive())
                    {
                        ShadeHasDied = true;
                        WayPointId = 0;
                        me->SetUnitMovementFlags(MOVEFLAG_WALK_MODE);
                        me->GetMotionMaster()->MovePoint(WayPointId, AkamaWP[0].x, AkamaWP[0].y, AkamaWP[0].z);
                    }
                    if (Shade && Shade->isAlive())
                    {
                        if (Shade->getThreatManager().getThreatList().size() < 2)
                            Shade->AI()->EnterEvadeMode();
                    }
                }
                CheckTimer = 5000;
            } else CheckTimer -= diff;
        }

        if (SummonBrokenTimer && BrokenSummonIndex < 4)
        {
            if (SummonBrokenTimer <= diff)
            {
                for (uint8 i = 0; i < 4; ++i)
                {
                    float x = BrokenCoords[BrokenSummonIndex].x + (i*5);
                    float y = BrokenCoords[BrokenSummonIndex].y + (1*5);
                    float z = BrokenCoords[BrokenSummonIndex].z;
                    float o = BrokenCoords[BrokenSummonIndex].o;
                    Creature* Broken = me->SummonCreature(CREATURE_BROKEN, x, y, z, o, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 360000);
                    if (Broken)
                    {
                        float wx = BrokenWP[BrokenSummonIndex].x + (i*5);
                        float wy = BrokenWP[BrokenSummonIndex].y + (i*5);
                        float wz = BrokenWP[BrokenSummonIndex].z;
                        Broken->GetMotionMaster()->MovePoint(0, wx, wy, wz);
                        Broken->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
                        BrokenList.push_back(Broken->GetGUID());
                    }
                }
                ++BrokenSummonIndex;
                SummonBrokenTimer = 1000;
            } else SummonBrokenTimer -= diff;
        }

        if (SoulRetrieveTimer)
            if (SoulRetrieveTimer <= diff)
            {
                switch (EndingTalkCount)
                {
                case 0:
                    me->HandleEmoteCommand(EMOTE_ONESHOT_ROAR);
                    ++EndingTalkCount;
                    SoulRetrieveTimer = 2000;
                    SummonBrokenTimer = 1;
                    break;
                case 1:
                    DoScriptText(SAY_FREE, me);
                    ++EndingTalkCount;
                    SoulRetrieveTimer = 25000;
                    break;
                case 2:
                    if (!BrokenList.empty())
                    {
                        bool Yelled = false;
                        for (std::list<uint64>::iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr)
                            if (Creature* pUnit = Unit::GetCreature(*me, *itr))
                            {
                                if (!Yelled)
                                {
                                    DoScriptText(SAY_BROKEN_FREE_01, pUnit);
                                    Yelled = true;
                                }
                                pUnit->HandleEmoteCommand(EMOTE_ONESHOT_KNEEL);
                            }
                    }
                    ++EndingTalkCount;
                    SoulRetrieveTimer = 1500;
                    break;
                case 3:
                    if (!BrokenList.empty())
                    {
                        for (std::list<uint64>::iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr)
                            if (Creature* pUnit = Unit::GetCreature(*me, *itr))
                                // This is the incorrect spell, but can't seem to find the right one.
                                pUnit->CastSpell(pUnit, 39656, true);
                    }
                    ++EndingTalkCount;
                    SoulRetrieveTimer = 5000;
                    break;
                case 4:
                    if (!BrokenList.empty())
                    {
                        for (std::list<uint64>::iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr)
                            if (Creature* pUnit = Unit::GetCreature((*me), *itr))
                                pUnit->MonsterYell(SAY_BROKEN_FREE_02, LANG_UNIVERSAL, 0);
                    }
                    SoulRetrieveTimer = 0;
                    break;
                }
            } else SoulRetrieveTimer -= diff;

        if (!UpdateVictim())
            return;

        if (DestructivePoisonTimer <= diff)
        {
            Creature* Shade = Unit::GetCreature((*me), ShadeGUID);
            if (Shade && Shade->isAlive())
                DoCast(Shade, SPELL_DESTRUCTIVE_POISON);
            DestructivePoisonTimer = 15000;
        } else DestructivePoisonTimer -= diff;

        if (LightningBoltTimer <= diff)
        {
            DoCast(me->getVictim(), SPELL_LIGHTNING_BOLT);
            LightningBoltTimer = 10000;
        } else LightningBoltTimer -= diff;

        DoMeleeAttackIfReady();
    }
Example #7
0
    void UpdateAI(const uint32 diff)
    {
        if (!UpdateVictim())
            return;

        if (Phase == 3)
        {
            if (Timer[TIMER_PHASE] <= diff)
            {
                if (!pInstance)
                    return;
                switch(pInstance->GetData(DATA_MURU_EVENT))
                {
                    case NOT_STARTED:
                        Reset();
                        break;
                    case DONE:
                        Phase = 4;
                        me->DisappearAndDie();
                        break;
                }
                Timer[TIMER_PHASE] = 3000;
            } else Timer[TIMER_PHASE] -= diff;
            return;
        }

        if (EnrageTimer <= diff && !me->HasAura(SPELL_ENRAGE, 0))
            DoCast(me, SPELL_ENRAGE, false);
        else EnrageTimer -= diff;

        for (uint8 i = 0; i < 4; ++i)
        {
            if (Timer[i] <= diff)
            {
                switch(i)
                {
                    case TIMER_DARKNESS:
                        if (!DarkFiend)
                        {
                            DoCastAOE(SPELL_DARKNESS, false);
                            Timer[TIMER_DARKNESS] = 3000;
                            DarkFiend = true;
                        }
                        else
                        {
                            DarkFiend = false;
                            for (uint8 i = 0; i < 8; ++i)
                                me->SummonCreature(CREATURE_DARK_FIENDS,DarkFiends[i][0],DarkFiends[i][1],DarkFiends[i][2], DarkFiends[i][3], TEMPSUMMON_CORPSE_DESPAWN, 0);
                            Timer[TIMER_DARKNESS] = 42000;
                        }
                        break;
                    case TIMER_HUMANOIDES:
                        for (uint8 i = 0; i < 6; ++i)
                            me->SummonCreature(Humanoides[i][0],Humanoides[i][1],Humanoides[i][2],Humanoides[i][3], Humanoides[i][4], TEMPSUMMON_CORPSE_DESPAWN, 0);
                        Timer[TIMER_HUMANOIDES] = 60000;
                        break;
                    case TIMER_PHASE:
                        me->RemoveAllAuras();
                        DoCast(me, SPELL_SUMMON_ENTROPIUS, false);
                        Timer[TIMER_PHASE] = 3000;
                        Phase = 3;
                        return;
                    case TIMER_SENTINEL:
                        DoCastAOE(SPELL_OPEN_PORTAL_2, false);
                        Timer[TIMER_SENTINEL] = 30000;
                        break;
                }
                break;
            }
        }

        //Timer
        for (uint8 i = 0; i < 4; ++i)
        {
            if (i != TIMER_PHASE)Timer[i] -= diff;
            else if (Phase == 2) Timer[i] -= diff;
        }
    }
Example #8
0
    void UpdateAI(const uint32 diff)
    {
        if (!UpdateVictim())
            return;
 
        if (Revive_Delay < diff && dead)
        {
            if (Creature *pAuriaya = Unit::GetCreature((*me), m_pInstance->GetData64(TYPE_AURIAYA)))
            {
                if (!pAuriaya->isAlive())
                {
                    me->DisappearAndDie();
                    return;
                }
            }

            me->SetHealth(me->GetMaxHealth());
            me->RemoveAurasDueToSpell(SPELL_FEIGN_DEATH);
            me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
            me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
            dead = false;
        }else Revive_Delay -= diff;

        if (Pounce_Timer < diff)
        {
            if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)){
                DoCast(target, m_bIsRegularMode ? SPELL_FERAL_POUNCE : SPELL_FERAL_POUNCE_H);
                me->AddThreat(target,0.0f);
                me->AI()->AttackStart(target);
            }
            Pounce_Timer = 5000;
        }else Pounce_Timer -= diff;
 
        if (Rush_Start_Timer < diff)
        {
            if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)){
                DoCast(target, m_bIsRegularMode ? SPELL_FERAL_RUSH : SPELL_FERAL_RUSH_H);
                me->AddThreat(target,0.0f);
                me->AI()->AttackStart(target);
            }
            Rush_Start_Timer = 35000;
            Rush_Finish_Timer = 5000;
            Rush_Delay = 500;
        }else Rush_Start_Timer -= diff;
 
        if (Rush_Delay < diff && rush)
        {
            if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)){
                DoCast(target, m_bIsRegularMode ? SPELL_FERAL_RUSH : SPELL_FERAL_RUSH_H);
                me->AddThreat(target,0.0f);
                me->AI()->AttackStart(target);
            }
            Rush_Delay = 500;
        }else Rush_Delay -= diff;
 
        if (Rush_Finish_Timer < diff)
            rush = false;
        else Rush_Finish_Timer -= diff;
 
        
 
        if (stack_delay < diff && !rdy)
        {
            DoCast(me, SPELL_FERAL_ESSENCE);
            if (me->GetAura(SPELL_FERAL_ESSENCE, 0)->GetStackAmount() == 8)
                    rdy = true;
            stack_delay = 500;
        }else stack_delay -= diff;

        DoMeleeAttackIfReady();
    }
Example #9
0
    void UpdateAI(const uint32 uiDiff)
    {
        if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
        {
            if (!m_bIsIntroDone)
            {
                IntroDone();
                return;
            }

            if (m_uiRandChat_Timer < uiDiff)
            {
                DoScriptText(RandomTaunt[rand()%6].id, m_creature);
                m_uiRandChat_Timer = 90000;
            }
            else
                m_uiRandChat_Timer -= uiDiff;

            return;
        }

        if (m_bNeedCheckCube)
            NeedCheckCubeStatus();

        if (m_uiBerserk_Timer < uiDiff)
        {
            DoScriptText(EMOTE_BERSERK, m_creature);
            m_creature->CastSpell(m_creature, SPELL_BERSERK, true);
            m_uiBerserk_Timer = 60000;
        }
        else
            m_uiBerserk_Timer -= uiDiff;

        //Cleave_Timer
        if (m_uiCleave_Timer < uiDiff)
        {
            DoCastSpellIfCan(m_creature->getVictim(), SPELL_CLEAVE);
            m_uiCleave_Timer = 10000;
        }
        else
            m_uiCleave_Timer -= uiDiff;

        if (m_uiQuake_Timer < uiDiff)
        {
            // to avoid blastnova interruption
            if (!m_creature->IsNonMeleeSpellCasted(false))
            {
                int32 i = SPELL_QUAKE_KNOCKBACK;
                m_creature->CastCustomSpell(m_creature, SPELL_QUAKE_TRIGGER, &i, 0, 0, false);
                m_uiQuake_Timer = 50000;
            }
        }
        else
            m_uiQuake_Timer -= uiDiff;

        if (m_uiBlastNova_Timer < uiDiff)
        {
            // to avoid earthquake interruption
            if (!m_creature->hasUnitState(UNIT_STAT_STUNNED))
            {
                DoScriptText(EMOTE_BLASTNOVA, m_creature);
                DoCastSpellIfCan(m_creature, SPELL_BLASTNOVA);
                m_uiBlastNova_Timer = 60000;
            }
        }
        else
            m_uiBlastNova_Timer -= uiDiff;

        if (m_uiBlaze_Timer < uiDiff)
        {
            if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))
            {
                float x, y, z;
                pTarget->GetPosition(x, y, z);
                Creature *summon = m_creature->SummonCreature(NPC_BURNING_ABYSS, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
                if (summon)
                {
                    ((mob_abyssalAI*)summon->AI())->SetTrigger(2);
                    m_creature->CastSpell(summon, SPELL_BLAZE_TARGET, true);
                    summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
                }
            }

            m_uiBlaze_Timer = urand(20000, 40000);
        }
        else
            m_uiBlaze_Timer -= uiDiff;

        if (!m_bIsPhase3 && m_creature->GetHealthPercent() < 30.0f
            && !m_creature->IsNonMeleeSpellCasted(false)    // blast nova
            && !m_creature->hasUnitState(UNIT_STAT_STUNNED))// shadow cage and earthquake
        {
            m_bIsPhase3 = true;
            DoScriptText(SAY_CHAMBER_DESTROY, m_creature);
        }

        if (m_bIsPhase3)
        {
            if (m_uiPhase3_Timer < uiDiff)
            {
                switch (m_uiPhase3_Count)
                {
                    case 0:
                        m_creature->CastSpell(m_creature, SPELL_CAMERA_SHAKE, true);
                        ++m_uiPhase3_Count;
                        m_uiPhase3_Timer = 2000;
                        break;
                    case 1:
                        if (m_pInstance)
                            m_pInstance->SetData(TYPE_HALL_COLLAPSE, IN_PROGRESS);
                        ++m_uiPhase3_Count;
                        m_uiPhase3_Timer = 8000;
                        break;
                    case 2:
                        m_creature->CastSpell(m_creature, SPELL_DEBRIS_KNOCKDOWN, true);
                        ++m_uiPhase3_Count;
                        m_uiPhase3_Timer = 15000;
                        break;
                    case 3:
                        if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))
                        {
                            float x, y, z;
                            pTarget->GetPosition(x, y, z);
                            Creature *summon = m_creature->SummonCreature(NPC_BURNING_ABYSS, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
                            if (summon)
                                ((mob_abyssalAI*)summon->AI())->SetTrigger(1);
                            m_uiPhase3_Timer = 15000;
                        }
                        break;
                }
            }
            else
                m_uiPhase3_Timer -= uiDiff;
        }

        DoMeleeAttackIfReady();
    }
Example #10
0
 void JustDied(Unit* /*pKiller*/)
 {
     if (instance)
         if (Creature* Garr = Creature::GetCreature(*me, instance->GetData64(DATA_GARR)))
             Garr->CastSpell(Garr, SPELL_ENRAGE, true, NULL, NULL, me->GetGUID());
 }
Example #11
0
    void UpdateAI(const uint32 diff)
    {
        if (!UpdateVictim())
        {
            if (Creature* pTemp = ((Creature*)Unit::GetUnit((*me), m_pInstance->GetData64(DATA_AURIAYA))))
            {
                if (pTemp->isAlive())
                {
                    me->GetMotionMaster()->MoveFollow(pTemp,0.0f,0.0f);
                    me->GetMap()->CreatureRelocation(me, pTemp->GetPositionX(), pTemp->GetPositionY(), pTemp->GetPositionZ(), 0.0f);
                }
            }
        }
 
        if (Rip_Flesh_Timer < diff)
        {
            DoCast(me->getVictim(), m_bIsRegularMode ? SPELL_RIP_FLESH : SPELL_RIP_FLESH_H);
            Rip_Flesh_Timer = 10000;
        }else Rip_Flesh_Timer -= diff;
 
        if (Jump_Timer < diff)
        {
            if (!me->IsWithinDistInMap(me->getVictim(), 8) && me->IsWithinDistInMap(me->getVictim(), 25))
                DoCast(me->getVictim(), m_bIsRegularMode ? SPELL_SAVAGE_POUNCE : SPELL_SAVAGE_POUNCE_H);
            Jump_Timer = 1000;
        }else Jump_Timer -= diff;
 
        if (Check_Timer < diff)
        {
            if (Creature* pTemp = ((Creature*)Unit::GetUnit((*me), m_pInstance->GetData64(DATA_SENTRY_1))))
                if (pTemp->isAlive())
                    if (pTemp->IsWithinDistInMap(me->getVictim(), 10))
                        if (Aura *pAura = pTemp->GetAura(SPELL_STRENGHT_OF_PACK)) //if (pTemp->HasAura(SPELL_STRENGHT_OF_PACK))
                            pAura->SetStackAmount(pAura->GetStackAmount() + 1, true);
                        else
                            DoCast(me->getVictim(), SPELL_STRENGHT_OF_PACK);
            if (Creature* pTemp = ((Creature*)Unit::GetUnit((*me), m_pInstance->GetData64(DATA_SENTRY_2))))
                if (pTemp->isAlive())
                    if (pTemp->IsWithinDistInMap(me->getVictim(), 10))
                        if (Aura *pAura = pTemp->GetAura(SPELL_STRENGHT_OF_PACK)) //if (pTemp->HasAura(SPELL_STRENGHT_OF_PACK))
                            pAura->SetStackAmount(pAura->GetStackAmount() + 1, true);
                        else
                            DoCast(me->getVictim(), SPELL_STRENGHT_OF_PACK);
            if (Creature* pTemp = ((Creature*)Unit::GetUnit((*me), m_pInstance->GetData64(DATA_SENTRY_3))))
                if (pTemp->isAlive())
                    if (pTemp->IsWithinDistInMap(me->getVictim(), 10))
                        if (Aura *pAura = pTemp->GetAura(SPELL_STRENGHT_OF_PACK)) //if (pTemp->HasAura(SPELL_STRENGHT_OF_PACK))
                            pAura->SetStackAmount(pAura->GetStackAmount() + 1, true);
                        else
                            DoCast(me->getVictim(), SPELL_STRENGHT_OF_PACK);
            if (Creature* pTemp = ((Creature*)Unit::GetUnit((*me), m_pInstance->GetData64(DATA_SENTRY_4))))
                if (pTemp->isAlive())
                    if (pTemp->IsWithinDistInMap(me->getVictim(), 10))
                        if (Aura *pAura = pTemp->GetAura(SPELL_STRENGHT_OF_PACK)) //if (pTemp->HasAura(SPELL_STRENGHT_OF_PACK))
                            pAura->SetStackAmount(pAura->GetStackAmount() + 1, true);
                        else
                            DoCast(me->getVictim(), SPELL_STRENGHT_OF_PACK);
            if (Aura *pAura = me->GetAura(SPELL_STRENGHT_OF_PACK)) // if (me->HasAura(SPELL_STRENGHT_OF_PACK))
            {
                if (pAura->GetStackAmount() == 1)
                    me->RemoveAurasDueToSpell(SPELL_STRENGHT_OF_PACK);
                else
                    pAura->SetStackAmount(pAura->GetStackAmount() - 1, true);
            }
            Check_Timer = 2100;
        }else Check_Timer -= diff;
 
        DoMeleeAttackIfReady();
    }
Example #12
0
    void UpdateEscortAI(const uint32 uiDiff)
    {
        if (uiPhase)
        {
            if (uiTimer <= uiDiff)
            {
                switch (uiPhase)
                {
                    case 1:
                        DoScriptText(SAY_BLASTMASTER_1,m_creature);
                        NextStep(1500,true);
                        break;
                    case 2:
                        SetEscortPaused(false);
                        NextStep(0,false,0);
                        break;
                    case 3:
                        DoScriptText(SAY_BLASTMASTER_2,m_creature);
                        SetEscortPaused(false);
                        NextStep(0,false,0);
                        break;
                    case 4:
                        DoScriptText(SAY_BLASTMASTER_3,m_creature);
                        NextStep(3000,true);
                        break;
                    case 5:
                        DoScriptText(SAY_BLASTMASTER_4,m_creature);
                        NextStep(3000,true);
                        break;
                    case 6:
                        SetInFace(true);
                        DoScriptText(SAY_BLASTMASTER_5,m_creature);
                        Summon(1);
                        if (pInstance)
                            if (GameObject* pGo = GameObject::GetGameObject((*m_creature),pInstance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
                                pInstance->HandleGameObject(NULL,true,pGo);
                        NextStep(3000,true);
                        break;
                    case 7:
                        DoScriptText(SAY_BLASTMASTER_6,m_creature);
                        SetEscortPaused(false);
                        NextStep(0,false,0);
                        break;
                    case 8:
                        m_creature->HandleEmoteCommand(EMOTE_STATE_WORK);
                        NextStep(25000,true);
                        break;
                    case 9:
                        Summon(2);
                        NextStep(0,false);
                        break;
                    case 10:
                        Summon(4);
                        NextStep(0,false);
                        break;
                    case 11:
                        DoScriptText(SAY_BLASTMASTER_17,m_creature);
                        NextStep(5000,true);
                        break;
                    case 12:
                        DoScriptText(SAY_BLASTMASTER_18,m_creature);
                        NextStep(5000,true);
                        break;
                    case 13:
                        DoScriptText(SAY_BLASTMASTER_20,m_creature);
                        CaveDestruction(true);
                        NextStep(8000,true);
                        break;
                    case 14:
                        DoScriptText(SAY_BLASTMASTER_21,m_creature);
                        NextStep(8500,true);
                        break;
                    case 15:
                        DoScriptText(SAY_BLASTMASTER_22,m_creature);
                        NextStep(2000,true);
                        break;
                    case 16:
                        DoScriptText(SAY_BLASTMASTER_23,m_creature);
                        SetInFace(false);
                        if (pInstance)
                            if (GameObject* pGo = GameObject::GetGameObject((*m_creature),pInstance->GetData64(DATA_GO_CAVE_IN_LEFT)))
                                pInstance->HandleGameObject(NULL,true,pGo);
                        NextStep(2000,true);
                        break;
                    case 17:
                        SetEscortPaused(false);
                        DoScriptText(SAY_BLASTMASTER_24,m_creature);
                        Summon(6);
                        NextStep(0,false);
                        break;
                    case 18:
                        Summon(7);
                        NextStep(0,false);
                        break;
                    case 19:
                        SetInFace(false);
                        Summon(8);
                        DoScriptText(SAY_BLASTMASTER_25,m_creature);
                        NextStep(0,false);
                        break;
                    case 20:
                        DoScriptText(SAY_BLASTMASTER_27,m_creature);
                        NextStep(2000,true);
                        break;
                    case 21:
                        Summon(9);
                        NextStep(0,false);
                        break;
                    case 22:
                        CaveDestruction(false);
                        DoScriptText(SAY_BLASTMASTER_20,m_creature);
                        NextStep(0,false);
                        break;
                }
            } else uiTimer -= uiDiff;
        }

        if (!UpdateVictim())
            return;

        DoMeleeAttackIfReady();
    }
Example #13
0
 void JustDied(Unit* /*Killer*/)
 {
     if (pInstance)
         pInstance->SetData(TYPE_BARON,DONE);
 }
Example #14
0
 void AttackStart(Unit* who)
 {
     if (pInstance)//can't use entercombat(), boss' dmg aura sets near players in combat, before entering the room's door
         pInstance->SetData(TYPE_BARON,IN_PROGRESS);
     ScriptedAI::AttackStart(who);
 }
Example #15
0
 void EnterCombat(Unit *who)
 {
     if (pInstance)
         pInstance->SetData(DATA_GARR_EVENT, IN_PROGRESS);
 }
Example #16
0
 void JustReachedHome()
 {
     if (m_pInstance)
         m_pInstance->SetData(TYPE_CHANNELER_EVENT, NOT_STARTED);
 }
Example #17
0
 void JustDied(Unit * killer)
 {
     if (pInstance)
         pInstance->SetData(DATA_GARR_EVENT, DONE);
 }
Example #18
0
 void JustDied(Unit *victim)
 {
     DoScriptText(SAY_DEATH, m_creature);
     pInstance->SetData(DATA_CURATOR_EVENT, DONE);
 }
Example #19
0
 void JustDied(Unit* pKiller)
 {
     if (pInstance)
         if (Creature* pSjonnir = Unit::GetCreature(*me, pInstance->GetData64(DATA_SJONNIR)))
             CAST_AI(boss_sjonnirAI, pSjonnir->AI())->KilledIronSludge();
 }
 void Aggro(Unit* /*pWho*/) override
 {
     if (m_pInstance)
         m_pInstance->SetData(TYPE_HUHURAN, IN_PROGRESS);
 }
Example #21
0
 void JustDied(Unit * /*who*/)
 {
     if (pInstance)
         pInstance->SetData(WHELP_DEATH_COUNT, pInstance->GetData(WHELP_DEATH_COUNT)+1);
 }
 void JustReachedHome() override
 {
     if (m_pInstance)
         m_pInstance->SetData(TYPE_HUHURAN, FAIL);
 }
 void JustReachedHome() override
 {
     if (m_pInstance)
         m_pInstance->SetData(TYPE_MAULGAR_EVENT, FAIL);
 }
 void JustDied(Unit* /*pKiller*/) override
 {
     if (m_pInstance)
         m_pInstance->SetData(TYPE_HUHURAN, DONE);
 }
 void EnterCombat(Unit * who)
 {
     me->InterruptNonMeleeSpells(false);
     if (pInstance)
         pInstance->SetData64(DATA_LEOTHERAS_EVENT_STARTER, who->GetGUID());
 }
Example #26
0
 void EnterCombat(Unit *who)
 {
     DoScriptText(SAY_AGGRO, m_creature);
     pInstance->SetData(DATA_MARLIEVENT, IN_PROGRESS);
 }
Example #27
0
        void UpdateAI(const uint32 uiDiff) override
        {
            if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
                return;

            if (m_creature->HasAura(SPELL_TRANSFORMATION) && !m_bMammothPhase)
            {
                DoScriptText(EMOTE_TRANSFORMED, m_creature);
                m_bMammothPhase = true;

                // Set the achievement to failed
                if (m_pInstance)
                    m_pInstance->SetData(TYPE_ACHIEV_LESS_RABI, uint32(false));
            }

            if (m_uiRoarTimer < uiDiff)
            {
                DoCastSpellIfCan(m_creature->getVictim(), m_bMammothPhase ? SPELL_NUMBING_ROAR : SPELL_NUMBING_SHOUT);
                m_uiRoarTimer = 20000;
            }
            else
                m_uiRoarTimer -= uiDiff;

            if (m_uiQuakeTimer < uiDiff)
            {
                DoScriptText(SAY_QUAKE, m_creature);
                DoCastSpellIfCan(m_creature->getVictim(), m_bMammothPhase ? SPELL_QUAKE : SPELL_GROUND_TREMOR);
                m_uiQuakeTimer = m_bMammothPhase ? 13000 : 18000;
            }
            else
                m_uiQuakeTimer -= uiDiff;

            if (m_uiStabTimer < uiDiff)
            {
                if (m_bMammothPhase)
                    DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_DETERMINED_GORE : SPELL_DETERMINED_GORE_H);
                else
                    DoCastSpellIfCan(m_creature->getVictim(), SPELL_DETERMINED_STAB);

                m_uiStabTimer = 7000;
            }
            else
                m_uiStabTimer -= uiDiff;

            // check only in troll phase
            if (!m_bMammothPhase)
            {
                if (m_uiTransformationTimer < uiDiff)
                {
                    DoScriptText(SAY_TRANSFORM, m_creature);
                    DoScriptText(EMOTE_TRANSFORM, m_creature);
                    DoCastSpellIfCan(m_creature, SPELL_TRANSFORMATION);
                    m_uiPreviousTimer *= 0.8;
                    m_uiTransformationTimer = m_uiPreviousTimer;
                }
                else
                    m_uiTransformationTimer -= uiDiff;
            }

            DoMeleeAttackIfReady();
        }
Example #28
0
 void JustDied(Unit* Killer)
 {
     DoScriptText(SAY_DEATH, m_creature);
     if(pInstance)
         pInstance->SetData(DATA_MARLIEVENT, DONE);
 }
Example #29
0
 void EnterCombat(Unit* who)
 {
     if (pInstance)
         pInstance->SetData(DATA_PRINCE_TALDARAM_EVENT, IN_PROGRESS);
     DoScriptText(SAY_AGGRO, m_creature);
 }
Example #30
0
    void JustDied(Unit* Killer)
    {
        DoScriptText(SAY_DEATH, m_creature);

        pInstance->SetData(DATA_JEKLIKEVENT, DONE);
    }