コード例 #1
0
    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);
    }
コード例 #2
0
    void UpdateAI(const uint32 diff)
    {
        if(!UpdateVictim())
            return;

      CheckCasterNoMovementInRange(diff);
      CastNextSpellIfAnyAndReady(diff);
    }
コード例 #3
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();
    }
コード例 #4
0
    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_POLYMORPH:
                {
                    AddSpellToCast(SPELL_GREATER_POLYMORPH, CAST_TANK);
                    events.ScheduleEvent(eventId, urand(10000, 20000));
                    break;
                }
                case EVENT_ARCANE_SHOCK:
                {
                    AddSpellToCast(SPELL_ARCANE_SHOCK);
                    events.ScheduleEvent(eventId, urand(15000, 20000));
                    break;
                }
                case EVENT_ARCANE_EXPLO:
                {
                    AddSpellToCast(SPELL_ARCANE_EXPLOSION, CAST_SELF);
                    events.ScheduleEvent(eventId, 30000);
                    break;
                }
            }
        }

        CheckCasterNoMovementInRange(diff, 42.0f);
        CastNextSpellIfAnyAndReady(diff);
        DoMeleeAttackIfReady();
    }
コード例 #5
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)
        {
            ClearCastQueue();
            AddSpellToCast(SPELL_DRINK_FEL_INFUSION, CAST_SELF);
            Drink_Timer = HeroicMode?urand(10000, 18000):urand(15000, 25000);
        }
        else
            Drink_Timer -= diff;

       if(Wretched_Cast_Timer < diff)
       {
           AddSpellToCast(m_creature->getVictim(), RAND(SPELL_WRETCHED_FIREBALL, SPELL_WRETCHED_FROSTBOLT));
           Wretched_Cast_Timer = me->HasAura(SPELL_DRINK_FEL_INFUSION, 1) ? 1400 : 2900;
       }
       else
           Wretched_Cast_Timer -= diff;

       CheckCasterNoMovementInRange(diff, 35.0);
       CastNextSpellIfAnyAndReady(diff);
       DoMeleeAttackIfReady();
    }
コード例 #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(Frostbolt_Timer < diff)
      {
          AddSpellToCast(me->getVictim(), SPELL_FROSTBOLT);
          Frostbolt_Timer = SpellMgr::GetSpellCastTime(GetSpellStore()->LookupEntry(SPELL_FROSTBOLT))-(diff+100);
      }
      else
          Frostbolt_Timer -= diff;

      if(Arcane_Nova_Timer < diff)
      {
          ClearCastQueue();
          AddSpellToCast(SPELL_ARCANE_NOVA, CAST_SELF);
          Arcane_Nova_Timer = urand(16000, 20000);
      }
      else
          Arcane_Nova_Timer -= diff;

      CheckCasterNoMovementInRange(diff, 35.0);
      CastNextSpellIfAnyAndReady();
      DoMeleeAttackIfReady();
    }