From 917b4cf0623c4a23292565257fc7620cdde3ed2e Mon Sep 17 00:00:00 2001 From: Pablito Date: Sat, 28 Jan 2023 15:09:05 -0300 Subject: [PATCH 1/2] 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 From 9e4a3a9dc36393ba247705ef4ab829727f2b9ce4 Mon Sep 17 00:00:00 2001 From: Pablito Date: Sat, 28 Jan 2023 15:21:11 -0300 Subject: [PATCH 2/2] Some missing brackets. --- src/DiIiS-NA/D3-GameServer/GSSystem/GameSystem/GSBackend.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/DiIiS-NA/D3-GameServer/GSSystem/GameSystem/GSBackend.cs b/src/DiIiS-NA/D3-GameServer/GSSystem/GameSystem/GSBackend.cs index 11f05ef..b5ad416 100644 --- a/src/DiIiS-NA/D3-GameServer/GSSystem/GameSystem/GSBackend.cs +++ b/src/DiIiS-NA/D3-GameServer/GSSystem/GameSystem/GSBackend.cs @@ -151,13 +151,13 @@ namespace DiIiS_NA.GameServer.GSSystem.GameSystem public void CheckKillMonsterCriteria(ulong gameAccountId, int actorId, int type, bool isHardcore) { Logger.MethodTrace($"gameAccountId {gameAccountId}, actorId {actorId}, type {type}, hc {isHardcore}"); - BattleNetSocketSend($"ckmc|{gameAccountId}/{actorId}/{type}/{(isHardcore ? "True" : "False")}"; + BattleNetSocketSend($"ckmc|{gameAccountId}/{actorId}/{type}/{ (isHardcore ? "True" : "False")}"); } public void CheckSalvageItemCriteria(ulong gameAccountId, int itemId) { Logger.MethodTrace($"gameAccountId {gameAccountId}, itemId {itemId}"); - BattleNetSocketSend($"csic|{gameAccountId}/{itemId}"; + BattleNetSocketSend($"csic|{gameAccountId}/{itemId}"); } public void CheckLevelCap(ulong gameAccountId)