diff options
author | ccrs <ccrs@users.noreply.github.com> | 2019-10-26 23:33:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-26 23:33:30 +0200 |
commit | 06c6b30ed484850228c57313dc2c024c38e2055f (patch) | |
tree | b38bf9e9326fcde9936ca12d06bb35797d6e023f /src/server/game/Scripting/ScriptMgr.h | |
parent | 00703ee238729a8d5b3d17edf8dc16d6c6c6b601 (diff) |
Scripts/ScarletMonastery: instance script cleanup (#23889)
Adapt InstanceScript into newer structure and style
Adapt existing boss scripts into newer structure and style
Improve existing boss related definitions
Should make each boss more functionally reliable, but nothing new has been added
Diffstat (limited to 'src/server/game/Scripting/ScriptMgr.h')
-rw-r--r-- | src/server/game/Scripting/ScriptMgr.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h index b9677ff70b4..b0dea1e36b6 100644 --- a/src/server/game/Scripting/ScriptMgr.h +++ b/src/server/game/Scripting/ScriptMgr.h @@ -1108,7 +1108,7 @@ class GenericCreatureScript : public CreatureScript }; #define RegisterCreatureAI(ai_name) new GenericCreatureScript<ai_name>(#ai_name) -template <class AI, AI*(*AIFactory)(Creature*)> +template <class AI, AI* (*AIFactory)(Creature*)> class FactoryCreatureScript : public CreatureScript { public: @@ -1126,6 +1126,15 @@ class GenericGameObjectScript : public GameObjectScript }; #define RegisterGameObjectAI(ai_name) new GenericGameObjectScript<ai_name>(#ai_name) +template <class AI, AI* (*AIFactory)(GameObject*)> +class FactoryGameObjectScript : public GameObjectScript +{ + public: + FactoryGameObjectScript(char const* name) : GameObjectScript(name) { } + GameObjectAI* GetAI(GameObject* me) const override { return AIFactory(me); } +}; +#define RegisterGameObjectAIWithFactory(ai_name, factory_fn) new FactoryGameObjectScript<ai_name, &factory_fn>(#ai_name) + #define sScriptMgr ScriptMgr::instance() #endif |