feat(Core/DB): Add Hooks On creature/game object save to db (#11246)

* implement OnCreatureSaveToDB and OnGameObjectSaveToDB Hooks

* fix Whitespaces in ScriptMgr.h

Co-authored-by: Timothée Moos <t1997.m@gmx.net>
This commit is contained in:
Tralenor
2022-05-06 05:42:49 +02:00
committed by GitHub
parent 7975bc63ca
commit 6cf82e3bd6
5 changed files with 39 additions and 1 deletions

View File

@@ -561,6 +561,13 @@ public:
*/
virtual void OnCreatureRemoveWorld(Creature* /*creature*/) { }
/**
* @brief This hook runs after creature has been saved to DB
*
* @param creature Contains information about the Creature
*/
virtual void OnCreatureSaveToDB(Creature* /*creature*/) { }
/**
* @brief This hook called when a player opens a gossip dialog with the creature.
*
@@ -643,7 +650,12 @@ public:
* @param go Contains information about the GameObject
*/
virtual void OnGameObjectAddWorld(GameObject* /*go*/) { }
/**
* @brief This hook runs after the game object iis saved to the database
*
* @param go Contains information about the GameObject
*/
virtual void OnGameObjectSaveToDB(GameObject* /*go*/) { }
/**
* @brief This hook runs after remove game object in world
*
@@ -2392,6 +2404,10 @@ public: /* AllCreatureScript */
//listener function (OnAllCreatureUpdate) is called by OnCreatureUpdate
//void OnAllCreatureUpdate(Creature* creature, uint32 diff);
void Creature_SelectLevel(const CreatureTemplate* cinfo, Creature* creature);
void OnCreatureSaveToDB(Creature* creature);
public: /* AllGameobjectScript */
void OnGameObjectSaveToDB(GameObject* go);
public: /* AllMapScript */
void OnBeforeCreateInstanceScript(InstanceMap* instanceMap, InstanceScript* instanceData, bool load, std::string data, uint32 completedEncounterMask);