aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Outland
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/Outland
parentb20acfe701e6f5f995f2776f076d3c494c02e1aa (diff)
Core/Misc: Port all the refactors sneaked in master to 3.3.5 include cleanup port
Diffstat (limited to 'src/server/scripts/Outland')
-rw-r--r--src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/auchenai_crypts.h6
-rw-r--r--src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp6
-rw-r--r--src/server/scripts/Outland/Auchindoun/ManaTombs/mana_tombs.h6
-rw-r--r--src/server/scripts/Outland/Auchindoun/SethekkHalls/instance_sethekk_halls.cpp2
-rw-r--r--src/server/scripts/Outland/Auchindoun/SethekkHalls/sethekk_halls.h6
-rw-r--r--src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp2
-rw-r--r--src/server/scripts/Outland/BlackTemple/black_temple.cpp2
-rw-r--r--src/server/scripts/Outland/BlackTemple/black_temple.h2
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_gurtogg_bloodboil.cpp3
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_illidan.cpp2
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_illidari_council.cpp12
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp14
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp7
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp3
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp16
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp6
-rw-r--r--src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp2
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp2
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp6
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp2
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp39
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp14
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp2
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SteamVault/steam_vault.h2
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_ahune.cpp4
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/the_slave_pens.h2
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/the_underbog.h6
-rw-r--r--src/server/scripts/Outland/GruulsLair/boss_gruul.cpp2
-rw-r--r--src/server/scripts/Outland/GruulsLair/gruuls_lair.h6
-rw-r--r--src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp45
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/BloodFurnace/blood_furnace.h2
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp3
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp3
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp22
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp2
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/hellfire_ramparts.h6
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp16
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp7
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/magtheridons_lair.h8
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/instance_shattered_halls.cpp31
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/shattered_halls.cpp6
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/shattered_halls.h12
-rw-r--r--src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp4
-rw-r--r--src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp13
-rw-r--r--src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp14
-rw-r--r--src/server/scripts/Outland/TempestKeep/Eye/the_eye.cpp2
-rw-r--r--src/server/scripts/Outland/TempestKeep/Eye/the_eye.h6
-rw-r--r--src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp32
-rw-r--r--src/server/scripts/Outland/TempestKeep/Mechanar/mechanar.h6
-rw-r--r--src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.h6
-rw-r--r--src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp19
-rw-r--r--src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp1
-rw-r--r--src/server/scripts/Outland/TempestKeep/botanica/the_botanica.h6
-rw-r--r--src/server/scripts/Outland/zone_blades_edge_mountains.cpp8
-rw-r--r--src/server/scripts/Outland/zone_hellfire_peninsula.cpp1
-rw-r--r--src/server/scripts/Outland/zone_nagrand.cpp7
-rw-r--r--src/server/scripts/Outland/zone_netherstorm.cpp11
-rw-r--r--src/server/scripts/Outland/zone_shadowmoon_valley.cpp9
58 files changed, 185 insertions, 307 deletions
diff --git a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/auchenai_crypts.h b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/auchenai_crypts.h
index 842f4ca195b..5ea113cc547 100644
--- a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/auchenai_crypts.h
+++ b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/auchenai_crypts.h
@@ -32,10 +32,10 @@ enum ACDataTypes
DATA_EXARCH_MALADAAR = 1
};
-template<typename AI>
-inline AI* GetAuchenaiCryptsAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetAuchenaiCryptsAI(T* obj)
{
- return GetInstanceAI<AI>(creature, ACScriptName);
+ return GetInstanceAI<AI>(obj, ACScriptName);
}
#endif // AUCHENAI_CRYPTS_H_
diff --git a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp
index c07ddb0cb23..0340a4dd2f1 100644
--- a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp
+++ b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp
@@ -57,7 +57,7 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
- return new boss_shirrak_the_dead_watcherAI(creature);
+ return GetAuchenaiCryptsAI<boss_shirrak_the_dead_watcherAI>(creature);
}
struct boss_shirrak_the_dead_watcherAI : public ScriptedAI
@@ -111,7 +111,7 @@ public:
if (Inhibitmagic_Timer <= diff)
{
float dist;
- Map::PlayerList const &PlayerList = me->GetMap()->GetPlayers();
+ Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
if (Player* i_pl = i->GetSource())
if (i_pl->IsAlive() && (dist = i_pl->GetDistance(me)) < 45)
@@ -174,7 +174,7 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
- return new npc_focus_fireAI(creature);
+ return GetAuchenaiCryptsAI<npc_focus_fireAI>(creature);
}
struct npc_focus_fireAI : public ScriptedAI
diff --git a/src/server/scripts/Outland/Auchindoun/ManaTombs/mana_tombs.h b/src/server/scripts/Outland/Auchindoun/ManaTombs/mana_tombs.h
index 94b178b1e87..2b6844017f0 100644
--- a/src/server/scripts/Outland/Auchindoun/ManaTombs/mana_tombs.h
+++ b/src/server/scripts/Outland/Auchindoun/ManaTombs/mana_tombs.h
@@ -34,10 +34,10 @@ enum MTDataTypes
DATA_YOR = 3
};
-template<typename AI>
-inline AI* GetManaTombsAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetManaTombsAI(T* obj)
{
- return GetInstanceAI<AI>(creature, MTScriptName);
+ return GetInstanceAI<AI>(obj, MTScriptName);
}
#endif // MANA_TOMBS_H_
diff --git a/src/server/scripts/Outland/Auchindoun/SethekkHalls/instance_sethekk_halls.cpp b/src/server/scripts/Outland/Auchindoun/SethekkHalls/instance_sethekk_halls.cpp
index 8c9ca995f59..435167bba65 100644
--- a/src/server/scripts/Outland/Auchindoun/SethekkHalls/instance_sethekk_halls.cpp
+++ b/src/server/scripts/Outland/Auchindoun/SethekkHalls/instance_sethekk_halls.cpp
@@ -24,7 +24,7 @@
DoorData const doorData[] =
{
{ GO_IKISS_DOOR, DATA_TALON_KING_IKISS, DOOR_TYPE_PASSAGE },
- { 0, 0, DOOR_TYPE_ROOM } // END
+ { 0, 0, DOOR_TYPE_ROOM } // END
};
ObjectData const gameObjectData[] =
diff --git a/src/server/scripts/Outland/Auchindoun/SethekkHalls/sethekk_halls.h b/src/server/scripts/Outland/Auchindoun/SethekkHalls/sethekk_halls.h
index b7b168c074e..bf64986f100 100644
--- a/src/server/scripts/Outland/Auchindoun/SethekkHalls/sethekk_halls.h
+++ b/src/server/scripts/Outland/Auchindoun/SethekkHalls/sethekk_halls.h
@@ -48,10 +48,10 @@ enum SHGameObjectIds
GO_TALON_KING_COFFER = 187372
};
-template<typename AI>
-inline AI* GetSethekkHallsAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetSethekkHallsAI(T* obj)
{
- return GetInstanceAI<AI>(creature, SHScriptName);
+ return GetInstanceAI<AI>(obj, SHScriptName);
}
#endif // SETHEKK_HALLS_H_
diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp
index 416eec05c45..529107380fb 100644
--- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp
+++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp
@@ -186,7 +186,7 @@ class boss_grandmaster_vorpil : public CreatureScript
break;
case EVENT_DRAW_SHADOWS:
{
- Map::PlayerList const &PlayerList = me->GetMap()->GetPlayers();
+ Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
if (Player* i_pl = i->GetSource())
if (i_pl->IsAlive() && !i_pl->HasAura(SPELL_BANISH))
diff --git a/src/server/scripts/Outland/BlackTemple/black_temple.cpp b/src/server/scripts/Outland/BlackTemple/black_temple.cpp
index e1615bf2260..647f678fbb8 100644
--- a/src/server/scripts/Outland/BlackTemple/black_temple.cpp
+++ b/src/server/scripts/Outland/BlackTemple/black_temple.cpp
@@ -19,8 +19,8 @@
#include "black_temple.h"
#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
-#include "SpellScript.h"
#include "SpellAuraEffects.h"
+#include "SpellScript.h"
enum Spells
{
diff --git a/src/server/scripts/Outland/BlackTemple/black_temple.h b/src/server/scripts/Outland/BlackTemple/black_temple.h
index 6e93e0c63c0..10be8f5c633 100644
--- a/src/server/scripts/Outland/BlackTemple/black_temple.h
+++ b/src/server/scripts/Outland/BlackTemple/black_temple.h
@@ -137,7 +137,7 @@ enum BlackTempleMisc
ACTION_OPEN_DOOR = 4
};
-template<class AI, class T>
+template <class AI, class T>
inline AI* GetBlackTempleAI(T* obj)
{
return GetInstanceAI<AI>(obj, BTScriptName);
diff --git a/src/server/scripts/Outland/BlackTemple/boss_gurtogg_bloodboil.cpp b/src/server/scripts/Outland/BlackTemple/boss_gurtogg_bloodboil.cpp
index ba8ded29f51..0cbf6010f8d 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_gurtogg_bloodboil.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_gurtogg_bloodboil.cpp
@@ -16,14 +16,13 @@
*/
#include "ScriptMgr.h"
+#include "black_temple.h"
#include "GridNotifiers.h"
#include "ObjectAccessor.h"
#include "PassiveAI.h"
#include "ScriptedCreature.h"
#include "SpellScript.h"
-#include "black_temple.h"
-
enum Says
{
SAY_AGGRO = 0,
diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp
index 9de5e595a1e..e1476f65df2 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp
@@ -678,7 +678,7 @@ public:
void EnterEvadeModeIfNeeded()
{
- Map::PlayerList const &players = me->GetMap()->GetPlayers();
+ Map::PlayerList const& players = me->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
if (Player* player = i->GetSource())
if (player->IsAlive() && !player->IsGameMaster() && CheckBoundary(player))
diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidari_council.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidari_council.cpp
index 90939e47b9d..4acd27f7d32 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_illidari_council.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_illidari_council.cpp
@@ -15,15 +15,15 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "ScriptMgr.h"
+#include "black_temple.h"
#include "CellImpl.h"
#include "GridNotifiersImpl.h"
#include "InstanceScript.h"
#include "PassiveAI.h"
#include "ScriptedCreature.h"
-#include "ScriptMgr.h"
#include "SpellAuraEffects.h"
#include "SpellScript.h"
-#include "black_temple.h"
enum Says
{
@@ -800,7 +800,7 @@ class spell_illidari_council_reflective_shield : public SpellScriptLoader
return ValidateSpellInfo({ SPELL_REFLECTIVE_SHIELD_DAMAGE });
}
- void OnAbsorb(AuraEffect* aurEff, DamageInfo & dmgInfo, uint32 & absorbAmount)
+ void OnAbsorb(AuraEffect* aurEff, DamageInfo& dmgInfo, uint32& absorbAmount)
{
Unit* target = GetTarget();
if (dmgInfo.GetAttacker() == target)
@@ -883,7 +883,11 @@ class spell_illidari_council_seal : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) override
{
- return ValidateSpellInfo({ SPELL_SEAL_OF_COMMAND, SPELL_SEAL_OF_BLOOD });
+ return ValidateSpellInfo(
+ {
+ SPELL_SEAL_OF_COMMAND,
+ SPELL_SEAL_OF_BLOOD
+ });
}
void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
diff --git a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp
index b640a57a67c..c38bf68ea04 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp
@@ -220,7 +220,11 @@ class spell_mother_shahraz_fatal_attraction : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) override
{
- return ValidateSpellInfo({ SPELL_SABER_LASH_IMMUNITY, SPELL_FATAL_ATTRACTION });
+ return ValidateSpellInfo(
+ {
+ SPELL_SABER_LASH_IMMUNITY,
+ SPELL_FATAL_ATTRACTION
+ });
}
void FilterTargets(std::list<WorldObject*>& targets)
@@ -371,13 +375,7 @@ class spell_mother_shahraz_random_periodic : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) override
{
- return ValidateSpellInfo(
- {
- SPELL_BEAM_SINISTER,
- SPELL_BEAM_VILE,
- SPELL_BEAM_WICKED,
- SPELL_BEAM_SINFUL
- });
+ return ValidateSpellInfo(RandomBeam);
}
void OnPeriodic(AuraEffect const* /*aurEffect*/)
diff --git a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp
index 50fbd937d53..34a8289629f 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp
@@ -20,13 +20,12 @@
#include "InstanceScript.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
+#include "Player.h"
#include "ScriptedCreature.h"
#include "Spell.h"
-#include "SpellInfo.h"
-#include "TemporarySummon.h"
-#include "SpellScript.h"
#include "SpellAuraEffects.h"
-#include "Player.h"
+#include "SpellScript.h"
+#include "TemporarySummon.h"
enum Says
{
diff --git a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp
index a7d20d6dda2..23ba4d03d97 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp
@@ -26,7 +26,6 @@
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "SpellAuraEffects.h"
-#include "SpellInfo.h"
#include "SpellScript.h"
#include "TemporarySummon.h"
@@ -291,7 +290,7 @@ public:
void EnterEvadeModeIfNeeded()
{
- Map::PlayerList const &players = me->GetMap()->GetPlayers();
+ Map::PlayerList const& players = me->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
if (Player* player = i->GetSource())
if (player->IsAlive() && !player->IsGameMaster() && CheckBoundary(player))
diff --git a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp
index 76323235cdf..3544532d8d9 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp
@@ -23,8 +23,8 @@
#include "PassiveAI.h"
#include "Player.h"
#include "ScriptedCreature.h"
-#include "SpellScript.h"
#include "SpellAuraEffects.h"
+#include "SpellScript.h"
#include "TemporarySummon.h"
enum Says
@@ -400,13 +400,13 @@ class spell_teron_gorefiend_shadow_of_death : public SpellScriptLoader
{
return ValidateSpellInfo(
{
- SPELL_SUMMON_SPIRIT,
- SPELL_POSSESS_SPIRIT_IMMUNE,
- SPELL_SPIRITUAL_VENGEANCE,
- SPELL_SUMMON_SKELETRON_1,
- SPELL_SUMMON_SKELETRON_2,
- SPELL_SUMMON_SKELETRON_3,
- SPELL_SUMMON_SKELETRON_4
+ SPELL_SUMMON_SPIRIT,
+ SPELL_POSSESS_SPIRIT_IMMUNE,
+ SPELL_SPIRITUAL_VENGEANCE,
+ SPELL_SUMMON_SKELETRON_1,
+ SPELL_SUMMON_SKELETRON_2,
+ SPELL_SUMMON_SKELETRON_3,
+ SPELL_SUMMON_SKELETRON_4
});
}
diff --git a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp
index f37cc338f65..c3861becf6b 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp
@@ -16,8 +16,9 @@
*/
#include "ScriptMgr.h"
-#include "GameObjectAI.h"
#include "black_temple.h"
+#include "GameObjectAI.h"
+#include "GridNotifiers.h"
#include "GameObject.h"
#include "InstanceScript.h"
#include "ObjectAccessor.h"
@@ -25,7 +26,6 @@
#include "ScriptedCreature.h"
#include "SpellInfo.h"
#include "SpellScript.h"
-#include "GridNotifiers.h"
enum Texts
{
@@ -91,7 +91,7 @@ public:
Talk(SAY_DEATH);
}
- void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
+ void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if (spell->Id == SPELL_HURL_SPINE && me->HasAura(SPELL_TIDAL_SHIELD))
{
diff --git a/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp b/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp
index 51983b77e20..241e8ba3629 100644
--- a/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp
+++ b/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp
@@ -19,10 +19,10 @@
#include "AreaBoundary.h"
#include "black_temple.h"
#include "Creature.h"
+#include "CreatureAI.h"
#include "GameObject.h"
#include "InstanceScript.h"
#include "Map.h"
-#include "ScriptedCreature.h"
DoorData const doorData[] =
{
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp
index d5ef10dda82..b22c5ae38a4 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp
@@ -221,7 +221,7 @@ public:
if (!beam)
{
SummonBeams();
- beam=true;
+ beam = true;
}
//Return since we have no target
if (!UpdateVictim())
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp
index f90d9e27604..6aeb637d172 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp
@@ -30,8 +30,8 @@ EndScriptData */
#include "ObjectAccessor.h"
#include "Player.h"
#include "ScriptedCreature.h"
-#include "Spell.h"
#include "serpent_shrine.h"
+#include "Spell.h"
#include "TemporarySummon.h"
enum LadyVashj
@@ -256,7 +256,7 @@ public:
void EnterCombat(Unit* who) override
{
// remove old tainted cores to prevent cheating in phase 2
- Map::PlayerList const &PlayerList = me->GetMap()->GetPlayers();
+ Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr)
if (Player* player = itr->GetSource())
player->DestroyItemCount(31088, 1, true);
@@ -326,7 +326,7 @@ public:
}
else
{
- AggroTimer-=diff;
+ AggroTimer -= diff;
return;
}
}
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp
index 3e1933cf8c9..d4ffc18fd0e 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp
@@ -792,7 +792,7 @@ public:
if (Earthshock_Timer <= diff)
{
- Map::PlayerList const &PlayerList = me->GetMap()->GetPlayers();
+ Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr)
{
if (Player* i_pl = itr->GetSource())
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp
index 1a7e2d4719b..592d2fbbaa2 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp
@@ -24,12 +24,12 @@ EndScriptData */
#include "ScriptMgr.h"
#include "GameObject.h"
+#include "GameObjectAI.h"
#include "InstanceScript.h"
#include "Map.h"
#include "MotionMaster.h"
#include "Player.h"
#include "ScriptedCreature.h"
-#include "GameObjectAI.h"
#include "serpent_shrine.h"
#include "TemporarySummon.h"
@@ -173,7 +173,6 @@ public:
}
void MoveInLineOfSight(Unit* who) override
-
{
if (!CanStartEvent) // boss is invisible, don't attack
return;
@@ -242,7 +241,9 @@ public:
DoCast(me, SPELL_SUBMERGE);
PhaseTimer = 60000; // 60secs submerged
Submerged = true;
- } else PhaseTimer-=diff;
+ }
+ else
+ PhaseTimer -= diff;
if (SpoutTimer <= diff)
{
@@ -253,19 +254,23 @@ public:
WhirlTimer = 20000; // whirl directly after spout
RotTimer = 20000;
return;
- } else SpoutTimer -= diff;
+ }
+ else
+ SpoutTimer -= diff;
// Whirl directly after a Spout and at random times
if (WhirlTimer <= diff)
{
WhirlTimer = 18000;
DoCast(me, SPELL_WHIRL);
- } else WhirlTimer -= diff;
+ }
+ else
+ WhirlTimer -= diff;
if (CheckTimer <= diff)//check if there are players in melee range
{
InRange = false;
- 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)
@@ -275,11 +280,13 @@ public:
}
}
CheckTimer = 2000;
- } else CheckTimer -= diff;
+ }
+ else
+ CheckTimer -= diff;
if (RotTimer)
{
- Map::PlayerList const &PlayerList = me->GetMap()->GetPlayers();
+ Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
if (i->GetSource() && i->GetSource()->IsAlive() && me->HasInArc(diff/20000.f*float(M_PI)*2.f, i->GetSource()) && me->IsWithinDist(i->GetSource(), SPOUT_DIST) && !i->GetSource()->IsInWater())
@@ -295,7 +302,9 @@ public:
if (RotTimer <= diff)
{
RotTimer = 0;
- } else RotTimer -= diff;
+ }
+ else
+ RotTimer -= diff;
return;
}
@@ -307,7 +316,9 @@ public:
if (target)
DoCast(target, SPELL_GEYSER, true);
GeyserTimer = rand32() % 5000 + 15000;
- } else GeyserTimer -= diff;
+ }
+ else
+ GeyserTimer -= diff;
if (!InRange) // if on players in melee range cast Waterbolt
{
@@ -319,7 +330,9 @@ public:
if (target)
DoCast(target, SPELL_WATERBOLT, true);
WaterboltTimer = 3000;
- } else WaterboltTimer -= diff;
+ }
+ else
+ WaterboltTimer -= diff;
}
if (!UpdateVictim())
@@ -342,7 +355,9 @@ public:
SpoutTimer = 3000; // directly cast Spout after emerging!
PhaseTimer = 120000;
return;
- } else PhaseTimer-=diff;
+ }
+ else
+ PhaseTimer -= diff;
if (!me->IsThreatened()) // check if should evade
{
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp
index 590ec8ad523..a86f3c71c2b 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp
@@ -24,13 +24,14 @@ EndScriptData */
#include "ScriptMgr.h"
#include "GameObject.h"
+#include "GameObjectAI.h"
#include "InstanceScript.h"
#include "Log.h"
#include "Map.h"
#include "Player.h"
#include "serpent_shrine.h"
#include "TemporarySummon.h"
-#include "GameObjectAI.h"
+#include <sstream>
#define MAX_ENCOUNTER 6
@@ -132,7 +133,7 @@ class instance_serpent_shrine : public InstanceMapScript
else
Water = WATERSTATE_FRENZY;
- Map::PlayerList const &PlayerList = instance->GetPlayers();
+ Map::PlayerList const& PlayerList = instance->GetPlayers();
if (PlayerList.isEmpty())
return;
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
@@ -143,12 +144,11 @@ class instance_serpent_shrine : public InstanceMapScript
{
if (Water == WATERSTATE_SCALDING)
{
-
if (!player->HasAura(SPELL_SCALDINGWATER))
- {
player->CastSpell(player, SPELL_SCALDINGWATER, true);
- }
- } else if (Water == WATERSTATE_FRENZY)
+
+ }
+ else if (Water == WATERSTATE_FRENZY)
{
//spawn frenzy
if (DoSpawnFrenzy)
@@ -392,7 +392,7 @@ class instance_serpent_shrine : public InstanceMapScript
return stream.str();
}
- void Load(const char* in) override
+ void Load(char const* in) override
{
if (!in)
{
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp
index 6db0f751512..78e92d7b4f1 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp
@@ -149,7 +149,7 @@ public:
Talk(SAY_SLAY);
}
- void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
+ void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
//hack :(
if (spell->Id == SPELL_WARLORDS_RAGE_PROC)
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/steam_vault.h b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/steam_vault.h
index 22846f6ac82..b153df14d6c 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/steam_vault.h
+++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/steam_vault.h
@@ -51,7 +51,7 @@ enum SVGameObjectIds
GO_ACCESS_PANEL_MEK = 184126
};
-template<class AI, class T>
+template <class AI, class T>
inline AI* GetSteamVaultAI(T* obj)
{
return GetInstanceAI<AI>(obj, SteamVaultScriptName);
diff --git a/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_ahune.cpp b/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_ahune.cpp
index b668c1a7989..ce777aa67c7 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_ahune.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_ahune.cpp
@@ -18,6 +18,7 @@
#include "ScriptMgr.h"
#include "CreatureTextMgr.h"
#include "GameObject.h"
+#include "GameObjectAI.h"
#include "Group.h"
#include "InstanceScript.h"
#include "LFGMgr.h"
@@ -25,9 +26,8 @@
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "Player.h"
-#include "ScriptedGossip.h"
#include "ScriptedCreature.h"
-#include "GameObjectAI.h"
+#include "ScriptedGossip.h"
#include "SpellAuraEffects.h"
#include "SpellInfo.h"
#include "SpellScript.h"
diff --git a/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/the_slave_pens.h b/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/the_slave_pens.h
index 398225c4d01..0f0e877425e 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/the_slave_pens.h
+++ b/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/the_slave_pens.h
@@ -68,7 +68,7 @@ enum SPGameObjectIds
GO_ICE_STONE = 187882
};
-template<class AI, class T>
+template <class AI, class T>
inline AI* GetSlavePensAI(T* obj)
{
return GetInstanceAI<AI>(obj, SPScriptName);
diff --git a/src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/the_underbog.h b/src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/the_underbog.h
index c32c7a05f30..a671d1c5fd0 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/the_underbog.h
+++ b/src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/the_underbog.h
@@ -22,10 +22,10 @@
#define TheUndebogScriptName "instance_the_underbog"
-template<typename AI>
-inline AI* GetTheUnderbogAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetTheUnderbogAI(T* obj)
{
- return GetInstanceAI<AI>(creature, TheUndebogScriptName);
+ return GetInstanceAI<AI>(obj, TheUndebogScriptName);
}
#endif // the_underbog_h__
diff --git a/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp b/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp
index fa8a6e81b2b..038dc187265 100644
--- a/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp
+++ b/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp
@@ -122,7 +122,7 @@ class boss_gruul : public CreatureScript
Talk(SAY_DEATH);
}
- void SpellHitTarget(Unit* target, const SpellInfo* pSpell) override
+ void SpellHitTarget(Unit* target, SpellInfo const* pSpell) override
{
//This to emulate effect1 (77) of SPELL_GROUND_SLAM, knock back to any direction
//It's initially wrong, since this will cause fall damage, which is by comments, not intended.
diff --git a/src/server/scripts/Outland/GruulsLair/gruuls_lair.h b/src/server/scripts/Outland/GruulsLair/gruuls_lair.h
index abd1fa9aceb..c7939dadc70 100644
--- a/src/server/scripts/Outland/GruulsLair/gruuls_lair.h
+++ b/src/server/scripts/Outland/GruulsLair/gruuls_lair.h
@@ -47,10 +47,10 @@ enum GLGameObjectIds
GO_GRUUL_DOOR = 184662
};
-template<typename AI>
-inline AI* GetGruulsLairAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetGruulsLairAI(T* obj)
{
- return GetInstanceAI<AI>(creature, GLScriptName);
+ return GetInstanceAI<AI>(obj, GLScriptName);
}
#endif // GRUULS_LAIR_H_
diff --git a/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp b/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp
index b413d805e0f..60a2cb6d34d 100644
--- a/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp
+++ b/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp
@@ -17,7 +17,6 @@
#include "ScriptMgr.h"
#include "Creature.h"
-#include "GameObject.h"
#include "gruuls_lair.h"
#include "InstanceScript.h"
@@ -55,6 +54,8 @@ class instance_gruuls_lair : public InstanceMapScript
void OnCreatureCreate(Creature* creature) override
{
+ InstanceScript::OnCreatureCreate(creature);
+
switch (creature->GetEntry())
{
case NPC_MAULGAR:
@@ -71,48 +72,6 @@ class instance_gruuls_lair : public InstanceMapScript
}
}
- void OnCreatureRemove(Creature* creature) override
- {
- switch (creature->GetEntry())
- {
- case NPC_MAULGAR:
- case NPC_KROSH_FIREHAND:
- case NPC_OLM_THE_SUMMONER:
- case NPC_KIGGLER_THE_CRAZED:
- case NPC_BLINDEYE_THE_SEER:
- AddMinion(creature, false);
- break;
- default:
- break;
- }
- }
-
- void OnGameObjectCreate(GameObject* go) override
- {
- switch (go->GetEntry())
- {
- case GO_MAULGAR_DOOR:
- case GO_GRUUL_DOOR:
- AddDoor(go, true);
- break;
- default:
- break;
- }
- }
-
- void OnGameObjectRemove(GameObject* go) override
- {
- switch (go->GetEntry())
- {
- case GO_MAULGAR_DOOR:
- case GO_GRUUL_DOOR:
- AddDoor(go, false);
- break;
- default:
- break;
- }
- }
-
ObjectGuid GetGuidData(uint32 type) const override
{
switch (type)
diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/blood_furnace.h b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/blood_furnace.h
index e3fd9704a0b..63c4bef65f2 100644
--- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/blood_furnace.h
+++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/blood_furnace.h
@@ -82,7 +82,7 @@ enum BFActionIds
ACTION_PREPARE_BROGGOK = 3
};
-template<class AI, class T>
+template <class AI, class T>
inline AI* GetBloodFurnaceAI(T* obj)
{
return GetInstanceAI<AI>(obj, BFScriptName);
diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp
index 9a92c30ecc7..b5cac8fbcd7 100644
--- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp
@@ -18,12 +18,11 @@
#include "ScriptMgr.h"
#include "blood_furnace.h"
#include "GameObject.h"
+#include "GameObjectAI.h"
#include "InstanceScript.h"
#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
-#include "GameObjectAI.h"
#include "SpellAuraEffects.h"
-#include "SpellInfo.h"
#include "SpellScript.h"
enum Yells
diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp
index ebe2a9ebe09..452ce7bd2f1 100644
--- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp
@@ -17,13 +17,10 @@
#include "ScriptMgr.h"
#include "blood_furnace.h"
-#include "Map.h"
#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
#include "Spell.h"
#include "SpellAuras.h"
-#include "SpellMgr.h"
-#include "SpellInfo.h"
#include "TemporarySummon.h"
enum Kelidan
diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp
index 014c4086716..6a5c804d41d 100644
--- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp
@@ -17,11 +17,10 @@
#include "ScriptMgr.h"
#include "blood_furnace.h"
-#include "Creature.h"
-#include "CreatureAI.h"
#include "GameObject.h"
#include "InstanceScript.h"
#include "Map.h"
+#include "ScriptedCreature.h"
DoorData const doorData[] =
{
@@ -82,6 +81,8 @@ class instance_blood_furnace : public InstanceMapScript
void OnGameObjectCreate(GameObject* go) override
{
+ InstanceScript::OnGameObjectCreate(go);
+
switch (go->GetEntry())
{
case GO_PRISON_DOOR_04:
@@ -126,23 +127,6 @@ class instance_blood_furnace : public InstanceMapScript
}
}
- void OnGameObjectRemove(GameObject* go) override
- {
- switch (go->GetEntry())
- {
- case GO_PRISON_DOOR_01:
- case GO_PRISON_DOOR_02:
- case GO_PRISON_DOOR_03:
- case GO_PRISON_DOOR_04:
- case GO_PRISON_DOOR_05:
- case GO_SUMMON_DOOR:
- AddDoor(go, false);
- break;
- default:
- break;
- }
- }
-
ObjectGuid GetGuidData(uint32 type) const override
{
switch (type)
diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp
index 5b2c6d1f6f8..ccec473f24d 100644
--- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp
@@ -110,7 +110,7 @@ class boss_nazan : public CreatureScript
}
}
- void SpellHitTarget(Unit* target, const SpellInfo* entry) override
+ void SpellHitTarget(Unit* target, SpellInfo const* entry) override
{
if (target && entry->Id == uint32(SPELL_FIREBALL))
me->SummonCreature(NPC_LIQUID_FIRE, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN, 30000);
diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/hellfire_ramparts.h b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/hellfire_ramparts.h
index 3329d011ca7..f3115b745c5 100644
--- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/hellfire_ramparts.h
+++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/hellfire_ramparts.h
@@ -48,10 +48,10 @@ enum HRGameobjectIds
GO_FEL_IRON_CHEST_HEROIC = 185169
};
-template<typename AI>
-inline AI* GetHellfireRampartsAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetHellfireRampartsAI(T* obj)
{
- return GetInstanceAI<AI>(creature, HRScriptName);
+ return GetInstanceAI<AI>(obj, HRScriptName);
}
#endif
diff --git a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp
index bdafad65efa..2e7cf22c93c 100644
--- a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp
@@ -17,17 +17,15 @@
#include "ScriptMgr.h"
#include "GameObject.h"
+#include "GameObjectAI.h"
#include "InstanceScript.h"
#include "magtheridons_lair.h"
-#include "ObjectAccessor.h"
+#include "PassiveAI.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "SpellInfo.h"
#include "TemporarySummon.h"
#include "SpellScript.h"
-#include "SpellAuraEffects.h"
-#include "PassiveAI.h"
-#include "GameObjectAI.h"
enum Yells
{
@@ -460,7 +458,7 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
- return new npc_magtheridon_roomAI(creature);
+ return GetMagtheridonsLairAI<npc_magtheridon_roomAI>(creature);
}
};
@@ -488,7 +486,7 @@ public:
GameObjectAI* GetAI(GameObject* go) const override
{
- return new go_manticron_cubeAI(go);
+ return GetMagtheridonsLairAI<go_manticron_cubeAI>(go);
}
};
@@ -571,7 +569,11 @@ class spell_magtheridon_shadow_grasp_visual : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) override
{
- return ValidateSpellInfo({ SPELL_SHADOW_CAGE, SPELL_SHADOW_GRASP_VISUAL });
+ return ValidateSpellInfo(
+ {
+ SPELL_SHADOW_CAGE,
+ SPELL_SHADOW_GRASP_VISUAL
+ });
}
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
diff --git a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp
index 233e72b0ad2..0a538face5c 100644
--- a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp
@@ -15,14 +15,13 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "AreaBoundary.h"
#include "ScriptMgr.h"
-#include "Creature.h"
-#include "CreatureAI.h"
+#include "AreaBoundary.h"
#include "GameObject.h"
#include "InstanceScript.h"
#include "magtheridons_lair.h"
#include "Map.h"
+#include "ScriptedCreature.h"
BossBoundaryData const boundaries =
{
@@ -68,7 +67,7 @@ static MLDataTypes const collapseObjectDatas[] =
class instance_magtheridons_lair : public InstanceMapScript
{
public:
- instance_magtheridons_lair() : InstanceMapScript("instance_magtheridons_lair", 544) { }
+ instance_magtheridons_lair() : InstanceMapScript(MLScriptName, 544) { }
struct instance_magtheridons_lair_InstanceMapScript : public InstanceScript
{
diff --git a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/magtheridons_lair.h b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/magtheridons_lair.h
index 87190d446b0..cd0b441fada 100644
--- a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/magtheridons_lair.h
+++ b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/magtheridons_lair.h
@@ -18,9 +18,9 @@
#ifndef DEF_MAGTHERIDONS_LAIR_H
#define DEF_MAGTHERIDONS_LAIR_H
-#define MLScriptName "instance_magtheridons_lair"
#include "CreatureAIImpl.h"
+#define MLScriptName "instance_magtheridons_lair"
#define DataHeader "ML"
uint32 const EncounterCount = 1;
@@ -74,10 +74,10 @@ enum MLGameObjectIds
GO_MAGTHERIDON_COLUMN_5 = 184637
};
-template<typename AI>
-inline AI* GetMagtheridonsLairAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetMagtheridonsLairAI(T* obj)
{
- return GetInstanceAI<AI>(creature, MLScriptName);
+ return GetInstanceAI<AI>(obj, MLScriptName);
}
#endif
diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/instance_shattered_halls.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/instance_shattered_halls.cpp
index 27149503712..514300e96af 100644
--- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/instance_shattered_halls.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/instance_shattered_halls.cpp
@@ -23,15 +23,14 @@ SDCategory: Hellfire Citadel, Shattered Halls
EndScriptData */
#include "ScriptMgr.h"
-#include "Creature.h"
-#include "CreatureAI.h"
-#include "GameObject.h"
#include "InstanceScript.h"
#include "Map.h"
#include "Player.h"
+#include "ScriptedCreature.h"
#include "shattered_halls.h"
#include "SpellAuras.h"
#include "TemporarySummon.h"
+#include <sstream>
DoorData const doorData[] =
{
@@ -93,35 +92,11 @@ class instance_shattered_halls : public InstanceMapScript
ex->SetDuration(executionTimer);
}
- void OnGameObjectCreate(GameObject* go) override
- {
- switch (go->GetEntry())
- {
- case GO_GRAND_WARLOCK_CHAMBER_DOOR_1:
- case GO_GRAND_WARLOCK_CHAMBER_DOOR_2:
- AddDoor(go, true);
- default:
- break;
- }
- }
-
- void OnGameObjectRemove(GameObject* go) override
- {
- switch (go->GetEntry())
- {
- case GO_GRAND_WARLOCK_CHAMBER_DOOR_1:
- case GO_GRAND_WARLOCK_CHAMBER_DOOR_2:
- AddDoor(go, false);
- default:
- break;
- }
- }
-
void OnCreatureCreate(Creature* creature) override
{
if (!_team)
{
- Map::PlayerList const &players = instance->GetPlayers();
+ Map::PlayerList const& players = instance->GetPlayers();
if (!players.isEmpty())
if (Player* player = players.begin()->GetSource())
_team = player->GetTeam();
diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/shattered_halls.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/shattered_halls.cpp
index 800a1149115..63503c6bbe6 100644
--- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/shattered_halls.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/shattered_halls.cpp
@@ -21,8 +21,8 @@
#include "ObjectAccessor.h"
#include "Player.h"
#include "ScriptedCreature.h"
-#include "SpellScript.h"
#include "shattered_halls.h"
+#include "SpellScript.h"
#include "TemporarySummon.h"
class at_nethekurse_exit : public AreaTriggerScript
@@ -110,7 +110,7 @@ class boss_shattered_executioner : public CreatureScript
if (instance->GetData(DATA_PRISONERS_EXECUTED) > 0)
return;
- Map::PlayerList const &players = instance->instance->GetPlayers();
+ Map::PlayerList const& players = instance->instance->GetPlayers();
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
{
Player* pl = itr->GetSource();
@@ -129,7 +129,7 @@ class boss_shattered_executioner : public CreatureScript
if (data == 1)
{
- Map::PlayerList const &players = instance->instance->GetPlayers();
+ Map::PlayerList const& players = instance->instance->GetPlayers();
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
{
Player* pl = itr->GetSource();
diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/shattered_halls.h b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/shattered_halls.h
index 008692222e2..b1ec4de98c4 100644
--- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/shattered_halls.h
+++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/shattered_halls.h
@@ -91,11 +91,11 @@ enum SHActions
ACTION_EXECUTIONER_TAUNT = 1
};
-const Position Executioner = { 152.8524f, -83.63912f, 2.021005f, 0.06981317f };
+Position const Executioner = { 152.8524f, -83.63912f, 2.021005f, 0.06981317f };
struct FactionSpawnerHelper
{
- FactionSpawnerHelper(uint32 allianceEntry, uint32 hordeEntry, const Position& pos) : _allianceNPC(allianceEntry), _hordeNPC(hordeEntry), _spawnPos(pos) { }
+ FactionSpawnerHelper(uint32 allianceEntry, uint32 hordeEntry, Position const& pos) : _allianceNPC(allianceEntry), _hordeNPC(hordeEntry), _spawnPos(pos) { }
inline uint32 operator()(uint32 teamID) const { return teamID == ALLIANCE ? _allianceNPC : _hordeNPC; }
inline Position const& GetPos() const { return _spawnPos; }
@@ -106,17 +106,17 @@ private:
Position const _spawnPos;
};
-const FactionSpawnerHelper executionerVictims[VictimCount] =
+FactionSpawnerHelper const executionerVictims[VictimCount] =
{
{ NPC_CAPTAIN_ALINA, NPC_CAPTAIN_BONESHATTER, { 138.8807f, -84.22707f, 1.992269f, 0.06981317f } },
{ NPC_ALLIANCE_VICTIM_1, NPC_HORDE_VICTIM_1, { 151.2411f, -91.02930f, 2.019741f, 1.57079600f } },
{ NPC_ALLIANCE_VICTIM_2, NPC_HORDE_VICTIM_2, { 151.0459f, -77.51981f, 2.021008f, 4.74729500f } }
};
-template<typename AI>
-inline AI* GetShatteredHallsAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetShatteredHallsAI(T* obj)
{
- return GetInstanceAI<AI>(creature, SHScriptName);
+ return GetInstanceAI<AI>(obj, SHScriptName);
}
#endif
diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp
index 60343d6be1c..f9ea0cef899 100644
--- a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp
@@ -188,13 +188,13 @@ class boss_alar : public CreatureScript
}
}
- void SpellHit(Unit*, const SpellInfo* spell) override
+ void SpellHit(Unit*, SpellInfo const* spell) override
{
if (spell->Id == SPELL_DIVE_BOMB_VISUAL)
{
me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
me->SetDisplayId(11686);
- //me->SendUpdateObjectToAllExcept(NULL);
+ //me->SendUpdateObjectToAllExcept(nullptr);
}
}
diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp
index 7bd397539f0..1e1129b2f7f 100644
--- a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp
@@ -28,7 +28,6 @@ EndScriptData */
#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
#include "SpellAuras.h"
-#include "SpellInfo.h"
#include "SpellScript.h"
#include "TemporarySummon.h"
#include "the_eye.h"
@@ -292,7 +291,7 @@ class boss_high_astromancer_solarian : public CreatureScript
//After these 50 seconds she portals to the middle of the room and disappears, leaving 3 light portals behind.
me->GetMotionMaster()->Clear();
me->UpdatePosition(CENTER_X, CENTER_Y, CENTER_Z, CENTER_O);
- for (uint8 i=0; i <= 2; ++i)
+ for (uint8 i = 0; i <= 2; ++i)
{
if (!i)
{
@@ -309,15 +308,15 @@ class boss_high_astromancer_solarian : public CreatureScript
}
if ((std::abs(Portals[2][0] - Portals[1][0]) < 7) && (std::abs(Portals[2][1] - Portals[1][1]) < 7))
{
- int i=1;
+ int i = 1;
if (std::abs(CENTER_X + 26.0f - Portals[2][0]) < 7)
i = -1;
- Portals[2][0] = Portals[2][0]+7*i;
+ Portals[2][0] = Portals[2][0] + 7 * i;
Portals[2][1] = Portal_Y(Portals[2][0], LARGE_PORTAL_RADIUS);
}
- for (int i=0; i <= 2; ++i)
+ for (int i = 0; i <= 2; ++i)
{
- if (Creature* Summoned = me->SummonCreature(NPC_ASTROMANCER_SOLARIAN_SPOTLIGHT, Portals[i][0], Portals[i][1], Portals[i][2], CENTER_O, TEMPSUMMON_TIMED_DESPAWN, Phase2_Timer+Phase3_Timer+AppearDelay_Timer+1700))
+ if (Creature* Summoned = me->SummonCreature(NPC_ASTROMANCER_SOLARIAN_SPOTLIGHT, Portals[i][0], Portals[i][1], Portals[i][2], CENTER_O, TEMPSUMMON_TIMED_DESPAWN, Phase2_Timer + Phase3_Timer + AppearDelay_Timer + 1700))
{
Summoned->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
Summoned->CastSpell(Summoned, SPELL_SPOTLIGHT, false);
@@ -326,7 +325,7 @@ class boss_high_astromancer_solarian : public CreatureScript
AppearDelay = true;
}
else
- Phase1_Timer-=diff;
+ Phase1_Timer -= diff;
}
else if (Phase == 2)
{
diff --git a/src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp b/src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp
index 86ae7f1a454..dcd2df56c41 100644
--- a/src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp
@@ -106,13 +106,13 @@ class instance_the_eye : public InstanceMapScript
{
switch (identifier)
{
- case DATA_THALADREDTHEDARKENER: return ThaladredTheDarkener;
- case DATA_LORDSANGUINAR: return LordSanguinar;
- case DATA_GRANDASTROMANCERCAPERNIAN: return GrandAstromancerCapernian;
- case DATA_MASTERENGINEERTELONICUS: return MasterEngineerTelonicus;
- case DATA_KAELTHAS: return Kaelthas;
- case DATA_HIGH_ASTROMANCER_SOLARIAN: return Astromancer;
- case DATA_ALAR: return Alar;
+ case DATA_THALADREDTHEDARKENER: return ThaladredTheDarkener;
+ case DATA_LORDSANGUINAR: return LordSanguinar;
+ case DATA_GRANDASTROMANCERCAPERNIAN: return GrandAstromancerCapernian;
+ case DATA_MASTERENGINEERTELONICUS: return MasterEngineerTelonicus;
+ case DATA_KAELTHAS: return Kaelthas;
+ case DATA_HIGH_ASTROMANCER_SOLARIAN: return Astromancer;
+ case DATA_ALAR: return Alar;
}
return ObjectGuid::Empty;
}
diff --git a/src/server/scripts/Outland/TempestKeep/Eye/the_eye.cpp b/src/server/scripts/Outland/TempestKeep/Eye/the_eye.cpp
index 9dd6bc36fb9..7d1a4c484fd 100644
--- a/src/server/scripts/Outland/TempestKeep/Eye/the_eye.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Eye/the_eye.cpp
@@ -104,7 +104,7 @@ class npc_crystalcore_devastator : public CreatureScript
CreatureAI* GetAI(Creature* creature) const override
{
- return new npc_crystalcore_devastatorAI(creature);
+ return GetTheEyeAI<npc_crystalcore_devastatorAI>(creature);
}
};
void AddSC_the_eye()
diff --git a/src/server/scripts/Outland/TempestKeep/Eye/the_eye.h b/src/server/scripts/Outland/TempestKeep/Eye/the_eye.h
index 9eb9e5af0e5..f65b6714248 100644
--- a/src/server/scripts/Outland/TempestKeep/Eye/the_eye.h
+++ b/src/server/scripts/Outland/TempestKeep/Eye/the_eye.h
@@ -65,10 +65,10 @@ enum TEGameObjectIds
GO_ARCANE_DOOR_RIGHT = 184325
};
-template<typename AI>
-inline AI* GetTheEyeAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetTheEyeAI(T* obj)
{
- return GetInstanceAI<AI>(creature, TheEyeScriptName);
+ return GetInstanceAI<AI>(obj, TheEyeScriptName);
}
#endif
diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp
index aae21c154b2..c1b6020c8e6 100644
--- a/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp
@@ -24,8 +24,8 @@ static DoorData const doorData[] =
{
{ GO_DOOR_MOARG_1, DATA_GATEWATCHER_IRON_HAND, DOOR_TYPE_PASSAGE },
{ GO_DOOR_MOARG_2, DATA_GATEWATCHER_GYROKILL, DOOR_TYPE_PASSAGE },
- { GO_DOOR_NETHERMANCER, DATA_NETHERMANCER_SEPRETHREA, DOOR_TYPE_ROOM },
- { 0, 0, DOOR_TYPE_ROOM }
+ { GO_DOOR_NETHERMANCER, DATA_NETHERMANCER_SEPRETHREA, DOOR_TYPE_ROOM },
+ { 0, 0, DOOR_TYPE_ROOM }
};
class instance_mechanar : public InstanceMapScript
@@ -42,34 +42,6 @@ class instance_mechanar : public InstanceMapScript
LoadDoorData(doorData);
}
- void OnGameObjectCreate(GameObject* gameObject) override
- {
- switch (gameObject->GetEntry())
- {
- case GO_DOOR_MOARG_1:
- case GO_DOOR_MOARG_2:
- case GO_DOOR_NETHERMANCER:
- AddDoor(gameObject, true);
- break;
- default:
- break;
- }
- }
-
- void OnGameObjectRemove(GameObject* gameObject) override
- {
- switch (gameObject->GetEntry())
- {
- case GO_DOOR_MOARG_1:
- case GO_DOOR_MOARG_2:
- case GO_DOOR_NETHERMANCER:
- AddDoor(gameObject, false);
- break;
- default:
- break;
- }
- }
-
bool SetBossState(uint32 type, EncounterState state) override
{
if (!InstanceScript::SetBossState(type, state))
diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/mechanar.h b/src/server/scripts/Outland/TempestKeep/Mechanar/mechanar.h
index a9e82e2402b..beca8bd3849 100644
--- a/src/server/scripts/Outland/TempestKeep/Mechanar/mechanar.h
+++ b/src/server/scripts/Outland/TempestKeep/Mechanar/mechanar.h
@@ -41,10 +41,10 @@ enum MRGameobjectIds
GO_DOOR_NETHERMANCER = 184449
};
-template<typename AI>
-inline AI* GetMechanarAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetMechanarAI(T* obj)
{
- return GetInstanceAI<AI>(creature, MechanarScriptName);
+ return GetInstanceAI<AI>(obj, MechanarScriptName);
}
#endif
diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.h b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.h
index fecbdd46d6e..efccf5a958d 100644
--- a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.h
+++ b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.h
@@ -64,10 +64,10 @@ enum AZGameObjectIds
GO_WARDENS_SHIELD = 184802 // shield 'protecting' mellichar
};
-template<typename AI>
-inline AI* GetArcatrazAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetArcatrazAI(T* obj)
{
- return GetInstanceAI<AI>(creature, ArcatrazScriptName);
+ return GetInstanceAI<AI>(obj, ArcatrazScriptName);
}
#endif // ARCATRAZ_H
diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp
index b3f075e943c..c37580351b6 100644
--- a/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp
+++ b/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp
@@ -66,12 +66,10 @@ class instance_arcatraz : public InstanceMapScript
void OnGameObjectCreate(GameObject* go) override
{
+ InstanceScript::OnGameObjectCreate(go);
+
switch (go->GetEntry())
{
- case GO_CONTAINMENT_CORE_SECURITY_FIELD_ALPHA:
- case GO_CONTAINMENT_CORE_SECURITY_FIELD_BETA:
- AddDoor(go, true);
- break;
case GO_STASIS_POD_ALPHA:
StasisPodGUIDs[0] = go->GetGUID();
break;
@@ -95,19 +93,6 @@ class instance_arcatraz : public InstanceMapScript
}
}
- void OnGameObjectRemove(GameObject* go) override
- {
- switch (go->GetEntry())
- {
- case GO_CONTAINMENT_CORE_SECURITY_FIELD_ALPHA:
- case GO_CONTAINMENT_CORE_SECURITY_FIELD_BETA:
- AddDoor(go, false);
- break;
- default:
- break;
- }
- }
-
void SetData(uint32 type, uint32 data) override
{
switch (type)
diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp
index f1926cfd9f0..0665d3f3fb7 100644
--- a/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp
+++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp
@@ -96,7 +96,6 @@ class npc_warp_splinter_treant : public CreatureScript
void MoveInLineOfSight(Unit* /*who*/) override { }
-
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim() || !me->GetVictim())
diff --git a/src/server/scripts/Outland/TempestKeep/botanica/the_botanica.h b/src/server/scripts/Outland/TempestKeep/botanica/the_botanica.h
index 07b6b56c971..4c8fb6ae0d5 100644
--- a/src/server/scripts/Outland/TempestKeep/botanica/the_botanica.h
+++ b/src/server/scripts/Outland/TempestKeep/botanica/the_botanica.h
@@ -43,10 +43,10 @@ enum BCCreatureIds
NPC_WARP_SPLINTER = 17977
};
-template<typename AI>
-inline AI* GetBotanicaAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetBotanicaAI(T* obj)
{
- return GetInstanceAI<AI>(creature, BotanicaScriptName);
+ return GetInstanceAI<AI>(obj, BotanicaScriptName);
}
#endif
diff --git a/src/server/scripts/Outland/zone_blades_edge_mountains.cpp b/src/server/scripts/Outland/zone_blades_edge_mountains.cpp
index 9d1326ede7e..a34b659f2d3 100644
--- a/src/server/scripts/Outland/zone_blades_edge_mountains.cpp
+++ b/src/server/scripts/Outland/zone_blades_edge_mountains.cpp
@@ -31,13 +31,11 @@ EndContentData */
#include "ScriptMgr.h"
#include "CellImpl.h"
#include "CreatureAIImpl.h"
-#include "GameObject.h"
+#include "GameObjectAI.h"
#include "GridNotifiersImpl.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
-#include "Player.h"
#include "ScriptedCreature.h"
-#include "GameObjectAI.h"
#include "ScriptedGossip.h"
#include "SpellInfo.h"
#include "SpellScript.h"
@@ -126,7 +124,7 @@ public:
me->DespawnOrUnsummon(1);
}
- void SpellHit(Unit* caster, const SpellInfo* spell) override
+ void SpellHit(Unit* caster, SpellInfo const* spell) override
{
if (spell->Id == SPELL_T_PHASE_MODULATOR && caster->GetTypeId() == TYPEID_PLAYER)
{
@@ -843,7 +841,7 @@ class npc_simon_bunny : public CreatureScript
}
}
- void SpellHitTarget(Unit* target, const SpellInfo* spell) override
+ void SpellHitTarget(Unit* target, SpellInfo const* spell) override
{
// Cast SPELL_BAD_PRESS_DAMAGE with scaled basepoints when the visual hits the target.
// Need Fix: When SPELL_BAD_PRESS_TRIGGER hits target it triggers spell SPELL_BAD_PRESS_DAMAGE by itself
diff --git a/src/server/scripts/Outland/zone_hellfire_peninsula.cpp b/src/server/scripts/Outland/zone_hellfire_peninsula.cpp
index efda058ca6a..90391331d33 100644
--- a/src/server/scripts/Outland/zone_hellfire_peninsula.cpp
+++ b/src/server/scripts/Outland/zone_hellfire_peninsula.cpp
@@ -34,7 +34,6 @@ EndContentData */
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "Player.h"
-#include "QuestDef.h"
#include "ScriptedEscortAI.h"
#include "ScriptedGossip.h"
diff --git a/src/server/scripts/Outland/zone_nagrand.cpp b/src/server/scripts/Outland/zone_nagrand.cpp
index b4572ce22f7..22bf85cca64 100644
--- a/src/server/scripts/Outland/zone_nagrand.cpp
+++ b/src/server/scripts/Outland/zone_nagrand.cpp
@@ -29,10 +29,9 @@ EndContentData */
#include "ScriptMgr.h"
#include "GameObject.h"
-#include "MotionMaster.h"
#include "GameObjectAI.h"
+#include "MotionMaster.h"
#include "Player.h"
-#include "QuestDef.h"
#include "ScriptedEscortAI.h"
#include "ScriptedGossip.h"
#include "SpellInfo.h"
@@ -144,7 +143,7 @@ public:
}
- void SpellHitTarget(Unit* /*target*/, const SpellInfo* spell) override
+ void SpellHitTarget(Unit* /*target*/, SpellInfo const* spell) override
{
if (spell->Id == SPELL_CHAIN_LIGHTNING)
{
@@ -517,7 +516,7 @@ public:
summoned->AI()->AttackStart(me);
}
- void SpellHitTarget(Unit* /*target*/, const SpellInfo* spell) override
+ void SpellHitTarget(Unit* /*target*/, SpellInfo const* spell) override
{
if (spell->Id == SPELL_KUR_CHAIN_LIGHTNING)
{
diff --git a/src/server/scripts/Outland/zone_netherstorm.cpp b/src/server/scripts/Outland/zone_netherstorm.cpp
index 1b7287a7d20..76f8e1d5959 100644
--- a/src/server/scripts/Outland/zone_netherstorm.cpp
+++ b/src/server/scripts/Outland/zone_netherstorm.cpp
@@ -31,11 +31,10 @@ EndContentData */
#include "ScriptMgr.h"
#include "GameObject.h"
+#include "GameObjectAI.h"
#include "Log.h"
#include "ObjectAccessor.h"
-#include "GameObjectAI.h"
#include "Player.h"
-#include "QuestDef.h"
#include "ScriptedEscortAI.h"
#include "ScriptedGossip.h"
@@ -318,7 +317,7 @@ class at_commander_dawnforge : public AreaTriggerScript
public:
at_commander_dawnforge() : AreaTriggerScript("at_commander_dawnforge") { }
- bool OnTrigger(Player* player, const AreaTriggerEntry* /*areaTrigger*/, bool /*entered*/) override
+ bool OnTrigger(Player* player, AreaTriggerEntry const* /*areaTrigger*/, bool /*entered*/) override
{
//if player lost aura or not have at all, we should not try start event.
if (!player->HasAura(SPELL_SUNFURY_DISGUISE))
@@ -409,7 +408,7 @@ public:
PlayerGUID = who->GetGUID();
}
- //void SpellHit(Unit* /*caster*/, const SpellInfo* /*spell*/) override
+ //void SpellHit(Unit* /*caster*/, SpellInfo const* /*spell*/) override
//{
// DoCast(me, SPELL_DE_MATERIALIZE);
//}
@@ -607,7 +606,7 @@ public:
// take the GO -> animation
me->HandleEmoteCommand(EMOTE_STATE_LOOT);
SetEscortPaused(true);
- bTake=true;
+ bTake = true;
}
break;
case 36: //return and quest_complete
@@ -634,7 +633,7 @@ public:
if (GameObject* go = GetClosestGameObjectWithEntry(me, GO_DRAENEI_MACHINE, INTERACTION_DISTANCE))
{
SetEscortPaused(false);
- bTake=false;
+ bTake = false;
uiTakeTimer = 3000;
go->Delete();
}
diff --git a/src/server/scripts/Outland/zone_shadowmoon_valley.cpp b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp
index a286e2f7ec5..fb702cb6a42 100644
--- a/src/server/scripts/Outland/zone_shadowmoon_valley.cpp
+++ b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp
@@ -42,7 +42,6 @@ EndContentData */
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "Player.h"
-#include "QuestDef.h"
#include "ScriptedEscortAI.h"
#include "ScriptedGossip.h"
#include "SpellInfo.h"
@@ -163,7 +162,7 @@ public:
caster->AI()->SetData(TYPE_INFERNAL, DATA_DIED);
}
- void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
+ void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if (spell->Id == SPELL_SUMMON_INFERNAL)
{
@@ -383,7 +382,7 @@ public:
me->SetDisableGravity(false);
}
- void SpellHit(Unit* caster, const SpellInfo* spell) override
+ void SpellHit(Unit* caster, SpellInfo const* spell) override
{
if (!caster)
return;
@@ -510,7 +509,7 @@ public:
Initialize();
}
- void SpellHit(Unit* caster, const SpellInfo* spell) override
+ void SpellHit(Unit* caster, SpellInfo const* spell) override
{
if (!caster)
return;
@@ -1561,7 +1560,7 @@ public:
}
}
- void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
+ void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if (spell->Id == SPELL_WHISTLE)
{