mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-27 23:56:25 +00:00
feat(Core/Instance): Add instance validation for creature scripts (#4596)
This commit is contained in:
@@ -327,7 +327,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_alarAI>(creature);
|
||||
return GetTheEyeAI<boss_alarAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -225,7 +225,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_high_astromancer_solarianAI>(creature);
|
||||
return GetTheEyeAI<boss_high_astromancer_solarianAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -706,7 +706,7 @@ public:
|
||||
};
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_kaelthasAI>(creature);
|
||||
return GetTheEyeAI<boss_kaelthasAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_void_reaverAI>(creature);
|
||||
return GetTheEyeAI<boss_void_reaverAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -5,11 +5,14 @@
|
||||
#ifndef DEF_THE_EYE_H
|
||||
#define DEF_THE_EYE_H
|
||||
|
||||
#include "CreatureAIImpl.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "Player.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellScript.h"
|
||||
|
||||
#define TheEyeScriptName "instance_the_eye"
|
||||
|
||||
enum EyeData
|
||||
{
|
||||
DATA_ALAR = 0,
|
||||
@@ -41,4 +44,10 @@ enum EyeGOs
|
||||
GO_KAEL_STATUE_LEFT = 184597
|
||||
};
|
||||
|
||||
template <class AI, class T>
|
||||
inline AI* GetTheEyeAI(T* obj)
|
||||
{
|
||||
return GetInstanceAI<AI>(obj, TheEyeScriptName);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -91,7 +91,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new boss_gatewatcher_gyrokillAI(creature);
|
||||
return GetMechanarAI<boss_gatewatcher_gyrokillAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new boss_gatewatcher_iron_handAI(creature);
|
||||
return GetMechanarAI<boss_gatewatcher_iron_handAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new boss_mechano_lord_capacitusAI(creature);
|
||||
return GetMechanarAI<boss_mechano_lord_capacitusAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new boss_nethermancer_sepethreaAI(creature);
|
||||
return GetMechanarAI<boss_nethermancer_sepethreaAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -179,7 +179,7 @@ public:
|
||||
};
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_ragin_flamesAI(creature);
|
||||
return GetMechanarAI<npc_ragin_flamesAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new boss_pathaleon_the_calculatorAI(creature);
|
||||
return GetMechanarAI<boss_pathaleon_the_calculatorAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -6,10 +6,13 @@
|
||||
#define DEF_MECHANAR_H
|
||||
|
||||
#include "CreatureAI.h"
|
||||
#include "CreatureAIImpl.h"
|
||||
#include "Player.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellScript.h"
|
||||
|
||||
#define MechanarScriptName "instance_mechanar"
|
||||
|
||||
enum DataTypes
|
||||
{
|
||||
DATA_GATEWATCHER_GYROKILL = 0,
|
||||
@@ -52,4 +55,10 @@ enum SpellIds
|
||||
SPELL_TELEPORT_VISUAL = 35517
|
||||
};
|
||||
|
||||
template <class AI, class T>
|
||||
inline AI* GetMechanarAI(T* obj)
|
||||
{
|
||||
return GetInstanceAI<AI>(obj, MechanarScriptName);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -231,7 +231,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_millhouse_manastormAI(creature);
|
||||
return GetArcatrazAI<npc_millhouse_manastormAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -560,7 +560,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_warden_mellicharAI(creature);
|
||||
return GetArcatrazAI<npc_warden_mellicharAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -6,9 +6,12 @@
|
||||
#define ARCATRAZ_H
|
||||
|
||||
#include "CreatureAI.h"
|
||||
#include "CreatureAIImpl.h"
|
||||
#include "Player.h"
|
||||
#include "SpellScript.h"
|
||||
|
||||
#define ArcatrazScriptName "instance_arcatraz"
|
||||
|
||||
enum DataTypes
|
||||
{
|
||||
// Encounter States/Boss GUIDs
|
||||
@@ -54,4 +57,10 @@ enum SpellIds
|
||||
SPELL_SOUL_STEAL = 36782
|
||||
};
|
||||
|
||||
template <class AI, class T>
|
||||
inline AI* GetArcatrazAI(T* obj)
|
||||
{
|
||||
return GetInstanceAI<AI>(obj, ArcatrazScriptName);
|
||||
}
|
||||
|
||||
#endif // ARCATRAZ_H
|
||||
|
||||
@@ -161,7 +161,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new boss_dalliah_the_doomsayerAI(creature);
|
||||
return GetArcatrazAI<boss_dalliah_the_doomsayerAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -163,7 +163,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new boss_harbinger_skyrissAI(creature);
|
||||
return GetArcatrazAI<boss_harbinger_skyrissAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -242,7 +242,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new boss_wrath_scryer_soccothratesAI(creature);
|
||||
return GetArcatrazAI<boss_wrath_scryer_soccothratesAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new boss_zereketh_the_unboundAI(creature);
|
||||
return GetArcatrazAI<boss_zereketh_the_unboundAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new boss_commander_sarannisAI(creature);
|
||||
return GetTheBotanicaAI<boss_commander_sarannisAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new boss_high_botanist_freywinnAI(creature);
|
||||
return GetTheBotanicaAI<boss_high_botanist_freywinnAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new boss_lajAI(creature);
|
||||
return GetTheBotanicaAI<boss_lajAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new boss_thorngrin_the_tenderAI(creature);
|
||||
return GetTheBotanicaAI<boss_thorngrin_the_tenderAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new boss_warp_splinterAI(creature);
|
||||
return GetTheBotanicaAI<boss_warp_splinterAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -6,6 +6,9 @@
|
||||
#define DEF_THE_BOTANICA_H
|
||||
|
||||
#include "SpellScript.h"
|
||||
#include "CreatureAIImpl.h"
|
||||
|
||||
#define TheBotanicaScriptName "instance_the_botanica"
|
||||
|
||||
enum DataTypes
|
||||
{
|
||||
@@ -36,4 +39,10 @@ enum SpellIds
|
||||
SPELL_SHADOW_FORM = 34205
|
||||
};
|
||||
|
||||
template <class AI, class T>
|
||||
inline AI* GetTheBotanicaAI(T* obj)
|
||||
{
|
||||
return GetInstanceAI<AI>(obj, TheBotanicaScriptName);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user