aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/EasternKingdoms
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2020-09-04 13:38:24 +0200
committerShauren <shauren.trinity@gmail.com>2020-09-04 13:38:24 +0200
commitb23190393248455f04d3a06def030a1ec7efad1e (patch)
tree1ce3772314492dcdb985641269a3114813d4b4dc /src/server/scripts/EasternKingdoms
parentb20acfe701e6f5f995f2776f076d3c494c02e1aa (diff)
Core/Misc: Port all the refactors sneaked in master to 3.3.5 include cleanup port
Diffstat (limited to 'src/server/scripts/EasternKingdoms')
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp9
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.h4
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_ambassador_flamelash.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_coren_direbrew.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_general_angerforge.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_high_interrogator_gerstahn.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_magmus.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_moira_bronzebeard.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp243
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/blackrock_spire.h6
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_drakkisath.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_pyroguard_emberseer.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/instance_blackrock_spire.cpp10
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_broodlord_lashlayer.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_chromaggus.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_ebonroc.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_firemaw.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_flamegor.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_baron_geddon.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_garr.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_gehennas.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_golemagg.cpp1
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_lucifron.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_sulfuron_harbinger.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/instance_molten_core.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/molten_core.h6
-rw-r--r--src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/Deadmines/deadmines.h6
-rw-r--r--src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp18
-rw-r--r--src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.h6
-rw-r--r--src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp5
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp1
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp16
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp5
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h6
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp6
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp5
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp14
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp17
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h2
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp22
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp5
-rw-r--r--src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp8
-rw-r--r--src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.h2
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp10
-rw-r--r--src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp1
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp7
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.h2
-rw-r--r--src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/zulaman.h8
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp33
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h6
-rw-r--r--src/server/scripts/EasternKingdoms/zone_duskwood.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/zone_hinterlands.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp2
92 files changed, 296 insertions, 359 deletions
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp
index c9998ea1547..57e3d8da81c 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp
@@ -16,10 +16,9 @@
*/
#include "ScriptMgr.h"
-#include "GameObjectAI.h"
#include "blackrock_depths.h"
-#include "CreatureAIImpl.h"
#include "GameObject.h"
+#include "GameObjectAI.h"
#include "InstanceScript.h"
#include "Log.h"
#include "ObjectAccessor.h"
@@ -98,7 +97,7 @@ class at_ring_of_law : public AreaTriggerScript
public:
at_ring_of_law() : AreaTriggerScript("at_ring_of_law") { }
- bool OnTrigger(Player* player, const AreaTriggerEntry* /*areaTrigger*/, bool /*entered*/) override
+ bool OnTrigger(Player* player, AreaTriggerEntry const* /*areaTrigger*/, bool /*entered*/) override
{
if (InstanceScript* instance = player->GetInstanceScript())
{
@@ -370,7 +369,7 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
- return new npc_phalanxAI(creature);
+ return GetBlackrockDepthsAI<npc_phalanxAI>(creature);
}
struct npc_phalanxAI : public ScriptedAI
@@ -494,7 +493,7 @@ class npc_lokhtos_darkbargainer : public CreatureScript
CreatureAI* GetAI(Creature* creature) const override
{
- return new npc_lokhtos_darkbargainerAI(creature);
+ return GetBlackrockDepthsAI<npc_lokhtos_darkbargainerAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.h b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.h
index fc571947ca6..2f5821ec6c2 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.h
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.h
@@ -20,8 +20,8 @@
#include "CreatureAIImpl.h"
-#define DataHeader "BRD"
#define BRDScriptName "instance_blackrock_depths"
+#define DataHeader "BRD"
enum BRDFactionIds
{
@@ -66,7 +66,7 @@ enum BRDDataTypes
DATA_COREN = 28
};
-template<typename AI, typename T>
+template <class AI, class T>
inline AI* GetBlackrockDepthsAI(T* obj)
{
return GetInstanceAI<AI>(obj, BRDScriptName);
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_ambassador_flamelash.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_ambassador_flamelash.cpp
index 966eb9a625c..de92d16041a 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_ambassador_flamelash.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_ambassador_flamelash.cpp
@@ -16,6 +16,7 @@
*/
#include "ScriptMgr.h"
+#include "blackrock_depths.h"
#include "ScriptedCreature.h"
enum Spells
@@ -89,7 +90,7 @@ class boss_ambassador_flamelash : public CreatureScript
CreatureAI* GetAI(Creature* creature) const override
{
- return new boss_ambassador_flamelashAI(creature);
+ return GetBlackrockDepthsAI<boss_ambassador_flamelashAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_coren_direbrew.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_coren_direbrew.cpp
index 2bb126dbd39..1ac96c8c4a4 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_coren_direbrew.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_coren_direbrew.cpp
@@ -15,6 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "ScriptMgr.h"
+#include "blackrock_depths.h"
#include "GameObjectAI.h"
#include "GridNotifiers.h"
#include "Group.h"
@@ -25,11 +27,9 @@
#include "Player.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
-#include "ScriptMgr.h"
#include "SpellAuras.h"
#include "SpellScript.h"
#include "TemporarySummon.h"
-#include "blackrock_depths.h"
enum DirebrewSays
{
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_general_angerforge.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_general_angerforge.cpp
index 9726c2508c1..f9a30d7210c 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_general_angerforge.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_general_angerforge.cpp
@@ -16,6 +16,7 @@
*/
#include "ScriptMgr.h"
+#include "blackrock_depths.h"
#include "ScriptedCreature.h"
enum Spells
@@ -130,7 +131,7 @@ class boss_general_angerforge : public CreatureScript
CreatureAI* GetAI(Creature* creature) const override
{
- return new boss_general_angerforgeAI(creature);
+ return GetBlackrockDepthsAI<boss_general_angerforgeAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_high_interrogator_gerstahn.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_high_interrogator_gerstahn.cpp
index d2fb95a39e3..c14d56ba7bf 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_high_interrogator_gerstahn.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_high_interrogator_gerstahn.cpp
@@ -16,6 +16,7 @@
*/
#include "ScriptMgr.h"
+#include "blackrock_depths.h"
#include "ScriptedCreature.h"
enum Spells
@@ -99,7 +100,7 @@ class boss_high_interrogator_gerstahn : public CreatureScript
CreatureAI* GetAI(Creature* creature) const override
{
- return new boss_high_interrogator_gerstahnAI(creature);
+ return GetBlackrockDepthsAI<boss_high_interrogator_gerstahnAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_magmus.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_magmus.cpp
index bc9401e7e16..295f94e71fd 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_magmus.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_magmus.cpp
@@ -106,7 +106,7 @@ class boss_magmus : public CreatureScript
CreatureAI* GetAI(Creature* creature) const override
{
- return new boss_magmusAI(creature);
+ return GetBlackrockDepthsAI<boss_magmusAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_moira_bronzebeard.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_moira_bronzebeard.cpp
index 097b4a67b82..4b2bee3fc16 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_moira_bronzebeard.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_moira_bronzebeard.cpp
@@ -16,6 +16,7 @@
*/
#include "ScriptMgr.h"
+#include "blackrock_depths.h"
#include "ScriptedCreature.h"
enum Spells
@@ -93,7 +94,7 @@ class boss_moira_bronzebeard : public CreatureScript
CreatureAI* GetAI(Creature* creature) const override
{
- return new boss_moira_bronzebeardAI(creature);
+ return GetBlackrockDepthsAI<boss_moira_bronzebeardAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp
index be16a653cfa..f6bbc3bd5ea 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp
@@ -23,6 +23,7 @@
#include "Map.h"
#include "MotionMaster.h"
#include "ScriptedCreature.h"
+#include <sstream>
#define TIMER_TOMBOFTHESEVEN 15000
#define MAX_ENCOUNTER 6
@@ -133,22 +134,22 @@ public:
{
switch (creature->GetEntry())
{
- case NPC_EMPEROR: EmperorGUID = creature->GetGUID(); break;
- case NPC_PHALANX: PhalanxGUID = creature->GetGUID(); break;
- case NPC_MOIRA: MoiraGUID = creature->GetGUID(); break;
- case NPC_COREN: CorenGUID = creature->GetGUID(); break;
- case NPC_DOOMREL: TombBossGUIDs[0] = creature->GetGUID(); break;
- case NPC_DOPEREL: TombBossGUIDs[1] = creature->GetGUID(); break;
- case NPC_HATEREL: TombBossGUIDs[2] = creature->GetGUID(); break;
- case NPC_VILEREL: TombBossGUIDs[3] = creature->GetGUID(); break;
- case NPC_SEETHREL: TombBossGUIDs[4] = creature->GetGUID(); break;
- case NPC_GLOOMREL: TombBossGUIDs[5] = creature->GetGUID(); break;
- case NPC_ANGERREL: TombBossGUIDs[6] = creature->GetGUID(); break;
- case NPC_MAGMUS:
- MagmusGUID = creature->GetGUID();
- if (!creature->IsAlive())
- HandleGameObject(GetGuidData(DATA_THRONE_DOOR), true); // if Magmus is dead open door to last boss
- break;
+ case NPC_EMPEROR: EmperorGUID = creature->GetGUID(); break;
+ case NPC_PHALANX: PhalanxGUID = creature->GetGUID(); break;
+ case NPC_MOIRA: MoiraGUID = creature->GetGUID(); break;
+ case NPC_COREN: CorenGUID = creature->GetGUID(); break;
+ case NPC_DOOMREL: TombBossGUIDs[0] = creature->GetGUID(); break;
+ case NPC_DOPEREL: TombBossGUIDs[1] = creature->GetGUID(); break;
+ case NPC_HATEREL: TombBossGUIDs[2] = creature->GetGUID(); break;
+ case NPC_VILEREL: TombBossGUIDs[3] = creature->GetGUID(); break;
+ case NPC_SEETHREL: TombBossGUIDs[4] = creature->GetGUID(); break;
+ case NPC_GLOOMREL: TombBossGUIDs[5] = creature->GetGUID(); break;
+ case NPC_ANGERREL: TombBossGUIDs[6] = creature->GetGUID(); break;
+ case NPC_MAGMUS:
+ MagmusGUID = creature->GetGUID();
+ if (!creature->IsAlive())
+ HandleGameObject(GetGuidData(DATA_THRONE_DOOR), true); // if Magmus is dead open door to last boss
+ break;
}
}
@@ -156,33 +157,33 @@ public:
{
switch (go->GetEntry())
{
- case GO_ARENA1: GoArena1GUID = go->GetGUID(); break;
- case GO_ARENA2: GoArena2GUID = go->GetGUID(); break;
- case GO_ARENA3: GoArena3GUID = go->GetGUID(); break;
- case GO_ARENA4: GoArena4GUID = go->GetGUID(); break;
- case GO_SHADOW_LOCK: GoShadowLockGUID = go->GetGUID(); break;
- case GO_SHADOW_MECHANISM: GoShadowMechGUID = go->GetGUID(); break;
- case GO_SHADOW_GIANT_DOOR: GoShadowGiantGUID = go->GetGUID(); break;
- case GO_SHADOW_DUMMY: GoShadowDummyGUID = go->GetGUID(); break;
- case GO_BAR_KEG_SHOT: GoBarKegGUID = go->GetGUID(); break;
- case GO_BAR_KEG_TRAP: GoBarKegTrapGUID = go->GetGUID(); break;
- case GO_BAR_DOOR: GoBarDoorGUID = go->GetGUID(); break;
- case GO_TOMB_ENTER: GoTombEnterGUID = go->GetGUID(); break;
- case GO_TOMB_EXIT:
- GoTombExitGUID = go->GetGUID();
- if (GhostKillCount >= 7)
- HandleGameObject(ObjectGuid::Empty, true, go);
- else
- HandleGameObject(ObjectGuid::Empty, false, go);
- break;
- case GO_LYCEUM: GoLyceumGUID = go->GetGUID(); break;
- case GO_SF_S: GoSFSGUID = go->GetGUID(); break;
- case GO_SF_N: GoSFNGUID = go->GetGUID(); break;
- case GO_GOLEM_ROOM_N: GoGolemNGUID = go->GetGUID(); break;
- case GO_GOLEM_ROOM_S: GoGolemSGUID = go->GetGUID(); break;
- case GO_THRONE_ROOM: GoThroneGUID = go->GetGUID(); break;
- case GO_CHEST_SEVEN: GoChestGUID = go->GetGUID(); break;
- case GO_SPECTRAL_CHALICE: GoSpectralChaliceGUID = go->GetGUID(); break;
+ case GO_ARENA1: GoArena1GUID = go->GetGUID(); break;
+ case GO_ARENA2: GoArena2GUID = go->GetGUID(); break;
+ case GO_ARENA3: GoArena3GUID = go->GetGUID(); break;
+ case GO_ARENA4: GoArena4GUID = go->GetGUID(); break;
+ case GO_SHADOW_LOCK: GoShadowLockGUID = go->GetGUID(); break;
+ case GO_SHADOW_MECHANISM: GoShadowMechGUID = go->GetGUID(); break;
+ case GO_SHADOW_GIANT_DOOR: GoShadowGiantGUID = go->GetGUID(); break;
+ case GO_SHADOW_DUMMY: GoShadowDummyGUID = go->GetGUID(); break;
+ case GO_BAR_KEG_SHOT: GoBarKegGUID = go->GetGUID(); break;
+ case GO_BAR_KEG_TRAP: GoBarKegTrapGUID = go->GetGUID(); break;
+ case GO_BAR_DOOR: GoBarDoorGUID = go->GetGUID(); break;
+ case GO_TOMB_ENTER: GoTombEnterGUID = go->GetGUID(); break;
+ case GO_TOMB_EXIT:
+ GoTombExitGUID = go->GetGUID();
+ if (GhostKillCount >= 7)
+ HandleGameObject(ObjectGuid::Empty, true, go);
+ else
+ HandleGameObject(ObjectGuid::Empty, false, go);
+ break;
+ case GO_LYCEUM: GoLyceumGUID = go->GetGUID(); break;
+ case GO_SF_S: GoSFSGUID = go->GetGUID(); break;
+ case GO_SF_N: GoSFNGUID = go->GetGUID(); break;
+ case GO_GOLEM_ROOM_N: GoGolemNGUID = go->GetGUID(); break;
+ case GO_GOLEM_ROOM_S: GoGolemSGUID = go->GetGUID(); break;
+ case GO_THRONE_ROOM: GoThroneGUID = go->GetGUID(); break;
+ case GO_CHEST_SEVEN: GoChestGUID = go->GetGUID(); break;
+ case GO_SPECTRAL_CHALICE: GoSpectralChaliceGUID = go->GetGUID(); break;
}
}
@@ -208,30 +209,30 @@ public:
switch (type)
{
- case TYPE_RING_OF_LAW:
- encounter[0] = data;
- break;
- case TYPE_VAULT:
- encounter[1] = data;
- break;
- case TYPE_BAR:
- if (data == SPECIAL)
- ++BarAleCount;
- else
- encounter[2] = data;
- break;
- case TYPE_TOMB_OF_SEVEN:
- encounter[3] = data;
- break;
- case TYPE_LYCEUM:
- encounter[4] = data;
- break;
- case TYPE_IRON_HALL:
- encounter[5] = data;
- break;
- case DATA_GHOSTKILL:
- GhostKillCount += data;
- break;
+ case TYPE_RING_OF_LAW:
+ encounter[0] = data;
+ break;
+ case TYPE_VAULT:
+ encounter[1] = data;
+ break;
+ case TYPE_BAR:
+ if (data == SPECIAL)
+ ++BarAleCount;
+ else
+ encounter[2] = data;
+ break;
+ case TYPE_TOMB_OF_SEVEN:
+ encounter[3] = data;
+ break;
+ case TYPE_LYCEUM:
+ encounter[4] = data;
+ break;
+ case TYPE_IRON_HALL:
+ encounter[5] = data;
+ break;
+ case DATA_GHOSTKILL:
+ GhostKillCount += data;
+ break;
}
if (data == DONE || GhostKillCount >= 7)
@@ -253,23 +254,23 @@ public:
{
switch (type)
{
- case TYPE_RING_OF_LAW:
- return encounter[0];
- case TYPE_VAULT:
- return encounter[1];
- case TYPE_BAR:
- if (encounter[2] == IN_PROGRESS && BarAleCount == 3)
- return SPECIAL;
- else
- return encounter[2];
- case TYPE_TOMB_OF_SEVEN:
- return encounter[3];
- case TYPE_LYCEUM:
- return encounter[4];
- case TYPE_IRON_HALL:
- return encounter[5];
- case DATA_GHOSTKILL:
- return GhostKillCount;
+ case TYPE_RING_OF_LAW:
+ return encounter[0];
+ case TYPE_VAULT:
+ return encounter[1];
+ case TYPE_BAR:
+ if (encounter[2] == IN_PROGRESS && BarAleCount == 3)
+ return SPECIAL;
+ else
+ return encounter[2];
+ case TYPE_TOMB_OF_SEVEN:
+ return encounter[3];
+ case TYPE_LYCEUM:
+ return encounter[4];
+ case TYPE_IRON_HALL:
+ return encounter[5];
+ case DATA_GHOSTKILL:
+ return GhostKillCount;
}
return 0;
}
@@ -278,42 +279,42 @@ public:
{
switch (data)
{
- case DATA_EMPEROR:
- return EmperorGUID;
- case DATA_PHALANX:
- return PhalanxGUID;
- case DATA_MOIRA:
- return MoiraGUID;
- case DATA_COREN:
- return CorenGUID;
- case DATA_ARENA1:
- return GoArena1GUID;
- case DATA_ARENA2:
- return GoArena2GUID;
- case DATA_ARENA3:
- return GoArena3GUID;
- case DATA_ARENA4:
- return GoArena4GUID;
- case DATA_GO_BAR_KEG:
- return GoBarKegGUID;
- case DATA_GO_BAR_KEG_TRAP:
- return GoBarKegTrapGUID;
- case DATA_GO_BAR_DOOR:
- return GoBarDoorGUID;
- case DATA_EVENSTARTER:
- return TombEventStarterGUID;
- case DATA_SF_BRAZIER_N:
- return GoSFNGUID;
- case DATA_SF_BRAZIER_S:
- return GoSFSGUID;
- case DATA_THRONE_DOOR:
- return GoThroneGUID;
- case DATA_GOLEM_DOOR_N:
- return GoGolemNGUID;
- case DATA_GOLEM_DOOR_S:
- return GoGolemSGUID;
- case DATA_GO_CHALICE:
- return GoSpectralChaliceGUID;
+ case DATA_EMPEROR:
+ return EmperorGUID;
+ case DATA_PHALANX:
+ return PhalanxGUID;
+ case DATA_MOIRA:
+ return MoiraGUID;
+ case DATA_COREN:
+ return CorenGUID;
+ case DATA_ARENA1:
+ return GoArena1GUID;
+ case DATA_ARENA2:
+ return GoArena2GUID;
+ case DATA_ARENA3:
+ return GoArena3GUID;
+ case DATA_ARENA4:
+ return GoArena4GUID;
+ case DATA_GO_BAR_KEG:
+ return GoBarKegGUID;
+ case DATA_GO_BAR_KEG_TRAP:
+ return GoBarKegTrapGUID;
+ case DATA_GO_BAR_DOOR:
+ return GoBarDoorGUID;
+ case DATA_EVENSTARTER:
+ return TombEventStarterGUID;
+ case DATA_SF_BRAZIER_N:
+ return GoSFNGUID;
+ case DATA_SF_BRAZIER_S:
+ return GoSFSGUID;
+ case DATA_THRONE_DOOR:
+ return GoThroneGUID;
+ case DATA_GOLEM_DOOR_N:
+ return GoGolemNGUID;
+ case DATA_GOLEM_DOOR_S:
+ return GoGolemSGUID;
+ case DATA_GO_CHALICE:
+ return GoSpectralChaliceGUID;
}
return ObjectGuid::Empty;
}
@@ -323,7 +324,7 @@ public:
return str_data;
}
- void Load(const char* in) override
+ void Load(char const* in) override
{
if (!in)
{
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/blackrock_spire.h b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/blackrock_spire.h
index ef1ee422476..bca9f01839a 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/blackrock_spire.h
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/blackrock_spire.h
@@ -122,10 +122,10 @@ enum BRSGameObjectsIds
GO_PORTCULLIS_TOBOSSROOMS = 175186
};
-template<typename AI>
-inline AI* GetBlackrockSpireAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetBlackrockSpireAI(T* obj)
{
- return GetInstanceAI<AI>(creature, BRSScriptName);
+ return GetInstanceAI<AI>(obj, BRSScriptName);
}
#endif
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_drakkisath.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_drakkisath.cpp
index 71beb27a282..8b5e4ad3d29 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_drakkisath.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_drakkisath.cpp
@@ -104,7 +104,7 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
- return new boss_drakkisathAI(creature);
+ return GetBlackrockSpireAI<boss_drakkisathAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_pyroguard_emberseer.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_pyroguard_emberseer.cpp
index da61c7d00b9..9b82c3292b0 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_pyroguard_emberseer.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_pyroguard_emberseer.cpp
@@ -255,7 +255,7 @@ public:
{
// Check to see if all players in instance have aura SPELL_EMBERSEER_START before starting event
bool _hasAura = true;
- Map::PlayerList const &players = me->GetMap()->GetPlayers();
+ Map::PlayerList const& players = me->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
if (Player* player = itr->GetSource()->ToPlayer())
if (!player->HasAura(SPELL_EMBERSEER_OBJECT_VISUAL))
@@ -441,7 +441,7 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
- return new npc_blackhand_incarceratorAI(creature);
+ return GetBlackrockSpireAI<npc_blackhand_incarceratorAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/instance_blackrock_spire.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/instance_blackrock_spire.cpp
index c5403ee37ad..0a756cced04 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/instance_blackrock_spire.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/instance_blackrock_spire.cpp
@@ -527,7 +527,7 @@ class at_dragonspire_hall : public AreaTriggerScript
public:
at_dragonspire_hall() : AreaTriggerScript("at_dragonspire_hall") { }
- bool OnTrigger(Player* player, const AreaTriggerEntry* /*areaTrigger*/, bool /*entered*/) override
+ bool OnTrigger(Player* player, AreaTriggerEntry const* /*areaTrigger*/, bool /*entered*/) override
{
if (player && player->IsAlive())
{
@@ -551,7 +551,7 @@ class at_blackrock_stadium : public AreaTriggerScript
public:
at_blackrock_stadium() : AreaTriggerScript("at_blackrock_stadium") { }
- bool OnTrigger(Player* player, const AreaTriggerEntry* /*areaTrigger*/, bool /*entered*/) override
+ bool OnTrigger(Player* player, AreaTriggerEntry const* /*areaTrigger*/, bool /*entered*/) override
{
if (player && player->IsAlive())
{
@@ -575,10 +575,12 @@ class at_nearby_scarshield_infiltrator : public AreaTriggerScript
public:
at_nearby_scarshield_infiltrator() : AreaTriggerScript("at_nearby_scarshield_infiltrator") { }
- bool OnTrigger(Player* player, const AreaTriggerEntry* /*at*/, bool /*entered*/) override
+ bool OnTrigger(Player* player, AreaTriggerEntry const* /*at*/, bool /*entered*/) override
{
if (player->IsAlive())
+ {
if (InstanceScript* instance = player->GetInstanceScript())
+ {
if (Creature* infiltrator = ObjectAccessor::GetCreature(*player, instance->GetGuidData(DATA_SCARSHIELD_INFILTRATOR)))
{
if (player->getLevel() >= 57)
@@ -588,6 +590,8 @@ public:
return true;
}
+ }
+ }
return false;
}
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_broodlord_lashlayer.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_broodlord_lashlayer.cpp
index 9fb0e77caac..9acbe8e6797 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_broodlord_lashlayer.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_broodlord_lashlayer.cpp
@@ -16,8 +16,8 @@
*/
#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
#include "blackwing_lair.h"
+#include "ScriptedCreature.h"
enum Say
{
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_chromaggus.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_chromaggus.cpp
index 5953adb8105..97a91c81fe3 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_chromaggus.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_chromaggus.cpp
@@ -240,7 +240,7 @@ public:
break;
case EVENT_AFFLICTION:
{
- Map::PlayerList const &players = me->GetMap()->GetPlayers();
+ Map::PlayerList const& players = me->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
{
if (Player* player = itr->GetSource()->ToPlayer())
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_ebonroc.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_ebonroc.cpp
index 447ca2fe1ab..c147fd85548 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_ebonroc.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_ebonroc.cpp
@@ -16,8 +16,8 @@
*/
#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
#include "blackwing_lair.h"
+#include "ScriptedCreature.h"
enum Spells
{
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_firemaw.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_firemaw.cpp
index 97c73b89973..e082f114c10 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_firemaw.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_firemaw.cpp
@@ -16,8 +16,8 @@
*/
#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
#include "blackwing_lair.h"
+#include "ScriptedCreature.h"
enum Spells
{
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_flamegor.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_flamegor.cpp
index a54285164d9..ab465de3805 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_flamegor.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_flamegor.cpp
@@ -16,8 +16,8 @@
*/
#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
#include "blackwing_lair.h"
+#include "ScriptedCreature.h"
enum Emotes
{
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_baron_geddon.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_baron_geddon.cpp
index 876f32cb89a..52fe779f4c1 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_baron_geddon.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_baron_geddon.cpp
@@ -22,10 +22,9 @@ SDComment:
SDCategory: Molten Core
EndScriptData */
-#include "ObjectMgr.h"
#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
#include "molten_core.h"
+#include "ScriptedCreature.h"
#include "SpellAuraEffects.h"
#include "SpellScript.h"
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_garr.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_garr.cpp
index e4b43d27b48..c54b27489bd 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_garr.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_garr.cpp
@@ -22,10 +22,10 @@ SDComment: Adds NYI
SDCategory: Molten Core
EndScriptData */
-#include "ObjectMgr.h"
#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
#include "molten_core.h"
+#include "ObjectMgr.h"
+#include "ScriptedCreature.h"
enum Spells
{
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_gehennas.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_gehennas.cpp
index f4652666abe..00aa6d38079 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_gehennas.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_gehennas.cpp
@@ -22,10 +22,10 @@ SDComment: Adds MC NYI
SDCategory: Molten Core
EndScriptData */
-#include "ObjectMgr.h"
#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
#include "molten_core.h"
+#include "ObjectMgr.h"
+#include "ScriptedCreature.h"
enum Spells
{
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_golemagg.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_golemagg.cpp
index 4980fbcdcfc..aeaa706c174 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_golemagg.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_golemagg.cpp
@@ -27,7 +27,6 @@ EndScriptData */
#include "molten_core.h"
#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
-#include "TemporarySummon.h"
enum Texts
{
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_lucifron.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_lucifron.cpp
index a0b70cc8396..fe297f576e6 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_lucifron.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_lucifron.cpp
@@ -22,10 +22,10 @@ SDComment:
SDCategory: Molten Core
EndScriptData */
-#include "ObjectMgr.h"
#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
#include "molten_core.h"
+#include "ObjectMgr.h"
+#include "ScriptedCreature.h"
enum Spells
{
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_sulfuron_harbinger.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_sulfuron_harbinger.cpp
index 386de5e94eb..aacf257226c 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_sulfuron_harbinger.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_sulfuron_harbinger.cpp
@@ -22,10 +22,10 @@ SDComment: Adds NYI
SDCategory: Molten Core
EndScriptData */
-#include "ObjectMgr.h"
#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
#include "molten_core.h"
+#include "ObjectMgr.h"
+#include "ScriptedCreature.h"
enum Spells
{
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/instance_molten_core.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/instance_molten_core.cpp
index d237c7fe3a6..c82abaa4035 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/instance_molten_core.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/instance_molten_core.cpp
@@ -16,10 +16,10 @@
*/
#include "ScriptMgr.h"
+#include "molten_core.h"
#include "GameObject.h"
#include "InstanceScript.h"
#include "Map.h"
-#include "molten_core.h"
#include "ScriptedCreature.h"
#include "TemporarySummon.h"
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/molten_core.h b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/molten_core.h
index cc3494fe5b6..e8f88b50405 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/molten_core.h
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/molten_core.h
@@ -75,10 +75,10 @@ enum MCData
DATA_RAGNAROS_ADDS = 0,
};
-template<typename AI>
-inline AI* GetMoltenCoreAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetMoltenCoreAI(T* obj)
{
- return GetInstanceAI<AI>(creature, MCScriptName);
+ return GetInstanceAI<AI>(obj, MCScriptName);
}
#endif
diff --git a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp
index 079f14155c1..9b575fd34a9 100644
--- a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp
+++ b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp
@@ -16,11 +16,7 @@
*/
#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
#include "deadmines.h"
-#include "Spell.h"
-#include "Player.h"
-#include "WorldSession.h"
void AddSC_deadmines()
{
diff --git a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h
index 74edaa2b7aa..dfebf706d18 100644
--- a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h
+++ b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h
@@ -52,10 +52,10 @@ enum DMGameObjects
GO_MR_SMITE_CHEST = 144111
};
-template<typename AI>
-inline AI* GetDeadminesAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetDeadminesAI(T* obj)
{
- return GetInstanceAI<AI>(creature, DMScriptName);
+ return GetInstanceAI<AI>(obj, DMScriptName);
}
#endif
diff --git a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp
index 1804cf17a52..0587987ece8 100644
--- a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp
+++ b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp
@@ -196,15 +196,15 @@ class instance_deadmines : public InstanceMapScript
{
switch (type)
{
- case EVENT_STATE:
- if (!DefiasCannonGUID.IsEmpty() && !IronCladDoorGUID.IsEmpty())
- State = data;
- break;
- case EVENT_RHAHKZOR:
- if (data == DONE)
- if (GameObject* go = instance->GetGameObject(FactoryDoorGUID))
- go->SetGoState(GO_STATE_ACTIVE);
- break;
+ case EVENT_STATE:
+ if (!DefiasCannonGUID.IsEmpty() && !IronCladDoorGUID.IsEmpty())
+ State = data;
+ break;
+ case EVENT_RHAHKZOR:
+ if (data == DONE)
+ if (GameObject* go = instance->GetGameObject(FactoryDoorGUID))
+ go->SetGoState(GO_STATE_ACTIVE);
+ break;
}
}
diff --git a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp
index aaa280fdbe1..98f3558d84e 100644
--- a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp
+++ b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp
@@ -204,7 +204,7 @@ public:
void AggroAllPlayers(Creature* temp)
{
- Map::PlayerList const &PlList = me->GetMap()->GetPlayers();
+ Map::PlayerList const& PlList = me->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator i = PlList.begin(); i != PlList.end(); ++i)
{
if (Player* player = i->GetSource())
diff --git a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.h b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.h
index e2ac26d6675..2b349789d97 100644
--- a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.h
+++ b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.h
@@ -50,10 +50,10 @@ enum GNOData64
DATA_NPC_BASTMASTER_EMI_SHORTFUSE
};
-template<typename AI>
-inline AI* GetGnomereganAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetGnomereganAI(T* obj)
{
- return GetInstanceAI<AI>(creature, GNOScriptName);
+ return GetInstanceAI<AI>(obj, GNOScriptName);
}
#endif
diff --git a/src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp b/src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp
index 5a583390728..965558131ee 100644
--- a/src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp
+++ b/src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp
@@ -22,13 +22,14 @@
#include "InstanceScript.h"
#include "Log.h"
#include "Map.h"
+#include <sstream>
#define MAX_ENCOUNTER 1
class instance_gnomeregan : public InstanceMapScript
{
public:
- instance_gnomeregan() : InstanceMapScript("instance_gnomeregan", 90) { }
+ instance_gnomeregan() : InstanceMapScript(GNOScriptName, 90) { }
InstanceScript* GetInstanceScript(InstanceMap* map) const override
{
@@ -50,7 +51,7 @@ public:
ObjectGuid uiBastmasterEmiShortfuseGUID;
- void Load(const char* in) override
+ void Load(char const* in) override
{
if (!in)
{
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp
index 1b7ded81966..0edd267c695 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp
@@ -18,7 +18,6 @@
#include "ScriptMgr.h"
#include "karazhan.h"
#include "ScriptedCreature.h"
-#include "karazhan.h"
enum CuratorSays
{
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp
index b89078fb228..282e1a56ecd 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp
@@ -222,7 +222,7 @@ public:
std::bind(&BossAI::DoMeleeAttackIfReady, this));
}
- void SpellHit(Unit* /*source*/, const SpellInfo* spell) override
+ void SpellHit(Unit* /*source*/, SpellInfo const* spell) override
{
if (spell->Mechanic == MECHANIC_DISARM)
Talk(SAY_DISARMED);
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp
index f612dc03094..539266ffa18 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp
@@ -23,8 +23,8 @@ SDCategory: Karazhan
EndScriptData */
#include "ScriptMgr.h"
-#include "InstanceScript.h"
#include "karazhan.h"
+#include "InstanceScript.h"
#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
#include "TemporarySummon.h"
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp
index a4463fe4a7f..2ba6ba50317 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp
@@ -15,16 +15,16 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "GameObject.h"
#include "ScriptMgr.h"
+#include "GameObject.h"
+#include "GameObjectAI.h"
#include "InstanceScript.h"
#include "karazhan.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
-#include "GameObjectAI.h"
-#include "SpellScript.h"
#include "SpellAuraEffects.h"
+#include "SpellScript.h"
enum NightbaneSpells
{
@@ -119,11 +119,6 @@ class boss_nightbane : public CreatureScript
public:
boss_nightbane() : CreatureScript("boss_nightbane") { }
- CreatureAI* GetAI(Creature* creature) const override
- {
- return GetKarazhanAI<boss_nightbaneAI>(creature);
- }
-
struct boss_nightbaneAI : public BossAI
{
boss_nightbaneAI(Creature* creature) : BossAI(creature, DATA_NIGHTBANE), _flyCount(0) { }
@@ -381,6 +376,11 @@ public:
private:
uint8 _flyCount;
};
+
+ CreatureAI* GetAI(Creature* creature) const override
+ {
+ return GetKarazhanAI<boss_nightbaneAI>(creature);
+ }
};
// 37098 - Rain of Bones
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp
index a70793dd572..e004ebeb87d 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp
@@ -23,8 +23,8 @@ SDCategory: Karazhan
EndScriptData */
#include "ScriptMgr.h"
-#include "InstanceScript.h"
#include "karazhan.h"
+#include "InstanceScript.h"
#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
#include "SpellInfo.h"
@@ -154,7 +154,7 @@ public:
creature->AI()->KilledUnit(who);
}
- void SpellHit(Unit* /*who*/, const SpellInfo* spell) override
+ void SpellHit(Unit* /*who*/, SpellInfo const* spell) override
{
if (spell->Id == SPELL_INFERNAL_RELAY)
{
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp
index 86c733d2e3c..a9eaa863f46 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp
@@ -23,11 +23,10 @@ SDCategory: Karazhan
EndScriptData */
#include "ScriptMgr.h"
-#include "GameObject.h"
+#include "karazhan.h"
#include "InstanceScript.h"
+#include "GameObject.h"
#include "Item.h"
-#include "karazhan.h"
-#include "Map.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "Player.h"
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp
index c639a384374..3150111e30b 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp
@@ -16,12 +16,10 @@
*/
#include "ScriptMgr.h"
-#include "InstanceScript.h"
#include "karazhan.h"
#include "ObjectAccessor.h"
#include "PassiveAI.h"
#include "ScriptedCreature.h"
-#include "TemporarySummon.h"
#include "SpellInfo.h"
enum TerestianSays
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp
index 32cc678e901..1f5d49a3c6d 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp
@@ -372,7 +372,7 @@ public:
me->DespawnOrUnsummon();
}
- void SpellHit(Unit* /*caster*/, const SpellInfo* Spell) override
+ void SpellHit(Unit* /*caster*/, SpellInfo const* Spell) override
{
if ((Spell->SchoolMask == SPELL_SCHOOL_MASK_FIRE) && (!(rand32() % 10)))
{
@@ -1136,7 +1136,7 @@ public:
me->DespawnOrUnsummon();
}
- void SpellHit(Unit* /*caster*/, const SpellInfo* Spell) override
+ void SpellHit(Unit* /*caster*/, SpellInfo const* Spell) override
{
if (Spell->Id == SPELL_DRINK_POISON)
{
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp
index b0300ec3b4b..3c7e07505db 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp
@@ -309,7 +309,7 @@ public:
{
if (WipeTimer <= diff)
{
- Map::PlayerList const &PlayerList = me->GetMap()->GetPlayers();
+ Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
if (PlayerList.isEmpty())
return;
@@ -566,7 +566,7 @@ public:
me->SetVisible(false);
me->ClearInCombat();
- InstanceMap::PlayerList const &PlayerList = me->GetMap()->GetPlayers();
+ InstanceMap::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
for (InstanceMap::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
if (i->GetSource()->IsAlive())
diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp
index 292dc10e7f8..7483991ca6f 100644
--- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp
+++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp
@@ -71,8 +71,6 @@ enum Spells
SPELL_POWER_FEEDBACK = 44233 // Stuns him, making him take 50% more damage for 10 seconds. Cast after Gravity Lapse
};
-
-
enum Creatures
{
CREATURE_PHOENIX = 24674,
diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp
index 0a9062e03f2..e6cac2e0132 100644
--- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp
+++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp
@@ -23,8 +23,8 @@ SDCategory: Magister's Terrace
EndScriptData */
#include "ScriptMgr.h"
-#include "InstanceScript.h"
#include "magisters_terrace.h"
+#include "InstanceScript.h"
#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
#include "TemporarySummon.h"
@@ -1328,7 +1328,7 @@ public:
//CreatureAI* GetAI(Creature* creature) const override
//{
- // return new npc_high_explosive_sheepAI(creature);
+ // return GetMagistersTerraceAI<npc_high_explosive_sheepAI>(creature);
//};
};
*/
diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp
index 40e3195326a..b9bdcced9e6 100644
--- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp
+++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp
@@ -16,9 +16,9 @@
*/
#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
#include "magisters_terrace.h"
#include "MotionMaster.h"
+#include "ScriptedCreature.h"
enum Yells
{
diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp
index 076520907d4..61507222774 100644
--- a/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp
+++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp
@@ -163,11 +163,13 @@ class instance_magisters_terrace : public InstanceMapScript
Events.Update(diff);
if (Events.ExecuteEvent() == EVENT_SPAWN_KALECGOS)
+ {
if (Creature* kalecgos = instance->SummonCreature(NPC_KALECGOS, KalecgosSpawnPos))
{
kalecgos->GetMotionMaster()->MovePath(PATH_KALECGOS_FLIGHT, false);
kalecgos->AI()->Talk(SAY_KALECGOS_SPAWN);
}
+ }
}
bool SetBossState(uint32 type, EncounterState state) override
diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp
index 98494d2703c..01879a1f029 100644
--- a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp
+++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp
@@ -154,7 +154,7 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
- return new npc_kalecgosAI(creature);
+ return GetMagistersTerraceAI<npc_kalecgosAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h
index 664ffd740a0..2a0b8217635 100644
--- a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h
+++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h
@@ -76,10 +76,10 @@ enum MTMovementData
PATH_KALECGOS_FLIGHT = 248440
};
-template<typename AI>
-inline AI* GetMagistersTerraceAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetMagistersTerraceAI(T* obj)
{
- return GetInstanceAI<AI>(creature, MGTScriptName);
+ return GetInstanceAI<AI>(obj, MGTScriptName);
}
#endif
diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp
index f26876e8f3f..d4869fb0d10 100644
--- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp
@@ -19,12 +19,12 @@
#include "CombatAI.h"
#include "CreatureTextMgr.h"
#include "GameObject.h"
+#include "GameObjectAI.h"
#include "Log.h"
#include "MotionMaster.h"
#include "MoveSplineInit.h"
#include "ObjectAccessor.h"
#include "PassiveAI.h"
-#include "GameObjectAI.h"
#include "Player.h"
#include "ScriptedEscortAI.h"
#include "ScriptedGossip.h"
@@ -521,7 +521,7 @@ public:
me->AddUnitFlag(UNIT_FLAG_UNK_15);
}
- void SpellHit(Unit* pCaster, const SpellInfo* pSpell) override
+ void SpellHit(Unit* pCaster, SpellInfo const* pSpell) override
{
if (!m_bIsDuelInProgress && pSpell->Id == SPELL_DUEL)
{
@@ -776,7 +776,7 @@ public:
return false;
}
- void SpellHit(Unit* caster, const SpellInfo* spell) override
+ void SpellHit(Unit* caster, SpellInfo const* spell) override
{
if (spell->Id == SPELL_DELIVER_STOLEN_HORSE)
{
diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp
index 934de238055..86fc1dc0c90 100644
--- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp
@@ -76,7 +76,7 @@ public:
me->RestoreFaction();
}
- void SpellHit(Unit* caster, const SpellInfo* spell) override
+ void SpellHit(Unit* caster, SpellInfo const* spell) override
{
if (spell->Id == SPELL_PERSUASIVE_STRIKE && caster->GetTypeId() == TYPEID_PLAYER && me->IsAlive() && !speechCounter)
{
diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp
index 35ddd4ab784..f9164589cc2 100644
--- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp
@@ -1266,7 +1266,7 @@ public:
// go->SetPhaseMask(0, true);
{
// search players with in 50 yards for quest credit
- Map::PlayerList const &PlayerList = me->GetMap()->GetPlayers();
+ Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
if (!PlayerList.isEmpty())
{
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp
index 84abf8b6062..eb9e2e4e871 100644
--- a/src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp
@@ -131,10 +131,11 @@ public:
break;
}
++phase;
- } else FlyBackTimer-=diff;
+ }
+ else
+ FlyBackTimer -= diff;
}
};
-
};
void AddSC_the_scarlet_enclave()
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp
index 3b294a6811c..6daedfb4a29 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp
@@ -23,8 +23,8 @@ SDCategory: Scarlet Monastery
EndScriptData */
#include "ScriptMgr.h"
-#include "GameObjectAI.h"
#include "GameObject.h"
+#include "GameObjectAI.h"
#include "Group.h"
#include "InstanceScript.h"
#include "LFGMgr.h"
@@ -187,7 +187,7 @@ public:
DoCast(me, _spell);
}
- void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
+ void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if (spell->Id == SPELL_WISP_FLIGHT_PORT && Creaturetype == 4)
me->SetDisplayId(2027);
@@ -302,7 +302,7 @@ public:
}
}
- void SpellHit(Unit* caster, const SpellInfo* spell) override
+ void SpellHit(Unit* caster, SpellInfo const* spell) override
{
if (!withbody)
return;
@@ -540,7 +540,7 @@ public:
Player* SelectRandomPlayer(float range = 0.0f, bool checkLoS = true)
{
- Map::PlayerList const &PlayerList = me->GetMap()->GetPlayers();
+ Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
if (PlayerList.isEmpty())
return nullptr;
@@ -559,7 +559,7 @@ public:
return nullptr;
}
- void SpellHitTarget(Unit* unit, const SpellInfo* spell) override
+ void SpellHitTarget(Unit* unit, SpellInfo const* spell) override
{
if (spell->Id == SPELL_CONFLAGRATION && unit->HasAura(SPELL_CONFLAGRATION))
SaySound(SAY_CONFLAGRATION, unit);
@@ -585,7 +585,7 @@ public:
}
}
- void SpellHit(Unit* caster, const SpellInfo* spell) override
+ void SpellHit(Unit* caster, SpellInfo const* spell) override
{
if (withhead)
return;
@@ -816,7 +816,7 @@ public:
void EnterCombat(Unit* /*who*/) override { }
- void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
+ void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if (spell->Id == SPELL_SPROUTING)
{
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp
index 4e3a71bbe71..75c6ad43263 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp
@@ -23,9 +23,9 @@ SDCategory: Scarlet Monastery
EndScriptData */
#include "ScriptMgr.h"
+#include "scarlet_monastery.h"
#include "ScriptedCreature.h"
#include "ScriptedEscortAI.h"
-#include "scarlet_monastery.h"
enum Says
{
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp
index fd0a8ec795f..7c5855b4b10 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp
@@ -23,8 +23,8 @@ SDCategory: Scarlet Monastery
EndScriptData */
#include "ScriptMgr.h"
-#include "InstanceScript.h"
#include "scarlet_monastery.h"
+#include "InstanceScript.h"
#include "ScriptedCreature.h"
enum Spells
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp
index 7e4b210f599..224bc488b03 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp
@@ -16,8 +16,8 @@
*/
#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
#include "scarlet_monastery.h"
+#include "ScriptedCreature.h"
enum Yells
{
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp
index fbdad6dc712..4714bcb999e 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp
@@ -16,9 +16,9 @@
*/
#include "ScriptMgr.h"
+#include "scarlet_monastery.h"
#include "InstanceScript.h"
#include "ObjectAccessor.h"
-#include "scarlet_monastery.h"
#include "ScriptedCreature.h"
enum Says
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp
index 5ae31c00d81..6d976481eca 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp
@@ -161,7 +161,7 @@ public:
}
}
- void SpellHit(Unit* /*who*/, const SpellInfo* spell) override
+ void SpellHit(Unit* /*who*/, SpellInfo const* spell) override
{
//When hit with resurrection say text
if (spell->Id == SPELL_SCARLETRESURRECTION)
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp
index 6d70f5b762c..8be2b9a6269 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp
@@ -46,26 +46,13 @@ class instance_scarlet_monastery : public InstanceMapScript
void OnGameObjectCreate(GameObject* go) override
{
+ InstanceScript::OnGameObjectCreate(go);
+
switch (go->GetEntry())
{
case GO_PUMPKIN_SHRINE:
PumpkinShrineGUID = go->GetGUID();
break;
- case GO_HIGH_INQUISITORS_DOOR:
- AddDoor(go, true);
- break;
- default:
- break;
- }
- }
-
- void OnGameObjectRemove(GameObject* go) override
- {
- switch (go->GetEntry())
- {
- case GO_HIGH_INQUISITORS_DOOR:
- AddDoor(go, false);
- break;
default:
break;
}
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h b/src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h
index c1ba06d446b..36d2569dbf3 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h
@@ -62,7 +62,7 @@ enum SMGameObjectIds
GO_PUMPKIN_SHRINE = 186267
};
-template<class AI, class T>
+template <class AI, class T>
inline AI* GetScarletMonasteryAI(T* obj)
{
return GetInstanceAI<AI>(obj, SMScriptName);
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp
index d0e711ae642..77539afa7be 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp
@@ -27,8 +27,8 @@ Category: Scholomance
#include "InstanceScript.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
-#include "ScriptedCreature.h"
#include "scholomance.h"
+#include "ScriptedCreature.h"
#include "SpellInfo.h"
#include "SpellScript.h"
#include "TemporarySummon.h"
@@ -171,17 +171,10 @@ class spell_shadow_portal : public SpellScriptLoader
{
PrepareSpellScript(spell_shadow_portal_SpellScript);
- public:
- spell_shadow_portal_SpellScript()
- {
- _instance = nullptr;
- }
-
- private:
bool Load() override
{
_instance = GetCaster()->GetInstanceScript();
- return _instance != nullptr;
+ return InstanceHasScript(GetCaster(), ScholomanceScriptName);
}
void HandleCast(SpellEffIndex /*effIndex*/)
@@ -238,7 +231,7 @@ class spell_shadow_portal : public SpellScriptLoader
OnEffectHitTarget += SpellEffectFn(spell_shadow_portal_SpellScript::HandleCast, EFFECT_0, SPELL_EFFECT_DUMMY);
}
- InstanceScript* _instance;
+ InstanceScript* _instance = nullptr;
};
SpellScript* GetSpellScript() const override
@@ -300,13 +293,6 @@ class spell_shadow_portal_rooms : public SpellScriptLoader
{
PrepareSpellScript(spell_shadow_portal_rooms_SpellScript);
- public:
- spell_shadow_portal_rooms_SpellScript()
- {
- _instance = nullptr;
- }
-
- private:
bool Load() override
{
_instance = GetCaster()->GetInstanceScript();
@@ -380,7 +366,7 @@ class spell_shadow_portal_rooms : public SpellScriptLoader
OnEffectHit += SpellEffectFn(spell_shadow_portal_rooms_SpellScript::HandleSendEvent, EFFECT_1, SPELL_EFFECT_SEND_EVENT);
}
- InstanceScript* _instance;
+ InstanceScript* _instance = nullptr;
};
SpellScript* GetSpellScript() const override
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp
index 3f3ec24913a..2f053417900 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp
@@ -23,8 +23,8 @@ Category: Scholomance
*/
#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
#include "scholomance.h"
+#include "ScriptedCreature.h"
enum Say
{
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp
index 23ba5b24237..99c81366ef5 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp
@@ -23,8 +23,8 @@ Category: Scholomance
*/
#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
#include "scholomance.h"
+#include "ScriptedCreature.h"
enum Spells
{
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp
index f7108dc14cd..55c5c442a71 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp
@@ -23,8 +23,8 @@ SDCategory: Scholomance
EndScriptData */
#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
#include "scholomance.h"
+#include "ScriptedCreature.h"
enum Spells
{
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp
index 2888a9b4135..f8678b1e6ae 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp
@@ -16,8 +16,8 @@
*/
#include "ScriptMgr.h"
-#include "GameObjectAI.h"
#include "GameObject.h"
+#include "GameObjectAI.h"
#include "InstanceScript.h"
#include "MotionMaster.h"
#include "MoveSplineInit.h"
@@ -141,9 +141,7 @@ class boss_kirtonos_the_herald : public CreatureScript
void MovementInform(uint32 type, uint32 id) override
{
if (type == WAYPOINT_MOTION_TYPE && id == POINT_KIRTONOS_LAND)
- {
events.ScheduleEvent(INTRO_2, 1500);
- }
}
void UpdateAI(uint32 diff) override
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp
index 5343104dce7..b54c8b40ad6 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp
@@ -22,9 +22,9 @@ SDComment: aura applied/defined in database
SDCategory: Scholomance
EndScriptData */
+#include "scholomance.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
-#include "scholomance.h"
enum Spells
{
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp
index e001036ca65..67df81f9928 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp
@@ -22,9 +22,9 @@ Comment:
Category: Scholomance
*/
+#include "scholomance.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
-#include "scholomance.h"
enum Spells
{
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp
index 37189ec6169..d4be3a1c44e 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp
@@ -15,8 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptMgr.h"
#include "scholomance.h"
+#include "ScriptMgr.h"
#include "ScriptedCreature.h"
enum Spells
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp
index 1ab11ee1903..2ef20dfa915 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp
@@ -22,9 +22,9 @@ Comment:
Category: Scholomance
*/
+#include "scholomance.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
-#include "scholomance.h"
enum Spells
{
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp
index 89ba79a8c25..9853500e5ee 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp
@@ -15,8 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptMgr.h"
#include "scholomance.h"
+#include "ScriptMgr.h"
#include "ScriptedCreature.h"
enum Emotes
diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp
index 3172c4e71fa..00e9b44d0da 100644
--- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp
+++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp
@@ -15,7 +15,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "shadowfang_keep.h"
+#include "ScriptMgr.h"
#include "GridNotifiersImpl.h"
#include "Group.h"
#include "InstanceScript.h"
@@ -25,8 +25,7 @@
#include "Player.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
-#include "ScriptMgr.h"
-#include "SpellAuraEffects.h"
+#include "shadowfang_keep.h"
#include "SpellScript.h"
enum ApothecarySpells
diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp
index 0872c8cfe0e..2837b3d1b75 100644
--- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp
+++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp
@@ -23,14 +23,14 @@ SDCategory: Shadowfang Keep
EndScriptData */
#include "ScriptMgr.h"
-#include "Creature.h"
-#include "CreatureAI.h"
+#include "shadowfang_keep.h"
#include "GameObject.h"
#include "InstanceScript.h"
#include "Log.h"
#include "Map.h"
-#include "shadowfang_keep.h"
+#include "ScriptedCreature.h"
#include "TemporarySummon.h"
+#include <sstream>
#define MAX_ENCOUNTER 4
@@ -217,7 +217,7 @@ public:
return str_data;
}
- void Load(const char* in) override
+ void Load(char const* in) override
{
if (!in)
{
diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp
index db50a0c8f34..a69238119d4 100644
--- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp
+++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp
@@ -27,11 +27,11 @@ npc_shadowfang_prisoner
EndContentData */
#include "ScriptMgr.h"
+#include "shadowfang_keep.h"
#include "InstanceScript.h"
#include "Player.h"
#include "ScriptedEscortAI.h"
#include "ScriptedGossip.h"
-#include "shadowfang_keep.h"
#include "SpellAuraEffects.h"
#include "SpellScript.h"
diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.h b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.h
index e7163fd64e0..486c9750acc 100644
--- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.h
+++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.h
@@ -33,7 +33,7 @@ enum SKDataTypes
DATA_APOTHECARY_HUMMEL = 6
};
-template<typename AI, typename T>
+template <class AI, class T>
inline AI* GetShadowfangKeepAI(T* obj)
{
return GetInstanceAI<AI>(obj, SFKScriptName);
diff --git a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp
index 64ecf812e66..04268b037b3 100644
--- a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp
+++ b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp
@@ -31,6 +31,7 @@ EndScriptData */
#include "Map.h"
#include "Player.h"
#include "stratholme.h"
+#include <sstream>
enum Misc
{
@@ -352,7 +353,7 @@ class instance_stratholme : public InstanceMapScript
return saveStream.str();
}
- void Load(const char* in) override
+ void Load(char const* in) override
{
if (!in)
{
diff --git a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp
index 624047a5ab5..ab619c8abba 100644
--- a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp
+++ b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp
@@ -30,8 +30,8 @@ npc_spectral_ghostly_citizen
EndContentData */
#include "ScriptMgr.h"
-#include "GameObjectAI.h"
#include "GameObject.h"
+#include "GameObjectAI.h"
#include "Group.h"
#include "InstanceScript.h"
#include "MotionMaster.h"
@@ -116,7 +116,7 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
- return new npc_restless_soulAI(creature);
+ return GetStratholmeAI<npc_restless_soulAI>(creature);
}
struct npc_restless_soulAI : public ScriptedAI
@@ -144,7 +144,7 @@ public:
void EnterCombat(Unit* /*who*/) override { }
- void SpellHit(Unit* caster, const SpellInfo* spell) override
+ void SpellHit(Unit* caster, SpellInfo const* spell) override
{
if (Tagged || spell->Id != SPELL_EGAN_BLASTER)
return;
@@ -209,7 +209,7 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
- return new npc_spectral_ghostly_citizenAI(creature);
+ return GetStratholmeAI<npc_spectral_ghostly_citizenAI>(creature);
}
struct npc_spectral_ghostly_citizenAI : public ScriptedAI
@@ -235,7 +235,7 @@ public:
void EnterCombat(Unit* /*who*/) override { }
- void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
+ void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if (!Tagged && spell->Id == SPELL_EGAN_BLASTER)
Tagged = true;
diff --git a/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp b/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp
index acf914ebba3..448150295a1 100644
--- a/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp
+++ b/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp
@@ -50,7 +50,7 @@ enum CreatureIds
class instance_sunken_temple : public InstanceMapScript
{
public:
- instance_sunken_temple() : InstanceMapScript("instance_sunken_temple", 109) { }
+ instance_sunken_temple() : InstanceMapScript(STScriptName, 109) { }
InstanceScript* GetInstanceScript(InstanceMap* map) const override
{
@@ -174,7 +174,7 @@ public:
void UseLastStatue(GameObject* go)
{
for (uint8 i = 0; i < nStatues; ++i)
- go->SummonGameObject(GO_ATALAI_LIGHT2, statuePositions[i], G3D::Quat(), 0);
+ go->SummonGameObject(GO_ATALAI_LIGHT2, statuePositions[i], QuaternionData(), 0);
go->SummonCreature(NPC_ATALALARION, atalalarianPos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200);
}
diff --git a/src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.cpp b/src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.cpp
index 4998861939e..5e0a2fc0a29 100644
--- a/src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.cpp
+++ b/src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.cpp
@@ -28,10 +28,10 @@ EndContentData */
#include "ScriptMgr.h"
#include "GameObject.h"
+#include "GameObjectAI.h"
#include "InstanceScript.h"
#include "Player.h"
#include "ScriptedCreature.h"
-#include "GameObjectAI.h"
#include "sunken_temple.h"
/*#####
@@ -43,7 +43,7 @@ class at_malfurion_stormrage : public AreaTriggerScript
public:
at_malfurion_stormrage() : AreaTriggerScript("at_malfurion_stormrage") { }
- bool OnTrigger(Player* player, const AreaTriggerEntry* /*areaTrigger*/, bool /*entered*/) override
+ bool OnTrigger(Player* player, AreaTriggerEntry const* /*areaTrigger*/, bool /*entered*/) override
{
if (player->GetInstanceScript() && !player->FindNearestCreature(15362, 15))
player->SummonCreature(15362, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), -1.52f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 100000);
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp
index 751ff1d16c1..9821ed2edae 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp
@@ -24,7 +24,6 @@ EndScriptData */
#include "ScriptMgr.h"
#include "InstanceScript.h"
#include "Log.h"
-#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
#include "sunwell_plateau.h"
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp
index a6bf0dec111..e733c6810c2 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp
@@ -17,7 +17,6 @@
#include "ScriptMgr.h"
#include "InstanceScript.h"
-#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
#include "SpellInfo.h"
#include "sunwell_plateau.h"
@@ -162,7 +161,7 @@ public:
me->RemoveDynamicFlag(UNIT_DYNFLAG_LOOTABLE);
}
- void SpellHitTarget(Unit* target, const SpellInfo* spell) override
+ void SpellHitTarget(Unit* target, SpellInfo const* spell) override
{
switch (spell->Id)
{
@@ -438,7 +437,7 @@ public:
me->RemoveDynamicFlag(UNIT_DYNFLAG_LOOTABLE);
}
- void SpellHitTarget(Unit* target, const SpellInfo* spell) override
+ void SpellHitTarget(Unit* target, SpellInfo const* spell) override
{
switch (spell->Id)
{
@@ -675,7 +674,7 @@ public:
void EnterCombat(Unit* /*who*/) override { }
- void SpellHitTarget(Unit* target, const SpellInfo* spell) override
+ void SpellHitTarget(Unit* target, SpellInfo const* spell) override
{
switch (spell->Id)
{
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp
index 229e942103e..fb11d19b833 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp
@@ -198,7 +198,7 @@ public:
instance->SetBossState(DATA_FELMYST, DONE);
}
- void SpellHit(Unit* caster, const SpellInfo* spell) override
+ void SpellHit(Unit* caster, SpellInfo const* spell) override
{
// workaround for linked aura
/*if (spell->Id == SPELL_VAPOR_FORCE)
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp
index 9ed81e6f526..684b094e06b 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp
@@ -26,13 +26,13 @@ EndScriptData */
#include "ScriptMgr.h"
#include "GameObject.h"
+#include "GameObjectAI.h"
#include "InstanceScript.h"
#include "Log.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "Player.h"
#include "ScriptedCreature.h"
-#include "GameObjectAI.h"
#include "sunwell_plateau.h"
#include "TemporarySummon.h"
#include <cmath>
@@ -707,7 +707,7 @@ public:
case TIMER_SPEECH:
if (SpeechBegins)
{
- SpeechBegins=false;
+ SpeechBegins = false;
switch (Phase)
{
case PHASE_NORMAL:
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.h b/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.h
index 1ea9a56f7ec..2ddb4233a18 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.h
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.h
@@ -116,7 +116,7 @@ enum SWPGameObjectIds
};
template <class AI, class T>
-inline AI* GetSunwellPlateauAI(T* obj)
+AI* GetSunwellPlateauAI(T* obj)
{
return GetInstanceAI<AI>(obj, SunwellPlateauScriptName);
}
diff --git a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp
index 79c8eb1f05b..8a2496b55da 100644
--- a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp
+++ b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp
@@ -26,14 +26,14 @@ On his death the vault door opens.
EndScriptData */
#include "ScriptMgr.h"
+#include "GameObject.h"
+#include "GameObjectAI.h"
#include "InstanceScript.h"
#include "ObjectAccessor.h"
#include "Player.h"
#include "ScriptedCreature.h"
-#include "GameObjectAI.h"
#include "SpellInfo.h"
#include "uldaman.h"
-#include "GameObject.h"
enum Says
{
diff --git a/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp b/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp
index 0b6128af171..02b7a121b96 100644
--- a/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp
+++ b/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp
@@ -32,6 +32,7 @@ EndScriptData */
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "uldaman.h"
+#include <sstream>
enum Spells
{
@@ -418,7 +419,7 @@ class instance_uldaman : public InstanceMapScript
return str_data;
}
- void Load(const char* in) override
+ void Load(char const* in) override
{
if (!in)
{
diff --git a/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp b/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp
index becc9fcb5d7..b8539f686bf 100644
--- a/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp
+++ b/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp
@@ -30,10 +30,10 @@ EndContentData */
#include "ScriptMgr.h"
#include "GameObject.h"
+#include "GameObjectAI.h"
#include "InstanceScript.h"
#include "Player.h"
#include "ScriptedCreature.h"
-#include "GameObjectAI.h"
#include "uldaman.h"
/*######
@@ -102,7 +102,7 @@ class npc_jadespine_basilisk : public CreatureScript
CreatureAI* GetAI(Creature* creature) const override
{
- return new npc_jadespine_basiliskAI(creature);
+ return GetUldamanAI<npc_jadespine_basiliskAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp
index ee4137453df..8db37e7275a 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp
@@ -23,11 +23,12 @@
#include "ScriptedCreature.h"
#include "WorldStatePackets.h"
#include "zulaman.h"
+#include <sstream>
class instance_zulaman : public InstanceMapScript
{
public:
- instance_zulaman() : InstanceMapScript(ZulAmanScriptName, 568) { }
+ instance_zulaman() : InstanceMapScript(ZulamanScriptName, 568) { }
struct instance_zulaman_InstanceScript : public InstanceScript
{
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h
index 4c2fadfb49f..5a482417563 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h
+++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h
@@ -21,7 +21,7 @@
#include "CreatureAIImpl.h"
uint32 const EncounterCount = 6;
-#define ZulAmanScriptName "instance_zulaman"
+#define ZulamanScriptName "instance_zulaman"
#define DataHeader "ZA"
enum ZADataTypes
@@ -80,10 +80,10 @@ enum ZAWorldStates
WORLD_STATE_ZULAMAN_TIMER = 3106,
};
-template<typename AI>
-CreatureAI* GetZulAmanAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetZulAmanAI(T* obj)
{
- return GetInstanceAI<AI>(creature, ZulAmanScriptName);
+ return GetInstanceAI<AI>(obj, ZulamanScriptName);
}
#endif
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp
index 8ff09f8bb9b..4dfb3a9e2d2 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp
@@ -17,7 +17,6 @@
#include "ScriptMgr.h"
#include "Creature.h"
-#include "GameObject.h"
#include "InstanceScript.h"
#include "zulgurub.h"
@@ -84,38 +83,6 @@ class instance_zulgurub : public InstanceMapScript
}
}
- void OnGameObjectCreate(GameObject* go) override
- {
- switch (go->GetEntry())
- {
- case GO_VENOXIS_COIL:
- case GO_ARENA_DOOR_1:
- case GO_FORCEFIELD:
- case GO_ZANZIL_DOOR:
- case GO_THE_CACHE_OF_MADNESS_DOOR:
- AddDoor(go, true);
- break;
- default:
- break;
- }
- }
-
- void OnGameObjectRemove(GameObject* go) override
- {
- switch (go->GetEntry())
- {
- case GO_VENOXIS_COIL:
- case GO_ARENA_DOOR_1:
- case GO_FORCEFIELD:
- case GO_ZANZIL_DOOR:
- case GO_THE_CACHE_OF_MADNESS_DOOR:
- AddDoor(go, false);
- break;
- default:
- break;
- }
- }
-
bool SetBossState(uint32 type, EncounterState state) override
{
if (!InstanceScript::SetBossState(type, state))
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h b/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h
index d4d2908dec5..517553727e6 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h
@@ -20,8 +20,8 @@
#include "CreatureAIImpl.h"
-#define DataHeader "ZG"
#define ZGScriptName "instance_zulgurub"
+#define DataHeader "ZG"
uint32 const EncounterCount = 5;
@@ -89,8 +89,8 @@ enum ZGGameObjectIds
GO_THE_CACHE_OF_MADNESS_DOOR = 208843
};
-template<class AI, class T>
-AI* GetZulGurubAI(T* obj)
+template <class AI, class T>
+inline AI* GetZulGurubAI(T* obj)
{
return GetInstanceAI<AI>(obj, ZGScriptName);
}
diff --git a/src/server/scripts/EasternKingdoms/zone_duskwood.cpp b/src/server/scripts/EasternKingdoms/zone_duskwood.cpp
index 068cfbc74e6..818418e65d9 100644
--- a/src/server/scripts/EasternKingdoms/zone_duskwood.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_duskwood.cpp
@@ -146,7 +146,7 @@ class at_twilight_grove : public AreaTriggerScript
public:
at_twilight_grove() : AreaTriggerScript("at_twilight_grove") { }
- bool OnTrigger(Player* player, const AreaTriggerEntry* /*areaTrigger*/, bool /*entered*/) override
+ bool OnTrigger(Player* player, AreaTriggerEntry const* /*areaTrigger*/, bool /*entered*/) override
{
if (player->GetQuestStatus(QUEST_NIGHTMARES_CORRUPTION) == QUEST_STATUS_INCOMPLETE)
if (!player->FindNearestCreature(NPC_TWILIGHT_CORRUPTER, 500.0f, true))
diff --git a/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp b/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp
index 1751bf9c77c..7c7c2c742c2 100644
--- a/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp
@@ -28,9 +28,8 @@ EndContentData */
#include "ScriptMgr.h"
#include "MotionMaster.h"
-#include "ScriptedCreature.h"
-#include "ScriptedEscortAI.h"
#include "Player.h"
+#include "ScriptedEscortAI.h"
/*######
## npc_oox09hl
diff --git a/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp b/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp
index 4ea7686519c..9ffe7b541fc 100644
--- a/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp
@@ -73,7 +73,7 @@ public:
me->SetEmoteState(EMOTE_STATE_NONE);
}
- void SpellHit(Unit* caster, const SpellInfo* spell) override
+ void SpellHit(Unit* caster, SpellInfo const* spell) override
{
if (bReset || spell->Id != SPELL_YENNIKUS_RELEASE)
return;