Core/SAI: Implemented new source type SMART_SCRIPT_TYPE_EVENT (3) (#28816)

This commit is contained in:
Meji
2023-07-09 11:59:35 +02:00
committed by GitHub
parent 996485e90e
commit d015711fbb
12 changed files with 244 additions and 64 deletions

View File

@@ -990,6 +990,20 @@ class TC_GAME_API WorldStateScript : public ScriptObject
virtual void OnValueChange(int32 worldStateId, int32 oldValue, int32 newValue, Map const* map);
};
class TC_GAME_API EventScript : public ScriptObject
{
protected:
explicit EventScript(char const* name);
public:
~EventScript();
// Called when a game event is triggered
virtual void OnTrigger(WorldObject* object, WorldObject* invoker, uint32 eventId);
};
// Manages registration, loading, and execution of scripts.
class TC_GAME_API ScriptMgr
{
@@ -1296,6 +1310,10 @@ class TC_GAME_API ScriptMgr
void OnWorldStateValueChange(WorldStateTemplate const* worldStateTemplate, int32 oldValue, int32 newValue, Map const* map);
public: /* EventScript */
void OnEventTrigger(WorldObject* object, WorldObject* invoker, uint32 eventId);
private:
uint32 _scriptCount;
bool _scriptIdUpdated;