diff options
| author | Seyden <saiifii@live.de> | 2021-10-22 12:51:45 +0200 |
|---|---|---|
| committer | Naios <naios-dev@live.de> | 2021-10-22 12:52:37 +0200 |
| commit | 8f097e4425d182c03b26d847c0537207d9f3cd2e (patch) | |
| tree | d9d6233d0cd2d75978a97ab8b3c73429886322a4 /src/server/scripts/Commands | |
| parent | 972105183a16c9ac8c43f379cce4acc8bf764cd8 (diff) | |
Core/Scripts: Implement script name reloading
* Authored by Seyden
* Co-authored by Naios
* We thank Shauren for your helpful feedback
Diffstat (limited to 'src/server/scripts/Commands')
| -rw-r--r-- | src/server/scripts/Commands/cs_reload.cpp | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp index 3e8a76b57c0..16bfea63ad5 100644 --- a/src/server/scripts/Commands/cs_reload.cpp +++ b/src/server/scripts/Commands/cs_reload.cpp @@ -41,6 +41,7 @@ EndScriptData */ #include "LootMgr.h" #include "MapManager.h" #include "ObjectMgr.h" +#include "ScriptMgr.h" #include "SkillDiscovery.h" #include "SkillExtraItems.h" #include "SmartAI.h" @@ -152,6 +153,7 @@ public: { "spell_pet_auras", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_PET_AURAS, true, &HandleReloadSpellPetAurasCommand, "" }, { "spell_proc", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_PROC, true, &HandleReloadSpellProcsCommand, "" }, { "spell_scripts", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_SCRIPTS, true, &HandleReloadSpellScriptsCommand, "" }, + { "spell_script_names", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_SCRIPT_NAMES, true, &HandleReloadSpellScriptNamesCommand, "" }, { "spell_target_position", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_TARGET_POSITION, true, &HandleReloadSpellTargetPositionCommand, "" }, { "spell_threats", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_THREATS, true, &HandleReloadSpellThreatsCommand, "" }, { "spell_group_stack_rules", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_GROUP_STACK_RULES, true, &HandleReloadSpellGroupStackRulesCommand, "" }, @@ -276,6 +278,7 @@ public: TC_LOG_INFO("misc", "Re-Loading Scripts..."); HandleReloadEventScriptsCommand(handler, "a"); HandleReloadSpellScriptsCommand(handler, "a"); + HandleReloadSpellScriptNamesCommand(handler, "a"); handler->SendGlobalGMSysMessage("DB tables `*_scripts` reloaded."); HandleReloadWpScriptsCommand(handler, "a"); HandleReloadWpCommand(handler, "a"); @@ -296,6 +299,7 @@ public: HandleReloadSpellThreatsCommand(handler, "a"); HandleReloadSpellGroupStackRulesCommand(handler, "a"); HandleReloadSpellPetAurasCommand(handler, "a"); + HandleReloadSpellScriptNamesCommand(handler, "a"); return true; } @@ -349,6 +353,7 @@ public: { TC_LOG_INFO("misc", "Re-Loading Additional Criteria Data..."); sCriteriaMgr->LoadCriteriaData(); + sScriptMgr->NotifyScriptIDUpdate(); handler->SendGlobalGMSysMessage("DB table `criteria_data` reloaded."); return true; } @@ -389,6 +394,7 @@ public: { TC_LOG_INFO("misc", "Re-Loading Battleground Templates..."); sBattlegroundMgr->LoadBattlegroundTemplates(); + sScriptMgr->NotifyScriptIDUpdate(); handler->SendGlobalGMSysMessage("DB table `battleground_template` reloaded."); return true; } @@ -461,6 +467,7 @@ public: } sObjectMgr->InitializeQueriesData(QUERY_DATA_CREATURES); + sScriptMgr->NotifyScriptIDUpdate(); handler->SendGlobalGMSysMessage("Creature template reloaded."); return true; } @@ -550,6 +557,8 @@ public: TC_LOG_INFO("misc", "Re-Loading GameObjects for quests..."); sObjectMgr->LoadGameObjectForQuests(); handler->SendGlobalGMSysMessage("Data GameObjects for quests reloaded."); + sScriptMgr->NotifyScriptIDUpdate(); + return true; } @@ -974,6 +983,16 @@ public: return true; } + static bool HandleReloadSpellScriptNamesCommand(ChatHandler* handler, const char* /*args*/) + { + TC_LOG_INFO("misc", "Reloading spell_script_names table..."); + sObjectMgr->LoadSpellScriptNames(); + sScriptMgr->NotifyScriptIDUpdate(); + sObjectMgr->ValidateSpellScripts(); + handler->SendGlobalGMSysMessage("Spell scripts reloaded."); + return true; + } + static bool HandleReloadGameGraveyardZoneCommand(ChatHandler* handler, char const* /*args*/) { TC_LOG_INFO("misc", "Re-Loading Graveyard-zone links..."); @@ -1107,6 +1126,7 @@ public: { TC_LOG_INFO("misc", "Re-Loading Conditions..."); sConditionMgr->LoadConditions(true); + sScriptMgr->NotifyScriptIDUpdate(); handler->SendGlobalGMSysMessage("Conditions reloaded."); return true; } @@ -1155,7 +1175,8 @@ public: { TC_LOG_INFO("misc", "Reloading areatrigger_template table..."); sAreaTriggerDataStore->LoadAreaTriggerTemplates(); - handler->SendGlobalGMSysMessage("AreaTrigger templates reloaded. Already spawned AT won't be affected. New scriptname need a reboot."); + sScriptMgr->NotifyScriptIDUpdate(); + handler->SendGlobalGMSysMessage("AreaTrigger templates reloaded."); return true; } @@ -1163,7 +1184,8 @@ public: { TC_LOG_INFO("misc", "Reloading scene_template table..."); sObjectMgr->LoadSceneTemplates(); - handler->SendGlobalGMSysMessage("Scenes templates reloaded. New scriptname need a reboot."); + sScriptMgr->NotifyScriptIDUpdate(); + handler->SendGlobalGMSysMessage("Scenes templates reloaded."); return true; } @@ -1171,6 +1193,7 @@ public: { TC_LOG_INFO("misc", "Reloading conversation_* tables..."); sConversationDataStore->LoadConversationTemplates(); + sScriptMgr->NotifyScriptIDUpdate(); handler->SendGlobalGMSysMessage("Conversation templates reloaded."); return true; } |
