feat(Core/Instance): Add instance validation for creature scripts (#4596)

This commit is contained in:
Kitzunu
2021-04-05 15:34:26 +02:00
committed by GitHub
parent 60f865fce6
commit f9d708b450
371 changed files with 1315 additions and 767 deletions
@@ -57,7 +57,7 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
return GetInstanceAI<boss_fathomlord_karathressAI>(creature);
return GetSerpentShrineAI<boss_fathomlord_karathressAI>(creature);
}
struct boss_fathomlord_karathressAI : public BossAI
@@ -83,7 +83,7 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
return GetInstanceAI<boss_hydross_the_unstableAI>(creature);
return GetSerpentShrineAI<boss_hydross_the_unstableAI>(creature);
}
struct boss_hydross_the_unstableAI : public BossAI
@@ -91,7 +91,7 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
return GetInstanceAI<boss_lady_vashjAI>(creature);
return GetSerpentShrineAI<boss_lady_vashjAI>(creature);
}
struct boss_lady_vashjAI : public BossAI
@@ -74,7 +74,7 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
return GetInstanceAI<boss_leotheras_the_blindAI>(creature);
return GetSerpentShrineAI<boss_leotheras_the_blindAI>(creature);
}
struct boss_leotheras_the_blindAI : public BossAI
@@ -264,7 +264,7 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_inner_demonAI(creature);
return GetSerpentShrineAI<npc_inner_demonAI>(creature);
}
struct npc_inner_demonAI : public ScriptedAI
@@ -53,7 +53,7 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
return GetInstanceAI<boss_the_lurker_belowAI>(creature);
return GetSerpentShrineAI<boss_the_lurker_belowAI>(creature);
}
struct boss_the_lurker_belowAI : public BossAI
@@ -57,7 +57,7 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
return GetInstanceAI<boss_morogrim_tidewalkerAI>(creature);
return GetSerpentShrineAI<boss_morogrim_tidewalkerAI>(creature);
}
struct boss_morogrim_tidewalkerAI : public BossAI
@@ -6,11 +6,14 @@
#define DEF_SERPENT_SHRINE_H
#include "CreatureAI.h"
#include "CreatureAIImpl.h"
#include "GridNotifiers.h"
#include "Player.h"
#include "SpellAuraEffects.h"
#include "SpellScript.h"
#define SerpentShrineScriptName "instance_serpent_shrine"
enum DataTypes
{
DATA_HYDROSS_THE_UNSTABLE = 0,
@@ -65,4 +68,10 @@ enum SSSpells
SPELL_FRENZY_WATER = 37026
};
template <class AI, class T>
inline AI* GetSerpentShrineAI(T* obj)
{
return GetInstanceAI<AI>(obj, SerpentShrineScriptName);
}
#endif
@@ -9,6 +9,7 @@
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "ScriptMgr.h"
#include "the_slave_pens.h"
#define GOSSIP_TEXT_ID 15864
#define QUEST_SUMMON_AHUNE 11691
@@ -21,17 +22,6 @@ const Position AhuneSummonPos = {-97.3473f, -233.139f, -1.27587f, M_PI / 2};
const Position TotemPos[3] = { {-115.141f, -143.317f, -2.09467f, 4.92772f}, {-120.178f, -144.398f, -2.23786f, 4.92379f}, {-125.277f, -145.463f, -1.95209f, 4.97877f} };
const Position MinionSummonPos = {-97.154404f, -204.382675f, -1.19f, M_PI / 2};
enum NPCs
{
NPC_AHUNE = 25740,
NPC_FROZEN_CORE = 25865,
NPC_AHUNE_SUMMON_LOC_BUNNY = 25745,
NPC_TOTEM = 25961,
NPC_TOTEM_BUNNY_1 = 25971,
NPC_TOTEM_BUNNY_2 = 25972,
NPC_TOTEM_BUNNY_3 = 25973,
};
enum EventSpells
{
SPELL_STARTING_BEAM = 46593,
@@ -81,7 +71,7 @@ public:
CreatureAI* GetAI(Creature* pCreature) const override
{
return new boss_ahuneAI (pCreature);
return GetTheSlavePensAI<boss_ahuneAI>(pCreature);
}
struct boss_ahuneAI : public ScriptedAI
@@ -360,7 +350,7 @@ public:
CreatureAI* GetAI(Creature* pCreature) const override
{
return new npc_ahune_frozen_coreAI (pCreature);
return GetTheSlavePensAI<npc_ahune_frozen_coreAI>(pCreature);
}
struct npc_ahune_frozen_coreAI : public NullCreatureAI
@@ -1,18 +1,6 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
* Copyright (C) 2008-2018 TrinityCore <https://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SLAVE_PENS_H
@@ -49,6 +37,11 @@ enum SPCreaturesIds
{
NPC_AHUNE = 25740,
NPC_FROZEN_CORE = 25865,
NPC_AHUNE_SUMMON_LOC_BUNNY = 25745,
NPC_TOTEM = 25961,
NPC_TOTEM_BUNNY_1 = 25971,
NPC_TOTEM_BUNNY_2 = 25972,
NPC_TOTEM_BUNNY_3 = 25973,
NPC_LUMA_SKYMOTHER = 25697,
NPC_AHUNE_LOC_BUNNY = 25745,
NPC_EARTHEN_RING_FLAMECALLER = 25754,
@@ -68,4 +61,10 @@ enum SPGameObjectIds
GO_ICE_STONE = 187882
};
template <class AI, class T>
inline AI* GetTheSlavePensAI(T* obj)
{
return GetInstanceAI<AI>(obj, SPScriptName);
}
#endif // SLAVE_PENS_H
@@ -29,7 +29,7 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
return new boss_thespiaAI (creature);
return GetSteamVaultAI<boss_thespiaAI>(creature);
}
struct boss_thespiaAI : public ScriptedAI
@@ -36,7 +36,7 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
return new boss_mekgineer_steamriggerAI (creature);
return GetSteamVaultAI<boss_mekgineer_steamriggerAI>(creature);
}
struct boss_mekgineer_steamriggerAI : public ScriptedAI
@@ -147,7 +147,7 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_steamrigger_mechanicAI (creature);
return GetSteamVaultAI<npc_steamrigger_mechanicAI>(creature);
}
struct npc_steamrigger_mechanicAI : public ScriptedAI
@@ -35,7 +35,7 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
return new boss_warlord_kalithreshAI (creature);
return GetSteamVaultAI<boss_warlord_kalithreshAI>(creature);
}
struct boss_warlord_kalithreshAI : public ScriptedAI
@@ -119,7 +119,7 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_naga_distillerAI (creature);
return GetSteamVaultAI<npc_naga_distillerAI>(creature);
}
struct npc_naga_distillerAI : public NullCreatureAI
@@ -6,6 +6,9 @@
#define DEF_STEAM_VAULT_H
#include "PassiveAI.h"
#include "CreatureAIImpl.h"
#define SteamVaultScriptName "instance_steam_vault"
enum steamVault
{
@@ -25,4 +28,10 @@ enum steamVaultNPCGO
NPC_WARLORD_KALITHRESH = 17798,
};
template <class AI, class T>
inline AI* GetSteamVaultAI(T* obj)
{
return GetInstanceAI<AI>(obj, SteamVaultScriptName);
}
#endif
@@ -14,6 +14,7 @@ EndScriptData */
#include "ScriptedCreature.h"
#include "ScriptMgr.h"
#include "SpellScript.h"
#include "the_underbog.h"
enum eBlackStalker
{
@@ -43,7 +44,7 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
return new boss_the_black_stalkerAI (creature);
return GetTheUnderbogAI<boss_the_black_stalkerAI>(creature);
}
struct boss_the_black_stalkerAI : public ScriptedAI
@@ -30,7 +30,7 @@ gets instead the deserter debuff.
class instance_the_underbog : public InstanceMapScript
{
public:
instance_the_underbog() : InstanceMapScript(TheUndebogScriptName, 546) { }
instance_the_underbog() : InstanceMapScript(TheUnderbogScriptName, 546) { }
InstanceScript* GetInstanceScript(InstanceMap* map) const override
{
@@ -1,18 +1,6 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
* Copyright (C) 2008-2018 TrinityCore <https://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef the_underbog_h__
@@ -20,6 +8,12 @@
#include "CreatureAIImpl.h"
#define TheUndebogScriptName "instance_the_underbog"
#define TheUnderbogScriptName "instance_the_underbog"
template <class AI, class T>
inline AI* GetTheUnderbogAI(T* obj)
{
return GetInstanceAI<AI>(obj, TheUnderbogScriptName);
}
#endif // the_underbog_h__