aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server/scripts/Commands/cs_debug.cpp32
1 files changed, 28 insertions, 4 deletions
diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp
index 682a3f5048c..c4b7fa411a1 100644
--- a/src/server/scripts/Commands/cs_debug.cpp
+++ b/src/server/scripts/Commands/cs_debug.cpp
@@ -118,8 +118,9 @@ public:
{ "raidreset", HandleDebugRaidResetCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
{ "neargraveyard", HandleDebugNearGraveyard, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
{ "instancespawn", HandleDebugInstanceSpawns, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
- { "conversation" , HandleDebugConversationCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
- { "wsexpression" , HandleDebugWSExpressionCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
+ { "conversation", HandleDebugConversationCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
+ { "wsexpression", HandleDebugWSExpressionCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
+ { "playercondition", HandleDebugPlayerConditionCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
{ "pvp warmode", HandleDebugWarModeBalanceCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::Yes },
{ "dummy", HandleDebugDummyCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
{ "asan memoryleak", HandleDebugMemoryLeak, rbac::RBAC_PERM_COMMAND_DEBUG, Console::Yes },
@@ -1577,13 +1578,36 @@ public:
if (!wsExpressionEntry)
return false;
- if (sConditionMgr->IsPlayerMeetingExpression(target, wsExpressionEntry))
+ if (ConditionMgr::IsPlayerMeetingExpression(target, wsExpressionEntry))
handler->PSendSysMessage("Expression %u meet", expressionId);
else
handler->PSendSysMessage("Expression %u not meet", expressionId);
return true;
- };
+ }
+
+ static bool HandleDebugPlayerConditionCommand(ChatHandler* handler, uint32 playerConditionId)
+ {
+ Player* target = handler->getSelectedPlayerOrSelf();
+
+ if (!target)
+ {
+ handler->SendSysMessage(LANG_PLAYER_NOT_FOUND);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ PlayerConditionEntry const* playerConditionEntry = sPlayerConditionStore.LookupEntry(playerConditionId);
+ if (!playerConditionEntry)
+ return false;
+
+ if (ConditionMgr::IsPlayerMeetingCondition(target, playerConditionEntry))
+ handler->PSendSysMessage("PlayerCondition %u met", playerConditionId);
+ else
+ handler->PSendSysMessage("PlayerCondition %u not met", playerConditionId);
+
+ return true;
+ }
static bool HandleDebugOutOfBounds([[maybe_unused]] ChatHandler* handler)
{