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
@@ -0,0 +1,18 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
*/
#ifndef DEF_GNOMEREGAN_H
#define DEF_GNOMEREGAN_H
#include "CreatureAIImpl.h"
#define GnomereganScriptName "instance_gnomeregan"
template <class AI, class T>
inline AI* GetGnomereganAI(T* obj)
{
return GetInstanceAI<AI>(obj, GnomereganScriptName);
}
#endif
@@ -2,6 +2,7 @@
* Originally written by Xinef - Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
*/
#include "gnomeregan.h"
#include "InstanceScript.h"
#include "PassiveAI.h"
#include "Player.h"
@@ -38,7 +39,7 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_kernobeeAI(creature);
return GetGnomereganAI<npc_kernobeeAI>(creature);
}
bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) override