!difficulty <set|up|down>

removed Not Implemented Exception in Item.cs
This commit is contained in:
Lucca Faria Ferri 2023-01-26 12:35:06 -08:00
parent 8ff0f67428
commit 70da7c4486
2 changed files with 35 additions and 1 deletions

View File

@ -45,6 +45,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
{

View File

@ -6581,7 +6581,6 @@ namespace D3.Items {
public void AddCurrency(object consumable)
{
throw new NotImplementedException();
}
}
static CurrencySavedData() {