diff options
| author | ccrs <ccrs@users.noreply.github.com> | 2019-10-26 23:33:30 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2021-12-18 23:36:17 +0100 |
| commit | 6443116d5b6392753c5b0605313fb0b5afd8fd94 (patch) | |
| tree | a1406a0ec463e96a852538b929d0bafd37a69091 /src/server/game/Scripting | |
| parent | 0fb1bf8439e29d283ff30b32c3df0bbdbdbdc543 (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
(cherry picked from commit 06c6b30ed484850228c57313dc2c024c38e2055f)
Diffstat (limited to 'src/server/game/Scripting')
| -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 7f77a6bba1c..708c51d7196 100644 --- a/src/server/game/Scripting/ScriptMgr.h +++ b/src/server/game/Scripting/ScriptMgr.h @@ -1213,7 +1213,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: @@ -1231,6 +1231,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) + template <class AI> class GenericAreaTriggerEntityScript : public AreaTriggerEntityScript { |
