diff options
Diffstat (limited to 'src/server/game/Scripting/ScriptMgr.h')
-rwxr-xr-x | src/server/game/Scripting/ScriptMgr.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h index 3b65a5cf256..270182509f9 100755 --- a/src/server/game/Scripting/ScriptMgr.h +++ b/src/server/game/Scripting/ScriptMgr.h @@ -39,6 +39,7 @@ class Creature; class CreatureAI; class DynamicObject; class GameObject; +class GameObjectAI; class Guild; class GridMap; class Group; @@ -163,7 +164,7 @@ class ScriptObject protected: ScriptObject(const char* name) - : _name(std::string(name)) + : _name(name) { } @@ -313,7 +314,7 @@ template<class TMap> class MapScript : public UpdatableScript<TMap> : _mapEntry(sMapStore.LookupEntry(mapId)) { if (!_mapEntry) - sLog->outError("Invalid MapScript for %u; no such map ID.", mapId); + sLog->outError(LOG_FILTER_TSCR, "Invalid MapScript for %u; no such map ID.", mapId); } public: @@ -471,6 +472,15 @@ class GameObjectScript : public ScriptObject, public UpdatableScript<GameObject> // Called when the game object is damaged (destructible buildings only). virtual void OnDamaged(GameObject* /*go*/, Player* /*player*/) { } + + // Called when the game object loot state is changed. + virtual void OnLootStateChanged(GameObject* /*go*/, uint32 /*state*/, Unit* /*unit*/) { } + + // Called when the game object state is changed. + virtual void OnGameObjectStateChanged(GameObject* /*go*/, uint32 /*state*/) { } + + // Called when a GameObjectAI object is needed for the gameobject. + virtual GameObjectAI* GetAI(GameObject* /*go*/) const { return NULL; } }; class AreaTriggerScript : public ScriptObject @@ -910,7 +920,10 @@ class ScriptMgr uint32 GetDialogStatus(Player* player, GameObject* go); void OnGameObjectDestroyed(GameObject* go, Player* player); void OnGameObjectDamaged(GameObject* go, Player* player); + void OnGameObjectLootStateChanged(GameObject* go, uint32 state, Unit* unit); + void OnGameObjectStateChanged(GameObject* go, uint32 state); void OnGameObjectUpdate(GameObject* go, uint32 diff); + GameObjectAI* GetGameObjectAI(GameObject* go); public: /* AreaTriggerScript */ |