void UpdateAI(const uint32 diff)
    {
        //Return since we have no target
        if (!UpdateVictim())
            return;

        DoSpecialThings(diff, DO_COMBAT_N_SPEED, 200.0f, 1.6f);

        events.Update(diff);
        while (uint32 eventId = events.ExecuteEvent())
        {
            switch (eventId)
            {
                case EVENT_SPELL_SHIELD:
                {
                    ForceSpellCast(me, SPELL_SPELLSHIELD);
                    events.ScheduleEvent(eventId, 31000);
                    break;
                }
                case EVENT_BLAST_WAVE:
                {
                    if (Unit *pTarget = SelectUnit(SELECT_TARGET_NEAREST, 0, 15.0f, true))
                        ForceSpellCast(SPELL_BLAST_WAVE, CAST_SELF);

                    events.ScheduleEvent(eventId, urand(3000, 5000));
                    break;
                }
            }
        }

        CheckCasterNoMovementInRange(diff, 42.0f);
        CastNextSpellIfAnyAndReady(diff);
    }
    void UpdateAI(const uint32 diff)
    {
        if (IntroStepCounter < 10)
        {
            if (IntroYellTimer < diff)
            {
                IntroYellTimer = IntroStep(++IntroStepCounter);
            }
            else 
                IntroYellTimer -= diff;
        }

        if (!UpdateVictim())
            return;

        if (SpecialTimer < diff)
        {
            if (pInstance->GetData(DATA_SACROLASH) == DONE)
            {
                AddSpellToCastWithScriptText(SPELL_SHADOW_NOVA, CAST_RANDOM_WITHOUT_TANK, EMOTE_SHADOW_NOVA, false, true);
                SpecialTimer = urand(14000, 16000);
            }
            else
            {
                if(Unit* target = GetConflagTarget())
                    AddSpellToCastWithScriptText(target , SPELL_CONFLAGRATION, EMOTE_CONFLAGRATION, false, true);
                DoScriptText(YELL_CANFLAGRATION, me);
                SpecialTimer = urand(30000,35000);
            }
        }
        else
            SpecialTimer -= diff;

        if (FlamesearTimer < diff)
        {
            AddSpellToCast(SPELL_FLAME_SEAR, CAST_SELF);
            FlamesearTimer = 10000;
        }
        else
            FlamesearTimer -=diff;

        if (PyrogenicsTimer < diff)
        {
            AddSpellToCast(SPELL_PYROGENICS, CAST_SELF);
            PyrogenicsTimer = 15000;
        }
        else
            PyrogenicsTimer -= diff;

        if (EnrageTimer < diff)
        {
            AddSpellToCastWithScriptText(SPELL_ENRAGE, CAST_SELF, YELL_BERSERK);
            EnrageTimer = 360000;
        }
        else
            EnrageTimer -= diff;

        CastNextSpellIfAnyAndReady(diff);
        DoMeleeAttackIfReady();
    }
Esempio n. 3
0
    void UpdateAI(const uint32 diff)
    {
        if (!UpdateVictim())
            return;

        CastNextSpellIfAnyAndReady(diff);
    }
    void UpdateAI(const uint32 diff)
    {
        if (!UpdateVictim())
            return;

        if (ShadowfuryTimer < diff)
        {
            if (me->IsWithinMeleeRange(me->getVictim()) && roll_chance_f(15))
            {
                AddSpellToCast(SPELL_SHADOW_FURY, CAST_NULL);
                ShadowfuryTimer = 5000;
            }
            ShadowfuryTimer = 1500;
        }
        else
            ShadowfuryTimer -= diff;

        if (DarkstrikeTimer < diff)
        {
            if (!me->IsNonMeleeSpellCasted(false))
            {
                //If we are within range melee the target
                if (me->IsWithinMeleeRange(me->getVictim()))
                    AddSpellToCast(SPELL_DARK_STRIKE, CAST_TANK);
            }
            DarkstrikeTimer = 1000;
        }
        else
            DarkstrikeTimer -= diff;

        CastNextSpellIfAnyAndReady();
    }
Esempio n. 5
0
    void UpdateAI(const uint32 diff)
    {
        if(!me->isInCombat())
            if(yelltimer < diff)
            {
                me->Yell(RAND(YELL_OOC1,YELL_OOC2,YELL_OOC3,YELL_OOC4,YELL_OOC5,YELL_OOC6),0,0);
                yelltimer = urand(60000,120000);
            }
            else
                yelltimer -=diff;

        if(!UpdateVictim())
            return;

        if(hamstringtimer < diff)
        {
            AddSpellToCast(SPELL_HAMSTRING);
            hamstringtimer = 9000;
        }
        else
            hamstringtimer -= diff;

        if(headcracktimer < diff)
        {
            AddSpellToCast(SPELL_HEAD_CRACK,CAST_RANDOM);
            headcracktimer = urand(20000,25000);
        }
        else
            headcracktimer -= diff;

        DoMeleeAttackIfReady();
        CastNextSpellIfAnyAndReady(diff);
    }
Esempio n. 6
0
    void UpdateAI(const uint32 diff)
    {
        if(!me->IsNonMeleeSpellCasted(false) && !me->isInCombat())
        {
            if(OOCTimer < diff)
            {
                HandleOffCombatEffects();
                OOCTimer = 10000;
            }
            else
                OOCTimer -= diff;
        }

        if(!UpdateVictim())
            return;

        if(Drink_Timer < diff)
        {
            AddSpellToCast(SPELL_DRINK_FEL_INFUSION, CAST_SELF);
            Drink_Timer = HeroicMode?urand(10000, 18000):urand(15000, 25000);
        }
        else
            Drink_Timer -= diff;

        if(Wretched_Strike_Timer < diff)
        {
            AddSpellToCast(m_creature->getVictim(), SPELL_WRETCHED_STRIKE);
            Wretched_Strike_Timer = urand(7000, 16000);
        }
        else
            Wretched_Strike_Timer -= diff;

        CastNextSpellIfAnyAndReady(diff);
        DoMeleeAttackIfReady();
    }
    void UpdateAI(const uint32 diff)
    {
        //Return since we have no target
        if (!UpdateVictim())
            return;

        DoSpecialThings(diff, DO_COMBAT_N_SPEED, 200.0f, 1.6f);

        events.Update(diff);
        while (uint32 eventId = events.ExecuteEvent())
        {
            switch (eventId)
            {
                case EVENT_HEAL:
                {
                    AddSpellToCast(SPELL_HEAL, CAST_SELF);
                    events.ScheduleEvent(eventId, urand(10000, 35000));
                    break;
                }
                case EVENT_SHIELD:
                {
                    AddSpellToCast(SPELL_GREATER_PW_SHIELD, CAST_SELF);
                    AddSpellToCast(SPELL_PRAYEROFHEALING, CAST_SELF);
                    events.ScheduleEvent(eventId, urand(30000, 40000));
                    break;
                }
            }
        }

        CastNextSpellIfAnyAndReady();
        DoMeleeAttackIfReady();
    }
    void UpdateAI(const uint32 diff)
    {
        if (!UpdateVictim())
            return;

        if (SpecialTimer < diff)
        {
            if (pInstance->GetData(DATA_ALYTHESS) == DONE)
            {
                AddSpellToCastWithScriptText(SPELL_CONFLAGRATION, CAST_RANDOM_WITHOUT_TANK, EMOTE_CONFLAGRATION, false, true);
                SpecialTimer = urand(14000, 16000);
            }
            else
            {
                if(Unit* target = GetNovaTarget())
                    AddSpellToCastWithScriptText(target, SPELL_SHADOW_NOVA, EMOTE_SHADOW_NOVA, false, true);
                DoScriptText(YELL_SHADOW_NOVA, me);
                SpecialTimer = urand(30000,35000);
            }
        }
        else
            SpecialTimer -= diff;

        if (ConfoundingblowTimer < diff)
        {
            AddSpellToCast(SPELL_CONFOUNDING_BLOW, CAST_TANK);
            ConfoundingblowTimer = urand(20000, 25000);
        }
        else
            ConfoundingblowTimer -= diff;

        if (ShadowimageTimer < diff)
        {
            for (int i = 0; i < 3; i++)
                DoSpawnCreature(MOB_SHADOW_IMAGE, 0, 0 , 0, frand(0, 2*M_PI), TEMPSUMMON_TIMED_DESPAWN, 15000);
            ShadowimageTimer = 20000;
        }
        else
            ShadowimageTimer -= diff;

        if (ShadowbladesTimer < diff)
        {
            AddSpellToCast(SPELL_SHADOW_BLADES, CAST_SELF);
            ShadowbladesTimer = 10000;
        }
        else
            ShadowbladesTimer -= diff;

        if (EnrageTimer < diff)
        {
            AddSpellToCastWithScriptText(SPELL_ENRAGE, CAST_SELF, YELL_ENRAGE);
            EnrageTimer = 360000;
        }
        else
            EnrageTimer -= diff;

        CastNextSpellIfAnyAndReady();
        DoMeleeAttackIfReady();
    }
Esempio n. 9
0
    void UpdateAI(const uint32 diff)
    {
        if(!UpdateVictim())
            return;

      CheckCasterNoMovementInRange(diff);
      CastNextSpellIfAnyAndReady(diff);
    }
Esempio n. 10
0
    void UpdateAI(const uint32 diff)
    {
        if (!UpdateVictim())
            return;

        if (CheckTimer < diff)
        {
            if (!m_creature->IsWithinDistInMap(&wLoc, 20.0f))
                EnterEvadeMode();

            me->SetSpeed(MOVE_WALK, 1.5f, true);
            me->SetSpeed(MOVE_RUN, 1.5f, true);

            CheckTimer = 2000;
        }
        else
            CheckTimer -= diff;

        if (chargeTimer < diff)
        {
            Unit * target = SelectUnit(SELECT_TARGET_RANDOM, 0, 25.0f, true, 0, 8.0f);

            if (target)
                AddSpellToCast(target, AV_VO_CHARGE);

            chargeTimer = urand(7500, 20000);
        }
        else
            chargeTimer -= diff;

        if (cleaveTimer < diff)
        {
            AddSpellToCast(AV_VO_CLEAVE, CAST_TANK);
            cleaveTimer = urand(5000, 10000);
        }
        else
            cleaveTimer -= diff;

        if (demoShoutTimer < diff)
        {
            AddSpellToCast(AV_VO_DEMOSHOUT, CAST_NULL);
            demoShoutTimer = urand(14000, 25000);
        }
        else
            demoShoutTimer -= diff;

        if (whirlwindTimer < diff)
        {
            AddSpellToCast(AV_VO_WHIRLWIND, CAST_SELF);
            whirlwindTimer = urand(9000, 13000);
        }
        else
            whirlwindTimer -= diff;


        CastNextSpellIfAnyAndReady();
        DoMeleeAttackIfReady();
    }
Esempio n. 11
0
    void UpdateAI(const uint32 diff)
    {
        if (!UpdateVictim())
            return;

        if (CheckTimer < diff)
        {
            if (!m_creature->IsWithinDistInMap(&wLoc, 20.0f))
                EnterEvadeMode();

            me->SetSpeed(MOVE_WALK, 2.0f, true);
            me->SetSpeed(MOVE_RUN, 2.0f, true);

            CheckTimer = 2000;
        }
        else
            CheckTimer -= diff;

        if (AvatarTimer < diff)
        {
            ForceSpellCast(m_creature->getVictim(), SPELL_AVATAR);
            AvatarTimer = urand(15000, 20000);
        }
        else
            AvatarTimer -= diff;

        if (ThunderclapTimer < diff)
        {
            AddSpellToCast(m_creature->getVictim(), SPELL_THUNDERCLAP);
            ThunderclapTimer = urand(5000, 15000);
        }
        else
            ThunderclapTimer -= diff;

        if (StormboltTimer < diff)
        {
            Unit * victim = SelectUnit(SELECT_TARGET_RANDOM, 1, 30.0f, true);
            if (victim)
                AddSpellToCast(victim, SPELL_STORMBOLT);
            StormboltTimer = urand(10000, 25000);
        }
        else
            StormboltTimer -= diff;

        if (YellTimer < diff)
        {
            DoScriptText(RAND(YELL_RANDOM1, YELL_RANDOM2, YELL_RANDOM3, YELL_RANDOM4, YELL_RANDOM5, YELL_RANDOM6, YELL_RANDOM7), m_creature);
            YellTimer = urand(20000, 30000); //20 to 30 seconds
        }
        else
            YellTimer -= diff;

        CastNextSpellIfAnyAndReady();
        DoMeleeAttackIfReady();
    }
Esempio n. 12
0
    void UpdateAI(const uint32 diff)
    {
        if (TransitionTimer)
        {
            if (TransitionTimer <= diff)
            {
                if(Unit* Muru = me->GetUnit(pInstance->GetData64(DATA_MURU)))
                {
                    Muru->SetVisibility(VISIBILITY_OFF);
                    Muru->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
                }
                me->SetRooted(false);
                AttackStart(me->getVictim());
                DoCast(me, SPELL_NEGATIVE_ENERGY_PERIODIC_E);
                TransitionTimer = 0;
            }
            else
                TransitionTimer -= diff;
            return;
        }

        if (!UpdateVictim())
            return;

        DoSpecialThings(diff, DO_COMBAT_N_EVADE, 100.0f);

        if (EnrageTimer < diff)
        {
            AddSpellToCast(me, SPELL_ENRAGE);
            EnrageTimer = 60000;
        }
        else
            EnrageTimer -= diff;

        if (DarknessTimer < diff)
        {
            if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0, 100, true))
                AddSpellToCast(target, SPELL_DARKNESS);
            DarknessTimer = 15000;
        }
        else
            DarknessTimer -= diff;

        if (BlackHole < diff)
        {
            if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0, 100, true, me->getVictimGUID(), 10.0))
                AddSpellToCast(target, SPELL_BLACK_HOLE);
            BlackHole = urand(15000, 18000);
        }
        else
            BlackHole -= diff;

        DoMeleeAttackIfReady();
        CastNextSpellIfAnyAndReady();
    }
Esempio n. 13
0
    void UpdateAI(const uint32 diff)
    {
        if (!UpdateVictim())
            return;

        DoSpecialThings(diff, DO_EVERYTHING);

        events.Update(diff);
        while (uint32 eventId = events.ExecuteEvent())
        {
            switch (eventId)
            {
                case EVENT_CORRUPTED_MIND:
                {
                    AddSpellToCast(SPELL_CORRUPTED_MIND, CAST_NULL);
                    events.ScheduleEvent(EVENT_CORRUPTED_MIND, 62000);
                    break;
                }
                case EVENT_POISON_AURA:
                {
                    AddSpellToCast(SPELL_POISON_AURA, CAST_NULL);
                    events.ScheduleEvent(EVENT_POISON_AURA, 12000);
                    break;
                }
                case EVENT_INEVITABLE_DOOM_5MIN:
                {
                    inevitableTimer = 15000;
                    break;
                }
                case EVENT_INEVITABLE_DOOM:
                {
                    AddSpellToCast(SPELL_INEVITABLE_DOOM, CAST_NULL);
                    events.ScheduleEvent(EVENT_INEVITABLE_DOOM, inevitableTimer);
                    break;
                }
                case EVENT_REMOVE_CURSE:
                {
                    AddSpellToCast(SPELL_REMOVE_CURSE, CAST_SELF);
                    events.ScheduleEvent(EVENT_REMOVE_CURSE, 30000);
                    break;
                }
                case EVENT_SUMMON_SPORE:
                {
                    for (uint8 i = 0; i < 3; ++i)
                        m_creature->SummonCreature(16286, SporesLocations[i][0], SporesLocations[i][1], SporesLocations[i][2], 0, TEMPSUMMON_TIMED_DESPAWN, 12000);
                    break;
                }
                default:
                    break;
            }
        }

        CastNextSpellIfAnyAndReady();
        DoMeleeAttackIfReady();
    }
Esempio n. 14
0
    void UpdateAI(const uint32 diff)
    {
      if(!me->isInCombat())
      {
          if(SummonImp_Timer < diff)
          {
              // check if still having pet ;]
              if(!me->GetMap()->GetCreature(SummonGUID))
                  SummonGUID = 0;

              if(!SummonGUID)
                  DoCast(m_creature, SPELL_SUMMON_SUNBLADE_IMP, false);
              SummonImp_Timer = 15000;
          }
          else
              SummonImp_Timer -= diff;
      }

      if(!me->IsNonMeleeSpellCasted(false) && !me->isInCombat())
      {
          if(OOCTimer < diff)
          {
              HandleOffCombatEffects();
              OOCTimer = 10000;
          }
          else
              OOCTimer -= diff;
      }

      if(!UpdateVictim())
      return;

      if(FelArmor_Timer < diff)
      {
          if(!me->HasAura(SPELL_FEL_ARMOR, 0))
              DoCast(me, SPELL_FEL_ARMOR, true);
          FelArmor_Timer = 120000;
      }
      else
          FelArmor_Timer -= diff;

      if(Immolate_Timer < diff)
      {
          ClearCastQueue();
          AddSpellToCast(m_creature->getVictim(), SPELL_IMMOLATE);
          Immolate_Timer = urand(16000, 25000);
      }
      else
          Immolate_Timer -= diff;

      CheckCasterNoMovementInRange(diff);
      CastNextSpellIfAnyAndReady(diff);
      DoMeleeAttackIfReady();
    }
Esempio n. 15
0
    void UpdateAI(const uint32 diff)
    {
        events.Update(diff);
        while (uint32 eventId = events.ExecuteEvent())
        {
            switch (eventId)
            {
                case EMBERSEER_EVENT_GROWING:
                {
                    me->CastSpell(me, SPELL_GROWING, true);
                    break;
                }
                case EMBERSEER_EVENT_TRANSFORM:
                {
                    DoScriptText(-2100023, me);
                    DoScriptText(-2100024, me);
                    me->CastSpell(me, SPELL_TRANSFORM, true);
                    me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
                    me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE);
                    events.SetPhase(2);
                    events.ScheduleEvent(EMBERSEER_EVENT_FIRENOVA, 6000, 0, 2);
                    events.ScheduleEvent(EMBERSEER_EVENT_FLAMEBUFFET, 3000, 0, 2);
                    events.ScheduleEvent(EMBERSEER_EVENT_PYROBLAST, 14000, 0, 2);
                    break;
                }
                case EMBERSEER_EVENT_FIRENOVA:
                {
                    AddSpellToCast(SPELL_FIRENOVA, CAST_SELF);
                    events.ScheduleEvent(EMBERSEER_EVENT_FIRENOVA, 6000, 0, 2);
                    break;
                }
                case EMBERSEER_EVENT_FLAMEBUFFET:
                {
                    AddSpellToCast(SPELL_FLAMEBUFFET, CAST_TANK);
                    events.ScheduleEvent(EMBERSEER_EVENT_FLAMEBUFFET, 3000, 0, 2);
                    break;
                }
                case EMBERSEER_EVENT_PYROBLAST:
                {
                    AddSpellToCast(SPELL_PYROBLAST, CAST_RANDOM);
                    events.ScheduleEvent(EMBERSEER_EVENT_PYROBLAST, 14000, 0, 2);
                    break;
                }
            }
        }

        if (!UpdateVictim())
        {
            return;
        }

        CastNextSpellIfAnyAndReady();
        DoMeleeAttackIfReady();
    }
Esempio n. 16
0
    void UpdateAI(const uint32 diff)
    {
        if(!UpdateVictim())
        {
            //UpdateAIOOC(diff);  // not working in 100%
            return;
        }

        if(Shout_Timer < diff)
        {
            AddSpellToCast(SPELL_FRIGHTENING_SHOUT, CAST_TANK);
            Shout_Timer = urand(30000, 40000);
        }
        else
            Shout_Timer -= diff;

        if(Knockback_Timer < diff)
        {
            AddSpellToCast(SPELL_KNOCKBACK, CAST_TANK);
            Knockback_Timer = urand(10000, 15000);
        }
        else
            Knockback_Timer -= diff;

        if(Execute_Timer < diff)
        {
            if(me->getVictim()->GetHealth() * 5 <= me->getVictim()->GetMaxHealth()) // below 20%
            {
                AddSpellToCast(SPELL_EXECUTE, CAST_TANK);
                Execute_Timer = 30000;
            }
        }
        else
            Execute_Timer -= diff;

        if(Cleave_Timer < diff)
        {
            AddSpellToCast(SPELL_MORTAL_CLEAVE, CAST_TANK);
            Cleave_Timer = urand(3000, 6000);
        }
        else
            Cleave_Timer -= diff;

        if(!Frenzy_Casted && HealthBelowPct(50))
        {
            AddSpellToCast(SPELL_FRENZY, CAST_SELF);
            Frenzy_Casted = true;
        }

        CastNextSpellIfAnyAndReady();
        DoMeleeAttackIfReady();
    }
    void UpdateAI(const uint32 diff)
    {
        if (!UpdateVictim())
            return;

        DoSpecialThings(diff, DO_EVERYTHING, 60.0f);

        events.Update(diff);
        while (uint32 eventId = events.ExecuteEvent())
        {
            switch (eventId)
            {
            case EVENT_BLAU_MARK:
            {
                AddSpellToCast(SPELL_MARK_OF_BLAUMEUX, CAST_NULL);
                events.ScheduleEvent(EVENT_BLAU_MARK, 12000);
                break;
            }
            case EVENT_BLAU_VOID_ZONE:
            {
                if (Unit * tmpUnit = SelectUnit(SELECT_TARGET_RANDOM, 0, 45.0f))
                    AddSpellToCast(tmpUnit, SPELL_VOID_ZONE);
                events.ScheduleEvent(EVENT_BLAU_VOID_ZONE, 12000);
                break;
            }
            default:
                break;
            }
        }

        // Shield Wall - All 4 horsemen will shield wall at 50% hp and 20% hp for 20 seconds
        if (!ShieldWall1)
        {
            if (HealthBelowPct(50))
            {
                AddSpellToCast(SPELL_SHIELDWALL, CAST_SELF);
                ShieldWall1 = true;
            }
        }
        else
        {
            if (!ShieldWall2 && HealthBelowPct(20))
            {
                AddSpellToCast(SPELL_SHIELDWALL, CAST_SELF);
                ShieldWall2 = true;
            }
        }

        CastNextSpellIfAnyAndReady();
        DoMeleeAttackIfReady();
    }
    void UpdateAI(const uint32 diff)
    {
        //Return since we have no target
        if (!UpdateVictim())
            return;

        DoSpecialThings(diff, DO_EVERYTHING, 60.0f);

        events.Update(diff);
        while (uint32 eventId = events.ExecuteEvent())
        {
            switch (eventId)
            {
            case EVENT_ZELIEK_MARK:
            {
                AddSpellToCast(SPELL_MARK_OF_ZELIEK, CAST_NULL);
                events.ScheduleEvent(EVENT_ZELIEK_MARK, 12000);
                break;
            }
            case EVENT_ZELIEK_WRATH:
            {
                AddSpellToCast(SPELL_HOLY_WRATH, CAST_TANK);
                events.ScheduleEvent(EVENT_ZELIEK_WRATH, 12000);
                break;
            }
            default:
                break;
            }
        }

        // Shield Wall - All 4 horsemen will shield wall at 50% hp and 20% hp for 20 seconds
        if (!ShieldWall1)
        {
            if (HealthBelowPct(50))
            {
                AddSpellToCast(SPELL_SHIELDWALL, CAST_SELF);
                ShieldWall1 = true;
            }
        }
        else
        {
            if (!ShieldWall2 && HealthBelowPct(20))
            {
                AddSpellToCast(SPELL_SHIELDWALL, CAST_SELF);
                ShieldWall2 = true;
            }
        }

        CastNextSpellIfAnyAndReady();
        DoMeleeAttackIfReady();
    }
Esempio n. 19
0
    void UpdateAI(const uint32 diff)
    {
        if (!UpdateVictim() )
            return;

        if (checkTimer < diff)
        {
            if (!me->IsWithinDistInMap(&pos, 105.0f))
            {
                EnterEvadeMode();
                return;
            }
            checkTimer = 3000;
        }
        else
            checkTimer -= diff;

        if (Rage_Timer < diff)
        {
            Creature* distiller = GetClosestCreatureWithEntry(me, 17954, 100);

            if (distiller)
            {
                float x, y, z;
                distiller->GetNearPoint(x, y, z, INTERACTION_DISTANCE);
                me->GetMotionMaster()->MovePoint(1, x, y, z);
                CurrentDistiller = distiller->GetGUID();
            }

            Rage_Timer = 15000+rand()%15000;
        }else Rage_Timer -= diff;

        //Reflection_Timer
        if (Reflection_Timer < diff)
        {
            AddSpellToCast(me, SPELL_SPELL_REFLECTION);
            Reflection_Timer = 15000+rand()%10000;
        }else Reflection_Timer -= diff;

        //Impale_Timer
        if (Impale_Timer < diff)
        {
            if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
                AddSpellToCast(target,SPELL_IMPALE);

            Impale_Timer = 7500+rand()%5000;
        }else Impale_Timer -= diff;

        CastNextSpellIfAnyAndReady();
        DoMeleeAttackIfReady();
    }
Esempio n. 20
0
    void UpdateAI(const uint32 diff)
    {
        if(!UpdateVictim())
            return;

        if(HealingWard_Timer < diff)
        {
            AddSpellToCast(m_creature, SPELL_HEALING_WARD);
            HealingWard_Timer = 30000;
        }
        else
            HealingWard_Timer -= diff;

        if(NovaTotem_Timer < diff)
        {
            AddSpellToCast(m_creature, SPELL_CORRUPTED_NOVA_TOTEM);
            NovaTotem_Timer = 45000;
        }
        else
            NovaTotem_Timer -= diff;

        if(LightningBolt_Timer < diff)
        {
            if (HeroicMode)
                AddCustomSpellToCast(m_creature->getVictim(), SPELL_LIGHTNING_BOLT,142,0,0);
            else
            AddCustomSpellToCast(m_creature->getVictim(), SPELL_LIGHTNING_BOLT,175,0,0);
            LightningBolt_Timer = 10000;
        }
        else
            LightningBolt_Timer -= diff;

        if(EarthGrab_Timer < diff)
        {
            AddSpellToCast(m_creature, SPELL_EARTHGRAB_TOTEM);
            EarthGrab_Timer = 30000;
        }
        else
            EarthGrab_Timer -= diff;

        if(StoneSkin_Timer < diff)
        {
            AddSpellToCast(m_creature, SPELL_STONESKIN_TOTEM);
            StoneSkin_Timer = 60000;
        }
        else
            StoneSkin_Timer -= diff;

        CastNextSpellIfAnyAndReady(diff);
        DoMeleeAttackIfReady();
    }
Esempio n. 21
0
    void UpdateAI(const uint32 diff)
    {
      if(!me->IsNonMeleeSpellCasted(false) && !me->isInCombat())
      {
          if(OOCTimer < diff)
          {
             HandleOffCombatEffects();
             OOCTimer = 10000;
          }
          else
              OOCTimer -= diff;
      }

      if(!UpdateVictim())
          return;

      if(Check_Timer)
      {
          // when not casting AE, chase victim
          if(Check_Timer <= diff)
          {
              me->setHover(false);
              DoStartMovement(me->getVictim());
              Check_Timer = 0;
          }
          else
              Check_Timer -= diff;
      }

      if(ExplosionCombo_Timer < diff)
      {
          if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0, 100.0f, true))
          {
              float x, y, z;
              target->GetPosition(x, y, z);
              DoTeleportTo(x, y, z);
              me->setHover(true);
              me->GetMotionMaster()->MoveIdle();
              for(uint8 i = 0; i < 3; ++i)
                AddSpellToCast(SPELL_ARCANE_EXPLOSION, CAST_NULL);
              Check_Timer = 2500;
          }
          ExplosionCombo_Timer = 30000;
      }
      else
          ExplosionCombo_Timer -= diff;

      CastNextSpellIfAnyAndReady();
      DoMeleeAttackIfReady();
    }
Esempio n. 22
0
    void UpdateAI(const uint32 diff)
    {
        if (!UpdateVictim())
            return;

        if (m_creature->HasAura(19695, 1))
            return;

        //If we are <2% hp cast Armageddom
        if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 2 && Armageddon_Timer < diff)
        {
            Armageddon_Timer = 9000;    //We don't want him to cast while being under Armageddon effect
            Inferno_Timer = 9000;
            IgniteMana_Timer = 9000;
            LivingBomb_Timer = 9000;
            m_creature->InterruptNonMeleeSpells(true);
            DoCast(m_creature,SPELL_ARMAGEDDOM);
            DoScriptText(EMOTE_SERVICE, m_creature);
            return;
        }

        //Inferno_Timer
        if (Inferno_Timer < diff)
        {
            AddSpellToCast(m_creature, SPELL_INFERNO, false);
            Inferno_Timer = 22000;
        }else Inferno_Timer -= diff;

        //IgniteMana_Timer
        if (IgniteMana_Timer < diff)
        {
            if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
                DoCast(target,SPELL_IGNITEMANA);

            IgniteMana_Timer = 30000;
        }else IgniteMana_Timer -= diff;

        //LivingBomb_Timer
        if (LivingBomb_Timer < diff)
        {
           if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
               DoCast(target,SPELL_LIVINGBOMB);

            LivingBomb_Timer = 35000;
        }else LivingBomb_Timer -= diff;

        CastNextSpellIfAnyAndReady();
        DoMeleeAttackIfReady();
    }
Esempio n. 23
0
    void UpdateAI(const uint32 diff)
    {
        if(!me->IsNonMeleeSpellCasted(false) && !me->isInCombat())
        {
            if(OOCTimer < diff)
            {
               HandleOffCombatEffects();
               OOCTimer = 10000;
            }
            else
                OOCTimer -= diff;
        }

        if(!UpdateVictim())
            return;

        if(Seal_Timer < diff)
        {
            AddSpellToCast(SPELL_SEAL_OF_WRATH, CAST_SELF);
            Seal_Timer = urand(20000, 30000);
        }
        else
            Seal_Timer -= diff;

        if(Judgement_Timer < diff)
        {
            if(me->HasAura(SPELL_SEAL_OF_WRATH, 0))
            {
                AddSpellToCast(me->getVictim(), SPELL_JUDGEMENT_OF_WRATH);
                me->RemoveAurasDueToSpell(SPELL_SEAL_OF_WRATH);
                Seal_Timer = urand(5000, 10000);
                Judgement_Timer = urand(13000, 20000);
            }
        }
        else
            Judgement_Timer -= diff;

        if(Holy_Light_Timer < diff)
        {
            Unit* healTarget = SelectLowestHpFriendly(40.0f, 10000);
            AddSpellToCast(healTarget, SPELL_HOLY_LIGHT);
            Holy_Light_Timer = urand(7000, 10000);
        }
        else
            Holy_Light_Timer -= diff;

        CastNextSpellIfAnyAndReady(diff);
        DoMeleeAttackIfReady();
    }
    void UpdateAI(const uint32 diff)
    {
        if (!UpdateVictim())
            return;

        //AmnenarsWrath_Timer
        if (AmnenarsWrath_Timer <= diff)
        {
            AddSpellToCast(me->getVictim(),SPELL_AMNENNARSWRATH);
            AmnenarsWrath_Timer = 12000;
        }
        else
            AmnenarsWrath_Timer -= diff;

        //FrostBolt_Timer
        if (FrostBolt_Timer <= diff)
        {
            Unit *pTarget = NULL;
            pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
            if (pTarget)
                AddSpellToCast(pTarget,SPELL_FROSTBOLT);

            FrostBolt_Timer = 8000;
        }
        else
            FrostBolt_Timer -= diff;

        if (!Spectrals && me->GetHealth()*100 / me->GetMaxHealth() < 50)
        {
            DoYell(SAY_1, LANG_UNIVERSAL, NULL);
            DoPlaySoundToSet(me, SOUND_SUMMON);

            Unit *pTarget = NULL;
            pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);

            if (pTarget)
            {
                SummonSpectrals(pTarget);
                SummonSpectrals(pTarget);
                SummonSpectrals(pTarget);
            }
            Spectrals = true;
        }

        CastNextSpellIfAnyAndReady();
        DoMeleeAttackIfReady();
    }
Esempio n. 25
0
    void UpdateAI(const uint32 diff)
    {
        if (!UpdateVictim())
            return;

        DoSpecialThings(diff, DO_EVERYTHING, 120.0f);

        events.Update(diff);
        while (uint32 eventId = events.ExecuteEvent())
        {
            switch (eventId)
            {
                case EVENT_IMPALE:
                {
                    //Cast Impale on a random target
                    //Do NOT cast it when we are afflicted by locust swarm
                    if (!m_creature->HasAura(SPELL_LOCUSTSWARM,1))
                        AddSpellToCast(SPELL_IMPALE, CAST_RANDOM);

                    events.ScheduleEvent(EVENT_IMPALE, 15000);
                    break;
                }
                case EVENT_SWARM:
                {
                    AddSpellToCast(SPELL_LOCUSTSWARM, CAST_SELF);
                    events.ScheduleEvent(EVENT_SWARM, 90000);
                    break;
                }
                case EVENT_SUMMON:
                {
                    AddSpellToCast(SPELL_SUMMONGUARD, CAST_SELF);
                    events.ScheduleEvent(EVENT_SUMMON, 45000);
                    break;
                }
                default:
                    break;
            }
        }

        CastNextSpellIfAnyAndReady();
        DoMeleeAttackIfReady();
    }
    void UpdateAI(const uint32 diff)
    {
        if (!UpdateVictim())
        {
            if(check_Timer < diff)
            {
                if (!m_creature->IsNonMeleeSpellCasted(false))
                    if(Creature *Kelidan = (Creature *)FindCreature(ENTRY_KELIDAN, 100, m_creature))
                    {
                        uint64 channeler = ((boss_kelidan_the_breakerAI*)Kelidan->AI())->GetChanneled(m_creature);
                        if(Unit *channeled = Unit::GetUnit(*m_creature, channeler))
                            DoCast(channeled,SPELL_CHANNELING);
                    }
                check_Timer = 5000;
            }
            else
                check_Timer -= diff;

            return;
        }

        if (MarkOfShadow_Timer < diff)
        {
            if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0))
                AddSpellToCast(target,SPELL_MARK_OF_SHADOW);

            MarkOfShadow_Timer = 15000+rand()%5000;
        }
        else
            MarkOfShadow_Timer -=diff;

        if (ShadowBolt_Timer < diff)
        {
            AddSpellToCast(me->getVictim(), SPELL_SHADOW_BOLT);
            ShadowBolt_Timer = urand(5000, 6000);
        }
        else
            ShadowBolt_Timer -=diff;

        CastNextSpellIfAnyAndReady();
        DoMeleeAttackIfReady();
    }
Esempio n. 27
0
    void UpdateAI(const uint32 diff)
    {
        if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE)
        {
            if (me->GetSelection())
                me->SetSelection(NULL);
            return;
        }

        if(ActivationTimer)
        {
            if(ActivationTimer <= diff)
            {
                ActivationTimer = 0;
                DoZoneInCombat(400);
                me->SetRooted(false);
                if(me->getVictim())
                    DoStartMovement(me->getVictim());
                SetAutocast(SPELL_FEL_FIREBALL, RAND(6300, 8300), true);
            }
            else
                ActivationTimer -= diff;
            return;
        }

        if(!UpdateVictim())
            return;

        if(SpellFury < diff)
        {
            ClearCastQueue();
            AddSpellToCast(SPELL_SPELL_FURY, CAST_SELF);
            SpellFury = 60000;
        }
        else
            SpellFury -= diff;

        CastNextSpellIfAnyAndReady(diff);
        DoMeleeAttackIfReady();
    }
Esempio n. 28
0
    void UpdateAI(const uint32 diff)
    {
        if(!me->isInCombat())
            if(yelltimer < diff)
            {
                me->Yell(RAND(YELL_OOC1,YELL_OOC2,YELL_OOC3,YELL_OOC4,YELL_OOC5,YELL_OOC6),0,0);
                yelltimer = urand(60000,120000);
            }
            else
                yelltimer -=diff;

        if(!UpdateVictim())
            return;

        if(hamstringtimer < diff)
        {
            AddSpellToCast(SPELL_DISARM);
            hamstringtimer = 9000;
        }
        else
            hamstringtimer -= diff;

        if(headcracktimer < diff)
        {
            AddSpellToCast(SPELL_GEYSER);
            headcracktimer = urand(20000,25000);
        }
        else
            headcracktimer -= diff;

        if (HealthBelowPct(20.0f) && !frenzy)
        {
            ForceSpellCast(me, SPELL_FRENZY, INTERRUPT_AND_CAST_INSTANTLY);
            frenzy = true;
        }

        DoMeleeAttackIfReady();
        CastNextSpellIfAnyAndReady(diff);
    }
Esempio n. 29
0
    void UpdateAI(const uint32 diff)
    {
        if (!UpdateVictim())
            return;

        DoSpecialThings(diff, DO_COMBAT_N_EVADE, 100.0f);

        events.Update(diff);

        while (uint32 eventId = events.ExecuteEvent())
        {
            switch (eventId)
            {
                case EVENT_UNBALANCING_STRIKE:
                {
                    AddSpellToCast(SPELL_UNBALANCINGSTRIKE, CAST_TANK);
                    events.ScheduleEvent(EVENT_UNBALANCING_STRIKE, 30000);
                    break;
                }
                case EVENT_DISTRUPTING_SHOUT:
                {
                    AddSpellToCast(SPELL_DISRUPTINGSHOUT, CAST_NULL);
                    events.ScheduleEvent(EVENT_DISTRUPTING_SHOUT, 25000);
                    break;
                }
                case EVENT_COMMAND_SOUND:
                {
                    DoPlaySoundToSet(m_creature, RAND(SOUND_COMMND1, SOUND_COMMND2, SOUND_COMMND3, SOUND_COMMND4, SOUND_COMMND5));
                    events.ScheduleEvent(EVENT_COMMAND_SOUND, 40000);
                    break;
                }
                default:
                    break;
            }
        }

        CastNextSpellIfAnyAndReady();
        DoMeleeAttackIfReady();
    }
Esempio n. 30
0
    void UpdateAI(const uint32 diff)
    {
      if(!me->IsNonMeleeSpellCasted(false) && !me->isInCombat())
      {
          if(OOCTimer < diff)
          {
             HandleOffCombatEffects();
             OOCTimer = 10000;
          }
          else
              OOCTimer -= diff;
      }

      if(!UpdateVictim())
          return;

      if(Poison_Timer < diff)
      {
          AddSpellToCast(SPELL_INJECT_POISON, CAST_SELF);
          Poison_Timer = urand(16000, 20000);
      }
      else
          Poison_Timer -= diff;

      if(Prayer_of_Mending_Timer < diff)
      {
          if(CanCastPoM())  // only one PoM active at a time
          {
              if(Unit* healTarget = SelectLowestHpFriendly(40))
                  AddSpellToCast(healTarget, SPELL_PRAYER_OF_MENDING);
          }
          Prayer_of_Mending_Timer = urand(7000, 12000);
      }
      else
          Prayer_of_Mending_Timer -= diff;

      CastNextSpellIfAnyAndReady();
      DoMeleeAttackIfReady();
    }