diff --git a/src/DiIiS-NA/D3-GameServer/CommandManager/GameCommands.cs b/src/DiIiS-NA/D3-GameServer/CommandManager/GameCommands.cs index f1865d3..01a3100 100644 --- a/src/DiIiS-NA/D3-GameServer/CommandManager/GameCommands.cs +++ b/src/DiIiS-NA/D3-GameServer/CommandManager/GameCommands.cs @@ -44,6 +44,41 @@ using static DiIiS_NA.Core.MPQ.FileFormats.GameBalance; namespace DiIiS_NA.GameServer.CommandManager { + + [CommandGroup("difficulty", "Changes difficulty of the game", Account.UserLevels.GM)] + public class DifficultyCommand : CommandGroup + { + [Command("up", "Increases difficulty of the game", Account.UserLevels.GM)] + public string Up(string[] @params, BattleClient invokerClient) + { + if (invokerClient?.InGameClient is null) + return "You must execute this command in-game."; + invokerClient.InGameClient.Player.World.Game.RaiseDifficulty(invokerClient.InGameClient, null); + return $"Difficulty increased - set to {invokerClient.InGameClient.Player.World.Game.Difficulty}"; + } + + [Command("down", "Decreases difficulty of the game", Account.UserLevels.GM)] + public string Down(string[] @params, BattleClient invokerClient) + { + if (invokerClient?.InGameClient is null) + return "You must execute this command in-game."; + if (invokerClient.InGameClient.Player.World.Game.Difficulty == 0) + return "Difficulty is already at minimum"; + invokerClient.InGameClient.Player.World.Game.LowDifficulty(invokerClient.InGameClient, null); + return $"Difficulty decreased - set to {invokerClient.InGameClient.Player.World.Game.Difficulty}"; + } + + [Command("set", "Sets difficulty of the game", Account.UserLevels.GM)] + public string Set(string[] @params, BattleClient invokerClient) + { + if (invokerClient?.InGameClient is null) + return "You must execute this command in-game."; + if (!int.TryParse(@params[0], out var difficulty) || difficulty is < 0 or > 100) + return "Invalid difficulty"; + invokerClient.InGameClient.Player.World.Game.SetDifficulty(difficulty); + return $"Difficulty set to {invokerClient.InGameClient.Player.World.Game.Difficulty}"; + } + } [CommandGroup("heal", "Heals yourself", Account.UserLevels.Tester)] public class HealCommand : CommandGroup diff --git a/src/DiIiSNet/D3/Items/Items.cs b/src/DiIiSNet/D3/Items/Items.cs index b315118..21e7fb4 100644 --- a/src/DiIiSNet/D3/Items/Items.cs +++ b/src/DiIiSNet/D3/Items/Items.cs @@ -6581,7 +6581,6 @@ namespace D3.Items { public void AddCurrency(object consumable) { - throw new NotImplementedException(); } } static CurrencySavedData() {