diff options
author | Tartalo <none@none> | 2010-04-06 21:34:37 +0200 |
---|---|---|
committer | Tartalo <none@none> | 2010-04-06 21:34:37 +0200 |
commit | 48b1ecf08f28f202f1f0ebb48402e35d1fbe0d88 (patch) | |
tree | aeffc421b45be60119b4271536abfbdf8b76d104 /src | |
parent | 971d617e9e01640a4f2b6d55aba4d98dfd352a76 (diff) |
Eastern Kingdoms, Alterac Valley: Scripts for Marshalls, Warmasters and bosses
Unknown author code contribution from issue #954.
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/ScriptLoader.cpp | 10 | ||||
-rw-r--r-- | src/scripts/CMakeLists.txt | 5 | ||||
-rw-r--r-- | src/scripts/eastern_kingdoms/alterac_valley/boss_balinda.cpp | 203 | ||||
-rw-r--r-- | src/scripts/eastern_kingdoms/alterac_valley/boss_drekthar.cpp | 138 | ||||
-rw-r--r-- | src/scripts/eastern_kingdoms/alterac_valley/boss_galvangar.cpp | 129 | ||||
-rw-r--r-- | src/scripts/eastern_kingdoms/alterac_valley/boss_vanndar.cpp | 129 |
6 files changed, 614 insertions, 0 deletions
diff --git a/src/game/ScriptLoader.cpp b/src/game/ScriptLoader.cpp index 43cb3fef3cf..c964a42d7b0 100644 --- a/src/game/ScriptLoader.cpp +++ b/src/game/ScriptLoader.cpp @@ -32,6 +32,11 @@ void AddSC_npcs_special(); void AddSC_npc_taxi(); //eastern kingdoms +void AddSC_alterac_valley(); //Alterac Valley +void AddSC_boss_balinda(); +void AddSC_boss_drekthar(); +void AddSC_boss_galvangar(); +void AddSC_boss_vanndar(); void AddSC_blackrock_depths(); //Blackrock Depths void AddSC_boss_ambassador_flamelash(); void AddSC_boss_anubshiah(); @@ -517,6 +522,11 @@ void AddScripts() AddSC_npc_taxi(); //eastern kingdoms + AddSC_alterac_valley(); //Alterac Valley + AddSC_boss_balinda(); + AddSC_boss_drekthar(); + AddSC_boss_galvangar(); + AddSC_boss_vanndar(); AddSC_blackrock_depths(); //Blackrock Depths AddSC_boss_ambassador_flamelash(); AddSC_boss_anubshiah(); diff --git a/src/scripts/CMakeLists.txt b/src/scripts/CMakeLists.txt index 5d8e71166a3..69dd177223b 100644 --- a/src/scripts/CMakeLists.txt +++ b/src/scripts/CMakeLists.txt @@ -17,6 +17,11 @@ SET(scripts_STAT_SRCS ../game/ScriptedSimpleAI.cpp ../game/ScriptedSimpleAI.h custom/on_events.cpp + eastern_kingdoms/alterac_valley/alterac_valley.cpp + eastern_kingdoms/alterac_valley/boss_balinda.cpp + eastern_kingdoms/alterac_valley/boss_drekthar.cpp + eastern_kingdoms/alterac_valley/boss_galvangar.cpp + eastern_kingdoms/alterac_valley/boss_vanndar.cpp eastern_kingdoms/blackrock_depths/blackrock_depths.cpp eastern_kingdoms/blackrock_depths/boss_ambassador_flamelash.cpp eastern_kingdoms/blackrock_depths/boss_anubshiah.cpp diff --git a/src/scripts/eastern_kingdoms/alterac_valley/boss_balinda.cpp b/src/scripts/eastern_kingdoms/alterac_valley/boss_balinda.cpp new file mode 100644 index 00000000000..6f5dfac570a --- /dev/null +++ b/src/scripts/eastern_kingdoms/alterac_valley/boss_balinda.cpp @@ -0,0 +1,203 @@ +/* Copyright (C) 2008 - 2010 TrinityCore <http://www.trinitycore.org/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "ScriptedPch.h"
+
+enum Spells
+{
+ SPELL_ARCANE_EXPLOSION = 46608,
+ SPELL_CONE_OF_COLD = 38384,
+ SPELL_FIREBALL = 46988,
+ SPELL_FROSTBOLT = 46987
+};
+
+enum Yells
+{
+ YELL_AGGRO = -2100019,
+ YELL_EVADE = -2100020
+};
+
+enum Creatures
+{
+ NPC_WATER_ELEMENTAL = 25040
+};
+
+enum WaterElementalSpells
+{
+ SPELL_WATERBOLT = 46983
+};
+
+struct mob_water_elementalAI : public ScriptedAI
+{
+ mob_water_elementalAI(Creature *c) : ScriptedAI(c) {}
+
+ uint32 uiWaterBoltTimer;
+ uint64 uiBalindaGUID;
+ uint32 uiResetTimer;
+
+ void Reset()
+ {
+ uiWaterBoltTimer = 3*IN_MILISECONDS;
+ uiResetTimer = 5*IN_MILISECONDS;
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!UpdateVictim())
+ return;
+
+ if(uiWaterBoltTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_WATERBOLT);
+ uiWaterBoltTimer = 5*IN_MILISECONDS;
+ } else uiWaterBoltTimer -= diff;
+
+ // check if creature is not outside of building
+ if(uiResetTimer < diff)
+ {
+ if (Creature *pBalinda = Unit::GetCreature(*m_creature, uiBalindaGUID))
+ if (m_creature->GetDistance2d(pBalinda->GetHomePosition().GetPositionX(), pBalinda->GetHomePosition().GetPositionY()) > 50)
+ EnterEvadeMode();
+ uiResetTimer = 5*IN_MILISECONDS;
+ } else uiResetTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+struct boss_balindaAI : public ScriptedAI
+{
+ boss_balindaAI(Creature *c) : ScriptedAI(c), Summons(m_creature) {}
+
+ uint32 uiArcaneExplosionTimer;
+ uint32 uiConeOfColdTimer;
+ uint32 uiFireBoltTimer;
+ uint32 uiFrostboltTimer;
+ uint32 uiResetTimer;
+ uint32 uiWaterElementalTimer;
+
+ SummonList Summons;
+
+ void Reset()
+ {
+ uiArcaneExplosionTimer = urand(5*IN_MILISECONDS,15*IN_MILISECONDS);
+ uiConeOfColdTimer = 8*IN_MILISECONDS;
+ uiFireBoltTimer = 1*IN_MILISECONDS;
+ uiFrostboltTimer = 4*IN_MILISECONDS;
+ uiResetTimer = 5*IN_MILISECONDS;
+ uiWaterElementalTimer = 0;
+
+ Summons.DespawnAll();
+ }
+
+ void EnterCombat(Unit *who)
+ {
+ DoScriptText(YELL_AGGRO, m_creature);
+ }
+
+ void JustRespawned()
+ {
+ Reset();
+ }
+
+ void JustSummoned(Creature* summoned)
+ {
+ ((mob_water_elementalAI*)summoned->AI())->uiBalindaGUID = m_creature->GetGUID();
+ summoned->AI()->AttackStart(SelectTarget(SELECT_TARGET_RANDOM,0, 50, true));
+ summoned->setFaction(m_creature->getFaction());
+ Summons.Summon(summoned);
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ Summons.DespawnAll();
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!UpdateVictim())
+ return;
+
+ if (uiWaterElementalTimer < diff)
+ {
+ if(Summons.empty())
+ m_creature->SummonCreature(NPC_WATER_ELEMENTAL, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45*IN_MILISECONDS);
+ uiWaterElementalTimer = 50*IN_MILISECONDS;
+ } else uiWaterElementalTimer -= diff;
+
+ if (uiArcaneExplosionTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_ARCANE_EXPLOSION);
+ uiArcaneExplosionTimer = urand(5*IN_MILISECONDS,15*IN_MILISECONDS);
+ } else uiArcaneExplosionTimer -= diff;
+
+ if (uiConeOfColdTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_CONE_OF_COLD);
+ uiConeOfColdTimer = urand(10*IN_MILISECONDS,20*IN_MILISECONDS);
+ } else uiConeOfColdTimer -= diff;
+
+ if (uiFireBoltTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_FIREBALL);
+ uiFireBoltTimer = urand(5*IN_MILISECONDS,9*IN_MILISECONDS);
+ } else uiFireBoltTimer -= diff;
+
+ if (uiFrostboltTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_FROSTBOLT);
+ uiFrostboltTimer = urand(4*IN_MILISECONDS,12*IN_MILISECONDS);
+ } else uiFrostboltTimer -= diff;
+
+
+ // check if creature is not outside of building
+ if(uiResetTimer < diff)
+ {
+ if (m_creature->GetDistance2d(m_creature->GetHomePosition().GetPositionX(), m_creature->GetHomePosition().GetPositionY()) > 50)
+ {
+ EnterEvadeMode();
+ DoScriptText(YELL_EVADE, m_creature);
+ }
+ uiResetTimer = 5*IN_MILISECONDS;
+ } else uiResetTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_balinda(Creature *_Creature)
+{
+ return new boss_balindaAI (_Creature);
+}
+
+CreatureAI* GetAI_mob_water_elemental(Creature *_Creature)
+{
+ return new mob_water_elementalAI (_Creature);
+}
+
+void AddSC_boss_balinda()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "boss_balinda";
+ newscript->GetAI = &GetAI_boss_balinda;
+ newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name = "mob_water_elemental";
+ newscript->GetAI = &GetAI_mob_water_elemental;
+ newscript->RegisterSelf();
+};
\ No newline at end of file diff --git a/src/scripts/eastern_kingdoms/alterac_valley/boss_drekthar.cpp b/src/scripts/eastern_kingdoms/alterac_valley/boss_drekthar.cpp new file mode 100644 index 00000000000..bc7913d9bc4 --- /dev/null +++ b/src/scripts/eastern_kingdoms/alterac_valley/boss_drekthar.cpp @@ -0,0 +1,138 @@ +/* Copyright (C) 2008 - 2010 TrinityCore <http://www.trinitycore.org/>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include "ScriptedPch.h"
+
+enum Spells
+{
+ SPELL_WHIRLWIND = 15589,
+ SPELL_WHIRLWIND2 = 13736,
+ SPELL_KNOCKDOWN = 19128,
+ SPELL_FRENZY = 8269,
+ SPELL_SWEEPING_STRIKES = 18765, // not sure
+ SPELL_CLEAVE = 20677, // not sure
+ SPELL_WINDFURY = 35886, // not sure
+ SPELL_STORMPIKE = 51876 // not sure
+};
+
+enum Yells
+{
+ YELL_AGGRO = -1810000,
+ YELL_EVADE = -1810001,
+ YELL_RESPAWN = -1810002,
+ YELL_RANDOM1 = -1810003,
+ YELL_RANDOM2 = -1810004,
+ YELL_RANDOM3 = -1810005,
+ YELL_RANDOM4 = -1810006,
+ YELL_RANDOM5 = -1810007
+};
+
+struct boss_drektharAI : public ScriptedAI
+{
+ boss_drektharAI(Creature *c) : ScriptedAI(c) {}
+
+ uint32 uiWhirlwindTimer;
+ uint32 uiWhirlwind2Timer;
+ uint32 uiKnockdownTimer;
+ uint32 uiFrenzyTimer;
+ uint32 uiYellTimer;
+ uint32 uiResetTimer;
+
+ void Reset()
+ {
+ uiWhirlwindTimer = urand(1*IN_MILISECONDS,20*IN_MILISECONDS);
+ uiWhirlwind2Timer = urand(1*IN_MILISECONDS,20*IN_MILISECONDS);
+ uiKnockdownTimer = 12*IN_MILISECONDS;
+ uiFrenzyTimer = 6*IN_MILISECONDS;
+ uiResetTimer = 5*IN_MILISECONDS;
+ uiYellTimer = urand(20*IN_MILISECONDS,30*IN_MILISECONDS); //20 to 30 seconds
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoScriptText(YELL_AGGRO, m_creature);
+ }
+
+ void JustRespawned()
+ {
+ Reset();
+ DoScriptText(YELL_RESPAWN, m_creature);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!UpdateVictim())
+ return;
+
+ if (uiWhirlwindTimer <= diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_WHIRLWIND);
+ uiWhirlwindTimer = urand(8*IN_MILISECONDS,18*IN_MILISECONDS);
+ } else uiWhirlwindTimer -= diff;
+
+ if (uiWhirlwind2Timer <= diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_WHIRLWIND2);
+ uiWhirlwind2Timer = urand(7*IN_MILISECONDS,25*IN_MILISECONDS);
+ } else uiWhirlwind2Timer -= diff;
+
+ if (uiKnockdownTimer <= diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_KNOCKDOWN);
+ uiKnockdownTimer = urand(10*IN_MILISECONDS,15*IN_MILISECONDS);
+ } else uiKnockdownTimer -= diff;
+
+ if (uiFrenzyTimer <= diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_FRENZY);
+ uiFrenzyTimer = urand(20*IN_MILISECONDS,30*IN_MILISECONDS);
+ } else uiFrenzyTimer -= diff;
+
+ if (uiYellTimer <= diff)
+ {
+ DoScriptText(RAND(YELL_RANDOM1,YELL_RANDOM2,YELL_RANDOM3,YELL_RANDOM4,YELL_RANDOM5), m_creature);
+ uiYellTimer = urand(20*IN_MILISECONDS,30*IN_MILISECONDS); //20 to 30 seconds
+ } else uiYellTimer -= diff;
+
+ // check if creature is not outside of building
+ if(uiResetTimer <= diff)
+ {
+ if (m_creature->GetDistance2d(m_creature->GetHomePosition().GetPositionX(), m_creature->GetHomePosition().GetPositionY()) > 50)
+ {
+ EnterEvadeMode();
+ DoScriptText(YELL_EVADE, m_creature);
+ }
+ uiResetTimer = 5*IN_MILISECONDS;
+ } else uiResetTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+
+CreatureAI* GetAI_boss_drekthar(Creature *_Creature)
+{
+ return new boss_drektharAI (_Creature);
+}
+
+void AddSC_boss_drekthar()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "boss_drekthar";
+ newscript->GetAI = &GetAI_boss_drekthar;
+ newscript->RegisterSelf();
+}
\ No newline at end of file diff --git a/src/scripts/eastern_kingdoms/alterac_valley/boss_galvangar.cpp b/src/scripts/eastern_kingdoms/alterac_valley/boss_galvangar.cpp new file mode 100644 index 00000000000..223b7b49a1f --- /dev/null +++ b/src/scripts/eastern_kingdoms/alterac_valley/boss_galvangar.cpp @@ -0,0 +1,129 @@ +/* Copyright (C) 2008 - 2010 TrinityCore <http://www.trinitycore.org/>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include "ScriptedPch.h"
+
+enum Spells
+{
+ SPELL_CLEAVE = 15284,
+ SPELL_FRIGHTENING_SHOUT = 19134,
+ SPELL_WHIRLWIND1 = 15589,
+ SPELL_WHIRLWIND2 = 13736,
+ SPELL_MORTAL_STRIKE = 16856
+};
+
+enum Yells
+{
+ YELL_AGGRO = -1810021,
+ YELL_EVADE = -1810022
+};
+
+struct boss_galvangarAI : public ScriptedAI
+{
+ boss_galvangarAI(Creature *c) : ScriptedAI(c) {}
+
+
+ uint32 uiCleaveTimer;
+ uint32 uiFrighteningShoutTimer;
+ uint32 uiWhirlwind1Timer;
+ uint32 uiWhirlwind2Timer;
+ uint32 uiMortalStrikeTimer;
+ uint32 uiResetTimer;
+
+
+ void Reset()
+ {
+ uiCleaveTimer = urand(1*IN_MILISECONDS,9*IN_MILISECONDS);
+ uiFrighteningShoutTimer = urand(2*IN_MILISECONDS,19*IN_MILISECONDS);
+ uiWhirlwind1Timer = urand(1*IN_MILISECONDS,13*IN_MILISECONDS);
+ uiWhirlwind2Timer = urand(5*IN_MILISECONDS,20*IN_MILISECONDS);
+ uiMortalStrikeTimer = urand(5*IN_MILISECONDS,20*IN_MILISECONDS);
+ uiResetTimer = 5*IN_MILISECONDS;
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoScriptText(YELL_AGGRO, m_creature);
+ }
+
+ void JustRespawned()
+ {
+ Reset();
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!UpdateVictim())
+ return;
+
+ if (uiCleaveTimer <= diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_CLEAVE);
+ uiCleaveTimer = urand(10*IN_MILISECONDS,16*IN_MILISECONDS);
+ } else uiCleaveTimer -= diff;
+
+ if (uiFrighteningShoutTimer <= diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_FRIGHTENING_SHOUT);
+ uiFrighteningShoutTimer = urand(10*IN_MILISECONDS,15*IN_MILISECONDS);
+ } else uiFrighteningShoutTimer -= diff;
+
+ if (uiWhirlwind1Timer <= diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_WHIRLWIND1);
+ uiWhirlwind1Timer = urand(6*IN_MILISECONDS,10*IN_MILISECONDS);
+ } else uiWhirlwind1Timer -= diff;
+
+ if (uiWhirlwind2Timer <= diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_WHIRLWIND2);
+ uiWhirlwind2Timer = urand(10*IN_MILISECONDS,25*IN_MILISECONDS);
+ } else uiWhirlwind2Timer -= diff;
+
+ if (uiMortalStrikeTimer <= diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE);
+ uiMortalStrikeTimer = urand(10*IN_MILISECONDS,30*IN_MILISECONDS);
+ } else uiMortalStrikeTimer -= diff;
+
+ // check if creature is not outside of building
+ if(uiResetTimer <= diff)
+ {
+ if (m_creature->GetDistance2d(m_creature->GetHomePosition().GetPositionX(), m_creature->GetHomePosition().GetPositionY()) > 50)
+ {
+ EnterEvadeMode();
+ DoScriptText(YELL_EVADE, m_creature);
+ }
+ uiResetTimer = 5*IN_MILISECONDS;
+ } else uiResetTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_galvangar(Creature *_Creature)
+{
+ return new boss_galvangarAI (_Creature);
+}
+
+void AddSC_boss_galvangar()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "boss_galvangar";
+ newscript->GetAI = &GetAI_boss_galvangar;
+ newscript->RegisterSelf();
+}
diff --git a/src/scripts/eastern_kingdoms/alterac_valley/boss_vanndar.cpp b/src/scripts/eastern_kingdoms/alterac_valley/boss_vanndar.cpp new file mode 100644 index 00000000000..584437eeb89 --- /dev/null +++ b/src/scripts/eastern_kingdoms/alterac_valley/boss_vanndar.cpp @@ -0,0 +1,129 @@ +/* Copyright (C) 2008 - 2010 TrinityCore <http://www.trinitycore.org/>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include "ScriptedPch.h"
+
+enum Yells
+{
+ YELL_AGGRO = -1810008,
+ YELL_EVADE = -1810009,
+ YELL_RESPAWN1 = -1810010,
+ YELL_RESPAWN2 = -1810011,
+ YELL_RANDOM1 = -1810012,
+ YELL_RANDOM2 = -1810013,
+ YELL_RANDOM3 = -1810014,
+ YELL_RANDOM4 = -1810015,
+ YELL_RANDOM5 = -1810016,
+ YELL_RANDOM6 = -1810017,
+ YELL_RANDOM7 = -1810018
+};
+
+enum Spells
+{
+ SPELL_AVATAR = 19135,
+ SPELL_THUNDERCLAP = 15588,
+ SPELL_STORMBOLT = 20685 // not sure
+};
+
+struct boss_vanndarAI : public ScriptedAI
+{
+ boss_vanndarAI(Creature *c) : ScriptedAI(c) {}
+
+
+ uint32 uiAvatarTimer;
+ uint32 uiThunderclapTimer;
+ uint32 uiStormboltTimer;
+ uint32 uiResetTimer;
+ uint32 uiYellTimer;
+
+
+ void Reset()
+ {
+ uiAvatarTimer = 3*IN_MILISECONDS;
+ uiThunderclapTimer = 4*IN_MILISECONDS;
+ uiStormboltTimer = 6*IN_MILISECONDS;
+ uiResetTimer = 5*IN_MILISECONDS;
+ uiYellTimer = urand(20*IN_MILISECONDS,30*IN_MILISECONDS);
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoScriptText(YELL_AGGRO, m_creature);
+ }
+
+ void JustRespawned()
+ {
+ Reset();
+ DoScriptText(RAND(YELL_RESPAWN1,YELL_RESPAWN2), m_creature);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!UpdateVictim())
+ return;
+
+ if (uiAvatarTimer <= diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_AVATAR);
+ uiAvatarTimer = urand(15*IN_MILISECONDS,20*IN_MILISECONDS);
+ } else uiAvatarTimer -= diff;
+
+ if (uiThunderclapTimer <= diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_THUNDERCLAP);
+ uiThunderclapTimer = urand(5*IN_MILISECONDS,15*IN_MILISECONDS);
+ } else uiThunderclapTimer -= diff;
+
+ if (uiStormboltTimer <= diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_STORMBOLT);
+ uiStormboltTimer = urand(10*IN_MILISECONDS,25*IN_MILISECONDS);
+ } else uiStormboltTimer -= diff;
+
+ if (uiYellTimer <= diff)
+ {
+ DoScriptText(RAND(YELL_RANDOM1,YELL_RANDOM2,YELL_RANDOM3,YELL_RANDOM4,YELL_RANDOM5,YELL_RANDOM6,YELL_RANDOM7), m_creature);
+ uiYellTimer = urand(20*IN_MILISECONDS,30*IN_MILISECONDS); //20 to 30 seconds
+ } else uiYellTimer -= diff;
+
+ // check if creature is not outside of building
+ if(uiResetTimer <= diff)
+ {
+ if (m_creature->GetDistance2d(m_creature->GetHomePosition().GetPositionX(), m_creature->GetHomePosition().GetPositionY()) > 50)
+ {
+ EnterEvadeMode();
+ DoScriptText(YELL_EVADE, m_creature);
+ }
+ uiResetTimer = 5*IN_MILISECONDS;
+ } else uiResetTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_vanndar(Creature *_Creature)
+{
+ return new boss_vanndarAI (_Creature);
+}
+
+void AddSC_boss_vanndar()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "boss_vanndar";
+ newscript->GetAI = &GetAI_boss_vanndar;
+ newscript->RegisterSelf();
+}
\ No newline at end of file |