diff options
Diffstat (limited to 'src')
15 files changed, 1039 insertions, 708 deletions
diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h b/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h new file mode 100644 index 00000000000..969a81a537a --- /dev/null +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2008-2011 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, see <http://www.gnu.org/licenses/>. + */ + +#ifndef DEF_BLACKROCK_SPIRE_H +#define DEF_BLACKROCK_SPIRE_H + +uint32 const MAX_ENCOUNTER = 14; + +enum Data +{ + DATA_OMOKK, + DATA_SHADOW_HUNTER_VOSHGAJIN, + DATA_WARMASTER_VOONE, + DATA_MOTHER_SMOLDERWEB, + DATA_UROK_DOOMHOWL, // not scripted + DATA_QUARTERMASTER_ZIGRIS, + DATA_GIZRUL_THE_SLAVENER, // not scripted + DATA_HALYCON , + DATA_OVERLORD_WYRMTHALAK, + DATA_PYROGAURD_EMBERSEER, + DATA_WARCHIEF_REND_BLACKHAND, + DATA_GYTH, + DATA_THE_BEAST, + DATA_GENERAL_DRAKKISATH +}; + +enum Npc +{ + NPC_OMOKK = 9196, + NPC_SHADOW_HUNTER_VOSHGAJIN = 9236, + NPC_WARMASTER_VOONE = 9237, + NPC_MOTHER_SMOLDERWEB = 10596, + NPC_UROK_DOOMHOWL = 10584, + NPC_QUARTERMASTER_ZIGRIS = 9736, + NPC_GIZRUL_THE_SLAVENER = 10268, + NPC_HALYCON = 10220, + NPC_OVERLORD_WYRMTHALAK = 9568, + NPC_PYROGAURD_EMBERSEER = 9816, + NPC_WARCHIEF_REND_BLACKHAND = 10429, + NPC_GYTH = 10339, + NPC_THE_BEAST = 10430, + NPC_GENERAL_DRAKKISATH = 10363, +}; + +enum AchievementCriteriaIds +{ + CRITERIA_LEEROY = 7622, +}; + +#endif diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp index 8bf331f58f9..0e8b5dee7ff 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp @@ -15,90 +15,92 @@ * You should have received a copy of the GNU General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include "blackrock_spire.h" -/* ScriptData -SDName: Boss_Drakkisath -SD%Complete: 100 -SDComment: -SDCategory: Blackrock Spire -EndScriptData */ - -#include "ScriptPCH.h" +enum Spells +{ + SPELL_FIRENOVA = 23462, + SPELL_CLEAVE = 20691, + SPELL_CONFLIGURATION = 16805, + SPELL_THUNDERCLAP = 15548, //Not sure if right ID. 23931 would be a harder possibility. +}; -#define SPELL_FIRENOVA 23462 -#define SPELL_CLEAVE 20691 -#define SPELL_CONFLIGURATION 16805 -#define SPELL_THUNDERCLAP 15548 //Not sure if right ID. 23931 would be a harder possibility. +enum Events +{ + EVENT_FIRE_NOVA = 1, + EVENT_CLEAVE = 2, + EVENT_CONFLIGURATION = 3, + EVENT_THUNDERCLAP = 4, +}; class boss_drakkisath : public CreatureScript { public: boss_drakkisath() : CreatureScript("boss_drakkisath") { } - CreatureAI* GetAI(Creature* pCreature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_drakkisathAI (pCreature); + return new boss_drakkisathAI(creature); } - struct boss_drakkisathAI : public ScriptedAI + struct boss_drakkisathAI : public BossAI { - boss_drakkisathAI(Creature *c) : ScriptedAI(c) {} - - uint32 FireNova_Timer; - uint32 Cleave_Timer; - uint32 Confliguration_Timer; - uint32 Thunderclap_Timer; + boss_drakkisathAI(Creature* creature) : BossAI(creature, DATA_GENERAL_DRAKKISATH) {} void Reset() { - FireNova_Timer = 6000; - Cleave_Timer = 8000; - Confliguration_Timer = 15000; - Thunderclap_Timer = 17000; + _Reset(); + } + + void EnterCombat(Unit* /*who*/) + { + _EnterCombat(); + events.ScheduleEvent(EVENT_FIRE_NOVA, 6*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_CLEAVE, 8*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_CONFLIGURATION, 15*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_THUNDERCLAP, 17*IN_MILLISECONDS); } - void EnterCombat(Unit * /*who*/) + void JustDied(Unit* /*who*/) { + _JustDied(); } void UpdateAI(const uint32 diff) { - //Return since we have no target if (!UpdateVictim()) return; - //FireNova_Timer - if (FireNova_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_FIRENOVA); - FireNova_Timer = 10000; - } else FireNova_Timer -= diff; - - //Cleave_Timer - if (Cleave_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CLEAVE); - Cleave_Timer = 8000; - } else Cleave_Timer -= diff; + events.Update(diff); - //Confliguration_Timer - if (Confliguration_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CONFLIGURATION); - Confliguration_Timer = 18000; - } else Confliguration_Timer -= diff; + if (me->HasUnitState(UNIT_STAT_CASTING)) + return; - //Thunderclap_Timer - if (Thunderclap_Timer <= diff) + while (uint32 eventId = events.ExecuteEvent()) { - DoCast(me->getVictim(), SPELL_THUNDERCLAP); - Thunderclap_Timer = 20000; - } else Thunderclap_Timer -= diff; - + switch (eventId) + { + case EVENT_FIRE_NOVA: + DoCast(me->getVictim(), SPELL_FIRENOVA); + events.ScheduleEvent(EVENT_FIRE_NOVA, 10*IN_MILLISECONDS); + break; + case EVENT_CLEAVE: + DoCast(me->getVictim(), SPELL_CLEAVE); + events.ScheduleEvent(EVENT_CLEAVE, 8*IN_MILLISECONDS); + break; + case EVENT_CONFLIGURATION: + DoCast(me->getVictim(), SPELL_CONFLIGURATION); + events.ScheduleEvent(EVENT_CONFLIGURATION, 18*IN_MILLISECONDS); + break; + case EVENT_THUNDERCLAP: + DoCast(me->getVictim(), SPELL_THUNDERCLAP); + events.ScheduleEvent(EVENT_THUNDERCLAP, 20*IN_MILLISECONDS); + break; + } + } DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_drakkisath() diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp index ff74de7cdaf..68f5576dbe6 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp @@ -16,190 +16,160 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* ScriptData -SDName: Boss_Gyth -SD%Complete: 100 -SDComment: -SDCategory: Blackrock Spire -EndScriptData */ +#include "blackrock_spire.h" -#include "ScriptPCH.h" +enum Spells +{ + SPELL_CORROSIVE_ACID = 20667, + SPELL_FREEZE = 18763, + SPELL_FLAMEBREATH = 20712, + SPELL_SELF_ROOT_FOREVER = 33356, +}; + +enum Adds +{ + MODEL_REND_ON_DRAKE = 9723, // TODO: use creature_template 10459 instead of its modelid + NPC_RAGE_TALON_FIRE_TONG = 10372, + NPC_CHROMATIC_WHELP = 10442, + NPC_CHROMATIC_DRAGONSPAWN = 10447, + NPC_BLACKHAND_ELITE = 10317, +}; -#define SPELL_CORROSIVEACID 20667 -#define SPELL_FREEZE 18763 -#define SPELL_FLAMEBREATH 20712 +enum Events +{ + EVENT_SUMMON_REND = 1, + EVENT_AGGRO = 2, + EVENT_SUMMON_DRAGON_PACK = 3, + EVENT_SUMMON_ORC_PACK = 4, + EVENT_CORROSIVE_ACID = 5, + EVENT_FREEZE = 6, + EVENT_FLAME_BREATH = 7, +}; class boss_gyth : public CreatureScript { public: boss_gyth() : CreatureScript("boss_gyth") { } - CreatureAI* GetAI(Creature* pCreature) const + struct boss_gythAI : public BossAI { - return new boss_gythAI (pCreature); - } + boss_gythAI(Creature* creature) : BossAI(creature, DATA_GYTH) + { + DoCast(me, SPELL_SELF_ROOT_FOREVER); + } - struct boss_gythAI : public ScriptedAI - { - boss_gythAI(Creature *c) : ScriptedAI(c) {} - - uint32 Aggro_Timer; - uint32 Dragons_Timer; - uint32 Orc_Timer; - uint32 CorrosiveAcid_Timer; - uint32 Freeze_Timer; - uint32 Flamebreath_Timer; - uint32 Line1Count; - uint32 Line2Count; - - bool Event; - bool SummonedDragons; - bool SummonedOrcs; bool SummonedRend; - bool bAggro; - bool RootSelf; void Reset() { - Dragons_Timer = 3000; - Orc_Timer = 60000; - Aggro_Timer = 60000; - CorrosiveAcid_Timer = 8000; - Freeze_Timer = 11000; - Flamebreath_Timer = 4000; - Event = false; - SummonedDragons = false; - SummonedOrcs= false; + _Reset(); SummonedRend = false; - bAggro = false; - RootSelf = false; - - // how many times should the two lines of summoned creatures be spawned - // min 2 x 2, max 7 lines of attack in total - Line1Count = rand() % 4 + 2; - if (Line1Count < 5) - Line2Count = rand() % (5 - Line1Count) + 2; - else - Line2Count = 2; - //Invisible for event start - me->SetDisplayId(11686); + me->SetVisible(false); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); } - void EnterCombat(Unit * /*who*/) + void EnterCombat(Unit* /*who*/) { + _EnterCombat(); + events.ScheduleEvent(EVENT_SUMMON_DRAGON_PACK, 3*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_SUMMON_ORC_PACK, 60*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_AGGRO, 60*IN_MILLISECONDS); } - void SummonCreatureWithRandomTarget(uint32 creatureId) + void JustDied(Unit* /*who*/) { - Unit* Summoned = me->SummonCreature(creatureId, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 240000); - if (Summoned) - { - Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); - if (pTarget) - Summoned->AddThreat(pTarget, 1.0f); - } + _JustDied(); } - void UpdateAI(const uint32 diff) + void SummonCreatureWithRandomTarget(uint32 creatureId, uint8 count) { - //char buf[200]; + for (uint8 n = 0; n < count; n++) + if (Unit * Summoned = me->SummonCreature(creatureId, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 240*IN_MILLISECONDS)) + if (Unit * target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true)) + Summoned->AddThreat(target, 250.0f); + } - //Return since we have no target + void UpdateAI(uint32 const diff) + { if (!UpdateVictim()) return; - if (!RootSelf) - { - //me->m_canMove = true; - DoCast(me, 33356); - RootSelf = true; - } - - if (!bAggro && Line1Count == 0 && Line2Count == 0) + if (!SummonedRend && HealthBelowPct(11)) { - if (Aggro_Timer <= diff) - { - bAggro = true; - // Visible now! - me->SetDisplayId(9723); - me->setFaction(14); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } else Aggro_Timer -= diff; + events.ScheduleEvent(EVENT_SUMMON_REND, 8*IN_MILLISECONDS); + SummonedRend = true; } - // Summon Dragon pack. 2 Dragons and 3 Whelps - if (!bAggro && !SummonedRend && Line1Count > 0) - { - if (Dragons_Timer <= diff) - { - SummonCreatureWithRandomTarget(10372); - SummonCreatureWithRandomTarget(10372); - SummonCreatureWithRandomTarget(10442); - SummonCreatureWithRandomTarget(10442); - SummonCreatureWithRandomTarget(10442); - Line1Count = Line1Count - 1; - Dragons_Timer = 60000; - } else Dragons_Timer -= diff; - } + events.Update(diff); - //Summon Orc pack. 1 Orc Handler 1 Elite Dragonkin and 3 Whelps - if (!bAggro && !SummonedRend && Line1Count == 0 && Line2Count > 0) - { - if (Orc_Timer <= diff) - { - SummonCreatureWithRandomTarget(10447); - SummonCreatureWithRandomTarget(10317); - SummonCreatureWithRandomTarget(10442); - SummonCreatureWithRandomTarget(10442); - SummonCreatureWithRandomTarget(10442); - Line2Count = Line2Count - 1; - Orc_Timer = 60000; - } else Orc_Timer -= diff; - } + if (me->HasUnitState(UNIT_STAT_CASTING)) + return; - // we take part in the fight - if (bAggro) + while (uint32 eventId = events.ExecuteEvent()) { - // CorrosiveAcid_Timer - if (CorrosiveAcid_Timer <= diff) + switch (eventId) { - DoCast(me->getVictim(), SPELL_CORROSIVEACID); - CorrosiveAcid_Timer = 7000; - } else CorrosiveAcid_Timer -= diff; - - // Freeze_Timer - if (Freeze_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_FREEZE); - Freeze_Timer = 16000; - } else Freeze_Timer -= diff; - - // Flamebreath_Timer - if (Flamebreath_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_FLAMEBREATH); - Flamebreath_Timer = 10500; - } else Flamebreath_Timer -= diff; - - //Summon Rend - if (!SummonedRend && HealthBelowPct(11) && me->GetHealth() > 0) - { - //summon Rend and Change model to normal Gyth - //Interrupt any spell casting - me->InterruptNonMeleeSpells(false); - //Gyth model - me->SetDisplayId(9806); - me->SummonCreature(10429, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 900000); - SummonedRend = true; + case EVENT_SUMMON_REND: + // Summon Rend and Change model to normal Gyth + // Interrupt any spell casting + me->InterruptNonMeleeSpells(false); + // Gyth model + me->SetDisplayId(me->GetCreatureInfo()->Modelid1); + me->SummonCreature(NPC_WARCHIEF_REND_BLACKHAND, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 900*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_CORROSIVE_ACID, 8*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_FREEZE, 11*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_FLAME_BREATH, 4*IN_MILLISECONDS); + events.CancelEvent(EVENT_SUMMON_REND); + break; + case EVENT_AGGRO: + me->SetVisible(true); + me->SetDisplayId(MODEL_REND_ON_DRAKE); + me->setFaction(14); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + events.CancelEvent(EVENT_AGGRO); + break; + // Summon Dragon pack. 2 Dragons and 3 Whelps + case EVENT_SUMMON_DRAGON_PACK: + for (uint8 i = 0; i < urand(0, 3) + 2; ++i) + { + SummonCreatureWithRandomTarget(NPC_RAGE_TALON_FIRE_TONG, 2); + SummonCreatureWithRandomTarget(NPC_CHROMATIC_WHELP, 3); + } + events.CancelEvent(EVENT_SUMMON_DRAGON_PACK); + break; + // Summon Orc pack. 1 Orc Handler 1 Elite Dragonkin and 3 Whelps + case EVENT_SUMMON_ORC_PACK: + for (uint8 i = 0; i < urand (0, 5) + 2; ++i) + { + SummonCreatureWithRandomTarget(NPC_CHROMATIC_DRAGONSPAWN, 1); + SummonCreatureWithRandomTarget(NPC_BLACKHAND_ELITE, 1); + SummonCreatureWithRandomTarget(NPC_CHROMATIC_WHELP, 3); + } + events.CancelEvent(EVENT_SUMMON_ORC_PACK); + break; + case EVENT_CORROSIVE_ACID: + DoCast(me->getVictim(), SPELL_CORROSIVE_ACID); + events.ScheduleEvent(EVENT_CORROSIVE_ACID, 7*IN_MILLISECONDS); + break; + case EVENT_FREEZE: + DoCast(me->getVictim(), SPELL_FREEZE); + events.ScheduleEvent(EVENT_FREEZE, 16*IN_MILLISECONDS); + break; + case EVENT_FLAME_BREATH: + DoCast(me->getVictim(), SPELL_FLAMEBREATH); + events.ScheduleEvent(EVENT_FLAME_BREATH, 10500); + break; } - - DoMeleeAttackIfReady(); - } // end if Aggro + } + DoMeleeAttackIfReady(); } }; + CreatureAI* GetAI(Creature* creature) const + { + return new boss_gythAI(creature); + } }; void AddSC_boss_gyth() diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_halycon.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_halycon.cpp index e86b208c5d0..022e58051e7 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_halycon.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_halycon.cpp @@ -16,79 +16,87 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* ScriptData -SDName: Boss_Halycon -SD%Complete: 100 -SDComment: -SDCategory: Blackrock Spire -EndScriptData */ +#include "blackrock_spire.h" -#include "ScriptPCH.h" +enum Spells +{ + SPELL_CROWDPUMMEL = 10887, + SPELL_MIGHTYBLOW = 14099, +}; -#define SPELL_CROWDPUMMEL 10887 -#define SPELL_MIGHTYBLOW 14099 +enum Events +{ + EVENT_CROWD_PUMMEL = 1, + EVENT_MIGHTY_BLOW = 2, +}; -#define ADD_1X -169.839203f -#define ADD_1Y -324.961395f -#define ADD_1Z 64.401443f -#define ADD_1O 3.124724f +const Position SummonLocation = { -169.839f, -324.961f, 64.401f, 3.124f }; class boss_halycon : public CreatureScript { public: boss_halycon() : CreatureScript("boss_halycon") { } - CreatureAI* GetAI(Creature* pCreature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_halyconAI (pCreature); + return new boss_halyconAI(creature); } - struct boss_halyconAI : public ScriptedAI + struct boss_halyconAI : public BossAI { - boss_halyconAI(Creature *c) : ScriptedAI(c) {} + boss_halyconAI(Creature* creature) : BossAI(creature, DATA_HALYCON) {} - uint32 CrowdPummel_Timer; - uint32 MightyBlow_Timer; bool Summoned; void Reset() { - CrowdPummel_Timer = 8000; - MightyBlow_Timer = 14000; + _Reset(); Summoned = false; } - void EnterCombat(Unit * /*who*/) + void EnterCombat(Unit* /*who*/) { + _EnterCombat(); + events.ScheduleEvent(EVENT_CROWD_PUMMEL, 8*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_MIGHTY_BLOW, 14*IN_MILLISECONDS); } - void UpdateAI(const uint32 diff) + void JustDied(Unit* /*who*/) + { + _JustDied(); + } + + void UpdateAI(uint32 const diff) { - //Return since we have no target if (!UpdateVictim()) return; - //CrowdPummel_Timer - if (CrowdPummel_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CROWDPUMMEL); - CrowdPummel_Timer = 14000; - } else CrowdPummel_Timer -= diff; - - //MightyBlow_Timer - if (MightyBlow_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_MIGHTYBLOW); - MightyBlow_Timer = 10000; - } else MightyBlow_Timer -= diff; - //Summon Gizrul if (!Summoned && HealthBelowPct(25)) { - me->SummonCreature(10268,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,300000); + me->SummonCreature(NPC_GIZRUL_THE_SLAVENER, SummonLocation, TEMPSUMMON_TIMED_DESPAWN, 300*IN_MILLISECONDS); Summoned = true; } + events.Update(diff); + + if (me->HasUnitState(UNIT_STAT_CASTING)) + return; + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_CROWD_PUMMEL: + DoCast(me->getVictim(), SPELL_CROWDPUMMEL); + events.ScheduleEvent(EVENT_CROWD_PUMMEL, 14*IN_MILLISECONDS); + break; + case EVENT_MIGHTY_BLOW: + DoCast(me->getVictim(), SPELL_MIGHTYBLOW); + events.ScheduleEvent(EVENT_MIGHTY_BLOW, 10*IN_MILLISECONDS); + break; + } + } DoMeleeAttackIfReady(); } }; diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_highlord_omokk.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_highlord_omokk.cpp index a41c13112fe..7e438be1e19 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_highlord_omokk.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_highlord_omokk.cpp @@ -16,115 +16,110 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* ScriptData -SDName: Boss_Highlord_Omokk -SD%Complete: 100 -SDComment: -SDCategory: Blackrock Spire -EndScriptData */ +#include "blackrock_spire.h" -#include "ScriptPCH.h" +enum Spells +{ + SPELL_WARSTOMP = 24375, + SPELL_CLEAVE = 15579, + SPELL_STRIKE = 18368, + SPELL_REND = 18106, + SPELL_SUNDERARMOR = 24317, + SPELL_KNOCKAWAY = 20686, + SPELL_SLOW = 22356, +}; -#define SPELL_WARSTOMP 24375 -#define SPELL_CLEAVE 15579 -#define SPELL_STRIKE 18368 -#define SPELL_REND 18106 -#define SPELL_SUNDERARMOR 24317 -#define SPELL_KNOCKAWAY 20686 -#define SPELL_SLOW 22356 +enum Events +{ + EVENT_WARSTOMP = 1, + EVENT_CLEAVE = 2, + EVENT_STRIKE = 3, + EVENT_REND = 4, + EVENT_SUNDER_ARMOR = 5, + EVENT_KNOCK_AWAY = 6, + EVENT_SLOW = 7, +}; class boss_highlord_omokk : public CreatureScript { public: boss_highlord_omokk() : CreatureScript("boss_highlord_omokk") { } - CreatureAI* GetAI(Creature* pCreature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_highlordomokkAI (pCreature); + return new boss_highlordomokkAI(creature); } - struct boss_highlordomokkAI : public ScriptedAI + struct boss_highlordomokkAI : public BossAI { - boss_highlordomokkAI(Creature *c) : ScriptedAI(c) {} - - uint32 WarStomp_Timer; - uint32 Cleave_Timer; - uint32 Strike_Timer; - uint32 Rend_Timer; - uint32 SunderArmor_Timer; - uint32 KnockAway_Timer; - uint32 Slow_Timer; + boss_highlordomokkAI(Creature* creature) : BossAI(creature, DATA_OMOKK) {} void Reset() { - WarStomp_Timer = 15000; - Cleave_Timer = 6000; - Strike_Timer = 10000; - Rend_Timer = 14000; - SunderArmor_Timer = 2000; - KnockAway_Timer = 18000; - Slow_Timer = 24000; + _Reset(); } - void EnterCombat(Unit * /*who*/) + void EnterCombat(Unit* /*who*/) { + _EnterCombat(); + events.ScheduleEvent(EVENT_WARSTOMP, 15*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_CLEAVE, 6*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_STRIKE, 10*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_REND, 14*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_SUNDER_ARMOR, 2*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_KNOCK_AWAY, 18*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_SLOW, 24*IN_MILLISECONDS); } - void UpdateAI(const uint32 diff) + void JustDied(Unit* /*who*/) + { + _JustDied(); + } + + void UpdateAI(uint32 const diff) { - //Return since we have no target if (!UpdateVictim()) return; - //WarStomp_Timer - if (WarStomp_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_WARSTOMP); - WarStomp_Timer = 14000; - } else WarStomp_Timer -= diff; - - //Cleave_Timer - if (Cleave_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CLEAVE); - Cleave_Timer = 8000; - } else Cleave_Timer -= diff; - - //Strike_Timer - if (Strike_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_STRIKE); - Strike_Timer = 10000; - } else Strike_Timer -= diff; - - //Rend_Timer - if (Rend_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_REND); - Rend_Timer = 18000; - } else Rend_Timer -= diff; + events.Update(diff); - //SunderArmor_Timer - if (SunderArmor_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SUNDERARMOR); - SunderArmor_Timer = 25000; - } else SunderArmor_Timer -= diff; - - //KnockAway_Timer - if (KnockAway_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_KNOCKAWAY); - KnockAway_Timer = 12000; - } else KnockAway_Timer -= diff; + if (me->HasUnitState(UNIT_STAT_CASTING)) + return; - //Slow_Timer - if (Slow_Timer <= diff) + while (uint32 eventId = events.ExecuteEvent()) { - DoCast(me->getVictim(), SPELL_SLOW); - Slow_Timer = 18000; - } else Slow_Timer -= diff; - + switch (eventId) + { + case EVENT_WARSTOMP: + DoCast(me->getVictim(), SPELL_WARSTOMP); + events.ScheduleEvent(EVENT_WARSTOMP, 14*IN_MILLISECONDS); + break; + case EVENT_CLEAVE: + DoCast(me->getVictim(), SPELL_CLEAVE); + events.ScheduleEvent(EVENT_CLEAVE, 8*IN_MILLISECONDS); + break; + case EVENT_STRIKE: + DoCast(me->getVictim(), SPELL_STRIKE); + events.ScheduleEvent(EVENT_STRIKE, 10*IN_MILLISECONDS); + break; + case EVENT_REND: + DoCast(me->getVictim(), SPELL_REND); + events.ScheduleEvent(EVENT_REND, 18*IN_MILLISECONDS); + break; + case EVENT_SUNDER_ARMOR: + DoCast(me->getVictim(), SPELL_SUNDERARMOR); + events.ScheduleEvent(EVENT_SUNDER_ARMOR, 25*IN_MILLISECONDS); + break; + case EVENT_KNOCK_AWAY: + DoCast(me->getVictim(), SPELL_KNOCKAWAY); + events.ScheduleEvent(EVENT_KNOCK_AWAY, 12*IN_MILLISECONDS); + break; + case EVENT_SLOW: + DoCast(me->getVictim(), SPELL_SLOW); + events.ScheduleEvent(EVENT_SLOW, 18*IN_MILLISECONDS); + break; + } + } DoMeleeAttackIfReady(); } }; diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_mother_smolderweb.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_mother_smolderweb.cpp index a1d1c783ee5..ebfc10d28e2 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_mother_smolderweb.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_mother_smolderweb.cpp @@ -16,70 +16,82 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* ScriptData -SDName: Boss_Mother_Smolderweb -SD%Complete: 100 -SDComment: Uncertain how often mother's milk is casted -SDCategory: Blackrock Spire -EndScriptData */ +#include "blackrock_spire.h" -#include "ScriptPCH.h" +enum Spells +{ + SPELL_CRYSTALIZE = 16104, + SPELL_MOTHERSMILK = 16468, + SPELL_SUMMON_SPIRE_SPIDERLING = 16103, +}; -#define SPELL_CRYSTALIZE 16104 -#define SPELL_MOTHERSMILK 16468 -#define SPELL_SUMMON_SPIRE_SPIDERLING 16103 +enum Events +{ + EVENT_CRYSTALIZE = 1, + EVENT_MOTHERS_MILK = 2, +}; class boss_mother_smolderweb : public CreatureScript { public: boss_mother_smolderweb() : CreatureScript("boss_mother_smolderweb") { } - CreatureAI* GetAI(Creature* pCreature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_mothersmolderwebAI (pCreature); + return new boss_mothersmolderwebAI(creature); } - struct boss_mothersmolderwebAI : public ScriptedAI + struct boss_mothersmolderwebAI : public BossAI { - boss_mothersmolderwebAI(Creature *c) : ScriptedAI(c) {} - - uint32 Crystalize_Timer; - uint32 MothersMilk_Timer; + boss_mothersmolderwebAI(Creature* creature) : BossAI(creature, DATA_MOTHER_SMOLDERWEB) {} void Reset() { - Crystalize_Timer = 20000; - MothersMilk_Timer = 10000; + _Reset(); + } + + void EnterCombat(Unit* /*who*/) + { + _EnterCombat(); + events.ScheduleEvent(EVENT_CRYSTALIZE, 20*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_MOTHERS_MILK, 10*IN_MILLISECONDS); } - void EnterCombat(Unit * /*who*/) {} + void JustDied(Unit* /*who*/) + { + _JustDied(); + } - void DamageTaken(Unit * /*done_by*/, uint32 &damage) + void DamageTaken(Unit* /*done_by*/, uint32 &damage) { if (me->GetHealth() <= damage) DoCast(me, SPELL_SUMMON_SPIRE_SPIDERLING, true); } - void UpdateAI(const uint32 diff) + void UpdateAI(uint32 const diff) { - //Return since we have no target if (!UpdateVictim()) return; - //Crystalize_Timer - if (Crystalize_Timer <= diff) - { - DoCast(me, SPELL_CRYSTALIZE); - Crystalize_Timer = 15000; - } else Crystalize_Timer -= diff; + events.Update(diff); - //MothersMilk_Timer - if (MothersMilk_Timer <= diff) - { - DoCast(me, SPELL_MOTHERSMILK); - MothersMilk_Timer = urand(5000,12500); - } else MothersMilk_Timer -= diff; + if (me->HasUnitState(UNIT_STAT_CASTING)) + return; + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_CRYSTALIZE: + DoCast(me, SPELL_CRYSTALIZE); + events.ScheduleEvent(EVENT_CRYSTALIZE, 15*IN_MILLISECONDS); + break; + case EVENT_MOTHERS_MILK: + DoCast(me, SPELL_MOTHERSMILK); + events.ScheduleEvent(EVENT_MOTHERS_MILK, urand(5*IN_MILLISECONDS,12500)); + break; + } + } DoMeleeAttackIfReady(); } }; diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp index a85b03b1b9c..cd8e7791a91 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp @@ -16,113 +16,117 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* ScriptData -SDName: Boss_Overlord_Wyrmthalak -SD%Complete: 100 -SDComment: -SDCategory: Blackrock Spire -EndScriptData */ - -#include "ScriptPCH.h" - -#define SPELL_BLASTWAVE 11130 -#define SPELL_SHOUT 23511 -#define SPELL_CLEAVE 20691 -#define SPELL_KNOCKAWAY 20686 - -#define ADD_1X -39.355381f -#define ADD_1Y -513.456482f -#define ADD_1Z 88.472046f -#define ADD_1O 4.679872f - -#define ADD_2X -49.875881f -#define ADD_2Y -511.896942f -#define ADD_2Z 88.195160f -#define ADD_2O 4.613114f +#include "blackrock_spire.h" + +enum Spells +{ + SPELL_BLASTWAVE = 11130, + SPELL_SHOUT = 23511, + SPELL_CLEAVE = 20691, + SPELL_KNOCKAWAY = 20686, +}; + +enum Events +{ + EVENT_BLAST_WAVE = 1, + EVENT_SHOUT = 2, + EVENT_CLEAVE = 3, + EVENT_KNOCK_AWAY = 4, +}; + +enum Adds +{ + NPC_SPIRESTONE_WARLORD = 9216, + NPC_SMOLDERTHORN_BERSERKER = 9268, + +}; + +const Position SummonLocation1 = { -39.355f, -513.456f, 88.472f, 4.679f }; +const Position SummonLocation2 = { -49.875f, -511.896f, 88.195f, 4.613f }; class boss_overlord_wyrmthalak : public CreatureScript { public: boss_overlord_wyrmthalak() : CreatureScript("boss_overlord_wyrmthalak") { } - CreatureAI* GetAI(Creature* pCreature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_overlordwyrmthalakAI (pCreature); + return new boss_overlordwyrmthalakAI(creature); } - struct boss_overlordwyrmthalakAI : public ScriptedAI + struct boss_overlordwyrmthalakAI : public BossAI { - boss_overlordwyrmthalakAI(Creature *c) : ScriptedAI(c) {} + boss_overlordwyrmthalakAI(Creature* creature) : BossAI(creature, DATA_OVERLORD_WYRMTHALAK) {} - uint32 BlastWave_Timer; - uint32 Shout_Timer; - uint32 Cleave_Timer; - uint32 Knockaway_Timer; bool Summoned; void Reset() { - BlastWave_Timer = 20000; - Shout_Timer = 2000; - Cleave_Timer = 6000; - Knockaway_Timer = 12000; + _Reset(); Summoned = false; } - void EnterCombat(Unit * /*who*/) + void EnterCombat(Unit* /*who*/) { + _EnterCombat(); + events.ScheduleEvent(EVENT_BLAST_WAVE, 20*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_SHOUT, 2*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_CLEAVE, 6*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_KNOCK_AWAY, 12*IN_MILLISECONDS); } - void UpdateAI(const uint32 diff) + void JustDied(Unit* /*who*/) + { + _JustDied(); + } + + void UpdateAI(uint32 const diff) { - //Return since we have no target if (!UpdateVictim()) return; - //BlastWave_Timer - if (BlastWave_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_BLASTWAVE); - BlastWave_Timer = 20000; - } else BlastWave_Timer -= diff; - - //Shout_Timer - if (Shout_Timer <= diff) + if (!Summoned && HealthBelowPct(51)) { - DoCast(me->getVictim(), SPELL_SHOUT); - Shout_Timer = 10000; - } else Shout_Timer -= diff; + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0, 100, true)) + { + if (Creature* warlord = me->SummonCreature(NPC_SPIRESTONE_WARLORD, SummonLocation1, TEMPSUMMON_TIMED_DESPAWN,300*IN_MILLISECONDS)) + warlord->AI()->AttackStart(target); + if (Creature* berserker = me->SummonCreature(NPC_SMOLDERTHORN_BERSERKER, SummonLocation2, TEMPSUMMON_TIMED_DESPAWN,300*IN_MILLISECONDS)) + berserker->AI()->AttackStart(target); + Summoned = true; + } + } - //Cleave_Timer - if (Cleave_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CLEAVE); - Cleave_Timer = 7000; - } else Cleave_Timer -= diff; + events.Update(diff); - //Knockaway_Timer - if (Knockaway_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_KNOCKAWAY); - Knockaway_Timer = 14000; - } else Knockaway_Timer -= diff; + if (me->HasUnitState(UNIT_STAT_CASTING)) + return; - //Summon two Beserks - if (!Summoned && HealthBelowPct(51)) + while (uint32 eventId = events.ExecuteEvent()) { - Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0, 100, true); - - if (Creature *SummonedCreature = me->SummonCreature(9216,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,300000)) - SummonedCreature->AI()->AttackStart(pTarget); - if (Creature *SummonedCreature = me->SummonCreature(9268,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,300000)) - SummonedCreature->AI()->AttackStart(pTarget); - Summoned = true; + switch (eventId) + { + case EVENT_BLAST_WAVE: + DoCast(me->getVictim(), SPELL_BLASTWAVE); + events.ScheduleEvent(EVENT_BLAST_WAVE, 20*IN_MILLISECONDS); + break; + case EVENT_SHOUT: + DoCast(me->getVictim(), SPELL_SHOUT); + events.ScheduleEvent(EVENT_SHOUT, 10*IN_MILLISECONDS); + break; + case EVENT_CLEAVE: + DoCast(me->getVictim(), SPELL_CLEAVE); + events.ScheduleEvent(EVENT_CLEAVE, 7*IN_MILLISECONDS); + break; + case EVENT_KNOCK_AWAY: + DoCast(me->getVictim(), SPELL_KNOCKAWAY); + events.ScheduleEvent(EVENT_KNOCK_AWAY, 14*IN_MILLISECONDS); + break; + } } - DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_overlordwyrmthalak() diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp index 5cb4bd68a1f..dd8ab8dfc0b 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp @@ -16,80 +16,87 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* ScriptData -SDName: Boss_Pyroguard_Emberseer -SD%Complete: 100 -SDComment: Event to activate Emberseer NYI -SDCategory: Blackrock Spire -EndScriptData */ +#include "blackrock_spire.h" -#include "ScriptPCH.h" +enum Spells +{ + SPELL_FIRENOVA = 23462, + SPELL_FLAMEBUFFET = 23341, + SPELL_PYROBLAST = 17274, +}; + +enum Events +{ + EVENT_FIRENOVA = 1, + EVENT_FLAMEBUFFET = 2, + EVENT_PYROBLAST = 3, +}; -#define SPELL_FIRENOVA 23462 -#define SPELL_FLAMEBUFFET 23341 -#define SPELL_PYROBLAST 17274 class boss_pyroguard_emberseer : public CreatureScript { public: boss_pyroguard_emberseer() : CreatureScript("boss_pyroguard_emberseer") { } - CreatureAI* GetAI(Creature* pCreature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_pyroguard_emberseerAI (pCreature); + return new boss_pyroguard_emberseerAI(creature); } - struct boss_pyroguard_emberseerAI : public ScriptedAI + struct boss_pyroguard_emberseerAI : public BossAI { - boss_pyroguard_emberseerAI(Creature *c) : ScriptedAI(c) {} - - uint32 FireNova_Timer; - uint32 FlameBuffet_Timer; - uint32 PyroBlast_Timer; + boss_pyroguard_emberseerAI(Creature* creature) : BossAI(creature, DATA_PYROGAURD_EMBERSEER) {} void Reset() { - FireNova_Timer = 6000; - FlameBuffet_Timer = 3000; - PyroBlast_Timer = 14000; + _Reset(); + } + + void EnterCombat(Unit* /*who*/) + { + _EnterCombat(); + events.ScheduleEvent(EVENT_FIRENOVA, 6*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_FLAMEBUFFET, 3*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_PYROBLAST, 14*IN_MILLISECONDS); } - void EnterCombat(Unit * /*who*/) + void JustDied(Unit* /*who*/) { + _JustDied(); } - void UpdateAI(const uint32 diff) + void UpdateAI(uint32 const diff) { - //Return since we have no target if (!UpdateVictim()) return; - //FireNova_Timer - if (FireNova_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_FIRENOVA); - FireNova_Timer = 6000; - } else FireNova_Timer -= diff; + events.Update(diff); - //FlameBuffet_Timer - if (FlameBuffet_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_FLAMEBUFFET); - FlameBuffet_Timer = 14000; - } else FlameBuffet_Timer -= diff; + if (me->HasUnitState(UNIT_STAT_CASTING)) + return; - //PyroBlast_Timer - if (PyroBlast_Timer <= diff) + while (uint32 eventId = events.ExecuteEvent()) { - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - DoCast(pTarget, SPELL_PYROBLAST); - PyroBlast_Timer = 15000; - } else PyroBlast_Timer -= diff; - + switch (eventId) + { + case EVENT_FIRENOVA: + DoCast(me->getVictim(), SPELL_FIRENOVA); + events.ScheduleEvent(EVENT_FIRENOVA, 6*IN_MILLISECONDS); + break; + case EVENT_FLAMEBUFFET: + DoCast(me->getVictim(), SPELL_FLAMEBUFFET); + events.ScheduleEvent(EVENT_FLAMEBUFFET, 14*IN_MILLISECONDS); + break; + case EVENT_PYROBLAST: + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + DoCast(target, SPELL_PYROBLAST); + events.ScheduleEvent(EVENT_PYROBLAST, 15*IN_MILLISECONDS); + break; + } + } DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_pyroguard_emberseer() diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp index 8205a6a0ef7..881812c2883 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp @@ -16,73 +16,80 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* ScriptData -SDName: Boss_Quartmaster_Zigris -SD%Complete: 100 -SDComment: Needs revision -SDCategory: Blackrock Spire -EndScriptData */ +#include "blackrock_spire.h" -#include "ScriptPCH.h" +enum Spells +{ + SPELL_SHOOT = 16496, + SPELL_STUNBOMB = 16497, + SPELL_HEALING_POTION = 15504, + SPELL_HOOKEDNET = 15609, +}; -#define SPELL_SHOOT 16496 -#define SPELL_STUNBOMB 16497 -#define SPELL_HEALING_POTION 15504 -#define SPELL_HOOKEDNET 15609 +enum Events +{ + EVENT_SHOOT = 1, + EVENT_STUN_BOMB = 2, +}; class quartermaster_zigris : public CreatureScript { public: quartermaster_zigris() : CreatureScript("quartermaster_zigris") { } - CreatureAI* GetAI(Creature* pCreature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_quatermasterzigrisAI (pCreature); + return new boss_quatermasterzigrisAI(creature); } - struct boss_quatermasterzigrisAI : public ScriptedAI + struct boss_quatermasterzigrisAI : public BossAI { - boss_quatermasterzigrisAI(Creature *c) : ScriptedAI(c) {} - - uint32 Shoot_Timer; - uint32 StunBomb_Timer; - //uint32 HelingPotion_Timer; + boss_quatermasterzigrisAI(Creature* creature) : BossAI(creature, DATA_QUARTERMASTER_ZIGRIS) {} void Reset() { - Shoot_Timer = 1000; - StunBomb_Timer = 16000; - //HelingPotion_Timer = 25000; + _Reset(); } - void EnterCombat(Unit * /*who*/) + void EnterCombat(Unit* /*who*/) { + _EnterCombat(); + events.ScheduleEvent(EVENT_SHOOT, 1*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_STUN_BOMB, 16*IN_MILLISECONDS); } - void UpdateAI(const uint32 diff) + void JustDied(Unit* /*who*/) + { + _JustDied(); + } + + void UpdateAI(uint32 const diff) { - //Return since we have no target if (!UpdateVictim()) return; - //Shoot_Timer - if (Shoot_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SHOOT); - Shoot_Timer = 500; - } else Shoot_Timer -= diff; + events.Update(diff); - //StunBomb_Timer - if (StunBomb_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_STUNBOMB); - StunBomb_Timer = 14000; - } else StunBomb_Timer -= diff; + if (me->HasUnitState(UNIT_STAT_CASTING)) + return; + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_SHOOT: + DoCast(me->getVictim(), SPELL_SHOOT); + events.ScheduleEvent(EVENT_SHOOT, 500); + break; + case EVENT_STUN_BOMB: + DoCast(me->getVictim(), SPELL_STUNBOMB); + events.ScheduleEvent(EVENT_STUN_BOMB, 14*IN_MILLISECONDS); + break; + } + } DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_quatermasterzigris() diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp index dba2b386f4e..9813fa535f5 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp @@ -16,79 +16,85 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* ScriptData -SDName: Boss_Rend_Blackhand -SD%Complete: 100 -SDComment: Intro event NYI -SDCategory: Blackrock Spire -EndScriptData */ +#include "blackrock_spire.h" -#include "ScriptPCH.h" +enum Spells +{ + SPELL_WHIRLWIND = 26038, + SPELL_CLEAVE = 20691, + SPELL_THUNDERCLAP = 23931, //Not sure if he cast this spell +}; -#define SPELL_WHIRLWIND 26038 -#define SPELL_CLEAVE 20691 -#define SPELL_THUNDERCLAP 23931 //Not sure if he cast this spell +enum Events +{ + EVENT_WHIRLWIND = 1, + EVENT_CLEAVE = 2, + EVENT_THUNDERCLAP = 3, +}; class boss_rend_blackhand : public CreatureScript { public: boss_rend_blackhand() : CreatureScript("boss_rend_blackhand") { } - CreatureAI* GetAI(Creature* pCreature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_rend_blackhandAI (pCreature); + return new boss_rend_blackhandAI(creature); } - struct boss_rend_blackhandAI : public ScriptedAI + struct boss_rend_blackhandAI : public BossAI { - boss_rend_blackhandAI(Creature *c) : ScriptedAI(c) {} - - uint32 WhirlWind_Timer; - uint32 Cleave_Timer; - uint32 Thunderclap_Timer; + boss_rend_blackhandAI(Creature* creature) : BossAI(creature, DATA_WARCHIEF_REND_BLACKHAND) {} void Reset() { - WhirlWind_Timer = 20000; - Cleave_Timer = 5000; - Thunderclap_Timer = 9000; + _Reset(); } - void EnterCombat(Unit * /*who*/) + void EnterCombat(Unit* /*who*/) { + _EnterCombat(); + events.ScheduleEvent(EVENT_WHIRLWIND, 20*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_CLEAVE, 5*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_THUNDERCLAP, 9*IN_MILLISECONDS); } - void UpdateAI(const uint32 diff) + void JustDied(Unit* /*who*/) + { + _JustDied(); + } + + void UpdateAI(uint32 const diff) { - //Return since we have no target if (!UpdateVictim()) return; - //WhirlWind_Timer - if (WhirlWind_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_WHIRLWIND); - WhirlWind_Timer = 18000; - } else WhirlWind_Timer -= diff; + events.Update(diff); - //Cleave_Timer - if (Cleave_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CLEAVE); - Cleave_Timer = 10000; - } else Cleave_Timer -= diff; + if (me->HasUnitState(UNIT_STAT_CASTING)) + return; - //Thunderclap_Timer - if (Thunderclap_Timer <= diff) + while (uint32 eventId = events.ExecuteEvent()) { - DoCast(me->getVictim(), SPELL_THUNDERCLAP); - Thunderclap_Timer = 16000; - } else Thunderclap_Timer -= diff; - + switch (eventId) + { + case EVENT_WHIRLWIND: + DoCast(me->getVictim(), SPELL_WHIRLWIND); + events.ScheduleEvent(EVENT_WHIRLWIND, 18*IN_MILLISECONDS); + break; + case EVENT_CLEAVE: + DoCast(me->getVictim(), SPELL_CLEAVE); + events.ScheduleEvent(EVENT_CLEAVE, 10*IN_MILLISECONDS); + break; + case EVENT_THUNDERCLAP: + DoCast(me->getVictim(), SPELL_THUNDERCLAP); + events.ScheduleEvent(EVENT_THUNDERCLAP, 16*IN_MILLISECONDS); + break; + } + } DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_rend_blackhand() diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp index d90286084d1..0638ea7c503 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp @@ -16,76 +16,84 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* ScriptData -SDName: Boss_Shadow_Hunter_Voshgajin -SD%Complete: 100 -SDComment: -SDCategory: Blackrock Spire -EndScriptData */ +#include "blackrock_spire.h" -#include "ScriptPCH.h" +enum Spells +{ + SPELL_CURSEOFBLOOD = 24673, + SPELL_HEX = 16708, + SPELL_CLEAVE = 20691, +}; -#define SPELL_CURSEOFBLOOD 24673 -#define SPELL_HEX 16708 -#define SPELL_CLEAVE 20691 +enum Events +{ + EVENT_CURSE_OF_BLOOD = 1, + EVENT_HEX = 2, + EVENT_CLEAVE = 3, +}; class boss_shadow_hunter_voshgajin : public CreatureScript { public: boss_shadow_hunter_voshgajin() : CreatureScript("boss_shadow_hunter_voshgajin") { } - CreatureAI* GetAI(Creature* pCreature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_shadowvoshAI (pCreature); + return new boss_shadowvoshAI(creature); } - struct boss_shadowvoshAI : public ScriptedAI + struct boss_shadowvoshAI : public BossAI { - boss_shadowvoshAI(Creature *c) : ScriptedAI(c) {} - - uint32 CurseOfBlood_Timer; - uint32 Hex_Timer; - uint32 Cleave_Timer; + boss_shadowvoshAI(Creature* creature) : BossAI(creature, DATA_SHADOW_HUNTER_VOSHGAJIN) {} void Reset() { - CurseOfBlood_Timer = 2000; - Hex_Timer = 8000; - Cleave_Timer = 14000; - + _Reset(); //DoCast(me, SPELL_ICEARMOR, true); } - void EnterCombat(Unit * /*who*/){} + void EnterCombat(Unit * /*who*/) + { + _EnterCombat(); + events.ScheduleEvent(EVENT_CURSE_OF_BLOOD, 2*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_HEX, 8*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_CLEAVE, 14*IN_MILLISECONDS); + } - void UpdateAI(const uint32 diff) + void JustDied(Unit* /*who*/) + { + _JustDied(); + } + + void UpdateAI(uint32 const diff) { - //Return since we have no target if (!UpdateVictim()) return; - //CurseOfBlood_Timer - if (CurseOfBlood_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CURSEOFBLOOD); - CurseOfBlood_Timer = 45000; - } else CurseOfBlood_Timer -= diff; + events.Update(diff); - //Hex_Timer - if (Hex_Timer <= diff) - { - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - DoCast(pTarget, SPELL_HEX); - Hex_Timer = 15000; - } else Hex_Timer -= diff; + if (me->HasUnitState(UNIT_STAT_CASTING)) + return; - //Cleave_Timer - if (Cleave_Timer <= diff) + while (uint32 eventId = events.ExecuteEvent()) { - DoCast(me->getVictim(), SPELL_CLEAVE); - Cleave_Timer = 7000; - } else Cleave_Timer -= diff; - + switch (eventId) + { + case EVENT_CURSE_OF_BLOOD: + DoCast(me->getVictim(), SPELL_CURSEOFBLOOD); + events.ScheduleEvent(EVENT_CURSE_OF_BLOOD, 45*IN_MILLISECONDS); + break; + case EVENT_HEX: + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + DoCast(pTarget, SPELL_HEX); + events.ScheduleEvent(EVENT_HEX, 15*IN_MILLISECONDS); + break; + case EVENT_CLEAVE: + DoCast(me->getVictim(), SPELL_CLEAVE); + events.ScheduleEvent(EVENT_CLEAVE, 7*IN_MILLISECONDS); + break; + } + } DoMeleeAttackIfReady(); } }; diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_the_beast.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_the_beast.cpp index b16c960751a..9bb18bcdf2f 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_the_beast.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_the_beast.cpp @@ -16,80 +16,86 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* ScriptData -SDName: Boss_The_Best -SD%Complete: 100 -SDComment: -SDCategory: Blackrock Spire -EndScriptData */ +#include "blackrock_spire.h" -#include "ScriptPCH.h" +enum Spells +{ + SPELL_FLAMEBREAK = 16785, + SPELL_IMMOLATE = 20294, + SPELL_TERRIFYINGROAR = 14100, +}; -#define SPELL_FLAMEBREAK 16785 -#define SPELL_IMMOLATE 20294 -#define SPELL_TERRIFYINGROAR 14100 +enum Events +{ + EVENT_FLAME_BREAK = 1, + EVENT_IMMOLATE = 2, + EVENT_TERRIFYING_ROAR = 3, +}; class boss_the_beast : public CreatureScript { public: boss_the_beast() : CreatureScript("boss_the_beast") { } - CreatureAI* GetAI(Creature* pCreature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_thebeastAI (pCreature); + return new boss_thebeastAI(creature); } - struct boss_thebeastAI : public ScriptedAI + struct boss_thebeastAI : public BossAI { - boss_thebeastAI(Creature *c) : ScriptedAI(c) {} - - uint32 Flamebreak_Timer; - uint32 Immolate_Timer; - uint32 TerrifyingRoar_Timer; + boss_thebeastAI(Creature* creature) : BossAI(creature, DATA_THE_BEAST) {} void Reset() { - Flamebreak_Timer = 12000; - Immolate_Timer = 3000; - TerrifyingRoar_Timer = 23000; + _Reset(); } - void EnterCombat(Unit * /*who*/) + void EnterCombat(Unit* /*who*/) { + _EnterCombat(); + events.ScheduleEvent(EVENT_FLAME_BREAK, 12*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_IMMOLATE, 3*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_TERRIFYING_ROAR, 23*IN_MILLISECONDS); } - void UpdateAI(const uint32 diff) + void JustDied(Unit* /*who*/) + { + _JustDied(); + } + + void UpdateAI(uint32 const diff) { - //Return since we have no target if (!UpdateVictim()) return; - //Flamebreak_Timer - if (Flamebreak_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_FLAMEBREAK); - Flamebreak_Timer = 10000; - } else Flamebreak_Timer -= diff; + events.Update(diff); - //Immolate_Timer - if (Immolate_Timer <= diff) - { - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - DoCast(pTarget, SPELL_IMMOLATE); - Immolate_Timer = 8000; - } else Immolate_Timer -= diff; + if (me->HasUnitState(UNIT_STAT_CASTING)) + return; - //TerrifyingRoar_Timer - if (TerrifyingRoar_Timer <= diff) + while (uint32 eventId = events.ExecuteEvent()) { - DoCast(me->getVictim(), SPELL_TERRIFYINGROAR); - TerrifyingRoar_Timer = 20000; - } else TerrifyingRoar_Timer -= diff; - + switch (eventId) + { + case EVENT_FLAME_BREAK: + DoCast(me->getVictim(), SPELL_FLAMEBREAK); + events.ScheduleEvent(EVENT_FLAME_BREAK, 10*IN_MILLISECONDS); + break; + case EVENT_IMMOLATE: + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + DoCast(target, SPELL_IMMOLATE); + events.ScheduleEvent(EVENT_IMMOLATE, 8*IN_MILLISECONDS); + break; + case EVENT_TERRIFYING_ROAR: + DoCast(me->getVictim(), SPELL_TERRIFYINGROAR); + events.ScheduleEvent(EVENT_TERRIFYING_ROAR, 20*IN_MILLISECONDS); + break; + } + } DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_thebeast() diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_warmaster_voone.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_warmaster_voone.cpp index ca76f626099..77dea5123ca 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_warmaster_voone.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_warmaster_voone.cpp @@ -16,105 +16,103 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* ScriptData -SDName: Boss_Warmaster_Voone -SD%Complete: 100 -SDComment: -SDCategory: Blackrock Spire -EndScriptData */ +#include "blackrock_spire.h" -#include "ScriptPCH.h" +enum Spells +{ + SPELL_SNAPKICK = 15618, + SPELL_CLEAVE = 15579, + SPELL_UPPERCUT = 10966, + SPELL_MORTALSTRIKE = 16856, + SPELL_PUMMEL = 15615, + SPELL_THROWAXE = 16075, +}; -#define SPELL_SNAPKICK 15618 -#define SPELL_CLEAVE 15579 -#define SPELL_UPPERCUT 10966 -#define SPELL_MORTALSTRIKE 16856 -#define SPELL_PUMMEL 15615 -#define SPELL_THROWAXE 16075 +enum Events +{ + EVENT_SNAP_KICK = 1, + EVENT_CLEAVE = 2, + EVENT_UPPERCUT = 3, + EVENT_MORTAL_STRIKE = 4, + EVENT_PUMMEL = 5, + EVENT_THROW_AXE = 6, +}; class boss_warmaster_voone : public CreatureScript { public: boss_warmaster_voone() : CreatureScript("boss_warmaster_voone") { } - CreatureAI* GetAI(Creature* pCreature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_warmastervooneAI (pCreature); + return new boss_warmastervooneAI(creature); } - struct boss_warmastervooneAI : public ScriptedAI + struct boss_warmastervooneAI : public BossAI { - boss_warmastervooneAI(Creature *c) : ScriptedAI(c) {} - - uint32 Snapkick_Timer; - uint32 Cleave_Timer; - uint32 Uppercut_Timer; - uint32 MortalStrike_Timer; - uint32 Pummel_Timer; - uint32 ThrowAxe_Timer; + boss_warmastervooneAI(Creature* creature) : BossAI(creature, DATA_WARMASTER_VOONE) {} void Reset() { - Snapkick_Timer = 8000; - Cleave_Timer = 14000; - Uppercut_Timer = 20000; - MortalStrike_Timer = 12000; - Pummel_Timer = 32000; - ThrowAxe_Timer = 1000; + _Reset(); } void EnterCombat(Unit * /*who*/) { + _EnterCombat(); + events.ScheduleEvent(EVENT_SNAP_KICK, 8*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_CLEAVE, 14*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_UPPERCUT, 20*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_MORTAL_STRIKE, 12*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_PUMMEL, 32*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_THROW_AXE, 1*IN_MILLISECONDS); + } + + void JustDied(Unit* /*who*/) + { + _JustDied(); } void UpdateAI(const uint32 diff) { - //Return since we have no target if (!UpdateVictim()) return; - //Snapkick_Timer - if (Snapkick_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SNAPKICK); - Snapkick_Timer = 6000; - } else Snapkick_Timer -= diff; - - //Cleave_Timer - if (Cleave_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CLEAVE); - Cleave_Timer = 12000; - } else Cleave_Timer -= diff; + events.Update(diff); - //Uppercut_Timer - if (Uppercut_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_UPPERCUT); - Uppercut_Timer = 14000; - } else Uppercut_Timer -= diff; - - //MortalStrike_Timer - if (MortalStrike_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_MORTALSTRIKE); - MortalStrike_Timer = 10000; - } else MortalStrike_Timer -= diff; - - //Pummel_Timer - if (Pummel_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_PUMMEL); - Pummel_Timer = 16000; - } else Pummel_Timer -= diff; + if (me->HasUnitState(UNIT_STAT_CASTING)) + return; - //ThrowAxe_Timer - if (ThrowAxe_Timer <= diff) + while (uint32 eventId = events.ExecuteEvent()) { - DoCast(me->getVictim(), SPELL_THROWAXE); - ThrowAxe_Timer = 8000; - } else ThrowAxe_Timer -= diff; - + switch (eventId) + { + case EVENT_SNAP_KICK: + DoCast(me->getVictim(), SPELL_SNAPKICK); + events.ScheduleEvent(EVENT_SNAP_KICK, 6*IN_MILLISECONDS); + break; + case EVENT_CLEAVE: + DoCast(me->getVictim(), SPELL_CLEAVE); + events.ScheduleEvent(EVENT_CLEAVE, 12*IN_MILLISECONDS); + break; + case EVENT_UPPERCUT: + DoCast(me->getVictim(), SPELL_UPPERCUT); + events.ScheduleEvent(EVENT_UPPERCUT, 14*IN_MILLISECONDS); + break; + case EVENT_MORTAL_STRIKE: + DoCast(me->getVictim(), SPELL_MORTALSTRIKE); + events.ScheduleEvent(EVENT_MORTAL_STRIKE, 10*IN_MILLISECONDS); + break; + case EVENT_PUMMEL: + DoCast(me->getVictim(), SPELL_PUMMEL); + events.ScheduleEvent(EVENT_MORTAL_STRIKE, 16*IN_MILLISECONDS); + break; + case EVENT_THROW_AXE: + DoCast(me->getVictim(), SPELL_THROWAXE); + events.ScheduleEvent(EVENT_THROW_AXE, 8*IN_MILLISECONDS); + break; + } + } DoMeleeAttackIfReady(); } }; diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp new file mode 100644 index 00000000000..1297451b983 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp @@ -0,0 +1,242 @@ +/* + * Copyright (C) 2008-2011 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, see <http://www.gnu.org/licenses/>. + */ + +#include "blackrock_spire.h" + +class instance_blackrock_spire : public InstanceMapScript +{ +public: + instance_blackrock_spire() : InstanceMapScript("instance_blackrock_spire", 229) { } + + InstanceScript* GetInstanceScript(InstanceMap* pMap) const + { + return new instance_blackrock_spireMapScript(pMap); + } + + struct instance_blackrock_spireMapScript : public InstanceScript + { + instance_blackrock_spireMapScript(InstanceMap* map) : InstanceScript(map) {} + + uint32 Encounter[MAX_ENCOUNTER]; + std::string m_strInstData; + uint64 HighlordOmokk; + uint64 ShadowHunterVoshgajin; + uint64 WarMasterVoone; + uint64 MotherSmolderweb; + uint64 UrokDoomhowl; + uint64 QuartermasterZigris; + uint64 GizrultheSlavener; + uint64 Halycon; + uint64 OverlordWyrmthalak; + uint64 PyroguardEmberseer; + uint64 WarchiefRendBlackhand; + uint64 Gyth; + uint64 TheBeast; + uint64 GeneralDrakkisath; + + void Initialize() + { + SetBossNumber(MAX_ENCOUNTER); + HighlordOmokk = 0; + ShadowHunterVoshgajin = 0; + WarMasterVoone = 0; + MotherSmolderweb = 0; + UrokDoomhowl = 0; + QuartermasterZigris = 0; + GizrultheSlavener = 0; + Halycon = 0; + OverlordWyrmthalak = 0; + PyroguardEmberseer = 0; + WarchiefRendBlackhand = 0; + Gyth = 0; + TheBeast = 0; + GeneralDrakkisath = 0; + } + + bool IsEncounterInProgress() const + { + for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) + { + if (Encounter[i] == IN_PROGRESS) + return true; + } + return false; + } + + void OnCreatureCreate(Creature* creature) + { + switch(creature->GetEntry()) + { + case NPC_OMOKK: + HighlordOmokk = creature->GetGUID(); + break; + case NPC_SHADOW_HUNTER_VOSHGAJIN: + ShadowHunterVoshgajin = creature->GetGUID(); + break; + case NPC_WARMASTER_VOONE: + WarMasterVoone = creature->GetGUID(); + break; + case NPC_MOTHER_SMOLDERWEB: + MotherSmolderweb = creature->GetGUID(); + break; + case NPC_UROK_DOOMHOWL: + UrokDoomhowl = creature->GetGUID(); + break; + case NPC_QUARTERMASTER_ZIGRIS: + QuartermasterZigris = creature->GetGUID(); + break; + case NPC_GIZRUL_THE_SLAVENER: + GizrultheSlavener = creature->GetGUID(); + break; + case NPC_HALYCON: + Halycon = creature->GetGUID(); + break; + case NPC_OVERLORD_WYRMTHALAK: + OverlordWyrmthalak = creature->GetGUID(); + break; + case NPC_PYROGAURD_EMBERSEER: + PyroguardEmberseer = creature->GetGUID(); + break; + case NPC_WARCHIEF_REND_BLACKHAND: + WarchiefRendBlackhand = creature->GetGUID(); + break; + case NPC_GYTH: + Gyth = creature->GetGUID(); + break; + case NPC_THE_BEAST: + TheBeast = creature->GetGUID(); + break; + case NPC_GENERAL_DRAKKISATH: + GeneralDrakkisath = creature->GetGUID(); + break; + } + } + + bool SetBossState(uint32 type, EncounterState state) + { + if (!InstanceScript::SetBossState(type, state)) + return false; + + switch (type) + { + case DATA_OMOKK: + case DATA_SHADOW_HUNTER_VOSHGAJIN: + case DATA_WARMASTER_VOONE: + case DATA_MOTHER_SMOLDERWEB: + case DATA_UROK_DOOMHOWL: + case DATA_QUARTERMASTER_ZIGRIS: + case DATA_GIZRUL_THE_SLAVENER: + case DATA_HALYCON: + case DATA_OVERLORD_WYRMTHALAK: + case DATA_PYROGAURD_EMBERSEER: + case DATA_WARCHIEF_REND_BLACKHAND: + case DATA_GYTH: + case DATA_THE_BEAST: + case DATA_GENERAL_DRAKKISATH: + break; + default: + break; + } + + return true; + } + + uint64 GetData64(uint32 type) + { + switch(type) + { + case DATA_OMOKK: + return HighlordOmokk; + case DATA_SHADOW_HUNTER_VOSHGAJIN: + return ShadowHunterVoshgajin; + case DATA_WARMASTER_VOONE: + return WarMasterVoone; + case DATA_MOTHER_SMOLDERWEB: + return MotherSmolderweb; + case DATA_UROK_DOOMHOWL: + return UrokDoomhowl; + case DATA_QUARTERMASTER_ZIGRIS: + return QuartermasterZigris; + case DATA_GIZRUL_THE_SLAVENER: + return GizrultheSlavener; + case DATA_HALYCON: + return Halycon; + case DATA_OVERLORD_WYRMTHALAK: + return OverlordWyrmthalak; + case DATA_PYROGAURD_EMBERSEER: + return PyroguardEmberseer; + case DATA_WARCHIEF_REND_BLACKHAND: + return WarchiefRendBlackhand; + case DATA_GYTH: + return Gyth; + case DATA_THE_BEAST: + return TheBeast; + case DATA_GENERAL_DRAKKISATH: + return GeneralDrakkisath; + } + + return 0; + } + + std::string GetSaveData() + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << "B S " << GetBossSaveData(); + + OUT_SAVE_INST_DATA_COMPLETE; + return saveStream.str(); + } + + void Load(const char* strIn) + { + if (!strIn) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(strIn); + + char dataHead1, dataHead2; + + std::istringstream loadStream(strIn); + loadStream >> dataHead1 >> dataHead2; + + if (dataHead1 == 'B' && dataHead2 == 'S') + { + for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) + { + uint32 tmpState; + loadStream >> tmpState; + if (tmpState == IN_PROGRESS || tmpState > SPECIAL) + tmpState = NOT_STARTED; + } + } + + OUT_LOAD_INST_DATA_COMPLETE; + } + }; + +}; + + +void AddSC_instance_blackrock_spire() +{ + new instance_blackrock_spire(); +} diff --git a/src/server/scripts/EasternKingdoms/CMakeLists.txt b/src/server/scripts/EasternKingdoms/CMakeLists.txt index 2ddef873c8e..4885745aebd 100644 --- a/src/server/scripts/EasternKingdoms/CMakeLists.txt +++ b/src/server/scripts/EasternKingdoms/CMakeLists.txt @@ -120,6 +120,8 @@ set(scripts_STAT_SRCS EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp EasternKingdoms/BlackrockSpire/boss_highlord_omokk.cpp EasternKingdoms/BlackrockSpire/boss_the_beast.cpp + EasternKingdoms/BlackrockSpire/blackrock_spire.h + EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp EasternKingdoms/SunwellPlateau/sunwell_plateau.h |