Browse Source

Removed junk dev commands.

combat-2
MagicBot 8 months ago
parent
commit
d511eda713
  1. 87
      src/engine/devcmd/cmds/EnchantCmd.java
  2. 1
      src/engine/gameManager/DevCmdManager.java

87
src/engine/devcmd/cmds/EnchantCmd.java

@ -1,87 +0,0 @@ @@ -1,87 +0,0 @@
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.devcmd.cmds;
import engine.devcmd.AbstractDevCmd;
import engine.objects.*;
public class EnchantCmd extends AbstractDevCmd {
public EnchantCmd() {
super("enchant");
}
@Override
protected void _doCmd(PlayerCharacter pc, String[] words,
AbstractGameObject target) {
int rank = 0;
if (words.length < 1) {
this.sendUsage(pc);
return;
}
try {
rank = Integer.parseInt(words[0]);
} catch (Exception e) {
}
Item item;
if (target == null || target instanceof Item)
item = (Item) target;
else {
throwbackError(pc, "Must have an item targeted");
return;
}
CharacterItemManager cim = pc.charItemManager;
if (cim == null) {
throwbackError(pc, "Unable to find the character item manager for player " + pc.getFirstName() + '.');
return;
}
if (words[0].equals("clear")) {
item.clearEnchantments();
cim.updateInventory();
this.setResult(String.valueOf(item.getObjectUUID()));
} else {
int cnt = words.length;
for (int i = 1; i < cnt; i++) {
String enchant = words[i];
boolean valid = true;
for (Effect eff : item.getEffects().values()) {
if (eff.getEffectsBase().getIDString().equals(enchant)) {
throwbackError(pc, "This item already has that enchantment");
return;
}
}
if (valid) {
item.addPermanentEnchantmentForDev(enchant, rank);
this.setResult(String.valueOf(item.getObjectUUID()));
} else
throwbackError(pc, "Invalid Enchantment. Enchantment must consist of SUF-001 to SUF-328 or PRE-001 to PRE-334. Sent " + enchant + '.');
}
cim.updateInventory();
}
}
@Override
protected String _getHelpString() {
return "Enchants an item with a prefix and suffix";
}
@Override
protected String _getUsageString() {
return "' /enchant clear/Enchant1 Enchant2 Enchant3 ...'";
}
}

1
src/engine/gameManager/DevCmdManager.java

@ -97,7 +97,6 @@ public enum DevCmdManager { @@ -97,7 +97,6 @@ public enum DevCmdManager {
DevCmdManager.registerDevCmd(new SetAdminRuneCmd());
DevCmdManager.registerDevCmd(new SetInvulCmd());
DevCmdManager.registerDevCmd(new MakeItemCmd());
DevCmdManager.registerDevCmd(new EnchantCmd());
DevCmdManager.registerDevCmd(new SetSubRaceCmd());
// Admin

Loading…
Cancel
Save