From e5c1dc7bcb87df94a898376b30642c85de05d5f0 Mon Sep 17 00:00:00 2001 From: kevin Date: Sat, 17 Aug 2024 07:16:35 -0400 Subject: [PATCH] Added Test Log to verify Magixbox build of custom branch. Added new test dev command. --- src/engine/devcmd/cmds/SetCampLevelCmd.java | 61 +++++++++++++++++++++ src/engine/gameManager/DevCmdManager.java | 1 + src/engine/gameManager/LootManager.java | 3 + src/engine/objects/Zone.java | 11 ++++ 4 files changed, 76 insertions(+) create mode 100644 src/engine/devcmd/cmds/SetCampLevelCmd.java diff --git a/src/engine/devcmd/cmds/SetCampLevelCmd.java b/src/engine/devcmd/cmds/SetCampLevelCmd.java new file mode 100644 index 00000000..9c0e8fe3 --- /dev/null +++ b/src/engine/devcmd/cmds/SetCampLevelCmd.java @@ -0,0 +1,61 @@ +package engine.devcmd.cmds; + +import engine.devcmd.AbstractDevCmd; +import engine.gameManager.ZoneManager; +import engine.objects.AbstractGameObject; +import engine.objects.PlayerCharacter; +import engine.objects.Zone; + +public class SetCampLevelCmd extends AbstractDevCmd { + public SetCampLevelCmd() { super("setcamplevel"); } + + @Override + protected void _doCmd(PlayerCharacter pcSender, String[] args, AbstractGameObject target) { + + if (args.length > 1) + { + this.sendUsage(pcSender); + } + + // Get the current occupied camp + Zone playerZone = ZoneManager.findSmallestZone(pcSender.loc); + + // Make sure that the zone we're targeting is valid for action + if (playerZone == null || + playerZone.zoneMobSet.isEmpty() || + playerZone.isPlayerCity()) + { + throwbackError(pcSender, "Current zone must own mobs, and NOT be a city."); + return; + } + + int targetLevel = 0; + if (args.length == 1) + { + try + { + targetLevel = Integer.parseInt(args[0]); + } + catch (NumberFormatException nfe) + { + throwbackError(pcSender, "Argument MUST be integer. Received: " + args[0]); + } + catch (Exception e) + { + throwbackError(pcSender, "Unknown command parsing provided camp level: " + args[0]); + } + } + + playerZone.setCampLvl(targetLevel); + } + + @Override + protected String _getUsageString() { + return "Sets the level of the currently occupied camp to the desired level"; + } + + @Override + protected String _getHelpString() { + return "'./setcamplevel levelNum'"; + } +} diff --git a/src/engine/gameManager/DevCmdManager.java b/src/engine/gameManager/DevCmdManager.java index 47ae6cda..3ddeb783 100644 --- a/src/engine/gameManager/DevCmdManager.java +++ b/src/engine/gameManager/DevCmdManager.java @@ -143,6 +143,7 @@ public enum DevCmdManager { DevCmdManager.registerDevCmd(new ApplyBonusCmd()); DevCmdManager.registerDevCmd(new AuditFailedItemsCmd()); DevCmdManager.registerDevCmd(new SlotTestCmd()); + DevCmdManager.registerDevCmd(new SetCampLevelCmd()); } diff --git a/src/engine/gameManager/LootManager.java b/src/engine/gameManager/LootManager.java index a569324d..35cf63a7 100644 --- a/src/engine/gameManager/LootManager.java +++ b/src/engine/gameManager/LootManager.java @@ -196,6 +196,9 @@ public enum LootManager { Logger.error("Failed to GenerateSuffix for item: " + outItem.getName()); } } + + // We don't want to bother with identifying gear + outItem.setIsID(true); return outItem; } diff --git a/src/engine/objects/Zone.java b/src/engine/objects/Zone.java index 45314553..2fbca751 100644 --- a/src/engine/objects/Zone.java +++ b/src/engine/objects/Zone.java @@ -61,6 +61,7 @@ public class Zone extends AbstractGameObject { //public static ArrayList respawnQue = new ArrayList<>(); public static final Set respawnQue = Collections.newSetFromMap(new ConcurrentHashMap<>()); public static long lastRespawn = 0; + private int campLvl = 0; /** * ResultSet Constructor */ @@ -104,6 +105,16 @@ public class Zone extends AbstractGameObject { } + public void setCampLvl(int level) + { + this.campLvl = level; + } + + public int getCamplvl() + { + return this.campLvl; + } + public static void serializeForClientMsg(Zone zone, ByteBufferWriter writer) { if (zone.loadNum == 0 && zone.playerCityID == 0)