mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 02:04:52 +01:00
Core/Entities : Basic Conversation Implementation (#18010)
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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...");
|
||||
|
||||
Reference in New Issue
Block a user