From 8869772fa4fd27ab5d1f0ea1ea1bd6fe66ac213c Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Wed, 13 Sep 2023 20:34:48 -0500 Subject: [PATCH] print effects command --- src/engine/devcmd/cmds/PrintEffectsCmd.java | 67 +++++++++++++++++++++ src/engine/gameManager/DevCmdManager.java | 1 + 2 files changed, 68 insertions(+) create mode 100644 src/engine/devcmd/cmds/PrintEffectsCmd.java diff --git a/src/engine/devcmd/cmds/PrintEffectsCmd.java b/src/engine/devcmd/cmds/PrintEffectsCmd.java new file mode 100644 index 00000000..89bddecb --- /dev/null +++ b/src/engine/devcmd/cmds/PrintEffectsCmd.java @@ -0,0 +1,67 @@ +// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . +// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· +// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ +// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ +// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ +// Magicbane Emulator Project © 2013 - 2022 +// www.magicbane.com + + +package engine.devcmd.cmds; + +import engine.devcmd.AbstractDevCmd; +import engine.objects.*; + +import java.util.HashMap; + +/** + * + */ + +public class PrintEffectsCmd extends AbstractDevCmd { + + public PrintEffectsCmd() { + super("printeffects"); + // super("printstats", MBServerStatics.ACCESS_LEVEL_ADMIN); + } + + public static ItemBase getWeaponBase(int slot, HashMap equip) { + if (equip.containsKey(slot)) { + MobEquipment item = equip.get(slot); + if (item != null && item.getItemBase() != null) { + return item.getItemBase(); + } + } + return null; + } + + @Override + protected void _doCmd(PlayerCharacter pc, String[] words, + AbstractGameObject target) { + + AbstractCharacter tar; + + if (target != null && target instanceof AbstractCharacter) { + tar = (AbstractCharacter) target; + + String newline = "\r\n "; + String output = "Applied Runes For Character: " + tar.getName() + newline; + + for(String effect : tar.effects.keySet()){ + output += effect + newline; + } + throwbackInfo(pc, output); + } + } + + @Override + protected String _getHelpString() { + return "Returns the player's current stats"; + } + + @Override + protected String _getUsageString() { + return "' /printstats'"; + } + +} diff --git a/src/engine/gameManager/DevCmdManager.java b/src/engine/gameManager/DevCmdManager.java index 2b66f1b7..803ad944 100644 --- a/src/engine/gameManager/DevCmdManager.java +++ b/src/engine/gameManager/DevCmdManager.java @@ -46,6 +46,7 @@ public enum DevCmdManager { DevCmdManager.registerDevCmd(new GetZoneCmd()); DevCmdManager.registerDevCmd(new ZoneSetCmd()); DevCmdManager.registerDevCmd(new PrintBankCmd()); + DevCmdManager.registerDevCmd(new PrintEffectsCmd()); DevCmdManager.registerDevCmd(new PrintEquipCmd()); DevCmdManager.registerDevCmd(new PrintInventoryCmd()); DevCmdManager.registerDevCmd(new PrintVaultCmd());