mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-13 03:32:28 -04:00
Scripts/Commands: Add .debug modifiertree command
This commit is contained in:
5
sql/updates/world/master/2026_03_10_00_world.sql
Normal file
5
sql/updates/world/master/2026_03_10_00_world.sql
Normal file
@@ -0,0 +1,5 @@
|
||||
DELETE FROM `command` WHERE `name` IN ('debug modifiertree','debug playercondition','debug wsexpression');
|
||||
INSERT INTO `command` (`name`, `help`) VALUES
|
||||
('debug modifiertree', 'Syntax: .debug modifiertree #modifierTreeId\r\n\r\nChecks if ModifierTree #modifierTreeId conditions are met for targeted player.'),
|
||||
('debug playercondition', 'Syntax: .debug playercondition #playerConditionId\r\n\r\nChecks if PlayerCondition #playerConditionId condition is met for targeted player.'),
|
||||
('debug wsexpression', 'Syntax: .debug wsexpression #worldStateExpressionId\r\n\r\nChecks if WorldStateExpression #worldStateExpressionId condition is met on current map.');
|
||||
@@ -120,6 +120,7 @@ public:
|
||||
{ "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 },
|
||||
{ "modifiertree", HandleDebugModifierTreeCommand, 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 },
|
||||
@@ -1589,6 +1590,25 @@ public:
|
||||
return Conversation::CreateConversation(conversationEntry, target, *target, target->GetGUID()) != nullptr;
|
||||
}
|
||||
|
||||
static bool HandleDebugModifierTreeCommand(ChatHandler* handler, uint32 modifierTreeId)
|
||||
{
|
||||
Player* target = handler->getSelectedPlayerOrSelf();
|
||||
|
||||
if (!target)
|
||||
{
|
||||
handler->SendSysMessage(LANG_PLAYER_NOT_FOUND);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (target->ModifierTreeSatisfied(modifierTreeId))
|
||||
handler->PSendSysMessage("ModifierTree %u met", modifierTreeId);
|
||||
else
|
||||
handler->PSendSysMessage("ModifierTree %u not met", modifierTreeId);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleDebugWSExpressionCommand(ChatHandler* handler, uint32 expressionId)
|
||||
{
|
||||
Player* target = handler->getSelectedPlayerOrSelf();
|
||||
@@ -1605,9 +1625,9 @@ public:
|
||||
return false;
|
||||
|
||||
if (ConditionMgr::IsMeetingWorldStateExpression(target->GetMap(), wsExpressionEntry))
|
||||
handler->PSendSysMessage("Expression %u meet", expressionId);
|
||||
handler->PSendSysMessage("WorldStateExpression %u met", expressionId);
|
||||
else
|
||||
handler->PSendSysMessage("Expression %u not meet", expressionId);
|
||||
handler->PSendSysMessage("WorldStateExpression %u not met", expressionId);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user