Example #1
0
        void KilledUnit(Unit* /*victim*/)
        {
            Unit* pLeftHead  = Unit::GetUnit(*me, LeftHeadGUID);
            Unit* pRightHead = Unit::GetUnit(*me, RightHeadGUID);

            if (!pLeftHead || !pRightHead)
                return;

            ikilling = rand()%2;

            Unit *source = (pLeftHead->GetEntry() == Killing[ikilling].creature ? pLeftHead : pRightHead);

            switch(ikilling)
            {
            case 0:
                DoScriptText(Killing[ikilling].id, source);
                Delay_Timer = 3500;
                KillingYell = true;
                break;
            case 1:
                DoScriptText(Killing[ikilling].id, source);
                KillingYell = false;
                break;
            }
        }
Example #2
0
        void DoYellForThreat()
        {
            Unit *pLeftHead  = Unit::GetUnit(*me, LeftHeadGUID);
            Unit *pRightHead = Unit::GetUnit(*me, RightHeadGUID);

            if (!pLeftHead || !pRightHead)
                return;

            ithreat = rand()%4;

            Unit *source = (pLeftHead->GetEntry() == Threat[ithreat].creature ? pLeftHead : pRightHead);

            DoScriptText(Threat[ithreat].id, source);

            Delay_Timer = 3500;
            ThreatYell = true;
        }
Example #3
0
        void UpdateAI(const uint32 diff)
        {
            if (Delay_Timer <= diff)
            {
                Delay_Timer = 3500;

                Unit* pLeftHead  = Unit::GetUnit(*me, LeftHeadGUID);
                Unit* pRightHead = Unit::GetUnit(*me, RightHeadGUID);

                if (!pLeftHead || !pRightHead)
                    return;

                if (AggroYell)
                {
                    DoScriptText(GoCombatDelay[iaggro].id, pRightHead);
                    AggroYell = false;
                }

                if (ThreatYell2)
                {
                    Unit *source = (pLeftHead->GetEntry() == ThreatDelay2[ithreat].creature ? pLeftHead : pRightHead);

                    DoScriptText(ThreatDelay2[ithreat].id, source);
                    ThreatYell2 = false;
                }

                if (ThreatYell)
                {
                    Unit *source = (pLeftHead->GetEntry() == ThreatDelay1[ithreat].creature ? pLeftHead : pRightHead);

                    DoScriptText(ThreatDelay1[ithreat].id, source);
                    ThreatYell = false;
                    ThreatYell2 = true;
                }

                if (KillingYell)
                {
                    Unit *source = (pLeftHead->GetEntry() == KillingDelay[ikilling].creature ? pLeftHead : pRightHead);

                    DoScriptText(KillingDelay[ikilling].id, source);
                    KillingYell = false;
                }
            } else Delay_Timer -= diff;

            if (!UpdateVictim())
                return;

            if (BlastCount && BlastWave_Timer <= diff)
            {
                DoCast(me, SPELL_BLAST_WAVE);
                BlastWave_Timer = 5000;
                ++BlastCount;

                if (BlastCount == 3)
                    BlastCount = 0;
            }
            else
                BlastWave_Timer -= diff;

            if (BurningMaul_Timer <= diff)
            {
                DoScriptText(EMOTE_ENRAGE, me);
                DoCast(me, SPELL_BURNING_MAUL);
                BurningMaul_Timer = 40000;
                BlastWave_Timer = 16000;
                BlastCount = 1;
            }
            else
                BurningMaul_Timer -= diff;

            if (ResetThreat_Timer <= diff)
            {
                if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
                {
                    DoYellForThreat();
                    DoResetThreat();
                    me->AddThreat(pTarget, 0.0f);
                }
                ResetThreat_Timer = 25000+rand()%15000;
            }
            else
                ResetThreat_Timer -= diff;

            if (Fear_Timer <= diff)
            {
                DoCast(me, SPELL_FEAR);
                Fear_Timer = 15000+rand()%20000;
            }
            else
                Fear_Timer -= diff;

            if (ThunderClap_Timer <= diff)
            {
                DoCast(me, SPELL_THUNDERCLAP);
                ThunderClap_Timer = 15000+rand()%15000;
            }
            else
                ThunderClap_Timer -= diff;

            DoMeleeAttackIfReady();
        }