Core/Scripts: Implement script name reloading

* Authored by Seyden
* Co-authored by Naios
* We thank Shauren for your helpful feedback
This commit is contained in:
Seyden
2021-10-22 12:51:45 +02:00
committed by Naios
parent 972105183a
commit 8f097e4425
39 changed files with 478 additions and 221 deletions

View File

@@ -901,6 +901,12 @@ class TC_GAME_API ScriptMgr
_script_loader_callback = script_loader_callback;
}
public: /* Updating script ids */
/// Inform the ScriptMgr that an entity has a changed script id
void NotifyScriptIDUpdate();
/// Synchronize all scripts with their current ids
void SyncScripts();
public: /* Script contexts */
/// Set the current script context, which allows the ScriptMgr
/// to accept new scripts in this context.
@@ -989,10 +995,12 @@ class TC_GAME_API ScriptMgr
public: /* CreatureScript */
bool CanCreateCreatureAI(uint32 scriptId) const;
CreatureAI* GetCreatureAI(Creature* creature);
public: /* GameObjectScript */
bool CanCreateGameObjectAI(uint32 scriptId) const;
GameObjectAI* GetGameObjectAI(GameObject* go);
public: /* AreaTriggerScript */
@@ -1130,6 +1138,7 @@ class TC_GAME_API ScriptMgr
public: /* AreaTriggerEntityScript */
bool CanCreateAreaTriggerAI(uint32 scriptId) const;
AreaTriggerAI* GetAreaTriggerAI(AreaTrigger* areaTrigger);
public: /* ConversationScript */
@@ -1152,6 +1161,7 @@ class TC_GAME_API ScriptMgr
private:
uint32 _scriptCount;
bool _scriptIdUpdated;
ScriptLoaderCallbackType _script_loader_callback;