mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 03:15:41 +00:00
feat(Script/Instance): added generic instance map script (#21218)
Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
This commit is contained in:
@@ -34,4 +34,14 @@ public:
|
||||
virtual InstanceScript* GetInstanceScript(InstanceMap* /*map*/) const { return nullptr; }
|
||||
};
|
||||
|
||||
template<typename IS>
|
||||
class GenericInstanceMapScript : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
GenericInstanceMapScript(char const* name, uint32 mapId) : InstanceMapScript(name, mapId) { }
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const override { return new IS(map); }
|
||||
};
|
||||
|
||||
#define RegisterInstanceScript(script_name, mapId) new GenericInstanceMapScript<script_name>(#script_name, mapId)
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user