diff --git a/src/engine/devcmd/cmds/PrintRunesCmd.java b/src/engine/devcmd/cmds/PrintRunesCmd.java new file mode 100644 index 00000000..45b19d44 --- /dev/null +++ b/src/engine/devcmd/cmds/PrintRunesCmd.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 PrintRunesCmd extends AbstractDevCmd { + + public PrintRunesCmd() { + super("printrunes"); + // 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: " + ((AbstractCharacter) target).getName() + newline; + + for(CharacterRune rune : ((AbstractCharacter)target).runes){ + output += rune.getRuneBaseID() + " " + rune.getRuneBase().getName() + 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 30bc4b2e..2b66f1b7 100644 --- a/src/engine/gameManager/DevCmdManager.java +++ b/src/engine/gameManager/DevCmdManager.java @@ -49,6 +49,7 @@ public enum DevCmdManager { DevCmdManager.registerDevCmd(new PrintEquipCmd()); DevCmdManager.registerDevCmd(new PrintInventoryCmd()); DevCmdManager.registerDevCmd(new PrintVaultCmd()); + DevCmdManager.registerDevCmd(new PrintRunesCmd()); DevCmdManager.registerDevCmd(new PrintStatsCmd()); DevCmdManager.registerDevCmd(new PrintSkillsCmd()); DevCmdManager.registerDevCmd(new PrintPowersCmd());