From 53df58c31b98dea4f3c0f4704712e4ca42e0dc5b Mon Sep 17 00:00:00 2001 From: hondacrx Date: Tue, 30 May 2023 04:59:14 -0400 Subject: [PATCH] Core/Commands: Added .debug playercondition command Port From (https://github.com/TrinityCore/TrinityCore/commit/781ca507dd470087d663fde13df2cfde37a07335) --- Source/Game/Chat/Commands/DebugCommands.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Source/Game/Chat/Commands/DebugCommands.cs b/Source/Game/Chat/Commands/DebugCommands.cs index 0ac27ec8a..7c44f6c24 100644 --- a/Source/Game/Chat/Commands/DebugCommands.cs +++ b/Source/Game/Chat/Commands/DebugCommands.cs @@ -777,6 +777,28 @@ namespace Game.Chat return true; } + [Command("playercondition", RBACPermissions.CommandDebug)] + static bool HandleDebugPlayerConditionCommand(CommandHandler handler, uint playerConditionId) + { + Player target = handler.GetSelectedPlayerOrSelf(); + if (!target) + { + handler.SendSysMessage(CypherStrings.PlayerNotFound); + return false; + } + + var playerConditionEntry = CliDB.PlayerConditionStorage.LookupByKey(playerConditionId); + if (playerConditionEntry == null) + return false; + + if (ConditionManager.IsPlayerMeetingCondition(target, playerConditionEntry)) + handler.SendSysMessage($"PlayerCondition {playerConditionId} met"); + else + handler.SendSysMessage($"PlayerCondition {playerConditionId} not met"); + + return true; + } + [Command("pvp warmode", RBACPermissions.CommandDebug, true)] static bool HandleDebugWarModeBalanceCommand(CommandHandler handler, string command, int? rewardValue) {