aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMitchesD <majklprofik@seznam.cz>2015-03-07 11:38:10 +0100
committerMitchesD <majklprofik@seznam.cz>2015-03-07 11:49:03 +0100
commit02ccf53ad1c4547e78345161765475825093cd91 (patch)
tree8d3921f9084105bd5051a0514c332b57ca4af086 /src
parent1e8b2ae52796b26589909770d2216269bb1bafa9 (diff)
Scripts/Nexus: commanders converted from SAI to C++
(cherry picked from commit 5009d67f0c0dd90131ac6f81299e3719e2690ca1)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Scripting/ScriptLoader.cpp6
-rw-r--r--src/server/scripts/Northrend/CMakeLists.txt3
-rw-r--r--src/server/scripts/Northrend/Nexus/Nexus/boss_commander_kolurg.cpp80
-rw-r--r--src/server/scripts/Northrend/Nexus/Nexus/boss_commander_stoutbeard.cpp71
-rw-r--r--src/server/scripts/Northrend/Nexus/Nexus/boss_nexus_commanders.cpp110
-rw-r--r--src/server/scripts/Northrend/Nexus/Nexus/nexus.h19
6 files changed, 125 insertions, 164 deletions
diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp
index 4fe6c5e49cd..603089b0a6b 100644
--- a/src/server/game/Scripting/ScriptLoader.cpp
+++ b/src/server/game/Scripting/ScriptLoader.cpp
@@ -438,7 +438,8 @@ void AddSC_boss_heigan();
void AddSC_boss_gothik();
void AddSC_boss_thaddius();
void AddSC_instance_naxxramas();
-void AddSC_boss_magus_telestra(); //The Nexus Nexus
+void AddSC_boss_nexus_commanders(); // The Nexus Nexus
+void AddSC_boss_magus_telestra();
void AddSC_boss_anomalus();
void AddSC_boss_ormorok();
void AddSC_boss_keristrasza();
@@ -1291,7 +1292,8 @@ void AddNorthrendScripts()
AddSC_boss_gothik();
AddSC_boss_thaddius();
AddSC_instance_naxxramas();
- AddSC_boss_magus_telestra(); //The Nexus Nexus
+ AddSC_boss_nexus_commanders(); // The Nexus Nexus
+ AddSC_boss_magus_telestra();
AddSC_boss_anomalus();
AddSC_boss_ormorok();
AddSC_boss_keristrasza();
diff --git a/src/server/scripts/Northrend/CMakeLists.txt b/src/server/scripts/Northrend/CMakeLists.txt
index e04dcf0ec96..66d9021223f 100644
--- a/src/server/scripts/Northrend/CMakeLists.txt
+++ b/src/server/scripts/Northrend/CMakeLists.txt
@@ -78,8 +78,7 @@ set(scripts_STAT_SRCS
Northrend/Nexus/Oculus/boss_urom.cpp
Northrend/Nexus/Oculus/oculus.cpp
Northrend/Nexus/Oculus/instance_oculus.cpp
- Northrend/Nexus/Nexus/boss_commander_kolurg.cpp
- Northrend/Nexus/Nexus/boss_commander_stoutbeard.cpp
+ Northrend/Nexus/Nexus/boss_nexus_commanders.cpp
Northrend/Nexus/Nexus/boss_ormorok.cpp
Northrend/Nexus/Nexus/boss_magus_telestra.cpp
Northrend/Nexus/Nexus/instance_nexus.cpp
diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_commander_kolurg.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_commander_kolurg.cpp
deleted file mode 100644
index fc56f541a4b..00000000000
--- a/src/server/scripts/Northrend/Nexus/Nexus/boss_commander_kolurg.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (C) 2008-2015 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/>.
- */
-
-/* Script Data Start
-SDName: Boss Commander Kolurg
-SDAuthor: LordVanMartin
-SD%Complete:
-SDComment: Only Alliance Heroic
-SDCategory:
-Script Data End */
-
-#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
-
-enum Spells
-{
- SPELL_BATTLE_SHOUT = 31403,
- SPELL_CHARGE = 60067,
- SPELL_FRIGHTENING_SHOUT = 19134,
- SPELL_WHIRLWIND_1 = 38619,
- SPELL_WHIRLWIND_2 = 38618
-
-};
-
-//not used
-//Yell
-#define SAY_AGGRO -1576024
-#define SAY_KILL -1576025
-#define SAY_DEATH -1576026
-
-class boss_commander_kolurg : public CreatureScript
-{
-public:
- boss_commander_kolurg() : CreatureScript("boss_commander_kolurg") { }
-
- CreatureAI* GetAI(Creature* creature) const override
- {
- return new boss_commander_kolurgAI(creature);
- }
-
- struct boss_commander_kolurgAI : public ScriptedAI
- {
- boss_commander_kolurgAI(Creature* creature) : ScriptedAI(creature) { }
-
- void Reset() override { }
- void EnterCombat(Unit* /*who*/) override { }
- void AttackStart(Unit* /*who*/) override { }
- void MoveInLineOfSight(Unit* /*who*/) override { }
-
- void UpdateAI(uint32 /*diff*/) override
- {
- //Return since we have no target
- if (!UpdateVictim())
- return;
-
- DoMeleeAttackIfReady();
- }
- void JustDied(Unit* /*killer*/) override { }
- };
-
-};
-
-void AddSC_boss_commander_kolurg()
-{
- new boss_commander_kolurg();
-}
diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_commander_stoutbeard.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_commander_stoutbeard.cpp
deleted file mode 100644
index 3109d38b883..00000000000
--- a/src/server/scripts/Northrend/Nexus/Nexus/boss_commander_stoutbeard.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (C) 2008-2015 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/>.
- */
-
-/* Script Data Start
-SDName: Boss Commander Stoutbeard
-SDAuthor: LordVanMartin
-SD%Complete:
-SDComment: Only Horde Heroic
-SDCategory:
-Script Data End */
-
-#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
-
-enum CommanderStoutbeard
-{
- SPELL_BATTLE_SHOUT = 31403,
- SPELL_CHARGE = 60067,
- SPELL_FRIGHTENING_SHOUT = 19134,
- SPELL_WHIRLWIND_1 = 38619,
- SPELL_WHIRLWIND_2 = 38618
-};
-
-class boss_commander_stoutbeard : public CreatureScript
-{
-public:
- boss_commander_stoutbeard() : CreatureScript("boss_commander_stoutbeard") { }
-
- CreatureAI* GetAI(Creature* creature) const override
- {
- return new boss_commander_stoutbeardAI(creature);
- }
-
- struct boss_commander_stoutbeardAI : public ScriptedAI
- {
- boss_commander_stoutbeardAI(Creature* creature) : ScriptedAI(creature) { }
-
- void Reset() override { }
- void AttackStart(Unit* /*who*/) override { }
- void MoveInLineOfSight(Unit* /*who*/) override { }
-
- void UpdateAI(uint32 /*diff*/) override
- {
- //Return since we have no target
- if (!UpdateVictim())
- return;
-
- DoMeleeAttackIfReady();
- }
- };
-
-};
-
-void AddSC_boss_commander_stoutbeard()
-{
- new boss_commander_stoutbeard();
-}
diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_nexus_commanders.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_nexus_commanders.cpp
new file mode 100644
index 00000000000..d40f9fecc6a
--- /dev/null
+++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_nexus_commanders.cpp
@@ -0,0 +1,110 @@
+/*
+ * Copyright (C) 2008-2015 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 "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "nexus.h"
+
+enum Spells
+{
+ SPELL_BATTLE_SHOUT = 31403,
+ SPELL_CHARGE = 60067,
+ SPELL_FRIGHTENING_SHOUT = 19134,
+ SPELL_WHIRLWIND = 38618,
+ SPELL_FROZEN_PRISON = 47543
+};
+
+enum Yells
+{
+ SAY_AGGRO = 0,
+ SAY_KILL = 1,
+ SAY_DEATH = 2
+};
+
+enum Events
+{
+ EVENT_CHARGE_COMMANDER = 1,
+ EVENT_WHIRLWIND,
+ EVENT_FRIGHTENING_SHOUT
+};
+
+class boss_nexus_commanders : public CreatureScript
+{
+ public:
+ boss_nexus_commanders() : CreatureScript("boss_nexus_commanders") { }
+
+ struct boss_nexus_commandersAI : public BossAI
+ {
+ boss_nexus_commandersAI(Creature* creature) : BossAI(creature, DATA_COMMANDER) { }
+
+ void EnterCombat(Unit* /*who*/) override
+ {
+ _EnterCombat();
+ Talk(SAY_AGGRO);
+ me->RemoveAurasDueToSpell(SPELL_FROZEN_PRISON);
+ DoCast(me, SPELL_BATTLE_SHOUT);
+
+ events.ScheduleEvent(EVENT_CHARGE_COMMANDER, urand(3000, 4000));
+ events.ScheduleEvent(EVENT_WHIRLWIND, urand(6000, 8000));
+ events.ScheduleEvent(EVENT_FRIGHTENING_SHOUT, urand(13000, 15000));
+ }
+
+ void ExecuteEvent(uint32 eventId) override
+ {
+ switch (eventId)
+ {
+ case EVENT_CHARGE_COMMANDER:
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true))
+ DoCast(target, SPELL_CHARGE);
+ events.ScheduleEvent(EVENT_CHARGE_COMMANDER, urand(11000, 15000));
+ break;
+ case EVENT_WHIRLWIND:
+ DoCast(me, SPELL_WHIRLWIND);
+ events.ScheduleEvent(EVENT_WHIRLWIND, urand(19500, 25000));
+ break;
+ case EVENT_FRIGHTENING_SHOUT:
+ DoCastAOE(SPELL_FRIGHTENING_SHOUT);
+ events.ScheduleEvent(EVENT_FRIGHTENING_SHOUT, urand(45000, 55000));
+ break;
+ default:
+ break;
+ }
+ }
+
+ void JustDied(Unit* /*killer*/) override
+ {
+ _JustDied();
+ Talk(SAY_DEATH);
+ }
+
+ void KilledUnit(Unit* who) override
+ {
+ if (who->GetTypeId() == TYPEID_PLAYER)
+ Talk(SAY_KILL);
+ }
+ };
+
+ CreatureAI* GetAI(Creature* creature) const override
+ {
+ return GetInstanceAI<boss_nexus_commandersAI>(creature);
+ }
+};
+
+void AddSC_boss_nexus_commanders()
+{
+ new boss_nexus_commanders();
+}
diff --git a/src/server/scripts/Northrend/Nexus/Nexus/nexus.h b/src/server/scripts/Northrend/Nexus/Nexus/nexus.h
index ffc63a35a7b..6123407575d 100644
--- a/src/server/scripts/Northrend/Nexus/Nexus/nexus.h
+++ b/src/server/scripts/Northrend/Nexus/Nexus/nexus.h
@@ -21,18 +21,19 @@
#define NexusScriptName "instance_nexus"
#define DataHeader "NEX"
-uint32 const EncounterCount = 4;
-
+uint32 const EncounterCount = 5;
+
enum DataTypes
{
- DATA_MAGUS_TELESTRA = 0,
- DATA_ANOMALUS = 1,
- DATA_ORMOROK = 2,
- DATA_KERISTRASZA = 3,
+ DATA_COMMANDER = 0,
+ DATA_MAGUS_TELESTRA = 1,
+ DATA_ANOMALUS = 2,
+ DATA_ORMOROK = 3,
+ DATA_KERISTRASZA = 4,
- ANOMALUS_CONTAINMET_SPHERE = 4,
- ORMOROKS_CONTAINMET_SPHERE = 5,
- TELESTRAS_CONTAINMET_SPHERE = 6
+ ANOMALUS_CONTAINMET_SPHERE = 5,
+ ORMOROKS_CONTAINMET_SPHERE = 6,
+ TELESTRAS_CONTAINMET_SPHERE = 7
};
enum CreatureIds