aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/scripts')
-rw-r--r--src/server/scripts/Commands/cs_debug.cpp25
-rw-r--r--src/server/scripts/Commands/cs_reload.cpp10
2 files changed, 35 insertions, 0 deletions
diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp
index 1419a5b3b74..bfa60398261 100644
--- a/src/server/scripts/Commands/cs_debug.cpp
+++ b/src/server/scripts/Commands/cs_debug.cpp
@@ -29,6 +29,7 @@ EndScriptData */
#include "Chat.h"
#include "Cell.h"
#include "CellImpl.h"
+#include "Conversation.h"
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
#include "GossipDef.h"
@@ -102,6 +103,7 @@ public:
{ "boundary", rbac::RBAC_PERM_COMMAND_DEBUG_BOUNDARY, false, &HandleDebugBoundaryCommand, "" },
{ "raidreset", rbac::RBAC_PERM_COMMAND_INSTANCE_UNBIND, false, &HandleDebugRaidResetCommand, "" },
{ "neargraveyard", rbac::RBAC_PERM_COMMAND_NEARGRAVEYARD, false, &HandleDebugNearGraveyard, "" },
+ { "conversation" , rbac::RBAC_PERM_COMMAND_DEBUG_CONVERSATION, false, &HandleDebugConversationCommand, "" },
};
static std::vector<ChatCommand> commandTable =
{
@@ -1567,6 +1569,29 @@ public:
return true;
}
+
+ static bool HandleDebugConversationCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ char const* conversationEntryStr = strtok((char*)args, " ");
+
+ if (!conversationEntryStr)
+ return false;
+
+ uint32 conversationEntry = atoi(conversationEntryStr);
+ Player* target = handler->getSelectedPlayerOrSelf();
+
+ if (!target)
+ {
+ handler->SendSysMessage(LANG_PLAYER_NOT_FOUND);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ return Conversation::CreateConversation(conversationEntry, target, *target, { target->GetGUID() }) != nullptr;
+ }
};
void AddSC_debug_commandscript()
diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp
index 1b54aa4f03e..2732d6d8be7 100644
--- a/src/server/scripts/Commands/cs_reload.cpp
+++ b/src/server/scripts/Commands/cs_reload.cpp
@@ -29,6 +29,7 @@ EndScriptData */
#include "BattlegroundMgr.h"
#include "CharacterTemplateDataStore.h"
#include "Chat.h"
+#include "ConversationDataStore.h"
#include "CreatureTextMgr.h"
#include "DisableMgr.h"
#include "Language.h"
@@ -81,6 +82,7 @@ public:
{ "command", rbac::RBAC_PERM_COMMAND_RELOAD_COMMAND, true, &HandleReloadCommandCommand, "" },
{ "conditions", rbac::RBAC_PERM_COMMAND_RELOAD_CONDITIONS, true, &HandleReloadConditions, "" },
{ "config", rbac::RBAC_PERM_COMMAND_RELOAD_CONFIG, true, &HandleReloadConfigCommand, "" },
+ { "conversation_template", rbac::RBAC_PERM_COMMAND_RELOAD_CONVERSATION_TEMPLATE, true, &HandleReloadConversationTemplateCommand, "" },
{ "creature_text", rbac::RBAC_PERM_COMMAND_RELOAD_CREATURE_TEXT, true, &HandleReloadCreatureText, "" },
{ "creature_questender", rbac::RBAC_PERM_COMMAND_RELOAD_CREATURE_QUESTENDER, true, &HandleReloadCreatureQuestEnderCommand, "" },
{ "creature_linked_respawn", rbac::RBAC_PERM_COMMAND_RELOAD_CREATURE_LINKED_RESPAWN, true, &HandleReloadLinkedRespawnCommand, "" },
@@ -1150,6 +1152,14 @@ public:
return true;
}
+ static bool HandleReloadConversationTemplateCommand(ChatHandler* handler, const char* /*args*/)
+ {
+ TC_LOG_INFO("misc", "Reloading conversation_* tables...");
+ sConversationDataStore->LoadConversationTemplates();
+ handler->SendGlobalGMSysMessage("Conversation templates reloaded.");
+ return true;
+ }
+
static bool HandleReloadRBACCommand(ChatHandler* handler, const char* /*args*/)
{
TC_LOG_INFO("misc", "Reloading RBAC tables...");