From b63a5fa1c18e1534783ccaa3f8ae30ef80d1597a Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Thu, 15 Feb 2024 20:16:48 -0600 Subject: [PATCH] Enchantment Exploring --- src/engine/devcmd/cmds/EnchantCmd.java | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) 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(); } }