diff --git a/src/engine/devcmd/cmds/EnchantCmd.java b/src/engine/devcmd/cmds/EnchantCmd.java index 1f23ae86..b03e2b6e 100644 --- a/src/engine/devcmd/cmds/EnchantCmd.java +++ b/src/engine/devcmd/cmds/EnchantCmd.java @@ -11,6 +11,7 @@ package engine.devcmd.cmds; import engine.devcmd.AbstractDevCmd; import engine.objects.*; +import engine.powers.EffectsBase; public class EnchantCmd extends AbstractDevCmd { @@ -55,21 +56,9 @@ public class EnchantCmd extends AbstractDevCmd { 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 + '.'); - } + String enchant = words[1]; + enchant = EffectsBase.getItemEffectsByName(enchant.toLowerCase()); + item.addPermanentEnchantmentForDev(enchant, 0); cim.updateInventory(); } }