# HG changeset patch # User Aokromes # Date 1250602671 -36000 # Branch trunk # Node ID f935d221a9d99896044f94e4af967ab1dc3557b1 # Parent 4a322bea12a83972545905d5166de99cd77401a3 Alterac Valley from HackerToad adapted to TC2 By Aokromes diff -r b2b48f8cdc60 src/scripts/CMakeLists.txt --- a/src/scripts/CMakeLists.txt Thu Jan 21 11:21:47 2010 +0100 +++ b/src/scripts/CMakeLists.txt Thu Jan 21 12:22:59 2010 +0100 @@ -492,6 +492,12 @@ eastern_kingdoms/zulgurub/zulgurub.h eastern_kingdoms/zulgurub/instance_zulgurub.cpp eastern_kingdoms/alterac_mountains.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/alterac_valley/AV_Marshals.cpp + eastern_kingdoms/alterac_valley/AV_Warmasters.cpp eastern_kingdoms/arathi_highlands.cpp eastern_kingdoms/blasted_lands.cpp eastern_kingdoms/boss_kruul.cpp diff -r b2b48f8cdc60 src/game/ScriptLoader.cpp --- a/src/game/ScriptLoader.cpp Thu Jan 21 11:21:47 2010 +0100 +++ b/src/game/ScriptLoader.cpp Thu Jan 21 12:22:59 2010 +0100 @@ -207,6 +207,14 @@ extern void AddSC_westfall(); extern void AddSC_wetlands(); +//Alterac Valley +extern void AddSC_boss_balinda(); +extern void AddSC_boss_drekthar(); +extern void AddSC_boss_galvangar(); +extern void AddSC_AV_Marshals(); +extern void AddSC_boss_vanndar(); +extern void AddSC_AV_Warmasters(); + //kalimdor extern void AddSC_blackfathom_deeps(); //Blackfathom Depths extern void AddSC_boss_gelihast(); @@ -671,6 +679,14 @@ AddSC_westfall(); AddSC_wetlands(); + //Alterac Valley + AddSC_boss_balinda(); + AddSC_boss_drekthar(); + AddSC_boss_galvangar(); + AddSC_AV_Marshals(); + AddSC_boss_vanndar(); + AddSC_AV_Warmasters(); + //kalimdor AddSC_blackfathom_deeps(); //Blackfathom Depths AddSC_boss_gelihast(); diff -r b2b48f8cdc60 src/scripts/eastern_kingdoms/alterac_valley/AV_Marshals.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/scripts/eastern_kingdoms/alterac_valley/AV_Marshals.cpp Thu Jan 21 12:22:59 2010 +0100 @@ -0,0 +1,168 @@ +/* Copyright (C) 2006 - 2008 ScriptDev2 + * 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 + */ + +/* ScriptData +SDName: AV Marshals +SD%Complete: +SDComment: Returns AV marshals to inside the building +SDCategory: Bosses +EndScriptData */ + +#include "ScriptedPch.h" + +#define SPELL_CHARGE 22911 +#define SPELL_CLEAVE 40504 +#define SPELL_DEMORALIZING_SHOUT 23511 +#define SPELL_ENRAGE 8599 +#define SPELL_WHIRLWIND1 15589 +#define SPELL_WHIRLWIND2 13736 + +struct AV_MarshalsAI : public ScriptedAI +{ + AV_MarshalsAI(Creature *c) : ScriptedAI(c) {Reset();} + + uint32 ChargeTimer; + uint32 CleaveTimer; + uint32 DemoralizingShoutTimer; + uint32 Whirlwind1Timer; + uint32 Whirlwind2Timer; + uint32 EnrageTimer; + uint32 ResetTimer; + uint32 Aura1; + uint32 Aura2; + uint32 Aura3; + uint32 Aura4; + + + void Reset() + { + ChargeTimer = (2+rand()%10)*1000; + CleaveTimer = (1+rand()%10)*1000; + DemoralizingShoutTimer = (2+rand()%18)*1000; + Whirlwind1Timer = (1+rand()%12)*1000; + Whirlwind2Timer = (5+rand()%15)*1000; + EnrageTimer = (5+rand()%20)*1000; + ResetTimer = 5000; + + //switch for aures// + Aura1 = 0; + Aura2 = 0; + Aura3 = 0; + Aura4 = 0; + + } + void Aggro(Unit *who){} + + void JustRespawned() + { + Reset(); + } + + void KilledUnit(Unit* victim){} + + void JustDied(Unit* Killer){} + + void UpdateAI(const uint32 diff) + { + //Adding the auras// + if(m_creature->GetEntry() == 14762 && Aura1 == 0) //North Marshal + { + DoCast(m_creature, 45828); + Aura1 = 1; + } + if(m_creature->GetEntry() == 14763 && Aura2 == 0) //South Marshal + { + DoCast(m_creature, 45829); + Aura2 = 1; + } + if(m_creature->GetEntry() == 14764 && Aura3 == 0) //Icewing Marshal + { + DoCast(m_creature, 45831); + Aura3 = 1; + } + if(m_creature->GetEntry() == 14765 && Aura4 == 0) //Stonehearth Marshal + { + DoCast(m_creature, 45830); + Aura4 = 1; + } + if (!UpdateVictim()) + return; + if (ChargeTimer getVictim(), SPELL_CHARGE); + ChargeTimer = (10+rand()%15)*1000; + }else ChargeTimer -= diff; + + if (CleaveTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_CLEAVE); + CleaveTimer = (10+rand()%6)*1000; + }else CleaveTimer -= diff; + + if (DemoralizingShoutTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_DEMORALIZING_SHOUT); + DemoralizingShoutTimer = (10+rand()%5)*1000; + }else DemoralizingShoutTimer -= diff; + + if (Whirlwind1Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_WHIRLWIND1); + Whirlwind1Timer = (6+rand()%14)*1000; + }else Whirlwind1Timer -= diff; + + if (Whirlwind2Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_WHIRLWIND2); + Whirlwind2Timer = (10+rand()%15)*1000; + }else Whirlwind2Timer -= diff; + + if (EnrageTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_ENRAGE); + EnrageTimer = (10+rand()%20)*1000; + }else EnrageTimer -= diff; + + + // check if creature is not outside of building + if(ResetTimer < diff) + { + float x, y, z; + m_creature->GetPosition(x, y, z); + if(x < 678) + { + EnterEvadeMode(); + } + ResetTimer = 5000; + }else ResetTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_AV_Marshals(Creature *_Creature) +{ + return new AV_MarshalsAI (_Creature); +} + +void AddSC_AV_Marshals() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "AV_Marshals"; + newscript->GetAI = &GetAI_AV_Marshals; + newscript->RegisterSelf(); +} diff -r b2b48f8cdc60 src/scripts/eastern_kingdoms/alterac_valley/AV_Warmasters.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/scripts/eastern_kingdoms/alterac_valley/AV_Warmasters.cpp Thu Jan 21 12:22:59 2010 +0100 @@ -0,0 +1,167 @@ +/* Copyright (C) 2006 - 2008 ScriptDev2 + * 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 + */ + +/* ScriptData +SDName: AV Warmasters +SD%Complete: +SDComment: Returns AV Warmasters to building +SDCategory: Bosses +EndScriptData */ + +#include "ScriptedPch.h" + +#define SPELL_CHARGE 22911 +#define SPELL_CLEAVE 40504 +#define SPELL_DEMORALIZING_SHOUT 23511 +#define SPELL_ENRAGE 8599 +#define SPELL_WHIRLWIND1 15589 +#define SPELL_WHIRLWIND2 13736 + +struct AV_WarmastersAI : public ScriptedAI +{ + AV_WarmastersAI(Creature *c) : ScriptedAI(c) {Reset();} + + uint32 ChargeTimer; + uint32 CleaveTimer; + uint32 DemoralizingShoutTimer; + uint32 Whirlwind1Timer; + uint32 Whirlwind2Timer; + uint32 EnrageTimer; + uint32 ResetTimer; + uint32 Aura1; + uint32 Aura2; + uint32 Aura3; + uint32 Aura4; + + void Reset() + { + ChargeTimer = (2+rand()%10)*1000; + CleaveTimer = (1+rand()%10)*1000; + DemoralizingShoutTimer = (2+rand()%18)*1000; + Whirlwind1Timer = (1+rand()%12)*1000; + Whirlwind2Timer = (5+rand()%15)*1000; + EnrageTimer = (5+rand()%20)*1000; + ResetTimer = 5000; + + //Auras switch// + Aura1 = 0; + Aura2 = 0; + Aura3 = 0; + Aura4 = 0; + + } + void Aggro(Unit *who){} + + void JustRespawned() + { + Reset(); + } + + void KilledUnit(Unit* victim){} + + void JustDied(Unit* Killer){} + + void UpdateAI(const uint32 diff) + { + //Adding the auras// + if(m_creature->GetEntry()== 14773 && Aura1 == 0) //Iceblood Warmaster + { + DoCast(m_creature, 45822); + Aura1 = 1; + } + if(m_creature->GetEntry() == 14776 && Aura2 == 0) //Tower Point Warmaster + { + DoCast(m_creature, 45823); + Aura2 = 1; + } + if(m_creature->GetEntry() == 14772 && Aura3 == 0) //East Frostwolf Warmaster + { + DoCast(m_creature, 45826); + Aura3 = 1; + } + if(m_creature->GetEntry() == 14777 && Aura4 == 0) //West FRostwolf Marshal + { + DoCast(m_creature, 45824); + Aura4 = 1; + } + if (!UpdateVictim()) + return; + if (ChargeTimer getVictim(), SPELL_CHARGE); + ChargeTimer = (10+rand()%15)*1000; + }else ChargeTimer -= diff; + + if (CleaveTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_CLEAVE); + CleaveTimer = (10+rand()%6)*1000; + }else CleaveTimer -= diff; + + if (DemoralizingShoutTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_DEMORALIZING_SHOUT); + DemoralizingShoutTimer = (10+rand()%5)*1000; + }else DemoralizingShoutTimer -= diff; + + if (Whirlwind1Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_WHIRLWIND1); + Whirlwind1Timer = (6+rand()%14)*1000; + }else Whirlwind1Timer -= diff; + + if (Whirlwind2Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_WHIRLWIND2); + Whirlwind2Timer = (10+rand()%15)*1000; + }else Whirlwind2Timer -= diff; + + if (EnrageTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_ENRAGE); + EnrageTimer = (10+rand()%20)*1000; + }else EnrageTimer -= diff; + + + // check if creature is not outside of building + if(ResetTimer < diff) + { + float x, y, z; + m_creature->GetPosition(x, y, z); + if(y < -260) + { + EnterEvadeMode(); + } + ResetTimer = 5000; + }else ResetTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_AV_Warmasters(Creature *_Creature) +{ + return new AV_WarmastersAI (_Creature); +} + +void AddSC_AV_Warmasters() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "AV_Warmasters"; + newscript->GetAI = &GetAI_AV_Warmasters; + newscript->RegisterSelf(); +} diff -r b2b48f8cdc60 src/scripts/eastern_kingdoms/alterac_valley/boss_balinda.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/scripts/eastern_kingdoms/alterac_valley/boss_balinda.cpp Thu Jan 21 12:22:59 2010 +0100 @@ -0,0 +1,129 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * 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 + */ + +/* ScriptData +SDName: Boss_Balinda +SD%Complete: +SDComment: Timers should be adjusted +EndScriptData */ + +#include "ScriptedPch.h" + +#define YELL_AGGRO -1810019 +#define YELL_EVADE -1810020 + +#define SPELL_ARCANE_EXPLOSION 46608 +#define SPELL_CONE_OF_COLD 38384 +#define SPELL_FIREBALL 46988 +#define SPELL_FROSTBOLT 46987 +#define SPELL_WATER_ELEMENTAL 45067 + + +struct boss_balindaAI : public ScriptedAI +{ + boss_balindaAI(Creature *c) : ScriptedAI(c) {Reset();} + + + uint32 ArcaneExplosionTimer; + uint32 ConeofcoldTimer; + uint32 FireboltTimer; + uint32 FrostboltTimer; + uint32 ResetTimer; + + + void Reset() + { + ArcaneExplosionTimer = (10+rand()%5)*1000; + ConeofcoldTimer = 8000; + FireboltTimer = 1000; + FrostboltTimer = 4000; + ResetTimer = 5000; + } + + void Aggro(Unit *who) + { + DoScriptText(YELL_AGGRO, m_creature); + } + + void JustRespawned() + { + Reset(); + } + + void KilledUnit(Unit* victim){} + + void JustDied(Unit* Killer){} + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (ArcaneExplosionTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_ARCANE_EXPLOSION); + ArcaneExplosionTimer = (10+rand()%5)*1000; + }else ArcaneExplosionTimer -= diff; + + if (ConeofcoldTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_CONE_OF_COLD); + ConeofcoldTimer = (10+rand()%10)*1000; + }else ConeofcoldTimer -= diff; + + if (FireboltTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_FIREBALL); + FireboltTimer = (5+rand()%4)*1000; + }else FireboltTimer -= diff; + + if (FrostboltTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_FROSTBOLT); + FrostboltTimer = (4+rand()%8)*1000; + }else FrostboltTimer -= diff; + + + // check if creature is not outside of building + if(ResetTimer < diff) + { + float x, y, z; + m_creature->GetPosition(x, y, z); + if(x > -6) + { + DoScriptText(YELL_EVADE, m_creature); + EnterEvadeMode(); + } + ResetTimer = 5000; + }else ResetTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_balinda(Creature *_Creature) +{ + return new boss_balindaAI (_Creature); +} + +void AddSC_boss_balinda() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_balinda"; + newscript->GetAI = &GetAI_boss_balinda; + newscript->RegisterSelf(); +} diff -r b2b48f8cdc60 src/scripts/eastern_kingdoms/alterac_valley/boss_drekthar.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/scripts/eastern_kingdoms/alterac_valley/boss_drekthar.cpp Thu Jan 21 12:22:59 2010 +0100 @@ -0,0 +1,155 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * 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 + */ + +/* ScriptData +SDName: Boss_DrekThar +SD%Complete: 50% +SDComment: Some spells listed on wowwiki but doesn't exist on wowhead +EndScriptData */ + +#include "ScriptedPch.h" + +#define YELL_AGGRO -1810000 + +#define YELL_EVADE -1810001 +#define YELL_RESPAWN -1810002 + +#define YELL_RANDOM1 -1810003 +#define YELL_RANDOM2 -1810004 +#define YELL_RANDOM3 -1810005 +#define YELL_RANDOM4 -1810006 +#define YELL_RANDOM5 -1810007 + + +#define SPELL_WHIRLWIND 15589 +#define SPELL_WHIRLWIND2 13736 +#define SPELL_KNOCKDOWN 19128 +#define SPELL_FRENZY 8269 +#define SPELL_SWEEPING_STRIKES 18765 // not sure +#define SPELL_CLEAVE 20677 // not sure +#define SPELL_WINDFURY 35886 // not sure +#define SPELL_STORMPIKE 51876 // not sure + + +struct boss_drektharAI : public ScriptedAI +{ + boss_drektharAI(Creature *c) : ScriptedAI(c) {Reset();} + + + uint32 WhirlwindTimer; + uint32 Whirlwind2Timer; + uint32 KnockdownTimer; + uint32 FrenzyTimer; + uint32 YellTimer; + uint32 ResetTimer; + + void Reset() + { + WhirlwindTimer = (rand()%20)*1000; + Whirlwind2Timer = (rand()%25)*1000; + KnockdownTimer = 12000; + FrenzyTimer = 6000; + ResetTimer = 5000; + YellTimer = (20+rand()%10)*1000; //20 to 30 seconds + } + + void Aggro(Unit *who) + { + DoScriptText(YELL_AGGRO, m_creature); + } + + void JustRespawned() + { + Reset(); + DoScriptText(YELL_RESPAWN, m_creature); + } + + void KilledUnit(Unit* victim){} + + void JustDied(Unit* Killer){} + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (WhirlwindTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_WHIRLWIND); + WhirlwindTimer = (8+rand()%10)*1000; + }else WhirlwindTimer -= diff; + + if (Whirlwind2Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_WHIRLWIND2); + Whirlwind2Timer = (7+rand()%18)*1000; + }else Whirlwind2Timer -= diff; + + if (KnockdownTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_KNOCKDOWN); + KnockdownTimer = (10+rand()%5)*1000; + }else KnockdownTimer -= diff; + + if (FrenzyTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_FRENZY); + FrenzyTimer = (20+rand()%5)*1000; + }else FrenzyTimer -= diff; + + if (YellTimer < diff) { + switch(rand()%4) + { + case 0: DoScriptText(YELL_RANDOM1, m_creature); break; + case 1: DoScriptText(YELL_RANDOM2, m_creature); break; + case 2: DoScriptText(YELL_RANDOM3, m_creature); break; + case 3: DoScriptText(YELL_RANDOM4, m_creature); break; + case 4: DoScriptText(YELL_RANDOM5, m_creature); break; + } + YellTimer = (20+rand()%10)*1000; //20 to 30 seconds + } else YellTimer -= diff; + +// check if creature is not outside of building + if(ResetTimer < diff) + { + float x, y, z; + m_creature->GetPosition(x, y, z); + if(y < -260) + { + DoScriptText(YELL_EVADE, m_creature); + EnterEvadeMode(); + } + ResetTimer = 5000; + }else ResetTimer -= 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(); +} diff -r b2b48f8cdc60 src/scripts/eastern_kingdoms/alterac_valley/boss_galvangar.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/scripts/eastern_kingdoms/alterac_valley/boss_galvangar.cpp Thu Jan 21 12:22:59 2010 +0100 @@ -0,0 +1,136 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * 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 + */ + +/* ScriptData +SDName: Boss_Galvangar +SD%Complete: +SDComment: timers should be adjusted +EndScriptData */ + +#include "ScriptedPch.h" + +#define YELL_AGGRO -1810021 +#define YELL_EVADE -1810022 + +#define SPELL_CLEAVE 15284 +#define SPELL_FRIGHTENING_SHOUT 19134 +#define SPELL_WHIRLWIND1 15589 +#define SPELL_WHIRLWIND2 13736 +#define SPELL_MORTAL_STRIKE 16856 + + +struct boss_galvangarAI : public ScriptedAI +{ + boss_galvangarAI(Creature *c) : ScriptedAI(c) {Reset();} + + + uint32 CleaveTimer; + uint32 FrighteningShoutTimer; + uint32 Whirlwind1Timer; + uint32 Whirlwind2Timer; + uint32 MortalStrikeTimer; + uint32 ResetTimer; + + + void Reset() + { + CleaveTimer = (1+rand()%10)*1000; + FrighteningShoutTimer = (2+rand()%18)*1000; + Whirlwind1Timer = (1+rand()%12)*1000; + Whirlwind2Timer = (5+rand()%15)*1000; + MortalStrikeTimer = (5+rand()%20)*1000; + ResetTimer = 5000; + } + + void Aggro(Unit *who) + { + DoScriptText(YELL_AGGRO, m_creature); + } + + void JustRespawned() + { + Reset(); + } + + void KilledUnit(Unit* victim){} + + void JustDied(Unit* Killer){} + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (CleaveTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_CLEAVE); + CleaveTimer = (10+rand()%6)*1000; + }else CleaveTimer -= diff; + + if (FrighteningShoutTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_FRIGHTENING_SHOUT); + FrighteningShoutTimer = (10+rand()%5)*1000; + }else FrighteningShoutTimer -= diff; + + if (Whirlwind1Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_WHIRLWIND1); + Whirlwind1Timer = (6+rand()%14)*1000; + }else Whirlwind1Timer -= diff; + + if (Whirlwind2Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_WHIRLWIND2); + Whirlwind2Timer = (10+rand()%15)*1000; + }else Whirlwind2Timer -= diff; + + if (MortalStrikeTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE); + MortalStrikeTimer = (10+rand()%20)*1000; + }else MortalStrikeTimer -= diff; + + // check if creature is not outside of building + if(ResetTimer < diff) + { + float x, y, z; + m_creature->GetPosition(x, y, z); + if(x > -504) + { + DoScriptText(YELL_EVADE, m_creature); + EnterEvadeMode(); + } + ResetTimer = 5000; + }else ResetTimer -= 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 -r b2b48f8cdc60 src/scripts/eastern_kingdoms/alterac_valley/boss_vanndar.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/scripts/eastern_kingdoms/alterac_valley/boss_vanndar.cpp Thu Jan 21 12:22:59 2010 +0100 @@ -0,0 +1,151 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * 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 + */ + +/* ScriptData +SDName: Boss_Vanndar +SD%Complete: +SDComment: Some spells listed on wowwiki but doesn't exist on wowhead +EndScriptData */ + +#include "ScriptedPch.h" + +#define YELL_AGGRO -1810008 + +#define YELL_EVADE -1810009 +#define YELL_RESPAWN1 -1810010 +#define YELL_RESPAWN2 -1810011 + +#define YELL_RANDOM1 -1810012 +#define YELL_RANDOM2 -1810013 +#define YELL_RANDOM3 -1810014 +#define YELL_RANDOM4 -1810015 +#define YELL_RANDOM5 -1810016 +#define YELL_RANDOM6 -1810017 +#define YELL_RANDOM7 -1810018 + + +#define SPELL_AVATAR 19135 +#define SPELL_THUNDERCLAP 15588 +#define SPELL_STORMBOLT 20685 // not sure + + +struct boss_vanndarAI : public ScriptedAI +{ + boss_vanndarAI(Creature *c) : ScriptedAI(c) {Reset();} + + + uint32 AvatarTimer; + uint32 ThunderclapTimer; + uint32 StormboltTimer; + uint32 ResetTimer; + uint32 YellTimer; + + + void Reset() + { + AvatarTimer = 3000; + ThunderclapTimer = 4000; + StormboltTimer = 6000; + ResetTimer = 5000; + YellTimer = (20+rand()%10)*1000; //20 to 30 seconds + } + + void Aggro(Unit *who) + { + DoScriptText(YELL_AGGRO, m_creature); + } + + void JustRespawned() + { + Reset(); + switch(rand()%1) + { + case 0: DoScriptText(YELL_RESPAWN1, m_creature); break; + case 1: DoScriptText(YELL_RESPAWN2, m_creature); break; + } + } + + void KilledUnit(Unit* victim){} + + void JustDied(Unit* Killer){} + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (AvatarTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_AVATAR); + AvatarTimer = (15+rand()%5)*1000; + }else AvatarTimer -= diff; + + if (ThunderclapTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_THUNDERCLAP); + ThunderclapTimer = (5+rand()%10)*1000; + }else ThunderclapTimer -= diff; + + if (StormboltTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_STORMBOLT); + StormboltTimer = (10+rand()%15)*1000; + }else StormboltTimer -= diff; + + if (YellTimer < diff) { + switch(rand()%6) + { + case 0: DoScriptText(YELL_RANDOM1, m_creature); break; + case 1: DoScriptText(YELL_RANDOM2, m_creature); break; + case 2: DoScriptText(YELL_RANDOM3, m_creature); break; + case 3: DoScriptText(YELL_RANDOM4, m_creature); break; + case 4: DoScriptText(YELL_RANDOM5, m_creature); break; + case 5: DoScriptText(YELL_RANDOM6, m_creature); break; + case 6: DoScriptText(YELL_RANDOM7, m_creature); break; + } + YellTimer = (20+rand()%10)*1000; //20 to 30 seconds + } else YellTimer -= diff; + + // check if creature is not outside of building + if(ResetTimer < diff) + { + float x, y, z; + m_creature->GetPosition(x, y, z); + if(x < 678) + { + DoScriptText(YELL_EVADE, m_creature); + EnterEvadeMode(); + } + ResetTimer = 5000; + }else ResetTimer -= 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(); +}