From 917b4cf0623c4a23292565257fc7620cdde3ed2e Mon Sep 17 00:00:00 2001 From: Pablito Date: Sat, 28 Jan 2023 15:09:05 -0300 Subject: [PATCH] Command to makes you char full resources (arcane power, furia and etc.) --- docs/commands-list.md | 3 +++ .../CommandManager/GameCommands.cs | 27 +++++++++++++++++++ .../GSSystem/ObjectsSystem/FixedMap.cs | 3 ++- 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/docs/commands-list.md b/docs/commands-list.md index 88fa3fb..311c4e0 100644 --- a/docs/commands-list.md +++ b/docs/commands-list.md @@ -43,6 +43,9 @@ Switch private Tag for connect ### !powerful Makes your character with absurd amount of damage. Useful for testing. +### !resourceful +Makes your character with full resource. Useful for testing. + ### !info Get current game information. diff --git a/src/DiIiS-NA/D3-GameServer/CommandManager/GameCommands.cs b/src/DiIiS-NA/D3-GameServer/CommandManager/GameCommands.cs index 9eddce5..5c275dd 100644 --- a/src/DiIiS-NA/D3-GameServer/CommandManager/GameCommands.cs +++ b/src/DiIiS-NA/D3-GameServer/CommandManager/GameCommands.cs @@ -55,6 +55,33 @@ public class PowerfulCommand : CommandGroup } } +[CommandGroup("resourcefull", "Makes your character with full resource. Useful for testing.", + Account.UserLevels.Tester)] +public class ResourcefullCommand : CommandGroup +{ + [DefaultCommand] + public string Resourcefull(string[] @params, BattleClient invokerClient) + { + if (invokerClient?.InGameClient?.Player is not { } player) + return "You must be in game to use this command."; + + if (player.Attributes.FixedMap.Contains(FixedAttribute.Resourcefull)) + { + player.Attributes.FixedMap.Remove(FixedAttribute.Resourcefull); + player.Attributes.BroadcastChangedIfRevealed(); + return "You are no longer Resourcefull."; + } + + player.Attributes.FixedMap.Add(FixedAttribute.Resourcefull, (attributes) => + { + attributes[GameAttribute.Resource_Cur, 1] = 100; + }); + + player.Attributes.BroadcastChangedIfRevealed(); + return "You are full resource."; + } +} + [CommandGroup("info", "Get current game information.")] public class InfoCommand : CommandGroup { diff --git a/src/DiIiS-NA/D3-GameServer/GSSystem/ObjectsSystem/FixedMap.cs b/src/DiIiS-NA/D3-GameServer/GSSystem/ObjectsSystem/FixedMap.cs index 9f5724a..82ec63d 100644 --- a/src/DiIiS-NA/D3-GameServer/GSSystem/ObjectsSystem/FixedMap.cs +++ b/src/DiIiS-NA/D3-GameServer/GSSystem/ObjectsSystem/FixedMap.cs @@ -8,7 +8,8 @@ namespace DiIiS_NA.GameServer.GSSystem.ObjectsSystem { Invulnerable, Speed, - Powerful + Powerful, + Resourcefull } public class FixedMap