diff --git a/src/engine/devcmd/cmds/AuditMobsCmd.java b/src/engine/devcmd/cmds/AuditMobsCmd.java deleted file mode 100644 index 42a22506..00000000 --- a/src/engine/devcmd/cmds/AuditMobsCmd.java +++ /dev/null @@ -1,105 +0,0 @@ -// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . -// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· -// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ -// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ -// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ -// Magicbane Emulator Project © 2013 - 2022 -// www.magicbane.com - - -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 AuditMobsCmd extends AbstractDevCmd { - - public AuditMobsCmd() { - super("auditmobs"); - } - - @Override - protected void _doCmd(PlayerCharacter pcSender, String[] words, - AbstractGameObject target) { - if (pcSender == null) - return; - - //get Zone to check mobs against - - Zone zone; - - if (words.length == 2) { - if (words[0].equals("all")) { - int plusplus = 0; - int count = Integer.parseInt(words[1]); - for (Zone zoneMicro : ZoneManager.getAllZones()) { - int size = zoneMicro.zoneMobSet.size(); - - if (size >= count) { - plusplus++; - throwbackInfo(pcSender, zoneMicro.zoneName + " at location " + zoneMicro.getLoc().toString() + " has " + size + " mobs. "); - System.out.println(zoneMicro.zoneName + " at location " + zoneMicro.getLoc().toString() + " has " + size + " mobs. "); - } - - - } - throwbackInfo(pcSender, " there are " + plusplus + " zones with at least " + count + " mobs in each."); - } - return; - } - if (words.length > 1) { - this.sendUsage(pcSender); - return; - } else if (words.length == 1) { - int uuid; - try { - uuid = Integer.parseInt(words[0]); - zone = ZoneManager.getZoneByUUID(uuid); - } catch (NumberFormatException e) { - zone = ZoneManager.findSmallestZone(pcSender.getLoc()); - } - } else - zone = ZoneManager.findSmallestZone(pcSender.getLoc()); - - if (zone == null) { - throwbackError(pcSender, "Unable to find the zone"); - return; - } - - //get list of mobs for zone - - if (zone.zoneMobSet.isEmpty()) { - throwbackError(pcSender, "No mobs found for this zone."); - return; - } - - // ConcurrentHashMap spawnMap = Mob.getSpawnMap(); - //ConcurrentHashMap respawnMap = Mob.getRespawnMap(); - // ConcurrentHashMap despawnMap = Mob.getDespawnMap(); - - throwbackInfo(pcSender, zone.zoneName + ", numMobs: " + zone.zoneMobSet.size()); - throwbackInfo(pcSender, "UUID, dbID, inRespawnMap, isAlive, activeAI, Loc"); - - - //mob not found in spawn map, check respawn - boolean inRespawn = false; - - - } - - - @Override - protected String _getUsageString() { - return "' /auditmobs [zone.UUID]'"; - } - - @Override - protected String _getHelpString() { - return "Audits all the mobs in a zone."; - - } - -} diff --git a/src/engine/devcmd/cmds/ChangeNameCmd.java b/src/engine/devcmd/cmds/ChangeNameCmd.java deleted file mode 100644 index e8676bdd..00000000 --- a/src/engine/devcmd/cmds/ChangeNameCmd.java +++ /dev/null @@ -1,114 +0,0 @@ -// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . -// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· -// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ -// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ -// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ -// Magicbane Emulator Project © 2013 - 2022 -// www.magicbane.com - - -package engine.devcmd.cmds; - -import engine.devcmd.AbstractDevCmd; -import engine.gameManager.DbManager; -import engine.gameManager.SessionManager; -import engine.math.Vector3fImmutable; -import engine.objects.AbstractGameObject; -import engine.objects.PlayerCharacter; -import engine.util.MiscUtils; - -public class ChangeNameCmd extends AbstractDevCmd { - - public ChangeNameCmd() { - super("changename"); - } - - @Override - protected void _doCmd(PlayerCharacter pc, String[] words, - AbstractGameObject target) { - Vector3fImmutable loc = null; - - // Arg Count Check - if (words.length < 2) { - this.sendUsage(pc); - return; - } - - String oldFirst = words[0]; - String newFirst = words[1]; - String newLast = ""; - if (words.length > 2) { - newLast = words[2]; - for (int i = 3; i < words.length; i++) - newLast += ' ' + words[i]; - } - - //verify new name length - if (newFirst.length() < 3) { - this.throwbackError(pc, "Error: First name is incorrect length. Must be between 3 and 15 characters"); - return; - } - - //verify old name length - if (newLast.length() > 50) { - this.throwbackError(pc, "Error: Last name is incorrect length. Must be no more than 50 characters"); - return; - } - - // Check if firstname is valid - if (MiscUtils.checkIfFirstNameInvalid(newFirst)) { - this.throwbackError(pc, "Error: First name is not allowed"); - return; - } - - - //get the world ID we're modifying for - - //test if first name is unique, unless new and old first name are equal. - if (!(oldFirst.equals(newFirst))) { - if (!DbManager.PlayerCharacterQueries.IS_CHARACTER_NAME_UNIQUE(newFirst)) { - this.throwbackError(pc, "Error: First name is not unique."); - return; - } - } - - //tests passed, update name in database - if (!DbManager.PlayerCharacterQueries.UPDATE_NAME(oldFirst, newFirst, newLast)) { - this.throwbackError(pc, "Error: Database failed to update the name."); - return; - } - - //Finally update player ingame - PlayerCharacter pcTar = null; - try { - pcTar = SessionManager - .getPlayerCharacterByLowerCaseName(words[0]); - pcTar.setFirstName(newFirst); - pcTar.setLastName(newLast); - this.setTarget(pcTar); //for logging - - //specify if last name is ascii characters only - String lastAscii = newLast.replaceAll("[^\\p{ASCII}]", ""); - pcTar.setAsciiLastName(lastAscii.equals(newLast)); - } catch (Exception e) { - this.throwbackError(pc, "Database was updated but ingame character failed to update."); - return; - } - - String out = oldFirst + " was changed to " + newFirst + (newLast.isEmpty() ? "." : (' ' + newLast + '.')); - this.throwbackInfo(pc, out); - - - } - - @Override - protected String _getHelpString() { - return "Changes the name of a player"; - } - - @Override - protected String _getUsageString() { - return "'./changename oldFirstName newFirstName newLastName'"; - } - -} diff --git a/src/engine/devcmd/cmds/CombatMessageCmd.java b/src/engine/devcmd/cmds/CombatMessageCmd.java deleted file mode 100644 index 6f1254d5..00000000 --- a/src/engine/devcmd/cmds/CombatMessageCmd.java +++ /dev/null @@ -1,56 +0,0 @@ -// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . -// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· -// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ -// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ -// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ -// Magicbane Emulator Project © 2013 - 2022 -// www.magicbane.com - - -package engine.devcmd.cmds; - -import engine.devcmd.AbstractDevCmd; -import engine.net.client.msg.TargetedActionMsg; -import engine.objects.AbstractGameObject; -import engine.objects.PlayerCharacter; - -/** - * @author Eighty - */ -public class CombatMessageCmd extends AbstractDevCmd { - - public CombatMessageCmd() { - super("cm"); - } - - @Override - protected void _doCmd(PlayerCharacter pcSender, String[] args, - AbstractGameObject target) { - if (pcSender == null) - return; - if (args.length != 1) { - this.sendUsage(pcSender); - return; - } - int num = 0; - try { - num = Integer.parseInt(args[0]); - } catch (NumberFormatException e) { - throwbackError(pcSender, "Supplied message number " + args[0] + " failed to parse to an Integer"); - return; - } - TargetedActionMsg.un2cnt = num; - throwbackInfo(pcSender, "CombatMessage set to " + num); - } - - @Override - protected String _getUsageString() { - return "' /cm [cmNumber]'"; - } - - @Override - protected String _getHelpString() { - return "Sets the combat message to the supplied integer value"; - } - -} diff --git a/src/engine/devcmd/cmds/DebugCmd.java b/src/engine/devcmd/cmds/DebugCmd.java deleted file mode 100644 index ef1111c2..00000000 --- a/src/engine/devcmd/cmds/DebugCmd.java +++ /dev/null @@ -1,122 +0,0 @@ -// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . -// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· -// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ -// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ -// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ -// Magicbane Emulator Project © 2013 - 2022 -// www.magicbane.com - - -package engine.devcmd.cmds; - -import engine.devcmd.AbstractDevCmd; -import engine.jobs.DebugTimerJob; -import engine.objects.AbstractGameObject; -import engine.objects.PlayerCharacter; - -public class DebugCmd extends AbstractDevCmd { - - - public DebugCmd() { - super("debug"); - // super("debug", MBServerStatics.ACCESS_GROUP_ALL_TEAM, 0, false, false); - } - - private static void toggleDebugTimer(PlayerCharacter pc, String name, int num, int duration, boolean toggle) { - if (toggle) { - DebugTimerJob dtj = new DebugTimerJob(pc, name, num, duration); - pc.renewTimer(name, dtj, duration); - } else - pc.cancelTimer(name); - } - - @Override - protected void _doCmd(PlayerCharacter pc, String[] words, - AbstractGameObject target) { - if (words.length < 2) { - this.sendUsage(pc); - return; - } - - if (pc == null) - return; - - //pc.setDebug must use bit sizes: 1, 2, 4, 8, 16, 32 - - String command = words[0].toLowerCase(); - boolean toggle = (words[1].toLowerCase().equals("on")) ? true : false; - - switch (command) { - case "magictrek": - pc.RUN_MAGICTREK = toggle; - - break; - case "combat": - pc.setDebug(64, toggle); - - break; - case "health": - toggleDebugTimer(pc, "Debug_Health", 1, 1000, toggle); - - break; - case "mana": - toggleDebugTimer(pc, "Debug_Mana", 2, 1000, toggle); - - break; - case "stamina": - toggleDebugTimer(pc, "Debug_Stamina", 3, 500, toggle); - - break; - case "spells": - pc.setDebug(16, toggle); - - break; - case "damageabsorber": - pc.setDebug(2, toggle); - - break; - case "recast": - case "recycle": - pc.setDebug(4, toggle); - - break; - case "seeinvis": - pc.setDebug(8, toggle); - - break; - case "movement": - pc.setDebug(1, toggle); - - break; - case "noaggro": - pc.setDebug(32, toggle); - - break; - // case "loot": - // MBServerStatics.debugLoot = toggle; - // break; - - default: - String output = "Debug for " + command + " not found."; - throwbackError(pc, output); - return; - } - - - setTarget(pc); //for logging - - String output = "Debug for " + command + " turned " + ((toggle) ? "on." : "off."); - throwbackInfo(pc, output); - } - - @Override - protected String _getHelpString() { - return "Runs debug commands"; - - } - - @Override - protected String _getUsageString() { - return "'./Debug command on/off'"; - } -} diff --git a/src/engine/devcmd/cmds/DebugMeleeSyncCmd.java b/src/engine/devcmd/cmds/DebugMeleeSyncCmd.java deleted file mode 100644 index ff97a168..00000000 --- a/src/engine/devcmd/cmds/DebugMeleeSyncCmd.java +++ /dev/null @@ -1,57 +0,0 @@ -// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . -// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· -// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ -// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ -// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ -// Magicbane Emulator Project © 2013 - 2022 -// www.magicbane.com - - -package engine.devcmd.cmds; - -import engine.devcmd.AbstractDevCmd; -import engine.gameManager.ChatManager; -import engine.objects.AbstractGameObject; -import engine.objects.PlayerCharacter; - -public class DebugMeleeSyncCmd extends AbstractDevCmd { - - public DebugMeleeSyncCmd() { - super("debugmeleesync"); - } - - @Override - protected void _doCmd(PlayerCharacter pc, String[] words, - AbstractGameObject target) { - // Arg Count Check - if (words.length != 1) { - this.sendUsage(pc); - return; - } - - String s = words[0].toLowerCase(); - - if (s.equals("on")) { - pc.setDebug(64, true); - ChatManager.chatSayInfo(pc, "Melee Sync Debug ON"); - } else if (s.equals("off")) { - pc.setDebug(64, false); - ChatManager.chatSayInfo(pc, "Melee Sync Debug OFF"); - } else { - this.sendUsage(pc); - } - } - - @Override - protected String _getHelpString() { - return "Turns on/off melee sync debugging."; - - } - - @Override - protected String _getUsageString() { - return "'./debugmeleesync on|off'"; - - } - -} diff --git a/src/engine/devcmd/cmds/DecachePlayerCmd.java b/src/engine/devcmd/cmds/DecachePlayerCmd.java deleted file mode 100644 index d4e006e2..00000000 --- a/src/engine/devcmd/cmds/DecachePlayerCmd.java +++ /dev/null @@ -1,54 +0,0 @@ -// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . -// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· -// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ -// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ -// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ -// Magicbane Emulator Project © 2013 - 2022 -// www.magicbane.com - - -package engine.devcmd.cmds; - -import engine.Enum; -import engine.devcmd.AbstractDevCmd; -import engine.gameManager.DbManager; -import engine.objects.AbstractGameObject; -import engine.objects.PlayerCharacter; - -/** - * - */ -public class DecachePlayerCmd extends AbstractDevCmd { - - public DecachePlayerCmd() { - super("decacheplayer"); - } - - @Override - protected void _doCmd(PlayerCharacter pc, String[] words, - AbstractGameObject target) { - if (words.length < 1) { - this.sendUsage(pc); - } - - int objectUUID = Integer.parseInt(words[0]); - - if (DbManager.inCache(Enum.GameObjectType.PlayerCharacter, objectUUID)) { - this.setTarget(PlayerCharacter.getFromCache(objectUUID)); //for logging - PlayerCharacter.getFromCache(objectUUID).removeFromCache(); - } else { - this.sendHelp(pc); - } - } - - @Override - protected String _getHelpString() { - return "No player found. Please make sure the table ID is correct."; - } - - @Override - protected String _getUsageString() { - return "' /decacheplayer '"; - } - -} diff --git a/src/engine/devcmd/cmds/DespawnCmd.java b/src/engine/devcmd/cmds/DespawnCmd.java deleted file mode 100644 index 02f7ce98..00000000 --- a/src/engine/devcmd/cmds/DespawnCmd.java +++ /dev/null @@ -1,66 +0,0 @@ -// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . -// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· -// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ -// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ -// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ -// Magicbane Emulator Project © 2013 - 2022 -// www.magicbane.com - - -package engine.devcmd.cmds; - -import engine.Enum.GameObjectType; -import engine.devcmd.AbstractDevCmd; -import engine.objects.AbstractGameObject; -import engine.objects.Mob; -import engine.objects.PlayerCharacter; - -public class DespawnCmd extends AbstractDevCmd { - - public DespawnCmd() { - super("debugmob"); - } - - @Override - protected void _doCmd(PlayerCharacter pc, String[] words, - AbstractGameObject target) { - - - if (pc == null) { - return; - } - - - Mob mob = null; - - if (target != null && target.getObjectType().equals(GameObjectType.Mob)) - mob = (Mob) target; - - if (mob == null) - mob = Mob.getFromCache(Integer.parseInt(words[1])); - - if (mob == null) - return; - - if (words[0].equalsIgnoreCase("respawn")) { - mob.respawn(); - this.throwbackInfo(pc, "Mob with ID " + mob.getObjectUUID() + " Respawned"); - } else if (words[0].equalsIgnoreCase("despawn")) { - mob.despawn(); - this.throwbackInfo(pc, "Mob with ID " + mob.getObjectUUID() + " Despawned"); - } - } - - @Override - protected String _getHelpString() { - return "Gets distance from a target."; - - } - - @Override - protected String _getUsageString() { - return "' /distance'"; - - } - -} diff --git a/src/engine/devcmd/cmds/DistanceCmd.java b/src/engine/devcmd/cmds/DistanceCmd.java deleted file mode 100644 index 81e02c3f..00000000 --- a/src/engine/devcmd/cmds/DistanceCmd.java +++ /dev/null @@ -1,65 +0,0 @@ -// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . -// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· -// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ -// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ -// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ -// Magicbane Emulator Project © 2013 - 2022 -// www.magicbane.com - - -package engine.devcmd.cmds; - -import engine.devcmd.AbstractDevCmd; -import engine.math.Vector3fImmutable; -import engine.objects.AbstractGameObject; -import engine.objects.AbstractWorldObject; -import engine.objects.PlayerCharacter; - -public class DistanceCmd extends AbstractDevCmd { - - public DistanceCmd() { - super("distance"); - } - - @Override - protected void _doCmd(PlayerCharacter pc, String[] words, - AbstractGameObject target) { - - - // Arg Count Check - if (words.length != 1) { - this.sendUsage(pc); - return; - } - if (pc == null) { - return; - } - - if (target == null || !(target instanceof AbstractWorldObject)) { - throwbackError(pc, "No target found."); - return; - } - - AbstractWorldObject awoTarget = (AbstractWorldObject) target; - - Vector3fImmutable pcLoc = pc.getLoc(); - Vector3fImmutable tarLoc = awoTarget.getLoc(); - String out = "Distance: " + pcLoc.distance(tarLoc) + - "\r\nYour Loc: " + pcLoc.x + 'x' + pcLoc.y + 'x' + pcLoc.z + - "\r\nTarget Loc: " + tarLoc.x + 'x' + tarLoc.y + 'x' + tarLoc.z; - throwbackInfo(pc, out); - } - - @Override - protected String _getHelpString() { - return "Gets distance from a target."; - - } - - @Override - protected String _getUsageString() { - return "' /distance'"; - - } - -} diff --git a/src/engine/devcmd/cmds/EffectCmd.java b/src/engine/devcmd/cmds/EffectCmd.java deleted file mode 100644 index 8ad9ca8d..00000000 --- a/src/engine/devcmd/cmds/EffectCmd.java +++ /dev/null @@ -1,61 +0,0 @@ -// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . -// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· -// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ -// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ -// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ -// Magicbane Emulator Project © 2013 - 2022 -// www.magicbane.com - - -package engine.devcmd.cmds; - -import engine.devcmd.AbstractDevCmd; -import engine.gameManager.ChatManager; -import engine.gameManager.PowersManager; -import engine.objects.AbstractGameObject; -import engine.objects.PlayerCharacter; -import engine.powers.EffectsBase; - -/** - * @author Eighty - */ -public class EffectCmd extends AbstractDevCmd { - - public EffectCmd() { - super("effect"); - } - - @Override - protected void _doCmd(PlayerCharacter pcSender, String[] args, - AbstractGameObject target) { - int ID = 0; - int token = 0; - - if (args.length != 2) { - this.sendUsage(pcSender); - return; - } - ID = Integer.parseInt(args[0]); - token = Integer.parseInt(args[1]); - - EffectsBase eb = PowersManager.setEffectToken(ID, token); - if (eb == null) { - throwbackError(pcSender, "Unable to find EffectsBase " + ID - + " to modify."); - return; - } - ChatManager.chatSayInfo(pcSender, - "EffectsBase with ID " + ID + " changed token to " + token); - } - - @Override - protected String _getUsageString() { - return "' /effect EffectsBaseID Token'"; - } - - @Override - protected String _getHelpString() { - return "Temporarily places the effect token with the corresponding EffectsBase on the server"; - } - -} diff --git a/src/engine/devcmd/cmds/GateInfoCmd.java b/src/engine/devcmd/cmds/GateInfoCmd.java deleted file mode 100644 index 700f2928..00000000 --- a/src/engine/devcmd/cmds/GateInfoCmd.java +++ /dev/null @@ -1,84 +0,0 @@ -package engine.devcmd.cmds; - -import engine.Enum.BuildingGroup; -import engine.Enum.GameObjectType; -import engine.devcmd.AbstractDevCmd; -import engine.math.Vector3fImmutable; -import engine.objects.*; - -public class GateInfoCmd extends AbstractDevCmd { - - public GateInfoCmd() { - super("gateinfo"); - } - - // AbstractDevCmd Overridden methods - - @Override - protected void _doCmd(PlayerCharacter player, String[] args, - AbstractGameObject target) { - - Building targetBuilding; - String outString; - Runegate runeGate; - Blueprint blueprint; - String newline = "\r\n "; - targetBuilding = (Building) target; - - if (targetBuilding.getObjectType() != GameObjectType.Building) { - throwbackInfo(player, "GateInfo: target must be a Building"); - throwbackInfo(player, "Found" + targetBuilding.getObjectType().toString()); - return; - } - - blueprint = Blueprint._meshLookup.get(targetBuilding.getMeshUUID()); - - if (blueprint == null || - (blueprint.getBuildingGroup() != BuildingGroup.RUNEGATE)) { - throwbackInfo(player, "showgate: target must be a Runegate"); - return; - } - - - runeGate = Runegate._runegates.get(targetBuilding.getObjectUUID()); - - outString = "RungateType: " + runeGate.gateBuilding.getName(); - outString += newline; - - outString += "Portal State:"; - outString += newline; - - for (Portal portal : runeGate.getPortals()) { - - outString += "Portal: " + portal.portalType.name(); - outString += " Active: " + portal.isActive(); - outString += " Dest: " + portal.targetGate.getName(); - outString += newline; - outString += " Origin: " + portal.getPortalLocation().x + 'x'; - outString += " " + portal.getPortalLocation().y + 'y'; - outString += newline; - - Vector3fImmutable offset = portal.getPortalLocation().subtract(targetBuilding.getLoc()); - outString += " Offset: " + offset.x + "x " + offset.z + 'y'; - outString += newline; - outString += newline; - - } - outString += newline; - throwbackInfo(player, outString); - } - - @Override - protected String _getHelpString() { - return "Displays a runegate's gate status"; - } - - @Override - protected String _getUsageString() { - - - return "/gateinfo \n"; - } - - -} diff --git a/src/engine/devcmd/cmds/GetBankCmd.java b/src/engine/devcmd/cmds/GetBankCmd.java deleted file mode 100644 index 65e4c466..00000000 --- a/src/engine/devcmd/cmds/GetBankCmd.java +++ /dev/null @@ -1,52 +0,0 @@ -// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . -// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· -// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ -// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ -// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ -// Magicbane Emulator Project © 2013 - 2022 -// www.magicbane.com - - -package engine.devcmd.cmds; - -import engine.devcmd.AbstractDevCmd; -import engine.gameManager.SessionManager; -import engine.net.client.ClientConnection; -import engine.net.client.msg.VendorDialogMsg; -import engine.objects.AbstractGameObject; -import engine.objects.PlayerCharacter; - -/** - * @author Eighty - */ -public class GetBankCmd extends AbstractDevCmd { - - public GetBankCmd() { - super("getbank"); - } - - @Override - protected void _doCmd(PlayerCharacter pcSender, String[] args, - AbstractGameObject target) { - if (pcSender == null) - return; - - ClientConnection cc = SessionManager.getClientConnection(pcSender); - if (cc == null) - return; - - VendorDialogMsg.getBank(pcSender, null, cc); - this.setTarget(pcSender); //for logging - } - - @Override - protected String _getUsageString() { - return "' /getbank'"; - } - - @Override - protected String _getHelpString() { - return "Opens bank window"; - } - -} diff --git a/src/engine/devcmd/cmds/GetCacheCountCmd.java b/src/engine/devcmd/cmds/GetCacheCountCmd.java deleted file mode 100644 index eaea4c14..00000000 --- a/src/engine/devcmd/cmds/GetCacheCountCmd.java +++ /dev/null @@ -1,40 +0,0 @@ -// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . -// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· -// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ -// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ -// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ -// Magicbane Emulator Project © 2013 - 2022 -// www.magicbane.com - - -package engine.devcmd.cmds; - -import engine.devcmd.AbstractDevCmd; -import engine.gameManager.DbManager; -import engine.objects.AbstractGameObject; -import engine.objects.PlayerCharacter; - -public class GetCacheCountCmd extends AbstractDevCmd { - - public GetCacheCountCmd() { - super("getcachecount"); - this.addCmdString("getcachecount"); - } - - @Override - protected void _doCmd(PlayerCharacter pcSender, String[] args, - AbstractGameObject target) { - DbManager.printCacheCount(pcSender); - } - - @Override - protected String _getUsageString() { - return "' /getcachecount'"; - } - - @Override - protected String _getHelpString() { - return "Get a count of the objects in the cache"; - } - -} diff --git a/src/engine/devcmd/cmds/GetMemoryCmd.java b/src/engine/devcmd/cmds/GetMemoryCmd.java deleted file mode 100644 index 795c19b7..00000000 --- a/src/engine/devcmd/cmds/GetMemoryCmd.java +++ /dev/null @@ -1,58 +0,0 @@ -// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . -// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· -// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ -// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ -// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ -// Magicbane Emulator Project © 2013 - 2022 -// www.magicbane.com - - -package engine.devcmd.cmds; - -import engine.devcmd.AbstractDevCmd; -import engine.objects.AbstractGameObject; -import engine.objects.PlayerCharacter; - -public class GetMemoryCmd extends AbstractDevCmd { - - public GetMemoryCmd() { - super("getmemory"); - } - - public static String getMemoryOutput(long memory) { - String out = ""; - if (memory > 1073741824) - return (memory / 1073741824) + "GB"; - else if (memory > 1048576) - return (memory / 1048576) + "MB"; - else if (memory > 1024) - return (memory / 1048576) + "KB"; - else - return memory + "B"; - } - - @Override - protected void _doCmd(PlayerCharacter pcSender, String[] words, - AbstractGameObject target) { - if (pcSender == null) - return; - - String hSize = getMemoryOutput(Runtime.getRuntime().totalMemory()); - String mhSize = getMemoryOutput(Runtime.getRuntime().maxMemory()); - String fhSize = getMemoryOutput(Runtime.getRuntime().freeMemory()); - - String out = "Heap Size: " + hSize + ", Max Heap Size: " + mhSize + ", Free Heap Size: " + fhSize; - throwbackInfo(pcSender, out); - } - - @Override - protected String _getUsageString() { - return "' /getmemory'"; - } - - @Override - protected String _getHelpString() { - return "lists memory usage"; - } - -} diff --git a/src/engine/devcmd/cmds/GetRuneDropRateCmd.java b/src/engine/devcmd/cmds/GetRuneDropRateCmd.java deleted file mode 100644 index 300fe6df..00000000 --- a/src/engine/devcmd/cmds/GetRuneDropRateCmd.java +++ /dev/null @@ -1,43 +0,0 @@ -// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . -// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· -// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ -// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ -// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ -// Magicbane Emulator Project © 2013 - 2022 -// www.magicbane.com - - -package engine.devcmd.cmds; - -import engine.devcmd.AbstractDevCmd; -import engine.objects.AbstractGameObject; -import engine.objects.PlayerCharacter; - - -public class GetRuneDropRateCmd extends AbstractDevCmd { - - public GetRuneDropRateCmd() { - super("getrunedroprate"); - } - - @Override - protected void _doCmd(PlayerCharacter pcSender, String[] words, - AbstractGameObject target) { - if (pcSender == null) - return; - - String out = "Depracated"; - throwbackInfo(pcSender, out); - } - - @Override - protected String _getUsageString() { - return "' /getrunedroprate'"; - } - - @Override - protected String _getHelpString() { - return "lists drop rates for runes and contracts in non-hotzone."; - } - -} diff --git a/src/engine/devcmd/cmds/GetZoneCmd.java b/src/engine/devcmd/cmds/GetZoneCmd.java deleted file mode 100644 index 857a3a47..00000000 --- a/src/engine/devcmd/cmds/GetZoneCmd.java +++ /dev/null @@ -1,67 +0,0 @@ -// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . -// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· -// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ -// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ -// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ -// Magicbane Emulator Project © 2013 - 2022 -// www.magicbane.com - - -package engine.devcmd.cmds; - -import engine.devcmd.AbstractDevCmd; -import engine.gameManager.ZoneManager; -import engine.objects.AbstractGameObject; -import engine.objects.PlayerCharacter; -import engine.objects.Zone; - -import java.util.ArrayList; - -public class GetZoneCmd extends AbstractDevCmd { - - public GetZoneCmd() { - super("getzone"); - } - - @Override - protected void _doCmd(PlayerCharacter pcSender, String[] words, - AbstractGameObject target) { - if (pcSender == null) - return; - - if (words.length != 1) { - this.sendUsage(pcSender); - return; - } - - ArrayList allIn = new ArrayList<>(); - switch (words[0].toLowerCase()) { - case "all": - throwbackInfo(pcSender, "All zones currently in"); - allIn = ZoneManager.getAllZonesIn(pcSender.getLoc()); - break; - case "smallest": - throwbackInfo(pcSender, "Smallest zone currently in"); - Zone zone = ZoneManager.findSmallestZone(pcSender.getLoc()); - allIn.add(zone); - break; - default: - this.sendUsage(pcSender); - return; - } - - for (Zone zone : allIn) - throwbackInfo(pcSender, zone.zoneName + "; UUID: " + zone.getObjectUUID() + ", loadNum: " + zone.templateID); - } - - @Override - protected String _getUsageString() { - return "' /getzone smallest/all'"; - } - - @Override - protected String _getHelpString() { - return "lists what zones a player is in"; - } - -} diff --git a/src/engine/devcmd/cmds/GotoBoundsCmd.java b/src/engine/devcmd/cmds/GotoBoundsCmd.java deleted file mode 100644 index 67004d26..00000000 --- a/src/engine/devcmd/cmds/GotoBoundsCmd.java +++ /dev/null @@ -1,107 +0,0 @@ -// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . -// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· -// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ -// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ -// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ -// Magicbane Emulator Project © 2013 - 2022 -// www.magicbane.com - - -package engine.devcmd.cmds; - -import engine.Enum.GameObjectType; -import engine.devcmd.AbstractDevCmd; -import engine.math.Vector3fImmutable; -import engine.objects.AbstractGameObject; -import engine.objects.Building; -import engine.objects.PlayerCharacter; - -public class GotoBoundsCmd extends AbstractDevCmd { - - public GotoBoundsCmd() { - super("gotobounds"); - } - - @Override - protected void _doCmd(PlayerCharacter player, String[] words, - AbstractGameObject target) { - - String corner = words[0]; - Vector3fImmutable targetLoc = Vector3fImmutable.ZERO; - - if (target == null || !target.getObjectType().equals(GameObjectType.Building)) { - this.throwbackError(player, "No Building Selected"); - return; - } - - Building building = (Building) target; - - if (building.getBounds() == null) { - this.throwbackInfo(player, "No valid Bounds for building UUID " + building.getObjectUUID()); - return; - } - float x = building.getBounds().getHalfExtents().x; - float z = building.getBounds().getHalfExtents().y; - - if (building.getBlueprint() != null) { - x = building.getBlueprint().getExtents().x; - z = building.getBlueprint().getExtents().y; - } - - float topLeftX = building.getLoc().x - x; - float topLeftY = building.getLoc().z - z; - - float topRightX = building.getLoc().x + x; - float topRightY = building.getLoc().z - z; - - float bottomLeftX = building.getLoc().x - x; - float bottomLeftY = building.getLoc().z + z; - - float bottomRightX = building.getLoc().x + x; - float bottomRightY = building.getLoc().z + z; - - - switch (corner) { - case "topleft": - targetLoc = new Vector3fImmutable(topLeftX, 0, topLeftY); - break; - case "topright": - targetLoc = new Vector3fImmutable(topRightX, 0, topRightY); - break; - case "bottomleft": - targetLoc = new Vector3fImmutable(bottomLeftX, 0, bottomLeftY); - break; - case "bottomright": - targetLoc = new Vector3fImmutable(bottomRightX, 0, bottomRightY); - break; - default: - this.throwbackInfo(player, "wrong corner name. use topleft , topright , bottomleft , bottomright"); - return; - - } - - targetLoc = Vector3fImmutable.transform(building.getLoc(), targetLoc, building.getBounds().getRotationDegrees()); - - // Teleport player - - if (targetLoc == Vector3fImmutable.ZERO) { - this.throwbackError(player, "Failed to locate UUID"); - return; - } - - player.teleport(targetLoc); - - } - - @Override - protected String _getHelpString() { - return "Teleports player to a UUID"; - } - - @Override - protected String _getUsageString() { - return "' /gotoobj '"; - - } - -} diff --git a/src/engine/devcmd/cmds/ItemInfoCmd.java b/src/engine/devcmd/cmds/ItemInfoCmd.java deleted file mode 100644 index 2332e9c3..00000000 --- a/src/engine/devcmd/cmds/ItemInfoCmd.java +++ /dev/null @@ -1,72 +0,0 @@ -// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . -// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· -// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ -// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ -// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ -// Magicbane Emulator Project © 2013 - 2022 -// www.magicbane.com - - -package engine.devcmd.cmds; - -import engine.Enum; -import engine.Enum.GameObjectType; -import engine.devcmd.AbstractDevCmd; -import engine.objects.AbstractGameObject; -import engine.objects.Item; -import engine.objects.PlayerCharacter; - - -/** - * @author - */ -public class ItemInfoCmd extends AbstractDevCmd { - - public ItemInfoCmd() { - super("iteminfo"); - } - - @Override - protected void _doCmd(PlayerCharacter pc, String[] words,AbstractGameObject target) { - if (pc == null) { - return; - } - if(target.getObjectType().equals(GameObjectType.Item) == false){ - throwbackInfo(pc, "Must Select An Item"); - return; - } - Item item = (Item)target; - String newline = "\r\n "; - String output = ""; - output += "Required Races:" + newline; - for (Enum.MonsterType required : item.template.item_race_req) - output += " " + required.name() + newline; - output += "Restricted Races:" + newline; - for (Enum.MonsterType required : item.template.item_race_res) - output += " " + required.name() + newline; - output += "Required Classes:" + newline; - for (Enum.ClassType required : item.template.item_class_req) - output += " " + required.name() + newline; - output += "Restricted Classes:" + newline; - for (Enum.ClassType required : item.template.item_class_res) - output += " " + required.name() + newline; - output += "Required Disciplines:" + newline; - for (Enum.DisciplineType required : item.template.item_disc_req) - output += " " + required.name() + newline; - output += "Restricted Disciplines:" + newline; - for (Enum.DisciplineType required : item.template.item_disc_res) - output += " " + required.name() + newline; - throwbackInfo(pc, output); - } - - @Override - protected String _getHelpString() { - return "Gets information on an Object."; - } - - @Override - protected String _getUsageString() { - return "' /iteminfo'"; - } - -} diff --git a/src/engine/devcmd/cmds/ResetLevelCmd.java b/src/engine/devcmd/cmds/ResetLevelCmd.java deleted file mode 100644 index aa6d1ef2..00000000 --- a/src/engine/devcmd/cmds/ResetLevelCmd.java +++ /dev/null @@ -1,35 +0,0 @@ -package engine.devcmd.cmds; - -import engine.devcmd.AbstractDevCmd; -import engine.objects.AbstractGameObject; -import engine.objects.PlayerCharacter; - -public class ResetLevelCmd extends AbstractDevCmd { - - public ResetLevelCmd() { - super("resetlevel"); - } - - // AbstractDevCmd Overridden methods - - @Override - protected void _doCmd(PlayerCharacter player, String[] args, - AbstractGameObject target) { - - player.ResetLevel(Short.parseShort(args[0])); - } - - @Override - protected String _getHelpString() { - return "Resets character level to `level`. All training points are reset. Player must relog for changes to update."; - } - - @Override - protected String _getUsageString() { - - - return "/resetlevel "; - } - - -} diff --git a/src/engine/devcmd/cmds/SetMaintCmd.java b/src/engine/devcmd/cmds/SetMaintCmd.java deleted file mode 100644 index 85346322..00000000 --- a/src/engine/devcmd/cmds/SetMaintCmd.java +++ /dev/null @@ -1,60 +0,0 @@ -// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . -// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· -// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ -// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ -// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ -// Magicbane Emulator Project © 2013 - 2022 -// www.magicbane.com - - -package engine.devcmd.cmds; - -import engine.Enum; -import engine.devcmd.AbstractDevCmd; -import engine.gameManager.ChatManager; -import engine.gameManager.MaintenanceManager; -import engine.objects.AbstractGameObject; -import engine.objects.Building; -import engine.objects.PlayerCharacter; - -import java.time.LocalDateTime; - -public class SetMaintCmd extends AbstractDevCmd { - - public SetMaintCmd() { - super("setMaint"); - this.addCmdString("setmaint"); - } - - @Override - protected void _doCmd(PlayerCharacter player, String[] words, - AbstractGameObject target) { - - if (!target.getObjectType().equals(Enum.GameObjectType.Building)) { - ChatManager.chatSayInfo(player, "Target is not a valid building"); - return; - } - - Building targetBuilding = (Building) target; - - if (targetBuilding.getProtectionState().equals(Enum.ProtectionState.NPC)) { - ChatManager.chatSayInfo(player, "Target is not a valid building"); - return; - } - - MaintenanceManager.setMaintDateTime(targetBuilding, LocalDateTime.now().minusDays(1).withHour(13).withMinute(0).withSecond(0).withNano(0)); - ChatManager.chatSayInfo(player, "Maint will run for UUID: " + targetBuilding.getObjectUUID()); - } - - - @Override - protected String _getHelpString() { - return "Sets the Rank of either the targets object or the object specified by ID."; - } - - @Override - protected String _getUsageString() { - return "' /setrank ID rank' || ' /setrank rank' || ' /rank ID rank' || ' /rank rank'"; - } - -} diff --git a/src/engine/devcmd/cmds/SetMineExpansion.java b/src/engine/devcmd/cmds/SetMineExpansion.java deleted file mode 100644 index 192329d5..00000000 --- a/src/engine/devcmd/cmds/SetMineExpansion.java +++ /dev/null @@ -1,80 +0,0 @@ -// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . -// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· -// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ -// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ -// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ -// Magicbane Emulator Project © 2013 - 2022 -// www.magicbane.com - - -package engine.devcmd.cmds; - - -import engine.Enum.GameObjectType; -import engine.devcmd.AbstractDevCmd; -import engine.gameManager.BuildingManager; -import engine.gameManager.ChatManager; -import engine.gameManager.DbManager; -import engine.objects.AbstractGameObject; -import engine.objects.Building; -import engine.objects.Mine; -import engine.objects.PlayerCharacter; - -/** - * @author Eighty - */ -public class SetMineExpansion extends AbstractDevCmd { - - public SetMineExpansion() { - super("setexpansion"); - this.addCmdString("setexpansion"); - } - - @Override - protected void _doCmd(PlayerCharacter pcSender, String[] args, - AbstractGameObject target) { - - - if (target.getObjectType() != GameObjectType.Building) - return; - Building mineBuilding = BuildingManager.getBuilding(target.getObjectUUID()); - if (mineBuilding == null) - return; - Mine mine = Mine.getMineFromTower(mineBuilding.getObjectUUID()); - if (mine == null) - return; - int bit = 2; - switch (args[0].toUpperCase()) { - case "ON": - - bit |= mine.getFlags(); - if (!DbManager.MineQueries.SET_FLAGS(mine, bit)) - return; - mine.setFlags(bit); - ChatManager.chatSystemInfo(pcSender, mine.getZoneName() + "'s " + mine.getMineType().name + " is now an expansion mine."); - break; - - case "OFF": - bit &= ~mine.getFlags(); - if (!DbManager.MineQueries.SET_FLAGS(mine, bit)) - return; - mine.setFlags(bit); - ChatManager.chatSystemInfo(pcSender, mine.getZoneName() + "'s " + mine.getMineType().name + " is no longer an expansion mine."); - break; - - } - - - } - - @Override - protected String _getUsageString() { - return "' /setmineexpansion on|off"; - } - - @Override - protected String _getHelpString() { - return "enables or disables an expansion type for a mine."; - } - -} diff --git a/src/engine/devcmd/cmds/SetMineTypeCmd.java b/src/engine/devcmd/cmds/SetMineTypeCmd.java deleted file mode 100644 index a469fe07..00000000 --- a/src/engine/devcmd/cmds/SetMineTypeCmd.java +++ /dev/null @@ -1,62 +0,0 @@ -// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . -// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· -// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ -// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ -// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ -// Magicbane Emulator Project © 2013 - 2022 -// www.magicbane.com - - -package engine.devcmd.cmds; - - -import engine.Enum.GameObjectType; -import engine.devcmd.AbstractDevCmd; -import engine.gameManager.BuildingManager; -import engine.gameManager.ChatManager; -import engine.gameManager.DbManager; -import engine.objects.*; - -/** - * @author Eighty - */ -public class SetMineTypeCmd extends AbstractDevCmd { - - public SetMineTypeCmd() { - super("setminetype"); - this.addCmdString("setminetype"); - } - - @Override - protected void _doCmd(PlayerCharacter pcSender, String[] args, - AbstractGameObject target) { - - MineProduction mineType = MineProduction.valueOf(args[0].toUpperCase()); - if (mineType == null) - return; - - if (target.getObjectType() != GameObjectType.Building) - return; - Building mineBuilding = BuildingManager.getBuilding(target.getObjectUUID()); - if (mineBuilding == null) - return; - Mine mine = Mine.getMineFromTower(mineBuilding.getObjectUUID()); - if (mine == null) - return; - if (!DbManager.MineQueries.CHANGE_TYPE(mine, mineType)) - return; - mine.setMineType(mineType.name()); - ChatManager.chatSystemInfo(pcSender, "The mine in " + mine.getZoneName() + " is now a(n) " + mine.getMineType().name); - } - - @Override - protected String _getUsageString() { - return "' /setminetype gold|ore|magic|lumber"; - } - - @Override - protected String _getHelpString() { - return "Changes the mine type of the current mine."; - } - -} diff --git a/src/engine/devcmd/cmds/SetNpcMobbaseCmd.java b/src/engine/devcmd/cmds/SetNpcMobbaseCmd.java deleted file mode 100644 index 4b5c708f..00000000 --- a/src/engine/devcmd/cmds/SetNpcMobbaseCmd.java +++ /dev/null @@ -1,66 +0,0 @@ -// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . -// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· -// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ -// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ -// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ -// Magicbane Emulator Project © 2013 - 2022 -// www.magicbane.com - - -package engine.devcmd.cmds; - -import engine.Enum.GameObjectType; -import engine.InterestManagement.WorldGrid; -import engine.devcmd.AbstractDevCmd; -import engine.objects.AbstractGameObject; -import engine.objects.MobBase; -import engine.objects.NPC; -import engine.objects.PlayerCharacter; - -public class SetNpcMobbaseCmd extends AbstractDevCmd { - - public SetNpcMobbaseCmd() { - super("setmobbase"); - this.addCmdString("npcmobbase"); - } - - @Override - protected void _doCmd(PlayerCharacter player, String[] words, - AbstractGameObject target) { - - // Arg Count Check - if (words.length != 1) { - this.sendUsage(player); - return; - } - - if (target.getObjectType() != GameObjectType.NPC) { - this.sendUsage(player); - return; - } - - NPC npc = (NPC) target; - - int mobBaseID = Integer.parseInt(words[0]); - - if (MobBase.getMobBase(mobBaseID) == null) { - this.throwbackError(player, "Cannot find Mobbase for ID " + mobBaseID); - return; - } - NPC.UpdateRaceID(npc, mobBaseID); - - WorldGrid.updateObject(npc); - - } - - @Override - protected String _getHelpString() { - return "Sets mobbase override for an NPC"; - } - - @Override - protected String _getUsageString() { - return "' /setmobbase mobBaseID'"; - } - -} diff --git a/src/engine/devcmd/cmds/convertLoc.java b/src/engine/devcmd/cmds/convertLoc.java deleted file mode 100644 index e794e3fd..00000000 --- a/src/engine/devcmd/cmds/convertLoc.java +++ /dev/null @@ -1,59 +0,0 @@ -// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . -// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· -// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ -// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ -// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ -// Magicbane Emulator Project © 2013 - 2022 -// www.magicbane.com - - -package engine.devcmd.cmds; - -import engine.Enum.GameObjectType; -import engine.devcmd.AbstractDevCmd; -import engine.gameManager.ChatManager; -import engine.gameManager.ZoneManager; -import engine.math.Vector3fImmutable; -import engine.objects.AbstractGameObject; -import engine.objects.Building; -import engine.objects.PlayerCharacter; - -public class convertLoc extends AbstractDevCmd { - - public convertLoc() { - super("convertLoc"); - } - - @Override - protected void _doCmd(PlayerCharacter pc, String[] words, - AbstractGameObject target) { - - - if (target == null) { - Vector3fImmutable convertLoc = ZoneManager.findSmallestZone(pc.getLoc()).getLoc().subtract(pc.getLoc()); - ChatManager.chatSystemInfo(pc, Vector3fImmutable.toString(convertLoc)); - return; - } - - - if (target.getObjectType() != GameObjectType.Building) - return; - Building toConvert = (Building) target; - Vector3fImmutable convertedLoc = ZoneManager.convertWorldToLocal(toConvert, pc.getLoc()); - ChatManager.chatSystemInfo(pc, Vector3fImmutable.toString(convertedLoc)); - - - } - - @Override - protected String _getHelpString() { - return "Temporarily Changes SubRace"; - } - - @Override - protected String _getUsageString() { - return "' /setBuildingCollidables add/remove 'add creates a collision line.' needs 4 integers. startX, endX, startY, endY"; - - } - -} diff --git a/src/engine/gameManager/DevCmdManager.java b/src/engine/gameManager/DevCmdManager.java index 1178c1be..4ce521fc 100644 --- a/src/engine/gameManager/DevCmdManager.java +++ b/src/engine/gameManager/DevCmdManager.java @@ -41,9 +41,7 @@ public enum DevCmdManager { private static void registerCommands() { // Player - DevCmdManager.registerDevCmd(new DistanceCmd()); DevCmdManager.registerDevCmd(new HelpCmd()); - DevCmdManager.registerDevCmd(new GetZoneCmd()); DevCmdManager.registerDevCmd(new ZoneSetCmd()); DevCmdManager.registerDevCmd(new PrintBankCmd()); DevCmdManager.registerDevCmd(new PrintEffectsCmd()); @@ -58,7 +56,6 @@ public enum DevCmdManager { DevCmdManager.registerDevCmd(new PrintResistsCmd()); DevCmdManager.registerDevCmd(new PrintLocationCmd()); DevCmdManager.registerDevCmd(new InfoCmd()); - DevCmdManager.registerDevCmd(new ItemInfoCmd()); DevCmdManager.registerDevCmd(new aiInfoCmd()); DevCmdManager.registerDevCmd(new SimulateBootyCmd()); DevCmdManager.registerDevCmd(new GetHeightCmd()); @@ -75,13 +72,10 @@ public enum DevCmdManager { DevCmdManager.registerDevCmd(new SetLevelCmd()); DevCmdManager.registerDevCmd(new SetBaseClassCmd()); DevCmdManager.registerDevCmd(new SetPromotionClassCmd()); - DevCmdManager.registerDevCmd(new EffectCmd()); DevCmdManager.registerDevCmd(new SetRuneCmd()); DevCmdManager.registerDevCmd(new GetOffsetCmd()); - DevCmdManager.registerDevCmd(new DebugCmd()); DevCmdManager.registerDevCmd(new AddGoldCmd()); DevCmdManager.registerDevCmd(new ZoneInfoCmd()); - DevCmdManager.registerDevCmd(new DebugMeleeSyncCmd()); DevCmdManager.registerDevCmd(new HotzoneCmd()); DevCmdManager.registerDevCmd(new MineActiveCmd()); // Dev @@ -93,12 +87,9 @@ public enum DevCmdManager { DevCmdManager.registerDevCmd(new RotateCmd()); DevCmdManager.registerDevCmd(new FlashMsgCmd()); DevCmdManager.registerDevCmd(new SysMsgCmd()); - DevCmdManager.registerDevCmd(new GetBankCmd()); DevCmdManager.registerDevCmd(new GetVaultCmd()); - DevCmdManager.registerDevCmd(new CombatMessageCmd()); DevCmdManager.registerDevCmd(new RenameCmd()); DevCmdManager.registerDevCmd(new CreateItemCmd()); - DevCmdManager.registerDevCmd(new GetMemoryCmd()); DevCmdManager.registerDevCmd(new SetRankCmd()); DevCmdManager.registerDevCmd(new MakeBaneCmd()); DevCmdManager.registerDevCmd(new RemoveBaneCmd()); @@ -109,11 +100,7 @@ public enum DevCmdManager { DevCmdManager.registerDevCmd(new EnchantCmd()); DevCmdManager.registerDevCmd(new SetSubRaceCmd()); // Admin - DevCmdManager.registerDevCmd(new GetCacheCountCmd()); - DevCmdManager.registerDevCmd(new GetRuneDropRateCmd()); - DevCmdManager.registerDevCmd(new DecachePlayerCmd()); - DevCmdManager.registerDevCmd(new AuditMobsCmd()); - DevCmdManager.registerDevCmd(new ChangeNameCmd()); + DevCmdManager.registerDevCmd(new SetGuildCmd()); DevCmdManager.registerDevCmd(new SetOwnerCmd()); DevCmdManager.registerDevCmd(new NetDebugCmd()); @@ -122,25 +109,16 @@ public enum DevCmdManager { DevCmdManager.registerDevCmd(new PurgeObjectsCmd()); DevCmdManager.registerDevCmd(new SplatMobCmd()); DevCmdManager.registerDevCmd(new SlotNpcCmd()); - DevCmdManager.registerDevCmd(new GateInfoCmd()); DevCmdManager.registerDevCmd(new ShowOffsetCmd()); DevCmdManager.registerDevCmd(new RealmInfoCmd()); DevCmdManager.registerDevCmd(new RebootCmd()); - DevCmdManager.registerDevCmd(new SetMineTypeCmd()); - DevCmdManager.registerDevCmd(new SetMineExpansion()); DevCmdManager.registerDevCmd(new SetForceRenameCityCmd()); DevCmdManager.registerDevCmd(new GotoObj()); - DevCmdManager.registerDevCmd(new convertLoc()); DevCmdManager.registerDevCmd(new UnloadFurnitureCmd()); DevCmdManager.registerDevCmd(new SetBuildingAltitudeCmd()); - DevCmdManager.registerDevCmd(new ResetLevelCmd()); DevCmdManager.registerDevCmd(new SetNpcNameCmd()); - DevCmdManager.registerDevCmd(new SetNpcMobbaseCmd()); - DevCmdManager.registerDevCmd(new DespawnCmd()); DevCmdManager.registerDevCmd(new BoundsCmd()); - DevCmdManager.registerDevCmd(new GotoBoundsCmd()); DevCmdManager.registerDevCmd(new RegionCmd()); - DevCmdManager.registerDevCmd(new SetMaintCmd()); DevCmdManager.registerDevCmd(new ApplyBonusCmd()); DevCmdManager.registerDevCmd(new SlotTestCmd()); }