void UpdateAI(const uint32 diff) { //Return since we have no target if (!UpdateVictim()) return; //ShadowVolley_Timer if (ShadowVolley_Timer <= diff) { if (urand(0, 99) < 45) DoCast(me->getVictim(), SPELL_SHADOWVOLLEY); ShadowVolley_Timer = 5000; } else ShadowVolley_Timer -= diff; //Cleave_Timer if (Cleave_Timer <= diff) { if (urand(0, 1)) DoCast(me->getVictim(), SPELL_CLEAVE); Cleave_Timer = 10000; } else Cleave_Timer -= diff; //ThunderClap_Timer if (ThunderClap_Timer <= diff) { if (urand(0, 9) < 2) DoCast(me->getVictim(), SPELL_THUNDERCLAP); ThunderClap_Timer = 12000; } else ThunderClap_Timer -= diff; //TwistedReflection_Timer if (TwistedReflection_Timer <= diff) { DoCast(me->getVictim(), SPELL_TWISTEDREFLECTION); TwistedReflection_Timer = 30000; } else TwistedReflection_Timer -= diff; //VoidBolt_Timer if (VoidBolt_Timer <= diff) { if (urand(0, 9) < 4) DoCast(me->getVictim(), SPELL_VOIDBOLT); VoidBolt_Timer = 18000; } else VoidBolt_Timer -= diff; //Rage_Timer if (Rage_Timer <= diff) { DoCast(me, SPELL_RAGE); Rage_Timer = 70000; } else Rage_Timer -= diff; //Hound_Timer if (Hound_Timer <= diff) { SummonHounds(me->getVictim()); SummonHounds(me->getVictim()); SummonHounds(me->getVictim()); Hound_Timer = 45000; } else Hound_Timer -= diff; DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 diff) { //Return since we have no target if (!m_creature->SelectHostilTarget() || !m_creature->getVictim()) return; //ShadowVolley_Timer if (ShadowVolley_Timer < diff) { if (rand()%100 < 46) { DoCast(m_creature->getVictim(),SPELL_SHADOWVOLLEY); } ShadowVolley_Timer = 5000; }else ShadowVolley_Timer -= diff; //Cleave_Timer if (Cleave_Timer < diff) { if (rand()%100 < 50) { DoCast(m_creature->getVictim(),SPELL_CLEAVE); } Cleave_Timer = 10000; }else Cleave_Timer -= diff; //ThunderClap_Timer if (ThunderClap_Timer < diff) { if (rand()%100 < 20) { DoCast(m_creature->getVictim(),SPELL_THUNDERCLAP); } ThunderClap_Timer = 12000; }else ThunderClap_Timer -= diff; //TwistedReflection_Timer if (TwistedReflection_Timer < diff) { DoCast(m_creature->getVictim(),SPELL_TWISTEDREFLECTION); TwistedReflection_Timer = 30000; }else TwistedReflection_Timer -= diff; //VoidBolt_Timer if (VoidBolt_Timer < diff) { if (rand()%100 < 40) { DoCast(m_creature->getVictim(),SPELL_VOIDBOLT); } VoidBolt_Timer = 18000; }else VoidBolt_Timer -= diff; //Rage_Timer if (Rage_Timer < diff) { DoCast(m_creature,SPELL_RAGE); Rage_Timer = 70000; }else Rage_Timer -= diff; //Hound_Timer if (Hound_Timer < diff) { SummonHounds(m_creature->getVictim()); SummonHounds(m_creature->getVictim()); SummonHounds(m_creature->getVictim()); Hound_Timer = 45000; }else Hound_Timer -= diff; DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 diff) { if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) return; if (ManaDetonation_Timer < diff) { if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) DoCast(pTarget,SPELL_MANA_DETONATION); ManaDetonation_Timer = 20000; }else ManaDetonation_Timer -= diff; if (Curse_Timer < diff) { if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) DoCast(pTarget,SPELL_CURSE); Curse_Timer = 38000; }else Curse_Timer -= diff; if (Polymorph_Timer < diff) { if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) DoCast(pTarget,SPELL_POLYMORPH); Polymorph_Timer = 12000; }else Polymorph_Timer -= diff; if (FrostBoltNova_Timer < diff) { DoCast(m_creature, SPELL_FROST_BOLT_NOVA); FrostBoltNova_Timer = 15000; }else FrostBoltNova_Timer -= diff; if (Enrage_Timer < diff) { DoCast(m_creature, SPELL_ENRAGE); DoScriptText(SAY_COMBAT6, m_creature); Enrage_Timer = 900000; }else Enrage_Timer -= diff; if (FrozenBlows_Timer < diff) { DoCast (m_creature, SPELL_FROZEN_BLOWS); FrozenBlows_Timer = 40000; }else FrozenBlows_Timer -= diff; if (TwistedReflection_Timer < diff) { DoCast(m_creature->getVictim(),SPELL_TWISTEDREFLECTION); TwistedReflection_Timer = 30000; }else TwistedReflection_Timer -= diff; if (VoidBolt_Timer < diff) { if (rand()%100 < 40) DoCast(m_creature->getVictim(),SPELL_VOIDBOLT); VoidBolt_Timer = 18000; }else VoidBolt_Timer -= diff; if (Hound_Timer < diff) { SummonHounds(m_creature->getVictim()); SummonHounds(m_creature->getVictim()); DoScriptText(SAY_COMBAT7, m_creature); Hound_Timer = 45000; }else Hound_Timer -= diff; if (!m_bCombat1 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 80)) { m_creature->SetDisplayId(21069); DoScriptText(SAY_COMBAT2, m_creature); m_bCombat1 = true; } if (!m_bCombat2 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 60)) { m_creature->SetDisplayId(14173); DoScriptText(SAY_COMBAT3, m_creature); m_bCombat2 = true; } if (!m_bCombat3 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 40)) { m_creature->SetDisplayId(1912); m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, 3); DoScriptText(SAY_COMBAT4, m_creature); m_bCombat3 = true; } if (!m_bCombat4 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 20)) { m_creature->SetDisplayId(18650); m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, 1); DoScriptText(SAY_COMBAT5, m_creature); m_bCombat4 = true; } if (!m_bRage && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 10) { DoCast(m_creature, SPELL_RAGE); DoScriptText(SAY_COMBAT5, m_creature); m_bRage = true; } DoMeleeAttackIfReady(); }