Minor AdminEnchant cleanup.

This commit is contained in:
MobiusDevelopment
2022-08-28 16:26:18 +00:00
parent 8b2147d013
commit d0fae0be8f
28 changed files with 836 additions and 836 deletions

View File

@@ -64,69 +64,69 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
int armorType = -1; int slot = -1;
if (command.startsWith("admin_seteh")) if (command.startsWith("admin_seteh"))
{ {
armorType = Inventory.PAPERDOLL_HEAD; slot = Inventory.PAPERDOLL_HEAD;
} }
else if (command.startsWith("admin_setec")) else if (command.startsWith("admin_setec"))
{ {
armorType = Inventory.PAPERDOLL_CHEST; slot = Inventory.PAPERDOLL_CHEST;
} }
else if (command.startsWith("admin_seteg")) else if (command.startsWith("admin_seteg"))
{ {
armorType = Inventory.PAPERDOLL_GLOVES; slot = Inventory.PAPERDOLL_GLOVES;
} }
else if (command.startsWith("admin_seteb")) else if (command.startsWith("admin_seteb"))
{ {
armorType = Inventory.PAPERDOLL_FEET; slot = Inventory.PAPERDOLL_FEET;
} }
else if (command.startsWith("admin_setel")) else if (command.startsWith("admin_setel"))
{ {
armorType = Inventory.PAPERDOLL_LEGS; slot = Inventory.PAPERDOLL_LEGS;
} }
else if (command.startsWith("admin_setew")) else if (command.startsWith("admin_setew"))
{ {
armorType = Inventory.PAPERDOLL_RHAND; slot = Inventory.PAPERDOLL_RHAND;
} }
else if (command.startsWith("admin_setes")) else if (command.startsWith("admin_setes"))
{ {
armorType = Inventory.PAPERDOLL_LHAND; slot = Inventory.PAPERDOLL_LHAND;
} }
else if (command.startsWith("admin_setle")) else if (command.startsWith("admin_setle"))
{ {
armorType = Inventory.PAPERDOLL_LEAR; slot = Inventory.PAPERDOLL_LEAR;
} }
else if (command.startsWith("admin_setre")) else if (command.startsWith("admin_setre"))
{ {
armorType = Inventory.PAPERDOLL_REAR; slot = Inventory.PAPERDOLL_REAR;
} }
else if (command.startsWith("admin_setlf")) else if (command.startsWith("admin_setlf"))
{ {
armorType = Inventory.PAPERDOLL_LFINGER; slot = Inventory.PAPERDOLL_LFINGER;
} }
else if (command.startsWith("admin_setrf")) else if (command.startsWith("admin_setrf"))
{ {
armorType = Inventory.PAPERDOLL_RFINGER; slot = Inventory.PAPERDOLL_RFINGER;
} }
else if (command.startsWith("admin_seten")) else if (command.startsWith("admin_seten"))
{ {
armorType = Inventory.PAPERDOLL_NECK; slot = Inventory.PAPERDOLL_NECK;
} }
else if (command.startsWith("admin_setun")) else if (command.startsWith("admin_setun"))
{ {
armorType = Inventory.PAPERDOLL_UNDER; slot = Inventory.PAPERDOLL_UNDER;
} }
else if (command.startsWith("admin_setba")) else if (command.startsWith("admin_setba"))
{ {
armorType = Inventory.PAPERDOLL_CLOAK; slot = Inventory.PAPERDOLL_CLOAK;
} }
else if (command.startsWith("admin_setbe")) else if (command.startsWith("admin_setbe"))
{ {
armorType = Inventory.PAPERDOLL_BELT; slot = Inventory.PAPERDOLL_BELT;
} }
if (armorType != -1) if (slot != -1)
{ {
try try
{ {
@@ -139,7 +139,7 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
setEnchant(activeChar, ench, armorType); setEnchant(activeChar, ench, slot);
} }
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
@@ -166,7 +166,7 @@ public class AdminEnchant implements IAdminCommandHandler
return true; return true;
} }
private void setEnchant(Player activeChar, int ench, int armorType) private void setEnchant(Player activeChar, int ench, int slot)
{ {
// get the target // get the target
@@ -181,10 +181,10 @@ public class AdminEnchant implements IAdminCommandHandler
Item itemInstance = null; Item itemInstance = null;
// only attempt to enchant if there is a weapon equipped // only attempt to enchant if there is a weapon equipped
final Item parmorInstance = player.getInventory().getPaperdollItem(armorType); final Item paperdollInstance = player.getInventory().getPaperdollItem(slot);
if ((parmorInstance != null) && (parmorInstance.getLocationSlot() == armorType)) if ((paperdollInstance != null) && (paperdollInstance.getLocationSlot() == slot))
{ {
itemInstance = parmorInstance; itemInstance = paperdollInstance;
} }
if (itemInstance != null) if (itemInstance != null)
@@ -192,7 +192,7 @@ public class AdminEnchant implements IAdminCommandHandler
final int curEnchant = itemInstance.getEnchantLevel(); final int curEnchant = itemInstance.getEnchantLevel();
// set enchant value // set enchant value
player.getInventory().unEquipItemInSlot(armorType); player.getInventory().unEquipItemInSlot(slot);
itemInstance.setEnchantLevel(ench); itemInstance.setEnchantLevel(ench);
player.getInventory().equipItem(itemInstance); player.getInventory().equipItem(itemInstance);

View File

@@ -64,69 +64,69 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
int armorType = -1; int slot = -1;
if (command.startsWith("admin_seteh")) if (command.startsWith("admin_seteh"))
{ {
armorType = Inventory.PAPERDOLL_HEAD; slot = Inventory.PAPERDOLL_HEAD;
} }
else if (command.startsWith("admin_setec")) else if (command.startsWith("admin_setec"))
{ {
armorType = Inventory.PAPERDOLL_CHEST; slot = Inventory.PAPERDOLL_CHEST;
} }
else if (command.startsWith("admin_seteg")) else if (command.startsWith("admin_seteg"))
{ {
armorType = Inventory.PAPERDOLL_GLOVES; slot = Inventory.PAPERDOLL_GLOVES;
} }
else if (command.startsWith("admin_seteb")) else if (command.startsWith("admin_seteb"))
{ {
armorType = Inventory.PAPERDOLL_FEET; slot = Inventory.PAPERDOLL_FEET;
} }
else if (command.startsWith("admin_setel")) else if (command.startsWith("admin_setel"))
{ {
armorType = Inventory.PAPERDOLL_LEGS; slot = Inventory.PAPERDOLL_LEGS;
} }
else if (command.startsWith("admin_setew")) else if (command.startsWith("admin_setew"))
{ {
armorType = Inventory.PAPERDOLL_RHAND; slot = Inventory.PAPERDOLL_RHAND;
} }
else if (command.startsWith("admin_setes")) else if (command.startsWith("admin_setes"))
{ {
armorType = Inventory.PAPERDOLL_LHAND; slot = Inventory.PAPERDOLL_LHAND;
} }
else if (command.startsWith("admin_setle")) else if (command.startsWith("admin_setle"))
{ {
armorType = Inventory.PAPERDOLL_LEAR; slot = Inventory.PAPERDOLL_LEAR;
} }
else if (command.startsWith("admin_setre")) else if (command.startsWith("admin_setre"))
{ {
armorType = Inventory.PAPERDOLL_REAR; slot = Inventory.PAPERDOLL_REAR;
} }
else if (command.startsWith("admin_setlf")) else if (command.startsWith("admin_setlf"))
{ {
armorType = Inventory.PAPERDOLL_LFINGER; slot = Inventory.PAPERDOLL_LFINGER;
} }
else if (command.startsWith("admin_setrf")) else if (command.startsWith("admin_setrf"))
{ {
armorType = Inventory.PAPERDOLL_RFINGER; slot = Inventory.PAPERDOLL_RFINGER;
} }
else if (command.startsWith("admin_seten")) else if (command.startsWith("admin_seten"))
{ {
armorType = Inventory.PAPERDOLL_NECK; slot = Inventory.PAPERDOLL_NECK;
} }
else if (command.startsWith("admin_setun")) else if (command.startsWith("admin_setun"))
{ {
armorType = Inventory.PAPERDOLL_UNDER; slot = Inventory.PAPERDOLL_UNDER;
} }
else if (command.startsWith("admin_setba")) else if (command.startsWith("admin_setba"))
{ {
armorType = Inventory.PAPERDOLL_CLOAK; slot = Inventory.PAPERDOLL_CLOAK;
} }
else if (command.startsWith("admin_setbe")) else if (command.startsWith("admin_setbe"))
{ {
armorType = Inventory.PAPERDOLL_BELT; slot = Inventory.PAPERDOLL_BELT;
} }
if (armorType != -1) if (slot != -1)
{ {
try try
{ {
@@ -139,7 +139,7 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
setEnchant(activeChar, ench, armorType); setEnchant(activeChar, ench, slot);
} }
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
@@ -166,7 +166,7 @@ public class AdminEnchant implements IAdminCommandHandler
return true; return true;
} }
private void setEnchant(Player activeChar, int ench, int armorType) private void setEnchant(Player activeChar, int ench, int slot)
{ {
// get the target // get the target
@@ -181,10 +181,10 @@ public class AdminEnchant implements IAdminCommandHandler
Item itemInstance = null; Item itemInstance = null;
// only attempt to enchant if there is a weapon equipped // only attempt to enchant if there is a weapon equipped
final Item parmorInstance = player.getInventory().getPaperdollItem(armorType); final Item paperdollInstance = player.getInventory().getPaperdollItem(slot);
if ((parmorInstance != null) && (parmorInstance.getLocationSlot() == armorType)) if ((paperdollInstance != null) && (paperdollInstance.getLocationSlot() == slot))
{ {
itemInstance = parmorInstance; itemInstance = paperdollInstance;
} }
if (itemInstance != null) if (itemInstance != null)
@@ -192,7 +192,7 @@ public class AdminEnchant implements IAdminCommandHandler
final int curEnchant = itemInstance.getEnchantLevel(); final int curEnchant = itemInstance.getEnchantLevel();
// set enchant value // set enchant value
player.getInventory().unEquipItemInSlot(armorType); player.getInventory().unEquipItemInSlot(slot);
itemInstance.setEnchantLevel(ench); itemInstance.setEnchantLevel(ench);
player.getInventory().equipItem(itemInstance); player.getInventory().equipItem(itemInstance);

View File

@@ -64,69 +64,69 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
int armorType = -1; int slot = -1;
if (command.startsWith("admin_seteh")) if (command.startsWith("admin_seteh"))
{ {
armorType = Inventory.PAPERDOLL_HEAD; slot = Inventory.PAPERDOLL_HEAD;
} }
else if (command.startsWith("admin_setec")) else if (command.startsWith("admin_setec"))
{ {
armorType = Inventory.PAPERDOLL_CHEST; slot = Inventory.PAPERDOLL_CHEST;
} }
else if (command.startsWith("admin_seteg")) else if (command.startsWith("admin_seteg"))
{ {
armorType = Inventory.PAPERDOLL_GLOVES; slot = Inventory.PAPERDOLL_GLOVES;
} }
else if (command.startsWith("admin_seteb")) else if (command.startsWith("admin_seteb"))
{ {
armorType = Inventory.PAPERDOLL_FEET; slot = Inventory.PAPERDOLL_FEET;
} }
else if (command.startsWith("admin_setel")) else if (command.startsWith("admin_setel"))
{ {
armorType = Inventory.PAPERDOLL_LEGS; slot = Inventory.PAPERDOLL_LEGS;
} }
else if (command.startsWith("admin_setew")) else if (command.startsWith("admin_setew"))
{ {
armorType = Inventory.PAPERDOLL_RHAND; slot = Inventory.PAPERDOLL_RHAND;
} }
else if (command.startsWith("admin_setes")) else if (command.startsWith("admin_setes"))
{ {
armorType = Inventory.PAPERDOLL_LHAND; slot = Inventory.PAPERDOLL_LHAND;
} }
else if (command.startsWith("admin_setle")) else if (command.startsWith("admin_setle"))
{ {
armorType = Inventory.PAPERDOLL_LEAR; slot = Inventory.PAPERDOLL_LEAR;
} }
else if (command.startsWith("admin_setre")) else if (command.startsWith("admin_setre"))
{ {
armorType = Inventory.PAPERDOLL_REAR; slot = Inventory.PAPERDOLL_REAR;
} }
else if (command.startsWith("admin_setlf")) else if (command.startsWith("admin_setlf"))
{ {
armorType = Inventory.PAPERDOLL_LFINGER; slot = Inventory.PAPERDOLL_LFINGER;
} }
else if (command.startsWith("admin_setrf")) else if (command.startsWith("admin_setrf"))
{ {
armorType = Inventory.PAPERDOLL_RFINGER; slot = Inventory.PAPERDOLL_RFINGER;
} }
else if (command.startsWith("admin_seten")) else if (command.startsWith("admin_seten"))
{ {
armorType = Inventory.PAPERDOLL_NECK; slot = Inventory.PAPERDOLL_NECK;
} }
else if (command.startsWith("admin_setun")) else if (command.startsWith("admin_setun"))
{ {
armorType = Inventory.PAPERDOLL_UNDER; slot = Inventory.PAPERDOLL_UNDER;
} }
else if (command.startsWith("admin_setba")) else if (command.startsWith("admin_setba"))
{ {
armorType = Inventory.PAPERDOLL_CLOAK; slot = Inventory.PAPERDOLL_CLOAK;
} }
else if (command.startsWith("admin_setbe")) else if (command.startsWith("admin_setbe"))
{ {
armorType = Inventory.PAPERDOLL_BELT; slot = Inventory.PAPERDOLL_BELT;
} }
if (armorType != -1) if (slot != -1)
{ {
try try
{ {
@@ -139,7 +139,7 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
setEnchant(activeChar, ench, armorType); setEnchant(activeChar, ench, slot);
} }
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
@@ -166,7 +166,7 @@ public class AdminEnchant implements IAdminCommandHandler
return true; return true;
} }
private void setEnchant(Player activeChar, int ench, int armorType) private void setEnchant(Player activeChar, int ench, int slot)
{ {
// get the target // get the target
@@ -181,10 +181,10 @@ public class AdminEnchant implements IAdminCommandHandler
Item itemInstance = null; Item itemInstance = null;
// only attempt to enchant if there is a weapon equipped // only attempt to enchant if there is a weapon equipped
final Item parmorInstance = player.getInventory().getPaperdollItem(armorType); final Item paperdollInstance = player.getInventory().getPaperdollItem(slot);
if ((parmorInstance != null) && (parmorInstance.getLocationSlot() == armorType)) if ((paperdollInstance != null) && (paperdollInstance.getLocationSlot() == slot))
{ {
itemInstance = parmorInstance; itemInstance = paperdollInstance;
} }
if (itemInstance != null) if (itemInstance != null)
@@ -192,7 +192,7 @@ public class AdminEnchant implements IAdminCommandHandler
final int curEnchant = itemInstance.getEnchantLevel(); final int curEnchant = itemInstance.getEnchantLevel();
// set enchant value // set enchant value
player.getInventory().unEquipItemInSlot(armorType); player.getInventory().unEquipItemInSlot(slot);
itemInstance.setEnchantLevel(ench); itemInstance.setEnchantLevel(ench);
player.getInventory().equipItem(itemInstance); player.getInventory().equipItem(itemInstance);

View File

@@ -64,69 +64,69 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
int armorType = -1; int slot = -1;
if (command.startsWith("admin_seteh")) if (command.startsWith("admin_seteh"))
{ {
armorType = Inventory.PAPERDOLL_HEAD; slot = Inventory.PAPERDOLL_HEAD;
} }
else if (command.startsWith("admin_setec")) else if (command.startsWith("admin_setec"))
{ {
armorType = Inventory.PAPERDOLL_CHEST; slot = Inventory.PAPERDOLL_CHEST;
} }
else if (command.startsWith("admin_seteg")) else if (command.startsWith("admin_seteg"))
{ {
armorType = Inventory.PAPERDOLL_GLOVES; slot = Inventory.PAPERDOLL_GLOVES;
} }
else if (command.startsWith("admin_seteb")) else if (command.startsWith("admin_seteb"))
{ {
armorType = Inventory.PAPERDOLL_FEET; slot = Inventory.PAPERDOLL_FEET;
} }
else if (command.startsWith("admin_setel")) else if (command.startsWith("admin_setel"))
{ {
armorType = Inventory.PAPERDOLL_LEGS; slot = Inventory.PAPERDOLL_LEGS;
} }
else if (command.startsWith("admin_setew")) else if (command.startsWith("admin_setew"))
{ {
armorType = Inventory.PAPERDOLL_RHAND; slot = Inventory.PAPERDOLL_RHAND;
} }
else if (command.startsWith("admin_setes")) else if (command.startsWith("admin_setes"))
{ {
armorType = Inventory.PAPERDOLL_LHAND; slot = Inventory.PAPERDOLL_LHAND;
} }
else if (command.startsWith("admin_setle")) else if (command.startsWith("admin_setle"))
{ {
armorType = Inventory.PAPERDOLL_LEAR; slot = Inventory.PAPERDOLL_LEAR;
} }
else if (command.startsWith("admin_setre")) else if (command.startsWith("admin_setre"))
{ {
armorType = Inventory.PAPERDOLL_REAR; slot = Inventory.PAPERDOLL_REAR;
} }
else if (command.startsWith("admin_setlf")) else if (command.startsWith("admin_setlf"))
{ {
armorType = Inventory.PAPERDOLL_LFINGER; slot = Inventory.PAPERDOLL_LFINGER;
} }
else if (command.startsWith("admin_setrf")) else if (command.startsWith("admin_setrf"))
{ {
armorType = Inventory.PAPERDOLL_RFINGER; slot = Inventory.PAPERDOLL_RFINGER;
} }
else if (command.startsWith("admin_seten")) else if (command.startsWith("admin_seten"))
{ {
armorType = Inventory.PAPERDOLL_NECK; slot = Inventory.PAPERDOLL_NECK;
} }
else if (command.startsWith("admin_setun")) else if (command.startsWith("admin_setun"))
{ {
armorType = Inventory.PAPERDOLL_UNDER; slot = Inventory.PAPERDOLL_UNDER;
} }
else if (command.startsWith("admin_setba")) else if (command.startsWith("admin_setba"))
{ {
armorType = Inventory.PAPERDOLL_CLOAK; slot = Inventory.PAPERDOLL_CLOAK;
} }
else if (command.startsWith("admin_setbe")) else if (command.startsWith("admin_setbe"))
{ {
armorType = Inventory.PAPERDOLL_BELT; slot = Inventory.PAPERDOLL_BELT;
} }
if (armorType != -1) if (slot != -1)
{ {
try try
{ {
@@ -139,7 +139,7 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
setEnchant(activeChar, ench, armorType); setEnchant(activeChar, ench, slot);
} }
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
@@ -166,7 +166,7 @@ public class AdminEnchant implements IAdminCommandHandler
return true; return true;
} }
private void setEnchant(Player activeChar, int ench, int armorType) private void setEnchant(Player activeChar, int ench, int slot)
{ {
// get the target // get the target
@@ -181,10 +181,10 @@ public class AdminEnchant implements IAdminCommandHandler
Item itemInstance = null; Item itemInstance = null;
// only attempt to enchant if there is a weapon equipped // only attempt to enchant if there is a weapon equipped
final Item parmorInstance = player.getInventory().getPaperdollItem(armorType); final Item paperdollInstance = player.getInventory().getPaperdollItem(slot);
if ((parmorInstance != null) && (parmorInstance.getLocationSlot() == armorType)) if ((paperdollInstance != null) && (paperdollInstance.getLocationSlot() == slot))
{ {
itemInstance = parmorInstance; itemInstance = paperdollInstance;
} }
if (itemInstance != null) if (itemInstance != null)
@@ -192,7 +192,7 @@ public class AdminEnchant implements IAdminCommandHandler
final int curEnchant = itemInstance.getEnchantLevel(); final int curEnchant = itemInstance.getEnchantLevel();
// set enchant value // set enchant value
player.getInventory().unEquipItemInSlot(armorType); player.getInventory().unEquipItemInSlot(slot);
itemInstance.setEnchantLevel(ench); itemInstance.setEnchantLevel(ench);
player.getInventory().equipItem(itemInstance); player.getInventory().equipItem(itemInstance);

View File

@@ -64,69 +64,69 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
int armorType = -1; int slot = -1;
if (command.startsWith("admin_seteh")) if (command.startsWith("admin_seteh"))
{ {
armorType = Inventory.PAPERDOLL_HEAD; slot = Inventory.PAPERDOLL_HEAD;
} }
else if (command.startsWith("admin_setec")) else if (command.startsWith("admin_setec"))
{ {
armorType = Inventory.PAPERDOLL_CHEST; slot = Inventory.PAPERDOLL_CHEST;
} }
else if (command.startsWith("admin_seteg")) else if (command.startsWith("admin_seteg"))
{ {
armorType = Inventory.PAPERDOLL_GLOVES; slot = Inventory.PAPERDOLL_GLOVES;
} }
else if (command.startsWith("admin_seteb")) else if (command.startsWith("admin_seteb"))
{ {
armorType = Inventory.PAPERDOLL_FEET; slot = Inventory.PAPERDOLL_FEET;
} }
else if (command.startsWith("admin_setel")) else if (command.startsWith("admin_setel"))
{ {
armorType = Inventory.PAPERDOLL_LEGS; slot = Inventory.PAPERDOLL_LEGS;
} }
else if (command.startsWith("admin_setew")) else if (command.startsWith("admin_setew"))
{ {
armorType = Inventory.PAPERDOLL_RHAND; slot = Inventory.PAPERDOLL_RHAND;
} }
else if (command.startsWith("admin_setes")) else if (command.startsWith("admin_setes"))
{ {
armorType = Inventory.PAPERDOLL_LHAND; slot = Inventory.PAPERDOLL_LHAND;
} }
else if (command.startsWith("admin_setle")) else if (command.startsWith("admin_setle"))
{ {
armorType = Inventory.PAPERDOLL_LEAR; slot = Inventory.PAPERDOLL_LEAR;
} }
else if (command.startsWith("admin_setre")) else if (command.startsWith("admin_setre"))
{ {
armorType = Inventory.PAPERDOLL_REAR; slot = Inventory.PAPERDOLL_REAR;
} }
else if (command.startsWith("admin_setlf")) else if (command.startsWith("admin_setlf"))
{ {
armorType = Inventory.PAPERDOLL_LFINGER; slot = Inventory.PAPERDOLL_LFINGER;
} }
else if (command.startsWith("admin_setrf")) else if (command.startsWith("admin_setrf"))
{ {
armorType = Inventory.PAPERDOLL_RFINGER; slot = Inventory.PAPERDOLL_RFINGER;
} }
else if (command.startsWith("admin_seten")) else if (command.startsWith("admin_seten"))
{ {
armorType = Inventory.PAPERDOLL_NECK; slot = Inventory.PAPERDOLL_NECK;
} }
else if (command.startsWith("admin_setun")) else if (command.startsWith("admin_setun"))
{ {
armorType = Inventory.PAPERDOLL_UNDER; slot = Inventory.PAPERDOLL_UNDER;
} }
else if (command.startsWith("admin_setba")) else if (command.startsWith("admin_setba"))
{ {
armorType = Inventory.PAPERDOLL_CLOAK; slot = Inventory.PAPERDOLL_CLOAK;
} }
else if (command.startsWith("admin_setbe")) else if (command.startsWith("admin_setbe"))
{ {
armorType = Inventory.PAPERDOLL_BELT; slot = Inventory.PAPERDOLL_BELT;
} }
if (armorType != -1) if (slot != -1)
{ {
try try
{ {
@@ -139,7 +139,7 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
setEnchant(activeChar, ench, armorType); setEnchant(activeChar, ench, slot);
} }
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
@@ -166,7 +166,7 @@ public class AdminEnchant implements IAdminCommandHandler
return true; return true;
} }
private void setEnchant(Player activeChar, int ench, int armorType) private void setEnchant(Player activeChar, int ench, int slot)
{ {
// get the target // get the target
@@ -181,10 +181,10 @@ public class AdminEnchant implements IAdminCommandHandler
Item itemInstance = null; Item itemInstance = null;
// only attempt to enchant if there is a weapon equipped // only attempt to enchant if there is a weapon equipped
final Item parmorInstance = player.getInventory().getPaperdollItem(armorType); final Item paperdollInstance = player.getInventory().getPaperdollItem(slot);
if ((parmorInstance != null) && (parmorInstance.getLocationSlot() == armorType)) if ((paperdollInstance != null) && (paperdollInstance.getLocationSlot() == slot))
{ {
itemInstance = parmorInstance; itemInstance = paperdollInstance;
} }
if (itemInstance != null) if (itemInstance != null)
@@ -192,7 +192,7 @@ public class AdminEnchant implements IAdminCommandHandler
final int curEnchant = itemInstance.getEnchantLevel(); final int curEnchant = itemInstance.getEnchantLevel();
// set enchant value // set enchant value
player.getInventory().unEquipItemInSlot(armorType); player.getInventory().unEquipItemInSlot(slot);
itemInstance.setEnchantLevel(ench); itemInstance.setEnchantLevel(ench);
player.getInventory().equipItem(itemInstance); player.getInventory().equipItem(itemInstance);

View File

@@ -114,197 +114,197 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
int armorType = -1; int slot = -1;
if (command.startsWith("admin_seteh")) if (command.startsWith("admin_seteh"))
{ {
armorType = Inventory.PAPERDOLL_HEAD; slot = Inventory.PAPERDOLL_HEAD;
} }
else if (command.startsWith("admin_setec")) else if (command.startsWith("admin_setec"))
{ {
armorType = Inventory.PAPERDOLL_CHEST; slot = Inventory.PAPERDOLL_CHEST;
} }
else if (command.startsWith("admin_seteg")) else if (command.startsWith("admin_seteg"))
{ {
armorType = Inventory.PAPERDOLL_GLOVES; slot = Inventory.PAPERDOLL_GLOVES;
} }
else if (command.startsWith("admin_seteb")) else if (command.startsWith("admin_seteb"))
{ {
armorType = Inventory.PAPERDOLL_FEET; slot = Inventory.PAPERDOLL_FEET;
} }
else if (command.startsWith("admin_setel")) else if (command.startsWith("admin_setel"))
{ {
armorType = Inventory.PAPERDOLL_LEGS; slot = Inventory.PAPERDOLL_LEGS;
} }
else if (command.startsWith("admin_setew")) else if (command.startsWith("admin_setew"))
{ {
armorType = Inventory.PAPERDOLL_RHAND; slot = Inventory.PAPERDOLL_RHAND;
} }
else if (command.startsWith("admin_setes")) else if (command.startsWith("admin_setes"))
{ {
armorType = Inventory.PAPERDOLL_LHAND; slot = Inventory.PAPERDOLL_LHAND;
} }
else if (command.startsWith("admin_setle")) else if (command.startsWith("admin_setle"))
{ {
armorType = Inventory.PAPERDOLL_LEAR; slot = Inventory.PAPERDOLL_LEAR;
} }
else if (command.startsWith("admin_setre")) else if (command.startsWith("admin_setre"))
{ {
armorType = Inventory.PAPERDOLL_REAR; slot = Inventory.PAPERDOLL_REAR;
} }
else if (command.startsWith("admin_setlf")) else if (command.startsWith("admin_setlf"))
{ {
armorType = Inventory.PAPERDOLL_LFINGER; slot = Inventory.PAPERDOLL_LFINGER;
} }
else if (command.startsWith("admin_setrf")) else if (command.startsWith("admin_setrf"))
{ {
armorType = Inventory.PAPERDOLL_RFINGER; slot = Inventory.PAPERDOLL_RFINGER;
} }
else if (command.startsWith("admin_seten")) else if (command.startsWith("admin_seten"))
{ {
armorType = Inventory.PAPERDOLL_NECK; slot = Inventory.PAPERDOLL_NECK;
} }
else if (command.startsWith("admin_setun")) else if (command.startsWith("admin_setun"))
{ {
armorType = Inventory.PAPERDOLL_UNDER; slot = Inventory.PAPERDOLL_UNDER;
} }
else if (command.startsWith("admin_setba")) else if (command.startsWith("admin_setba"))
{ {
armorType = Inventory.PAPERDOLL_CLOAK; slot = Inventory.PAPERDOLL_CLOAK;
} }
else if (command.startsWith("admin_setbe")) else if (command.startsWith("admin_setbe"))
{ {
armorType = Inventory.PAPERDOLL_BELT; slot = Inventory.PAPERDOLL_BELT;
} }
else if (command.startsWith("admin_seth1")) else if (command.startsWith("admin_seth1"))
{ {
armorType = Inventory.PAPERDOLL_HAIR; slot = Inventory.PAPERDOLL_HAIR;
} }
else if (command.startsWith("admin_seth2")) else if (command.startsWith("admin_seth2"))
{ {
armorType = Inventory.PAPERDOLL_HAIR2; slot = Inventory.PAPERDOLL_HAIR2;
} }
else if (command.startsWith("admin_setbr")) else if (command.startsWith("admin_setbr"))
{ {
armorType = Inventory.PAPERDOLL_BROOCH; slot = Inventory.PAPERDOLL_BROOCH;
} }
else if (command.startsWith("admin_setbt")) // bracelet else if (command.startsWith("admin_setbt")) // bracelet
{ {
armorType = Inventory.PAPERDOLL_RBRACELET; slot = Inventory.PAPERDOLL_RBRACELET;
} }
else if (command.startsWith("admin_setsb")) // seed bracelet else if (command.startsWith("admin_setsb")) // seed bracelet
{ {
armorType = Inventory.PAPERDOLL_LBRACELET; slot = Inventory.PAPERDOLL_LBRACELET;
} }
else if (command.startsWith("admin_setab")) else if (command.startsWith("admin_setab"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT_BOOK; slot = Inventory.PAPERDOLL_ARTIFACT_BOOK;
} }
else if (command.startsWith("admin_seta1")) else if (command.startsWith("admin_seta1"))
{ {
armorType = Inventory.PAPERDOLL_AGATHION1; slot = Inventory.PAPERDOLL_AGATHION1;
} }
else if (command.startsWith("admin_seta2")) else if (command.startsWith("admin_seta2"))
{ {
armorType = Inventory.PAPERDOLL_AGATHION2; slot = Inventory.PAPERDOLL_AGATHION2;
} }
else if (command.startsWith("admin_seta3")) else if (command.startsWith("admin_seta3"))
{ {
armorType = Inventory.PAPERDOLL_AGATHION3; slot = Inventory.PAPERDOLL_AGATHION3;
} }
else if (command.startsWith("admin_seta4")) else if (command.startsWith("admin_seta4"))
{ {
armorType = Inventory.PAPERDOLL_AGATHION4; slot = Inventory.PAPERDOLL_AGATHION4;
} }
else if (command.startsWith("admin_seta5")) else if (command.startsWith("admin_seta5"))
{ {
armorType = Inventory.PAPERDOLL_AGATHION5; slot = Inventory.PAPERDOLL_AGATHION5;
} }
else if (command.startsWith("admin_set01")) else if (command.startsWith("admin_set01"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT1; slot = Inventory.PAPERDOLL_ARTIFACT1;
} }
else if (command.startsWith("admin_set02")) else if (command.startsWith("admin_set02"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT2; slot = Inventory.PAPERDOLL_ARTIFACT2;
} }
else if (command.startsWith("admin_set03")) else if (command.startsWith("admin_set03"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT3; slot = Inventory.PAPERDOLL_ARTIFACT3;
} }
else if (command.startsWith("admin_set04")) else if (command.startsWith("admin_set04"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT4; slot = Inventory.PAPERDOLL_ARTIFACT4;
} }
else if (command.startsWith("admin_set05")) else if (command.startsWith("admin_set05"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT5; slot = Inventory.PAPERDOLL_ARTIFACT5;
} }
else if (command.startsWith("admin_set06")) else if (command.startsWith("admin_set06"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT6; slot = Inventory.PAPERDOLL_ARTIFACT6;
} }
else if (command.startsWith("admin_set07")) else if (command.startsWith("admin_set07"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT7; slot = Inventory.PAPERDOLL_ARTIFACT7;
} }
else if (command.startsWith("admin_set08")) else if (command.startsWith("admin_set08"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT8; slot = Inventory.PAPERDOLL_ARTIFACT8;
} }
else if (command.startsWith("admin_set09")) else if (command.startsWith("admin_set09"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT9; slot = Inventory.PAPERDOLL_ARTIFACT9;
} }
else if (command.startsWith("admin_set10")) else if (command.startsWith("admin_set10"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT10; slot = Inventory.PAPERDOLL_ARTIFACT10;
} }
else if (command.startsWith("admin_set11")) else if (command.startsWith("admin_set11"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT11; slot = Inventory.PAPERDOLL_ARTIFACT11;
} }
else if (command.startsWith("admin_set12")) else if (command.startsWith("admin_set12"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT12; slot = Inventory.PAPERDOLL_ARTIFACT12;
} }
else if (command.startsWith("admin_set13")) else if (command.startsWith("admin_set13"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT13; slot = Inventory.PAPERDOLL_ARTIFACT13;
} }
else if (command.startsWith("admin_set14")) else if (command.startsWith("admin_set14"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT14; slot = Inventory.PAPERDOLL_ARTIFACT14;
} }
else if (command.startsWith("admin_set15")) else if (command.startsWith("admin_set15"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT15; slot = Inventory.PAPERDOLL_ARTIFACT15;
} }
else if (command.startsWith("admin_set16")) else if (command.startsWith("admin_set16"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT16; slot = Inventory.PAPERDOLL_ARTIFACT16;
} }
else if (command.startsWith("admin_set17")) else if (command.startsWith("admin_set17"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT17; slot = Inventory.PAPERDOLL_ARTIFACT17;
} }
else if (command.startsWith("admin_set18")) else if (command.startsWith("admin_set18"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT18; slot = Inventory.PAPERDOLL_ARTIFACT18;
} }
else if (command.startsWith("admin_set19")) else if (command.startsWith("admin_set19"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT19; slot = Inventory.PAPERDOLL_ARTIFACT19;
} }
else if (command.startsWith("admin_set20")) else if (command.startsWith("admin_set20"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT20; slot = Inventory.PAPERDOLL_ARTIFACT20;
} }
else if (command.startsWith("admin_set21")) else if (command.startsWith("admin_set21"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT21; slot = Inventory.PAPERDOLL_ARTIFACT21;
} }
if (armorType != -1) if (slot != -1)
{ {
try try
{ {
@@ -318,7 +318,7 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
setEnchant(activeChar, ench, armorType); setEnchant(activeChar, ench, slot);
} }
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
@@ -331,7 +331,7 @@ public class AdminEnchant implements IAdminCommandHandler
} }
BuilderUtil.sendSysMessage(activeChar, "Auto-Set Enchant value to 0."); BuilderUtil.sendSysMessage(activeChar, "Auto-Set Enchant value to 0.");
setEnchant(activeChar, fuse, armorType); setEnchant(activeChar, fuse, slot);
} }
catch (NumberFormatException e) catch (NumberFormatException e)
{ {
@@ -349,7 +349,7 @@ public class AdminEnchant implements IAdminCommandHandler
return true; return true;
} }
private void setEnchant(Player activeChar, int ench, int armorType) private void setEnchant(Player activeChar, int ench, int slot)
{ {
// get the target // get the target
@@ -364,10 +364,10 @@ public class AdminEnchant implements IAdminCommandHandler
Item itemInstance = null; Item itemInstance = null;
// only attempt to enchant if there is a weapon equipped // only attempt to enchant if there is a weapon equipped
final Item parmorInstance = player.getInventory().getPaperdollItem(armorType); final Item paperdollInstance = player.getInventory().getPaperdollItem(slot);
if ((parmorInstance != null) && (parmorInstance.getLocationSlot() == armorType)) if ((paperdollInstance != null) && (paperdollInstance.getLocationSlot() == slot))
{ {
itemInstance = parmorInstance; itemInstance = paperdollInstance;
} }
if (itemInstance != null) if (itemInstance != null)

View File

@@ -114,197 +114,197 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
int armorType = -1; int slot = -1;
if (command.startsWith("admin_seteh")) if (command.startsWith("admin_seteh"))
{ {
armorType = Inventory.PAPERDOLL_HEAD; slot = Inventory.PAPERDOLL_HEAD;
} }
else if (command.startsWith("admin_setec")) else if (command.startsWith("admin_setec"))
{ {
armorType = Inventory.PAPERDOLL_CHEST; slot = Inventory.PAPERDOLL_CHEST;
} }
else if (command.startsWith("admin_seteg")) else if (command.startsWith("admin_seteg"))
{ {
armorType = Inventory.PAPERDOLL_GLOVES; slot = Inventory.PAPERDOLL_GLOVES;
} }
else if (command.startsWith("admin_seteb")) else if (command.startsWith("admin_seteb"))
{ {
armorType = Inventory.PAPERDOLL_FEET; slot = Inventory.PAPERDOLL_FEET;
} }
else if (command.startsWith("admin_setel")) else if (command.startsWith("admin_setel"))
{ {
armorType = Inventory.PAPERDOLL_LEGS; slot = Inventory.PAPERDOLL_LEGS;
} }
else if (command.startsWith("admin_setew")) else if (command.startsWith("admin_setew"))
{ {
armorType = Inventory.PAPERDOLL_RHAND; slot = Inventory.PAPERDOLL_RHAND;
} }
else if (command.startsWith("admin_setes")) else if (command.startsWith("admin_setes"))
{ {
armorType = Inventory.PAPERDOLL_LHAND; slot = Inventory.PAPERDOLL_LHAND;
} }
else if (command.startsWith("admin_setle")) else if (command.startsWith("admin_setle"))
{ {
armorType = Inventory.PAPERDOLL_LEAR; slot = Inventory.PAPERDOLL_LEAR;
} }
else if (command.startsWith("admin_setre")) else if (command.startsWith("admin_setre"))
{ {
armorType = Inventory.PAPERDOLL_REAR; slot = Inventory.PAPERDOLL_REAR;
} }
else if (command.startsWith("admin_setlf")) else if (command.startsWith("admin_setlf"))
{ {
armorType = Inventory.PAPERDOLL_LFINGER; slot = Inventory.PAPERDOLL_LFINGER;
} }
else if (command.startsWith("admin_setrf")) else if (command.startsWith("admin_setrf"))
{ {
armorType = Inventory.PAPERDOLL_RFINGER; slot = Inventory.PAPERDOLL_RFINGER;
} }
else if (command.startsWith("admin_seten")) else if (command.startsWith("admin_seten"))
{ {
armorType = Inventory.PAPERDOLL_NECK; slot = Inventory.PAPERDOLL_NECK;
} }
else if (command.startsWith("admin_setun")) else if (command.startsWith("admin_setun"))
{ {
armorType = Inventory.PAPERDOLL_UNDER; slot = Inventory.PAPERDOLL_UNDER;
} }
else if (command.startsWith("admin_setba")) else if (command.startsWith("admin_setba"))
{ {
armorType = Inventory.PAPERDOLL_CLOAK; slot = Inventory.PAPERDOLL_CLOAK;
} }
else if (command.startsWith("admin_setbe")) else if (command.startsWith("admin_setbe"))
{ {
armorType = Inventory.PAPERDOLL_BELT; slot = Inventory.PAPERDOLL_BELT;
} }
else if (command.startsWith("admin_seth1")) else if (command.startsWith("admin_seth1"))
{ {
armorType = Inventory.PAPERDOLL_HAIR; slot = Inventory.PAPERDOLL_HAIR;
} }
else if (command.startsWith("admin_seth2")) else if (command.startsWith("admin_seth2"))
{ {
armorType = Inventory.PAPERDOLL_HAIR2; slot = Inventory.PAPERDOLL_HAIR2;
} }
else if (command.startsWith("admin_setbr")) else if (command.startsWith("admin_setbr"))
{ {
armorType = Inventory.PAPERDOLL_BROOCH; slot = Inventory.PAPERDOLL_BROOCH;
} }
else if (command.startsWith("admin_setbt")) // bracelet else if (command.startsWith("admin_setbt")) // bracelet
{ {
armorType = Inventory.PAPERDOLL_RBRACELET; slot = Inventory.PAPERDOLL_RBRACELET;
} }
else if (command.startsWith("admin_setsb")) // seed bracelet else if (command.startsWith("admin_setsb")) // seed bracelet
{ {
armorType = Inventory.PAPERDOLL_LBRACELET; slot = Inventory.PAPERDOLL_LBRACELET;
} }
else if (command.startsWith("admin_setab")) else if (command.startsWith("admin_setab"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT_BOOK; slot = Inventory.PAPERDOLL_ARTIFACT_BOOK;
} }
else if (command.startsWith("admin_seta1")) else if (command.startsWith("admin_seta1"))
{ {
armorType = Inventory.PAPERDOLL_AGATHION1; slot = Inventory.PAPERDOLL_AGATHION1;
} }
else if (command.startsWith("admin_seta2")) else if (command.startsWith("admin_seta2"))
{ {
armorType = Inventory.PAPERDOLL_AGATHION2; slot = Inventory.PAPERDOLL_AGATHION2;
} }
else if (command.startsWith("admin_seta3")) else if (command.startsWith("admin_seta3"))
{ {
armorType = Inventory.PAPERDOLL_AGATHION3; slot = Inventory.PAPERDOLL_AGATHION3;
} }
else if (command.startsWith("admin_seta4")) else if (command.startsWith("admin_seta4"))
{ {
armorType = Inventory.PAPERDOLL_AGATHION4; slot = Inventory.PAPERDOLL_AGATHION4;
} }
else if (command.startsWith("admin_seta5")) else if (command.startsWith("admin_seta5"))
{ {
armorType = Inventory.PAPERDOLL_AGATHION5; slot = Inventory.PAPERDOLL_AGATHION5;
} }
else if (command.startsWith("admin_set01")) else if (command.startsWith("admin_set01"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT1; slot = Inventory.PAPERDOLL_ARTIFACT1;
} }
else if (command.startsWith("admin_set02")) else if (command.startsWith("admin_set02"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT2; slot = Inventory.PAPERDOLL_ARTIFACT2;
} }
else if (command.startsWith("admin_set03")) else if (command.startsWith("admin_set03"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT3; slot = Inventory.PAPERDOLL_ARTIFACT3;
} }
else if (command.startsWith("admin_set04")) else if (command.startsWith("admin_set04"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT4; slot = Inventory.PAPERDOLL_ARTIFACT4;
} }
else if (command.startsWith("admin_set05")) else if (command.startsWith("admin_set05"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT5; slot = Inventory.PAPERDOLL_ARTIFACT5;
} }
else if (command.startsWith("admin_set06")) else if (command.startsWith("admin_set06"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT6; slot = Inventory.PAPERDOLL_ARTIFACT6;
} }
else if (command.startsWith("admin_set07")) else if (command.startsWith("admin_set07"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT7; slot = Inventory.PAPERDOLL_ARTIFACT7;
} }
else if (command.startsWith("admin_set08")) else if (command.startsWith("admin_set08"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT8; slot = Inventory.PAPERDOLL_ARTIFACT8;
} }
else if (command.startsWith("admin_set09")) else if (command.startsWith("admin_set09"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT9; slot = Inventory.PAPERDOLL_ARTIFACT9;
} }
else if (command.startsWith("admin_set10")) else if (command.startsWith("admin_set10"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT10; slot = Inventory.PAPERDOLL_ARTIFACT10;
} }
else if (command.startsWith("admin_set11")) else if (command.startsWith("admin_set11"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT11; slot = Inventory.PAPERDOLL_ARTIFACT11;
} }
else if (command.startsWith("admin_set12")) else if (command.startsWith("admin_set12"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT12; slot = Inventory.PAPERDOLL_ARTIFACT12;
} }
else if (command.startsWith("admin_set13")) else if (command.startsWith("admin_set13"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT13; slot = Inventory.PAPERDOLL_ARTIFACT13;
} }
else if (command.startsWith("admin_set14")) else if (command.startsWith("admin_set14"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT14; slot = Inventory.PAPERDOLL_ARTIFACT14;
} }
else if (command.startsWith("admin_set15")) else if (command.startsWith("admin_set15"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT15; slot = Inventory.PAPERDOLL_ARTIFACT15;
} }
else if (command.startsWith("admin_set16")) else if (command.startsWith("admin_set16"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT16; slot = Inventory.PAPERDOLL_ARTIFACT16;
} }
else if (command.startsWith("admin_set17")) else if (command.startsWith("admin_set17"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT17; slot = Inventory.PAPERDOLL_ARTIFACT17;
} }
else if (command.startsWith("admin_set18")) else if (command.startsWith("admin_set18"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT18; slot = Inventory.PAPERDOLL_ARTIFACT18;
} }
else if (command.startsWith("admin_set19")) else if (command.startsWith("admin_set19"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT19; slot = Inventory.PAPERDOLL_ARTIFACT19;
} }
else if (command.startsWith("admin_set20")) else if (command.startsWith("admin_set20"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT20; slot = Inventory.PAPERDOLL_ARTIFACT20;
} }
else if (command.startsWith("admin_set21")) else if (command.startsWith("admin_set21"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT21; slot = Inventory.PAPERDOLL_ARTIFACT21;
} }
if (armorType != -1) if (slot != -1)
{ {
try try
{ {
@@ -318,7 +318,7 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
setEnchant(activeChar, ench, armorType); setEnchant(activeChar, ench, slot);
} }
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
@@ -331,7 +331,7 @@ public class AdminEnchant implements IAdminCommandHandler
} }
BuilderUtil.sendSysMessage(activeChar, "Auto-Set Enchant value to 0."); BuilderUtil.sendSysMessage(activeChar, "Auto-Set Enchant value to 0.");
setEnchant(activeChar, fuse, armorType); setEnchant(activeChar, fuse, slot);
} }
catch (NumberFormatException e) catch (NumberFormatException e)
{ {
@@ -349,7 +349,7 @@ public class AdminEnchant implements IAdminCommandHandler
return true; return true;
} }
private void setEnchant(Player activeChar, int ench, int armorType) private void setEnchant(Player activeChar, int ench, int slot)
{ {
// get the target // get the target
@@ -364,10 +364,10 @@ public class AdminEnchant implements IAdminCommandHandler
Item itemInstance = null; Item itemInstance = null;
// only attempt to enchant if there is a weapon equipped // only attempt to enchant if there is a weapon equipped
final Item parmorInstance = player.getInventory().getPaperdollItem(armorType); final Item paperdollInstance = player.getInventory().getPaperdollItem(slot);
if ((parmorInstance != null) && (parmorInstance.getLocationSlot() == armorType)) if ((paperdollInstance != null) && (paperdollInstance.getLocationSlot() == slot))
{ {
itemInstance = parmorInstance; itemInstance = paperdollInstance;
} }
if (itemInstance != null) if (itemInstance != null)

View File

@@ -114,197 +114,197 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
int armorType = -1; int slot = -1;
if (command.startsWith("admin_seteh")) if (command.startsWith("admin_seteh"))
{ {
armorType = Inventory.PAPERDOLL_HEAD; slot = Inventory.PAPERDOLL_HEAD;
} }
else if (command.startsWith("admin_setec")) else if (command.startsWith("admin_setec"))
{ {
armorType = Inventory.PAPERDOLL_CHEST; slot = Inventory.PAPERDOLL_CHEST;
} }
else if (command.startsWith("admin_seteg")) else if (command.startsWith("admin_seteg"))
{ {
armorType = Inventory.PAPERDOLL_GLOVES; slot = Inventory.PAPERDOLL_GLOVES;
} }
else if (command.startsWith("admin_seteb")) else if (command.startsWith("admin_seteb"))
{ {
armorType = Inventory.PAPERDOLL_FEET; slot = Inventory.PAPERDOLL_FEET;
} }
else if (command.startsWith("admin_setel")) else if (command.startsWith("admin_setel"))
{ {
armorType = Inventory.PAPERDOLL_LEGS; slot = Inventory.PAPERDOLL_LEGS;
} }
else if (command.startsWith("admin_setew")) else if (command.startsWith("admin_setew"))
{ {
armorType = Inventory.PAPERDOLL_RHAND; slot = Inventory.PAPERDOLL_RHAND;
} }
else if (command.startsWith("admin_setes")) else if (command.startsWith("admin_setes"))
{ {
armorType = Inventory.PAPERDOLL_LHAND; slot = Inventory.PAPERDOLL_LHAND;
} }
else if (command.startsWith("admin_setle")) else if (command.startsWith("admin_setle"))
{ {
armorType = Inventory.PAPERDOLL_LEAR; slot = Inventory.PAPERDOLL_LEAR;
} }
else if (command.startsWith("admin_setre")) else if (command.startsWith("admin_setre"))
{ {
armorType = Inventory.PAPERDOLL_REAR; slot = Inventory.PAPERDOLL_REAR;
} }
else if (command.startsWith("admin_setlf")) else if (command.startsWith("admin_setlf"))
{ {
armorType = Inventory.PAPERDOLL_LFINGER; slot = Inventory.PAPERDOLL_LFINGER;
} }
else if (command.startsWith("admin_setrf")) else if (command.startsWith("admin_setrf"))
{ {
armorType = Inventory.PAPERDOLL_RFINGER; slot = Inventory.PAPERDOLL_RFINGER;
} }
else if (command.startsWith("admin_seten")) else if (command.startsWith("admin_seten"))
{ {
armorType = Inventory.PAPERDOLL_NECK; slot = Inventory.PAPERDOLL_NECK;
} }
else if (command.startsWith("admin_setun")) else if (command.startsWith("admin_setun"))
{ {
armorType = Inventory.PAPERDOLL_UNDER; slot = Inventory.PAPERDOLL_UNDER;
} }
else if (command.startsWith("admin_setba")) else if (command.startsWith("admin_setba"))
{ {
armorType = Inventory.PAPERDOLL_CLOAK; slot = Inventory.PAPERDOLL_CLOAK;
} }
else if (command.startsWith("admin_setbe")) else if (command.startsWith("admin_setbe"))
{ {
armorType = Inventory.PAPERDOLL_BELT; slot = Inventory.PAPERDOLL_BELT;
} }
else if (command.startsWith("admin_seth1")) else if (command.startsWith("admin_seth1"))
{ {
armorType = Inventory.PAPERDOLL_HAIR; slot = Inventory.PAPERDOLL_HAIR;
} }
else if (command.startsWith("admin_seth2")) else if (command.startsWith("admin_seth2"))
{ {
armorType = Inventory.PAPERDOLL_HAIR2; slot = Inventory.PAPERDOLL_HAIR2;
} }
else if (command.startsWith("admin_setbr")) else if (command.startsWith("admin_setbr"))
{ {
armorType = Inventory.PAPERDOLL_BROOCH; slot = Inventory.PAPERDOLL_BROOCH;
} }
else if (command.startsWith("admin_setbt")) // bracelet else if (command.startsWith("admin_setbt")) // bracelet
{ {
armorType = Inventory.PAPERDOLL_RBRACELET; slot = Inventory.PAPERDOLL_RBRACELET;
} }
else if (command.startsWith("admin_setsb")) // seed bracelet else if (command.startsWith("admin_setsb")) // seed bracelet
{ {
armorType = Inventory.PAPERDOLL_LBRACELET; slot = Inventory.PAPERDOLL_LBRACELET;
} }
else if (command.startsWith("admin_setab")) else if (command.startsWith("admin_setab"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT_BOOK; slot = Inventory.PAPERDOLL_ARTIFACT_BOOK;
} }
else if (command.startsWith("admin_seta1")) else if (command.startsWith("admin_seta1"))
{ {
armorType = Inventory.PAPERDOLL_AGATHION1; slot = Inventory.PAPERDOLL_AGATHION1;
} }
else if (command.startsWith("admin_seta2")) else if (command.startsWith("admin_seta2"))
{ {
armorType = Inventory.PAPERDOLL_AGATHION2; slot = Inventory.PAPERDOLL_AGATHION2;
} }
else if (command.startsWith("admin_seta3")) else if (command.startsWith("admin_seta3"))
{ {
armorType = Inventory.PAPERDOLL_AGATHION3; slot = Inventory.PAPERDOLL_AGATHION3;
} }
else if (command.startsWith("admin_seta4")) else if (command.startsWith("admin_seta4"))
{ {
armorType = Inventory.PAPERDOLL_AGATHION4; slot = Inventory.PAPERDOLL_AGATHION4;
} }
else if (command.startsWith("admin_seta5")) else if (command.startsWith("admin_seta5"))
{ {
armorType = Inventory.PAPERDOLL_AGATHION5; slot = Inventory.PAPERDOLL_AGATHION5;
} }
else if (command.startsWith("admin_set01")) else if (command.startsWith("admin_set01"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT1; slot = Inventory.PAPERDOLL_ARTIFACT1;
} }
else if (command.startsWith("admin_set02")) else if (command.startsWith("admin_set02"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT2; slot = Inventory.PAPERDOLL_ARTIFACT2;
} }
else if (command.startsWith("admin_set03")) else if (command.startsWith("admin_set03"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT3; slot = Inventory.PAPERDOLL_ARTIFACT3;
} }
else if (command.startsWith("admin_set04")) else if (command.startsWith("admin_set04"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT4; slot = Inventory.PAPERDOLL_ARTIFACT4;
} }
else if (command.startsWith("admin_set05")) else if (command.startsWith("admin_set05"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT5; slot = Inventory.PAPERDOLL_ARTIFACT5;
} }
else if (command.startsWith("admin_set06")) else if (command.startsWith("admin_set06"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT6; slot = Inventory.PAPERDOLL_ARTIFACT6;
} }
else if (command.startsWith("admin_set07")) else if (command.startsWith("admin_set07"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT7; slot = Inventory.PAPERDOLL_ARTIFACT7;
} }
else if (command.startsWith("admin_set08")) else if (command.startsWith("admin_set08"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT8; slot = Inventory.PAPERDOLL_ARTIFACT8;
} }
else if (command.startsWith("admin_set09")) else if (command.startsWith("admin_set09"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT9; slot = Inventory.PAPERDOLL_ARTIFACT9;
} }
else if (command.startsWith("admin_set10")) else if (command.startsWith("admin_set10"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT10; slot = Inventory.PAPERDOLL_ARTIFACT10;
} }
else if (command.startsWith("admin_set11")) else if (command.startsWith("admin_set11"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT11; slot = Inventory.PAPERDOLL_ARTIFACT11;
} }
else if (command.startsWith("admin_set12")) else if (command.startsWith("admin_set12"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT12; slot = Inventory.PAPERDOLL_ARTIFACT12;
} }
else if (command.startsWith("admin_set13")) else if (command.startsWith("admin_set13"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT13; slot = Inventory.PAPERDOLL_ARTIFACT13;
} }
else if (command.startsWith("admin_set14")) else if (command.startsWith("admin_set14"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT14; slot = Inventory.PAPERDOLL_ARTIFACT14;
} }
else if (command.startsWith("admin_set15")) else if (command.startsWith("admin_set15"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT15; slot = Inventory.PAPERDOLL_ARTIFACT15;
} }
else if (command.startsWith("admin_set16")) else if (command.startsWith("admin_set16"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT16; slot = Inventory.PAPERDOLL_ARTIFACT16;
} }
else if (command.startsWith("admin_set17")) else if (command.startsWith("admin_set17"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT17; slot = Inventory.PAPERDOLL_ARTIFACT17;
} }
else if (command.startsWith("admin_set18")) else if (command.startsWith("admin_set18"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT18; slot = Inventory.PAPERDOLL_ARTIFACT18;
} }
else if (command.startsWith("admin_set19")) else if (command.startsWith("admin_set19"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT19; slot = Inventory.PAPERDOLL_ARTIFACT19;
} }
else if (command.startsWith("admin_set20")) else if (command.startsWith("admin_set20"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT20; slot = Inventory.PAPERDOLL_ARTIFACT20;
} }
else if (command.startsWith("admin_set21")) else if (command.startsWith("admin_set21"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT21; slot = Inventory.PAPERDOLL_ARTIFACT21;
} }
if (armorType != -1) if (slot != -1)
{ {
try try
{ {
@@ -318,7 +318,7 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
setEnchant(activeChar, ench, armorType); setEnchant(activeChar, ench, slot);
} }
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
@@ -331,7 +331,7 @@ public class AdminEnchant implements IAdminCommandHandler
} }
BuilderUtil.sendSysMessage(activeChar, "Auto-Set Enchant value to 0."); BuilderUtil.sendSysMessage(activeChar, "Auto-Set Enchant value to 0.");
setEnchant(activeChar, fuse, armorType); setEnchant(activeChar, fuse, slot);
} }
catch (NumberFormatException e) catch (NumberFormatException e)
{ {
@@ -349,7 +349,7 @@ public class AdminEnchant implements IAdminCommandHandler
return true; return true;
} }
private void setEnchant(Player activeChar, int ench, int armorType) private void setEnchant(Player activeChar, int ench, int slot)
{ {
// get the target // get the target
@@ -364,10 +364,10 @@ public class AdminEnchant implements IAdminCommandHandler
Item itemInstance = null; Item itemInstance = null;
// only attempt to enchant if there is a weapon equipped // only attempt to enchant if there is a weapon equipped
final Item parmorInstance = player.getInventory().getPaperdollItem(armorType); final Item paperdollInstance = player.getInventory().getPaperdollItem(slot);
if ((parmorInstance != null) && (parmorInstance.getLocationSlot() == armorType)) if ((paperdollInstance != null) && (paperdollInstance.getLocationSlot() == slot))
{ {
itemInstance = parmorInstance; itemInstance = paperdollInstance;
} }
if (itemInstance != null) if (itemInstance != null)

View File

@@ -114,197 +114,197 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
int armorType = -1; int slot = -1;
if (command.startsWith("admin_seteh")) if (command.startsWith("admin_seteh"))
{ {
armorType = Inventory.PAPERDOLL_HEAD; slot = Inventory.PAPERDOLL_HEAD;
} }
else if (command.startsWith("admin_setec")) else if (command.startsWith("admin_setec"))
{ {
armorType = Inventory.PAPERDOLL_CHEST; slot = Inventory.PAPERDOLL_CHEST;
} }
else if (command.startsWith("admin_seteg")) else if (command.startsWith("admin_seteg"))
{ {
armorType = Inventory.PAPERDOLL_GLOVES; slot = Inventory.PAPERDOLL_GLOVES;
} }
else if (command.startsWith("admin_seteb")) else if (command.startsWith("admin_seteb"))
{ {
armorType = Inventory.PAPERDOLL_FEET; slot = Inventory.PAPERDOLL_FEET;
} }
else if (command.startsWith("admin_setel")) else if (command.startsWith("admin_setel"))
{ {
armorType = Inventory.PAPERDOLL_LEGS; slot = Inventory.PAPERDOLL_LEGS;
} }
else if (command.startsWith("admin_setew")) else if (command.startsWith("admin_setew"))
{ {
armorType = Inventory.PAPERDOLL_RHAND; slot = Inventory.PAPERDOLL_RHAND;
} }
else if (command.startsWith("admin_setes")) else if (command.startsWith("admin_setes"))
{ {
armorType = Inventory.PAPERDOLL_LHAND; slot = Inventory.PAPERDOLL_LHAND;
} }
else if (command.startsWith("admin_setle")) else if (command.startsWith("admin_setle"))
{ {
armorType = Inventory.PAPERDOLL_LEAR; slot = Inventory.PAPERDOLL_LEAR;
} }
else if (command.startsWith("admin_setre")) else if (command.startsWith("admin_setre"))
{ {
armorType = Inventory.PAPERDOLL_REAR; slot = Inventory.PAPERDOLL_REAR;
} }
else if (command.startsWith("admin_setlf")) else if (command.startsWith("admin_setlf"))
{ {
armorType = Inventory.PAPERDOLL_LFINGER; slot = Inventory.PAPERDOLL_LFINGER;
} }
else if (command.startsWith("admin_setrf")) else if (command.startsWith("admin_setrf"))
{ {
armorType = Inventory.PAPERDOLL_RFINGER; slot = Inventory.PAPERDOLL_RFINGER;
} }
else if (command.startsWith("admin_seten")) else if (command.startsWith("admin_seten"))
{ {
armorType = Inventory.PAPERDOLL_NECK; slot = Inventory.PAPERDOLL_NECK;
} }
else if (command.startsWith("admin_setun")) else if (command.startsWith("admin_setun"))
{ {
armorType = Inventory.PAPERDOLL_UNDER; slot = Inventory.PAPERDOLL_UNDER;
} }
else if (command.startsWith("admin_setba")) else if (command.startsWith("admin_setba"))
{ {
armorType = Inventory.PAPERDOLL_CLOAK; slot = Inventory.PAPERDOLL_CLOAK;
} }
else if (command.startsWith("admin_setbe")) else if (command.startsWith("admin_setbe"))
{ {
armorType = Inventory.PAPERDOLL_BELT; slot = Inventory.PAPERDOLL_BELT;
} }
else if (command.startsWith("admin_seth1")) else if (command.startsWith("admin_seth1"))
{ {
armorType = Inventory.PAPERDOLL_HAIR; slot = Inventory.PAPERDOLL_HAIR;
} }
else if (command.startsWith("admin_seth2")) else if (command.startsWith("admin_seth2"))
{ {
armorType = Inventory.PAPERDOLL_HAIR2; slot = Inventory.PAPERDOLL_HAIR2;
} }
else if (command.startsWith("admin_setbr")) else if (command.startsWith("admin_setbr"))
{ {
armorType = Inventory.PAPERDOLL_BROOCH; slot = Inventory.PAPERDOLL_BROOCH;
} }
else if (command.startsWith("admin_setbt")) // bracelet else if (command.startsWith("admin_setbt")) // bracelet
{ {
armorType = Inventory.PAPERDOLL_RBRACELET; slot = Inventory.PAPERDOLL_RBRACELET;
} }
else if (command.startsWith("admin_setsb")) // seed bracelet else if (command.startsWith("admin_setsb")) // seed bracelet
{ {
armorType = Inventory.PAPERDOLL_LBRACELET; slot = Inventory.PAPERDOLL_LBRACELET;
} }
else if (command.startsWith("admin_setab")) else if (command.startsWith("admin_setab"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT_BOOK; slot = Inventory.PAPERDOLL_ARTIFACT_BOOK;
} }
else if (command.startsWith("admin_seta1")) else if (command.startsWith("admin_seta1"))
{ {
armorType = Inventory.PAPERDOLL_AGATHION1; slot = Inventory.PAPERDOLL_AGATHION1;
} }
else if (command.startsWith("admin_seta2")) else if (command.startsWith("admin_seta2"))
{ {
armorType = Inventory.PAPERDOLL_AGATHION2; slot = Inventory.PAPERDOLL_AGATHION2;
} }
else if (command.startsWith("admin_seta3")) else if (command.startsWith("admin_seta3"))
{ {
armorType = Inventory.PAPERDOLL_AGATHION3; slot = Inventory.PAPERDOLL_AGATHION3;
} }
else if (command.startsWith("admin_seta4")) else if (command.startsWith("admin_seta4"))
{ {
armorType = Inventory.PAPERDOLL_AGATHION4; slot = Inventory.PAPERDOLL_AGATHION4;
} }
else if (command.startsWith("admin_seta5")) else if (command.startsWith("admin_seta5"))
{ {
armorType = Inventory.PAPERDOLL_AGATHION5; slot = Inventory.PAPERDOLL_AGATHION5;
} }
else if (command.startsWith("admin_set01")) else if (command.startsWith("admin_set01"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT1; slot = Inventory.PAPERDOLL_ARTIFACT1;
} }
else if (command.startsWith("admin_set02")) else if (command.startsWith("admin_set02"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT2; slot = Inventory.PAPERDOLL_ARTIFACT2;
} }
else if (command.startsWith("admin_set03")) else if (command.startsWith("admin_set03"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT3; slot = Inventory.PAPERDOLL_ARTIFACT3;
} }
else if (command.startsWith("admin_set04")) else if (command.startsWith("admin_set04"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT4; slot = Inventory.PAPERDOLL_ARTIFACT4;
} }
else if (command.startsWith("admin_set05")) else if (command.startsWith("admin_set05"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT5; slot = Inventory.PAPERDOLL_ARTIFACT5;
} }
else if (command.startsWith("admin_set06")) else if (command.startsWith("admin_set06"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT6; slot = Inventory.PAPERDOLL_ARTIFACT6;
} }
else if (command.startsWith("admin_set07")) else if (command.startsWith("admin_set07"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT7; slot = Inventory.PAPERDOLL_ARTIFACT7;
} }
else if (command.startsWith("admin_set08")) else if (command.startsWith("admin_set08"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT8; slot = Inventory.PAPERDOLL_ARTIFACT8;
} }
else if (command.startsWith("admin_set09")) else if (command.startsWith("admin_set09"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT9; slot = Inventory.PAPERDOLL_ARTIFACT9;
} }
else if (command.startsWith("admin_set10")) else if (command.startsWith("admin_set10"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT10; slot = Inventory.PAPERDOLL_ARTIFACT10;
} }
else if (command.startsWith("admin_set11")) else if (command.startsWith("admin_set11"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT11; slot = Inventory.PAPERDOLL_ARTIFACT11;
} }
else if (command.startsWith("admin_set12")) else if (command.startsWith("admin_set12"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT12; slot = Inventory.PAPERDOLL_ARTIFACT12;
} }
else if (command.startsWith("admin_set13")) else if (command.startsWith("admin_set13"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT13; slot = Inventory.PAPERDOLL_ARTIFACT13;
} }
else if (command.startsWith("admin_set14")) else if (command.startsWith("admin_set14"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT14; slot = Inventory.PAPERDOLL_ARTIFACT14;
} }
else if (command.startsWith("admin_set15")) else if (command.startsWith("admin_set15"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT15; slot = Inventory.PAPERDOLL_ARTIFACT15;
} }
else if (command.startsWith("admin_set16")) else if (command.startsWith("admin_set16"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT16; slot = Inventory.PAPERDOLL_ARTIFACT16;
} }
else if (command.startsWith("admin_set17")) else if (command.startsWith("admin_set17"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT17; slot = Inventory.PAPERDOLL_ARTIFACT17;
} }
else if (command.startsWith("admin_set18")) else if (command.startsWith("admin_set18"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT18; slot = Inventory.PAPERDOLL_ARTIFACT18;
} }
else if (command.startsWith("admin_set19")) else if (command.startsWith("admin_set19"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT19; slot = Inventory.PAPERDOLL_ARTIFACT19;
} }
else if (command.startsWith("admin_set20")) else if (command.startsWith("admin_set20"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT20; slot = Inventory.PAPERDOLL_ARTIFACT20;
} }
else if (command.startsWith("admin_set21")) else if (command.startsWith("admin_set21"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT21; slot = Inventory.PAPERDOLL_ARTIFACT21;
} }
if (armorType != -1) if (slot != -1)
{ {
try try
{ {
@@ -318,7 +318,7 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
setEnchant(activeChar, ench, armorType); setEnchant(activeChar, ench, slot);
} }
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
@@ -331,7 +331,7 @@ public class AdminEnchant implements IAdminCommandHandler
} }
BuilderUtil.sendSysMessage(activeChar, "Auto-Set Enchant value to 0."); BuilderUtil.sendSysMessage(activeChar, "Auto-Set Enchant value to 0.");
setEnchant(activeChar, fuse, armorType); setEnchant(activeChar, fuse, slot);
} }
catch (NumberFormatException e) catch (NumberFormatException e)
{ {
@@ -349,7 +349,7 @@ public class AdminEnchant implements IAdminCommandHandler
return true; return true;
} }
private void setEnchant(Player activeChar, int ench, int armorType) private void setEnchant(Player activeChar, int ench, int slot)
{ {
// get the target // get the target
@@ -364,10 +364,10 @@ public class AdminEnchant implements IAdminCommandHandler
Item itemInstance = null; Item itemInstance = null;
// only attempt to enchant if there is a weapon equipped // only attempt to enchant if there is a weapon equipped
final Item parmorInstance = player.getInventory().getPaperdollItem(armorType); final Item paperdollInstance = player.getInventory().getPaperdollItem(slot);
if ((parmorInstance != null) && (parmorInstance.getLocationSlot() == armorType)) if ((paperdollInstance != null) && (paperdollInstance.getLocationSlot() == slot))
{ {
itemInstance = parmorInstance; itemInstance = paperdollInstance;
} }
if (itemInstance != null) if (itemInstance != null)

View File

@@ -114,197 +114,197 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
int armorType = -1; int slot = -1;
if (command.startsWith("admin_seteh")) if (command.startsWith("admin_seteh"))
{ {
armorType = Inventory.PAPERDOLL_HEAD; slot = Inventory.PAPERDOLL_HEAD;
} }
else if (command.startsWith("admin_setec")) else if (command.startsWith("admin_setec"))
{ {
armorType = Inventory.PAPERDOLL_CHEST; slot = Inventory.PAPERDOLL_CHEST;
} }
else if (command.startsWith("admin_seteg")) else if (command.startsWith("admin_seteg"))
{ {
armorType = Inventory.PAPERDOLL_GLOVES; slot = Inventory.PAPERDOLL_GLOVES;
} }
else if (command.startsWith("admin_seteb")) else if (command.startsWith("admin_seteb"))
{ {
armorType = Inventory.PAPERDOLL_FEET; slot = Inventory.PAPERDOLL_FEET;
} }
else if (command.startsWith("admin_setel")) else if (command.startsWith("admin_setel"))
{ {
armorType = Inventory.PAPERDOLL_LEGS; slot = Inventory.PAPERDOLL_LEGS;
} }
else if (command.startsWith("admin_setew")) else if (command.startsWith("admin_setew"))
{ {
armorType = Inventory.PAPERDOLL_RHAND; slot = Inventory.PAPERDOLL_RHAND;
} }
else if (command.startsWith("admin_setes")) else if (command.startsWith("admin_setes"))
{ {
armorType = Inventory.PAPERDOLL_LHAND; slot = Inventory.PAPERDOLL_LHAND;
} }
else if (command.startsWith("admin_setle")) else if (command.startsWith("admin_setle"))
{ {
armorType = Inventory.PAPERDOLL_LEAR; slot = Inventory.PAPERDOLL_LEAR;
} }
else if (command.startsWith("admin_setre")) else if (command.startsWith("admin_setre"))
{ {
armorType = Inventory.PAPERDOLL_REAR; slot = Inventory.PAPERDOLL_REAR;
} }
else if (command.startsWith("admin_setlf")) else if (command.startsWith("admin_setlf"))
{ {
armorType = Inventory.PAPERDOLL_LFINGER; slot = Inventory.PAPERDOLL_LFINGER;
} }
else if (command.startsWith("admin_setrf")) else if (command.startsWith("admin_setrf"))
{ {
armorType = Inventory.PAPERDOLL_RFINGER; slot = Inventory.PAPERDOLL_RFINGER;
} }
else if (command.startsWith("admin_seten")) else if (command.startsWith("admin_seten"))
{ {
armorType = Inventory.PAPERDOLL_NECK; slot = Inventory.PAPERDOLL_NECK;
} }
else if (command.startsWith("admin_setun")) else if (command.startsWith("admin_setun"))
{ {
armorType = Inventory.PAPERDOLL_UNDER; slot = Inventory.PAPERDOLL_UNDER;
} }
else if (command.startsWith("admin_setba")) else if (command.startsWith("admin_setba"))
{ {
armorType = Inventory.PAPERDOLL_CLOAK; slot = Inventory.PAPERDOLL_CLOAK;
} }
else if (command.startsWith("admin_setbe")) else if (command.startsWith("admin_setbe"))
{ {
armorType = Inventory.PAPERDOLL_BELT; slot = Inventory.PAPERDOLL_BELT;
} }
else if (command.startsWith("admin_seth1")) else if (command.startsWith("admin_seth1"))
{ {
armorType = Inventory.PAPERDOLL_HAIR; slot = Inventory.PAPERDOLL_HAIR;
} }
else if (command.startsWith("admin_seth2")) else if (command.startsWith("admin_seth2"))
{ {
armorType = Inventory.PAPERDOLL_HAIR2; slot = Inventory.PAPERDOLL_HAIR2;
} }
else if (command.startsWith("admin_setbr")) else if (command.startsWith("admin_setbr"))
{ {
armorType = Inventory.PAPERDOLL_BROOCH; slot = Inventory.PAPERDOLL_BROOCH;
} }
else if (command.startsWith("admin_setbt")) // bracelet else if (command.startsWith("admin_setbt")) // bracelet
{ {
armorType = Inventory.PAPERDOLL_RBRACELET; slot = Inventory.PAPERDOLL_RBRACELET;
} }
else if (command.startsWith("admin_setsb")) // seed bracelet else if (command.startsWith("admin_setsb")) // seed bracelet
{ {
armorType = Inventory.PAPERDOLL_LBRACELET; slot = Inventory.PAPERDOLL_LBRACELET;
} }
else if (command.startsWith("admin_setab")) else if (command.startsWith("admin_setab"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT_BOOK; slot = Inventory.PAPERDOLL_ARTIFACT_BOOK;
} }
else if (command.startsWith("admin_seta1")) else if (command.startsWith("admin_seta1"))
{ {
armorType = Inventory.PAPERDOLL_AGATHION1; slot = Inventory.PAPERDOLL_AGATHION1;
} }
else if (command.startsWith("admin_seta2")) else if (command.startsWith("admin_seta2"))
{ {
armorType = Inventory.PAPERDOLL_AGATHION2; slot = Inventory.PAPERDOLL_AGATHION2;
} }
else if (command.startsWith("admin_seta3")) else if (command.startsWith("admin_seta3"))
{ {
armorType = Inventory.PAPERDOLL_AGATHION3; slot = Inventory.PAPERDOLL_AGATHION3;
} }
else if (command.startsWith("admin_seta4")) else if (command.startsWith("admin_seta4"))
{ {
armorType = Inventory.PAPERDOLL_AGATHION4; slot = Inventory.PAPERDOLL_AGATHION4;
} }
else if (command.startsWith("admin_seta5")) else if (command.startsWith("admin_seta5"))
{ {
armorType = Inventory.PAPERDOLL_AGATHION5; slot = Inventory.PAPERDOLL_AGATHION5;
} }
else if (command.startsWith("admin_set01")) else if (command.startsWith("admin_set01"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT1; slot = Inventory.PAPERDOLL_ARTIFACT1;
} }
else if (command.startsWith("admin_set02")) else if (command.startsWith("admin_set02"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT2; slot = Inventory.PAPERDOLL_ARTIFACT2;
} }
else if (command.startsWith("admin_set03")) else if (command.startsWith("admin_set03"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT3; slot = Inventory.PAPERDOLL_ARTIFACT3;
} }
else if (command.startsWith("admin_set04")) else if (command.startsWith("admin_set04"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT4; slot = Inventory.PAPERDOLL_ARTIFACT4;
} }
else if (command.startsWith("admin_set05")) else if (command.startsWith("admin_set05"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT5; slot = Inventory.PAPERDOLL_ARTIFACT5;
} }
else if (command.startsWith("admin_set06")) else if (command.startsWith("admin_set06"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT6; slot = Inventory.PAPERDOLL_ARTIFACT6;
} }
else if (command.startsWith("admin_set07")) else if (command.startsWith("admin_set07"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT7; slot = Inventory.PAPERDOLL_ARTIFACT7;
} }
else if (command.startsWith("admin_set08")) else if (command.startsWith("admin_set08"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT8; slot = Inventory.PAPERDOLL_ARTIFACT8;
} }
else if (command.startsWith("admin_set09")) else if (command.startsWith("admin_set09"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT9; slot = Inventory.PAPERDOLL_ARTIFACT9;
} }
else if (command.startsWith("admin_set10")) else if (command.startsWith("admin_set10"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT10; slot = Inventory.PAPERDOLL_ARTIFACT10;
} }
else if (command.startsWith("admin_set11")) else if (command.startsWith("admin_set11"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT11; slot = Inventory.PAPERDOLL_ARTIFACT11;
} }
else if (command.startsWith("admin_set12")) else if (command.startsWith("admin_set12"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT12; slot = Inventory.PAPERDOLL_ARTIFACT12;
} }
else if (command.startsWith("admin_set13")) else if (command.startsWith("admin_set13"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT13; slot = Inventory.PAPERDOLL_ARTIFACT13;
} }
else if (command.startsWith("admin_set14")) else if (command.startsWith("admin_set14"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT14; slot = Inventory.PAPERDOLL_ARTIFACT14;
} }
else if (command.startsWith("admin_set15")) else if (command.startsWith("admin_set15"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT15; slot = Inventory.PAPERDOLL_ARTIFACT15;
} }
else if (command.startsWith("admin_set16")) else if (command.startsWith("admin_set16"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT16; slot = Inventory.PAPERDOLL_ARTIFACT16;
} }
else if (command.startsWith("admin_set17")) else if (command.startsWith("admin_set17"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT17; slot = Inventory.PAPERDOLL_ARTIFACT17;
} }
else if (command.startsWith("admin_set18")) else if (command.startsWith("admin_set18"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT18; slot = Inventory.PAPERDOLL_ARTIFACT18;
} }
else if (command.startsWith("admin_set19")) else if (command.startsWith("admin_set19"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT19; slot = Inventory.PAPERDOLL_ARTIFACT19;
} }
else if (command.startsWith("admin_set20")) else if (command.startsWith("admin_set20"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT20; slot = Inventory.PAPERDOLL_ARTIFACT20;
} }
else if (command.startsWith("admin_set21")) else if (command.startsWith("admin_set21"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT21; slot = Inventory.PAPERDOLL_ARTIFACT21;
} }
if (armorType != -1) if (slot != -1)
{ {
try try
{ {
@@ -318,7 +318,7 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
setEnchant(activeChar, ench, armorType); setEnchant(activeChar, ench, slot);
} }
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
@@ -331,7 +331,7 @@ public class AdminEnchant implements IAdminCommandHandler
} }
BuilderUtil.sendSysMessage(activeChar, "Auto-Set Enchant value to 0."); BuilderUtil.sendSysMessage(activeChar, "Auto-Set Enchant value to 0.");
setEnchant(activeChar, fuse, armorType); setEnchant(activeChar, fuse, slot);
} }
catch (NumberFormatException e) catch (NumberFormatException e)
{ {
@@ -349,7 +349,7 @@ public class AdminEnchant implements IAdminCommandHandler
return true; return true;
} }
private void setEnchant(Player activeChar, int ench, int armorType) private void setEnchant(Player activeChar, int ench, int slot)
{ {
// get the target // get the target
@@ -364,10 +364,10 @@ public class AdminEnchant implements IAdminCommandHandler
Item itemInstance = null; Item itemInstance = null;
// only attempt to enchant if there is a weapon equipped // only attempt to enchant if there is a weapon equipped
final Item parmorInstance = player.getInventory().getPaperdollItem(armorType); final Item paperdollInstance = player.getInventory().getPaperdollItem(slot);
if ((parmorInstance != null) && (parmorInstance.getLocationSlot() == armorType)) if ((paperdollInstance != null) && (paperdollInstance.getLocationSlot() == slot))
{ {
itemInstance = parmorInstance; itemInstance = paperdollInstance;
} }
if (itemInstance != null) if (itemInstance != null)

View File

@@ -114,197 +114,197 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
int armorType = -1; int slot = -1;
if (command.startsWith("admin_seteh")) if (command.startsWith("admin_seteh"))
{ {
armorType = Inventory.PAPERDOLL_HEAD; slot = Inventory.PAPERDOLL_HEAD;
} }
else if (command.startsWith("admin_setec")) else if (command.startsWith("admin_setec"))
{ {
armorType = Inventory.PAPERDOLL_CHEST; slot = Inventory.PAPERDOLL_CHEST;
} }
else if (command.startsWith("admin_seteg")) else if (command.startsWith("admin_seteg"))
{ {
armorType = Inventory.PAPERDOLL_GLOVES; slot = Inventory.PAPERDOLL_GLOVES;
} }
else if (command.startsWith("admin_seteb")) else if (command.startsWith("admin_seteb"))
{ {
armorType = Inventory.PAPERDOLL_FEET; slot = Inventory.PAPERDOLL_FEET;
} }
else if (command.startsWith("admin_setel")) else if (command.startsWith("admin_setel"))
{ {
armorType = Inventory.PAPERDOLL_LEGS; slot = Inventory.PAPERDOLL_LEGS;
} }
else if (command.startsWith("admin_setew")) else if (command.startsWith("admin_setew"))
{ {
armorType = Inventory.PAPERDOLL_RHAND; slot = Inventory.PAPERDOLL_RHAND;
} }
else if (command.startsWith("admin_setes")) else if (command.startsWith("admin_setes"))
{ {
armorType = Inventory.PAPERDOLL_LHAND; slot = Inventory.PAPERDOLL_LHAND;
} }
else if (command.startsWith("admin_setle")) else if (command.startsWith("admin_setle"))
{ {
armorType = Inventory.PAPERDOLL_LEAR; slot = Inventory.PAPERDOLL_LEAR;
} }
else if (command.startsWith("admin_setre")) else if (command.startsWith("admin_setre"))
{ {
armorType = Inventory.PAPERDOLL_REAR; slot = Inventory.PAPERDOLL_REAR;
} }
else if (command.startsWith("admin_setlf")) else if (command.startsWith("admin_setlf"))
{ {
armorType = Inventory.PAPERDOLL_LFINGER; slot = Inventory.PAPERDOLL_LFINGER;
} }
else if (command.startsWith("admin_setrf")) else if (command.startsWith("admin_setrf"))
{ {
armorType = Inventory.PAPERDOLL_RFINGER; slot = Inventory.PAPERDOLL_RFINGER;
} }
else if (command.startsWith("admin_seten")) else if (command.startsWith("admin_seten"))
{ {
armorType = Inventory.PAPERDOLL_NECK; slot = Inventory.PAPERDOLL_NECK;
} }
else if (command.startsWith("admin_setun")) else if (command.startsWith("admin_setun"))
{ {
armorType = Inventory.PAPERDOLL_UNDER; slot = Inventory.PAPERDOLL_UNDER;
} }
else if (command.startsWith("admin_setba")) else if (command.startsWith("admin_setba"))
{ {
armorType = Inventory.PAPERDOLL_CLOAK; slot = Inventory.PAPERDOLL_CLOAK;
} }
else if (command.startsWith("admin_setbe")) else if (command.startsWith("admin_setbe"))
{ {
armorType = Inventory.PAPERDOLL_BELT; slot = Inventory.PAPERDOLL_BELT;
} }
else if (command.startsWith("admin_seth1")) else if (command.startsWith("admin_seth1"))
{ {
armorType = Inventory.PAPERDOLL_HAIR; slot = Inventory.PAPERDOLL_HAIR;
} }
else if (command.startsWith("admin_seth2")) else if (command.startsWith("admin_seth2"))
{ {
armorType = Inventory.PAPERDOLL_HAIR2; slot = Inventory.PAPERDOLL_HAIR2;
} }
else if (command.startsWith("admin_setbr")) else if (command.startsWith("admin_setbr"))
{ {
armorType = Inventory.PAPERDOLL_BROOCH; slot = Inventory.PAPERDOLL_BROOCH;
} }
else if (command.startsWith("admin_setbt")) // bracelet else if (command.startsWith("admin_setbt")) // bracelet
{ {
armorType = Inventory.PAPERDOLL_RBRACELET; slot = Inventory.PAPERDOLL_RBRACELET;
} }
else if (command.startsWith("admin_setsb")) // seed bracelet else if (command.startsWith("admin_setsb")) // seed bracelet
{ {
armorType = Inventory.PAPERDOLL_LBRACELET; slot = Inventory.PAPERDOLL_LBRACELET;
} }
else if (command.startsWith("admin_setab")) else if (command.startsWith("admin_setab"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT_BOOK; slot = Inventory.PAPERDOLL_ARTIFACT_BOOK;
} }
else if (command.startsWith("admin_seta1")) else if (command.startsWith("admin_seta1"))
{ {
armorType = Inventory.PAPERDOLL_AGATHION1; slot = Inventory.PAPERDOLL_AGATHION1;
} }
else if (command.startsWith("admin_seta2")) else if (command.startsWith("admin_seta2"))
{ {
armorType = Inventory.PAPERDOLL_AGATHION2; slot = Inventory.PAPERDOLL_AGATHION2;
} }
else if (command.startsWith("admin_seta3")) else if (command.startsWith("admin_seta3"))
{ {
armorType = Inventory.PAPERDOLL_AGATHION3; slot = Inventory.PAPERDOLL_AGATHION3;
} }
else if (command.startsWith("admin_seta4")) else if (command.startsWith("admin_seta4"))
{ {
armorType = Inventory.PAPERDOLL_AGATHION4; slot = Inventory.PAPERDOLL_AGATHION4;
} }
else if (command.startsWith("admin_seta5")) else if (command.startsWith("admin_seta5"))
{ {
armorType = Inventory.PAPERDOLL_AGATHION5; slot = Inventory.PAPERDOLL_AGATHION5;
} }
else if (command.startsWith("admin_set01")) else if (command.startsWith("admin_set01"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT1; slot = Inventory.PAPERDOLL_ARTIFACT1;
} }
else if (command.startsWith("admin_set02")) else if (command.startsWith("admin_set02"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT2; slot = Inventory.PAPERDOLL_ARTIFACT2;
} }
else if (command.startsWith("admin_set03")) else if (command.startsWith("admin_set03"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT3; slot = Inventory.PAPERDOLL_ARTIFACT3;
} }
else if (command.startsWith("admin_set04")) else if (command.startsWith("admin_set04"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT4; slot = Inventory.PAPERDOLL_ARTIFACT4;
} }
else if (command.startsWith("admin_set05")) else if (command.startsWith("admin_set05"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT5; slot = Inventory.PAPERDOLL_ARTIFACT5;
} }
else if (command.startsWith("admin_set06")) else if (command.startsWith("admin_set06"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT6; slot = Inventory.PAPERDOLL_ARTIFACT6;
} }
else if (command.startsWith("admin_set07")) else if (command.startsWith("admin_set07"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT7; slot = Inventory.PAPERDOLL_ARTIFACT7;
} }
else if (command.startsWith("admin_set08")) else if (command.startsWith("admin_set08"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT8; slot = Inventory.PAPERDOLL_ARTIFACT8;
} }
else if (command.startsWith("admin_set09")) else if (command.startsWith("admin_set09"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT9; slot = Inventory.PAPERDOLL_ARTIFACT9;
} }
else if (command.startsWith("admin_set10")) else if (command.startsWith("admin_set10"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT10; slot = Inventory.PAPERDOLL_ARTIFACT10;
} }
else if (command.startsWith("admin_set11")) else if (command.startsWith("admin_set11"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT11; slot = Inventory.PAPERDOLL_ARTIFACT11;
} }
else if (command.startsWith("admin_set12")) else if (command.startsWith("admin_set12"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT12; slot = Inventory.PAPERDOLL_ARTIFACT12;
} }
else if (command.startsWith("admin_set13")) else if (command.startsWith("admin_set13"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT13; slot = Inventory.PAPERDOLL_ARTIFACT13;
} }
else if (command.startsWith("admin_set14")) else if (command.startsWith("admin_set14"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT14; slot = Inventory.PAPERDOLL_ARTIFACT14;
} }
else if (command.startsWith("admin_set15")) else if (command.startsWith("admin_set15"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT15; slot = Inventory.PAPERDOLL_ARTIFACT15;
} }
else if (command.startsWith("admin_set16")) else if (command.startsWith("admin_set16"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT16; slot = Inventory.PAPERDOLL_ARTIFACT16;
} }
else if (command.startsWith("admin_set17")) else if (command.startsWith("admin_set17"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT17; slot = Inventory.PAPERDOLL_ARTIFACT17;
} }
else if (command.startsWith("admin_set18")) else if (command.startsWith("admin_set18"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT18; slot = Inventory.PAPERDOLL_ARTIFACT18;
} }
else if (command.startsWith("admin_set19")) else if (command.startsWith("admin_set19"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT19; slot = Inventory.PAPERDOLL_ARTIFACT19;
} }
else if (command.startsWith("admin_set20")) else if (command.startsWith("admin_set20"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT20; slot = Inventory.PAPERDOLL_ARTIFACT20;
} }
else if (command.startsWith("admin_set21")) else if (command.startsWith("admin_set21"))
{ {
armorType = Inventory.PAPERDOLL_ARTIFACT21; slot = Inventory.PAPERDOLL_ARTIFACT21;
} }
if (armorType != -1) if (slot != -1)
{ {
try try
{ {
@@ -318,7 +318,7 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
setEnchant(activeChar, ench, armorType); setEnchant(activeChar, ench, slot);
} }
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
@@ -331,7 +331,7 @@ public class AdminEnchant implements IAdminCommandHandler
} }
BuilderUtil.sendSysMessage(activeChar, "Auto-Set Enchant value to 0."); BuilderUtil.sendSysMessage(activeChar, "Auto-Set Enchant value to 0.");
setEnchant(activeChar, fuse, armorType); setEnchant(activeChar, fuse, slot);
} }
catch (NumberFormatException e) catch (NumberFormatException e)
{ {
@@ -349,7 +349,7 @@ public class AdminEnchant implements IAdminCommandHandler
return true; return true;
} }
private void setEnchant(Player activeChar, int ench, int armorType) private void setEnchant(Player activeChar, int ench, int slot)
{ {
// get the target // get the target
@@ -364,10 +364,10 @@ public class AdminEnchant implements IAdminCommandHandler
Item itemInstance = null; Item itemInstance = null;
// only attempt to enchant if there is a weapon equipped // only attempt to enchant if there is a weapon equipped
final Item parmorInstance = player.getInventory().getPaperdollItem(armorType); final Item paperdollInstance = player.getInventory().getPaperdollItem(slot);
if ((parmorInstance != null) && (parmorInstance.getLocationSlot() == armorType)) if ((paperdollInstance != null) && (paperdollInstance.getLocationSlot() == slot))
{ {
itemInstance = parmorInstance; itemInstance = paperdollInstance;
} }
if (itemInstance != null) if (itemInstance != null)

View File

@@ -62,65 +62,65 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
int armorType = -1; int slot = -1;
if (command.startsWith("admin_seteh")) if (command.startsWith("admin_seteh"))
{ {
armorType = Inventory.PAPERDOLL_HEAD; slot = Inventory.PAPERDOLL_HEAD;
} }
else if (command.startsWith("admin_setec")) else if (command.startsWith("admin_setec"))
{ {
armorType = Inventory.PAPERDOLL_CHEST; slot = Inventory.PAPERDOLL_CHEST;
} }
else if (command.startsWith("admin_seteg")) else if (command.startsWith("admin_seteg"))
{ {
armorType = Inventory.PAPERDOLL_GLOVES; slot = Inventory.PAPERDOLL_GLOVES;
} }
else if (command.startsWith("admin_seteb")) else if (command.startsWith("admin_seteb"))
{ {
armorType = Inventory.PAPERDOLL_FEET; slot = Inventory.PAPERDOLL_FEET;
} }
else if (command.startsWith("admin_setel")) else if (command.startsWith("admin_setel"))
{ {
armorType = Inventory.PAPERDOLL_LEGS; slot = Inventory.PAPERDOLL_LEGS;
} }
else if (command.startsWith("admin_setew")) else if (command.startsWith("admin_setew"))
{ {
armorType = Inventory.PAPERDOLL_RHAND; slot = Inventory.PAPERDOLL_RHAND;
} }
else if (command.startsWith("admin_setes")) else if (command.startsWith("admin_setes"))
{ {
armorType = Inventory.PAPERDOLL_LHAND; slot = Inventory.PAPERDOLL_LHAND;
} }
else if (command.startsWith("admin_setle")) else if (command.startsWith("admin_setle"))
{ {
armorType = Inventory.PAPERDOLL_LEAR; slot = Inventory.PAPERDOLL_LEAR;
} }
else if (command.startsWith("admin_setre")) else if (command.startsWith("admin_setre"))
{ {
armorType = Inventory.PAPERDOLL_REAR; slot = Inventory.PAPERDOLL_REAR;
} }
else if (command.startsWith("admin_setlf")) else if (command.startsWith("admin_setlf"))
{ {
armorType = Inventory.PAPERDOLL_LFINGER; slot = Inventory.PAPERDOLL_LFINGER;
} }
else if (command.startsWith("admin_setrf")) else if (command.startsWith("admin_setrf"))
{ {
armorType = Inventory.PAPERDOLL_RFINGER; slot = Inventory.PAPERDOLL_RFINGER;
} }
else if (command.startsWith("admin_seten")) else if (command.startsWith("admin_seten"))
{ {
armorType = Inventory.PAPERDOLL_NECK; slot = Inventory.PAPERDOLL_NECK;
} }
else if (command.startsWith("admin_setun")) else if (command.startsWith("admin_setun"))
{ {
armorType = Inventory.PAPERDOLL_UNDER; slot = Inventory.PAPERDOLL_UNDER;
} }
else if (command.startsWith("admin_setba")) else if (command.startsWith("admin_setba"))
{ {
armorType = Inventory.PAPERDOLL_BACK; slot = Inventory.PAPERDOLL_BACK;
} }
if (armorType != -1) if (slot != -1)
{ {
try try
{ {
@@ -133,7 +133,7 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
setEnchant(activeChar, ench, armorType); setEnchant(activeChar, ench, slot);
} }
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
@@ -153,7 +153,7 @@ public class AdminEnchant implements IAdminCommandHandler
return true; return true;
} }
private void setEnchant(Player activeChar, int ench, int armorType) private void setEnchant(Player activeChar, int ench, int slot)
{ {
// get the target // get the target
WorldObject target = activeChar.getTarget(); WorldObject target = activeChar.getTarget();
@@ -178,18 +178,18 @@ public class AdminEnchant implements IAdminCommandHandler
Item itemInstance = null; Item itemInstance = null;
// only attempt to enchant if there is a weapon equipped // only attempt to enchant if there is a weapon equipped
Item parmorInstance = player.getInventory().getPaperdollItem(armorType); Item paperdollInstance = player.getInventory().getPaperdollItem(slot);
if ((parmorInstance != null) && (parmorInstance.getEquipSlot() == armorType)) if ((paperdollInstance != null) && (paperdollInstance.getEquipSlot() == slot))
{ {
itemInstance = parmorInstance; itemInstance = paperdollInstance;
} }
else else
{ {
// for bows and double handed weapons // for bows and double handed weapons
parmorInstance = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LRHAND); paperdollInstance = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LRHAND);
if ((parmorInstance != null) && (parmorInstance.getEquipSlot() == Inventory.PAPERDOLL_LRHAND)) if ((paperdollInstance != null) && (paperdollInstance.getEquipSlot() == Inventory.PAPERDOLL_LRHAND))
{ {
itemInstance = parmorInstance; itemInstance = paperdollInstance;
} }
} }

View File

@@ -64,65 +64,65 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
int armorType = -1; int slot = -1;
if (command.startsWith("admin_seteh")) if (command.startsWith("admin_seteh"))
{ {
armorType = Inventory.PAPERDOLL_HEAD; slot = Inventory.PAPERDOLL_HEAD;
} }
else if (command.startsWith("admin_setec")) else if (command.startsWith("admin_setec"))
{ {
armorType = Inventory.PAPERDOLL_CHEST; slot = Inventory.PAPERDOLL_CHEST;
} }
else if (command.startsWith("admin_seteg")) else if (command.startsWith("admin_seteg"))
{ {
armorType = Inventory.PAPERDOLL_GLOVES; slot = Inventory.PAPERDOLL_GLOVES;
} }
else if (command.startsWith("admin_seteb")) else if (command.startsWith("admin_seteb"))
{ {
armorType = Inventory.PAPERDOLL_FEET; slot = Inventory.PAPERDOLL_FEET;
} }
else if (command.startsWith("admin_setel")) else if (command.startsWith("admin_setel"))
{ {
armorType = Inventory.PAPERDOLL_LEGS; slot = Inventory.PAPERDOLL_LEGS;
} }
else if (command.startsWith("admin_setew")) else if (command.startsWith("admin_setew"))
{ {
armorType = Inventory.PAPERDOLL_RHAND; slot = Inventory.PAPERDOLL_RHAND;
} }
else if (command.startsWith("admin_setes")) else if (command.startsWith("admin_setes"))
{ {
armorType = Inventory.PAPERDOLL_LHAND; slot = Inventory.PAPERDOLL_LHAND;
} }
else if (command.startsWith("admin_setle")) else if (command.startsWith("admin_setle"))
{ {
armorType = Inventory.PAPERDOLL_LEAR; slot = Inventory.PAPERDOLL_LEAR;
} }
else if (command.startsWith("admin_setre")) else if (command.startsWith("admin_setre"))
{ {
armorType = Inventory.PAPERDOLL_REAR; slot = Inventory.PAPERDOLL_REAR;
} }
else if (command.startsWith("admin_setlf")) else if (command.startsWith("admin_setlf"))
{ {
armorType = Inventory.PAPERDOLL_LFINGER; slot = Inventory.PAPERDOLL_LFINGER;
} }
else if (command.startsWith("admin_setrf")) else if (command.startsWith("admin_setrf"))
{ {
armorType = Inventory.PAPERDOLL_RFINGER; slot = Inventory.PAPERDOLL_RFINGER;
} }
else if (command.startsWith("admin_seten")) else if (command.startsWith("admin_seten"))
{ {
armorType = Inventory.PAPERDOLL_NECK; slot = Inventory.PAPERDOLL_NECK;
} }
else if (command.startsWith("admin_setun")) else if (command.startsWith("admin_setun"))
{ {
armorType = Inventory.PAPERDOLL_UNDER; slot = Inventory.PAPERDOLL_UNDER;
} }
else if (command.startsWith("admin_setba")) else if (command.startsWith("admin_setba"))
{ {
armorType = Inventory.PAPERDOLL_CLOAK; slot = Inventory.PAPERDOLL_CLOAK;
} }
if (armorType != -1) if (slot != -1)
{ {
try try
{ {
@@ -135,7 +135,7 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
setEnchant(activeChar, ench, armorType); setEnchant(activeChar, ench, slot);
} }
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
@@ -163,7 +163,7 @@ public class AdminEnchant implements IAdminCommandHandler
return true; return true;
} }
private void setEnchant(Player activeChar, int ench, int armorType) private void setEnchant(Player activeChar, int ench, int slot)
{ {
// get the target // get the target
WorldObject target = activeChar.getTarget(); WorldObject target = activeChar.getTarget();
@@ -187,10 +187,10 @@ public class AdminEnchant implements IAdminCommandHandler
Item itemInstance = null; Item itemInstance = null;
// only attempt to enchant if there is a weapon equipped // only attempt to enchant if there is a weapon equipped
final Item parmorInstance = player.getInventory().getPaperdollItem(armorType); final Item paperdollInstance = player.getInventory().getPaperdollItem(slot);
if ((parmorInstance != null) && (parmorInstance.getLocationSlot() == armorType)) if ((paperdollInstance != null) && (paperdollInstance.getLocationSlot() == slot))
{ {
itemInstance = parmorInstance; itemInstance = paperdollInstance;
} }
if (itemInstance != null) if (itemInstance != null)
@@ -198,7 +198,7 @@ public class AdminEnchant implements IAdminCommandHandler
curEnchant = itemInstance.getEnchantLevel(); curEnchant = itemInstance.getEnchantLevel();
// set enchant value // set enchant value
player.getInventory().unEquipItemInSlot(armorType); player.getInventory().unEquipItemInSlot(slot);
itemInstance.setEnchantLevel(ench); itemInstance.setEnchantLevel(ench);
player.getInventory().equipItem(itemInstance); player.getInventory().equipItem(itemInstance);

View File

@@ -65,69 +65,69 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
int armorType = -1; int slot = -1;
if (command.startsWith("admin_seteh")) if (command.startsWith("admin_seteh"))
{ {
armorType = Inventory.PAPERDOLL_HEAD; slot = Inventory.PAPERDOLL_HEAD;
} }
else if (command.startsWith("admin_setec")) else if (command.startsWith("admin_setec"))
{ {
armorType = Inventory.PAPERDOLL_CHEST; slot = Inventory.PAPERDOLL_CHEST;
} }
else if (command.startsWith("admin_seteg")) else if (command.startsWith("admin_seteg"))
{ {
armorType = Inventory.PAPERDOLL_GLOVES; slot = Inventory.PAPERDOLL_GLOVES;
} }
else if (command.startsWith("admin_seteb")) else if (command.startsWith("admin_seteb"))
{ {
armorType = Inventory.PAPERDOLL_FEET; slot = Inventory.PAPERDOLL_FEET;
} }
else if (command.startsWith("admin_setel")) else if (command.startsWith("admin_setel"))
{ {
armorType = Inventory.PAPERDOLL_LEGS; slot = Inventory.PAPERDOLL_LEGS;
} }
else if (command.startsWith("admin_setew")) else if (command.startsWith("admin_setew"))
{ {
armorType = Inventory.PAPERDOLL_RHAND; slot = Inventory.PAPERDOLL_RHAND;
} }
else if (command.startsWith("admin_setes")) else if (command.startsWith("admin_setes"))
{ {
armorType = Inventory.PAPERDOLL_LHAND; slot = Inventory.PAPERDOLL_LHAND;
} }
else if (command.startsWith("admin_setle")) else if (command.startsWith("admin_setle"))
{ {
armorType = Inventory.PAPERDOLL_LEAR; slot = Inventory.PAPERDOLL_LEAR;
} }
else if (command.startsWith("admin_setre")) else if (command.startsWith("admin_setre"))
{ {
armorType = Inventory.PAPERDOLL_REAR; slot = Inventory.PAPERDOLL_REAR;
} }
else if (command.startsWith("admin_setlf")) else if (command.startsWith("admin_setlf"))
{ {
armorType = Inventory.PAPERDOLL_LFINGER; slot = Inventory.PAPERDOLL_LFINGER;
} }
else if (command.startsWith("admin_setrf")) else if (command.startsWith("admin_setrf"))
{ {
armorType = Inventory.PAPERDOLL_RFINGER; slot = Inventory.PAPERDOLL_RFINGER;
} }
else if (command.startsWith("admin_seten")) else if (command.startsWith("admin_seten"))
{ {
armorType = Inventory.PAPERDOLL_NECK; slot = Inventory.PAPERDOLL_NECK;
} }
else if (command.startsWith("admin_setun")) else if (command.startsWith("admin_setun"))
{ {
armorType = Inventory.PAPERDOLL_UNDER; slot = Inventory.PAPERDOLL_UNDER;
} }
else if (command.startsWith("admin_setba")) else if (command.startsWith("admin_setba"))
{ {
armorType = Inventory.PAPERDOLL_CLOAK; slot = Inventory.PAPERDOLL_CLOAK;
} }
else if (command.startsWith("admin_setbe")) else if (command.startsWith("admin_setbe"))
{ {
armorType = Inventory.PAPERDOLL_BELT; slot = Inventory.PAPERDOLL_BELT;
} }
if (armorType != -1) if (slot != -1)
{ {
try try
{ {
@@ -140,7 +140,7 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
setEnchant(activeChar, ench, armorType); setEnchant(activeChar, ench, slot);
} }
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
@@ -168,7 +168,7 @@ public class AdminEnchant implements IAdminCommandHandler
return true; return true;
} }
private void setEnchant(Player activeChar, int ench, int armorType) private void setEnchant(Player activeChar, int ench, int slot)
{ {
// get the target // get the target
WorldObject target = activeChar.getTarget(); WorldObject target = activeChar.getTarget();
@@ -192,10 +192,10 @@ public class AdminEnchant implements IAdminCommandHandler
Item itemInstance = null; Item itemInstance = null;
// only attempt to enchant if there is a weapon equipped // only attempt to enchant if there is a weapon equipped
final Item parmorInstance = player.getInventory().getPaperdollItem(armorType); final Item paperdollInstance = player.getInventory().getPaperdollItem(slot);
if ((parmorInstance != null) && (parmorInstance.getLocationSlot() == armorType)) if ((paperdollInstance != null) && (paperdollInstance.getLocationSlot() == slot))
{ {
itemInstance = parmorInstance; itemInstance = paperdollInstance;
} }
if (itemInstance != null) if (itemInstance != null)
@@ -203,7 +203,7 @@ public class AdminEnchant implements IAdminCommandHandler
curEnchant = itemInstance.getEnchantLevel(); curEnchant = itemInstance.getEnchantLevel();
// set enchant value // set enchant value
player.getInventory().unEquipItemInSlot(armorType); player.getInventory().unEquipItemInSlot(slot);
itemInstance.setEnchantLevel(ench); itemInstance.setEnchantLevel(ench);
player.getInventory().equipItem(itemInstance); player.getInventory().equipItem(itemInstance);

View File

@@ -65,69 +65,69 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
int armorType = -1; int slot = -1;
if (command.startsWith("admin_seteh")) if (command.startsWith("admin_seteh"))
{ {
armorType = Inventory.PAPERDOLL_HEAD; slot = Inventory.PAPERDOLL_HEAD;
} }
else if (command.startsWith("admin_setec")) else if (command.startsWith("admin_setec"))
{ {
armorType = Inventory.PAPERDOLL_CHEST; slot = Inventory.PAPERDOLL_CHEST;
} }
else if (command.startsWith("admin_seteg")) else if (command.startsWith("admin_seteg"))
{ {
armorType = Inventory.PAPERDOLL_GLOVES; slot = Inventory.PAPERDOLL_GLOVES;
} }
else if (command.startsWith("admin_seteb")) else if (command.startsWith("admin_seteb"))
{ {
armorType = Inventory.PAPERDOLL_FEET; slot = Inventory.PAPERDOLL_FEET;
} }
else if (command.startsWith("admin_setel")) else if (command.startsWith("admin_setel"))
{ {
armorType = Inventory.PAPERDOLL_LEGS; slot = Inventory.PAPERDOLL_LEGS;
} }
else if (command.startsWith("admin_setew")) else if (command.startsWith("admin_setew"))
{ {
armorType = Inventory.PAPERDOLL_RHAND; slot = Inventory.PAPERDOLL_RHAND;
} }
else if (command.startsWith("admin_setes")) else if (command.startsWith("admin_setes"))
{ {
armorType = Inventory.PAPERDOLL_LHAND; slot = Inventory.PAPERDOLL_LHAND;
} }
else if (command.startsWith("admin_setle")) else if (command.startsWith("admin_setle"))
{ {
armorType = Inventory.PAPERDOLL_LEAR; slot = Inventory.PAPERDOLL_LEAR;
} }
else if (command.startsWith("admin_setre")) else if (command.startsWith("admin_setre"))
{ {
armorType = Inventory.PAPERDOLL_REAR; slot = Inventory.PAPERDOLL_REAR;
} }
else if (command.startsWith("admin_setlf")) else if (command.startsWith("admin_setlf"))
{ {
armorType = Inventory.PAPERDOLL_LFINGER; slot = Inventory.PAPERDOLL_LFINGER;
} }
else if (command.startsWith("admin_setrf")) else if (command.startsWith("admin_setrf"))
{ {
armorType = Inventory.PAPERDOLL_RFINGER; slot = Inventory.PAPERDOLL_RFINGER;
} }
else if (command.startsWith("admin_seten")) else if (command.startsWith("admin_seten"))
{ {
armorType = Inventory.PAPERDOLL_NECK; slot = Inventory.PAPERDOLL_NECK;
} }
else if (command.startsWith("admin_setun")) else if (command.startsWith("admin_setun"))
{ {
armorType = Inventory.PAPERDOLL_UNDER; slot = Inventory.PAPERDOLL_UNDER;
} }
else if (command.startsWith("admin_setba")) else if (command.startsWith("admin_setba"))
{ {
armorType = Inventory.PAPERDOLL_CLOAK; slot = Inventory.PAPERDOLL_CLOAK;
} }
else if (command.startsWith("admin_setbe")) else if (command.startsWith("admin_setbe"))
{ {
armorType = Inventory.PAPERDOLL_BELT; slot = Inventory.PAPERDOLL_BELT;
} }
if (armorType != -1) if (slot != -1)
{ {
try try
{ {
@@ -140,7 +140,7 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
setEnchant(activeChar, ench, armorType); setEnchant(activeChar, ench, slot);
} }
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
@@ -168,7 +168,7 @@ public class AdminEnchant implements IAdminCommandHandler
return true; return true;
} }
private void setEnchant(Player activeChar, int ench, int armorType) private void setEnchant(Player activeChar, int ench, int slot)
{ {
// get the target // get the target
WorldObject target = activeChar.getTarget(); WorldObject target = activeChar.getTarget();
@@ -192,10 +192,10 @@ public class AdminEnchant implements IAdminCommandHandler
Item itemInstance = null; Item itemInstance = null;
// only attempt to enchant if there is a weapon equipped // only attempt to enchant if there is a weapon equipped
final Item parmorInstance = player.getInventory().getPaperdollItem(armorType); final Item paperdollInstance = player.getInventory().getPaperdollItem(slot);
if ((parmorInstance != null) && (parmorInstance.getLocationSlot() == armorType)) if ((paperdollInstance != null) && (paperdollInstance.getLocationSlot() == slot))
{ {
itemInstance = parmorInstance; itemInstance = paperdollInstance;
} }
if (itemInstance != null) if (itemInstance != null)
@@ -203,7 +203,7 @@ public class AdminEnchant implements IAdminCommandHandler
curEnchant = itemInstance.getEnchantLevel(); curEnchant = itemInstance.getEnchantLevel();
// set enchant value // set enchant value
player.getInventory().unEquipItemInSlot(armorType); player.getInventory().unEquipItemInSlot(slot);
itemInstance.setEnchantLevel(ench); itemInstance.setEnchantLevel(ench);
player.getInventory().equipItem(itemInstance); player.getInventory().equipItem(itemInstance);

View File

@@ -64,69 +64,69 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
int armorType = -1; int slot = -1;
if (command.startsWith("admin_seteh")) if (command.startsWith("admin_seteh"))
{ {
armorType = Inventory.PAPERDOLL_HEAD; slot = Inventory.PAPERDOLL_HEAD;
} }
else if (command.startsWith("admin_setec")) else if (command.startsWith("admin_setec"))
{ {
armorType = Inventory.PAPERDOLL_CHEST; slot = Inventory.PAPERDOLL_CHEST;
} }
else if (command.startsWith("admin_seteg")) else if (command.startsWith("admin_seteg"))
{ {
armorType = Inventory.PAPERDOLL_GLOVES; slot = Inventory.PAPERDOLL_GLOVES;
} }
else if (command.startsWith("admin_seteb")) else if (command.startsWith("admin_seteb"))
{ {
armorType = Inventory.PAPERDOLL_FEET; slot = Inventory.PAPERDOLL_FEET;
} }
else if (command.startsWith("admin_setel")) else if (command.startsWith("admin_setel"))
{ {
armorType = Inventory.PAPERDOLL_LEGS; slot = Inventory.PAPERDOLL_LEGS;
} }
else if (command.startsWith("admin_setew")) else if (command.startsWith("admin_setew"))
{ {
armorType = Inventory.PAPERDOLL_RHAND; slot = Inventory.PAPERDOLL_RHAND;
} }
else if (command.startsWith("admin_setes")) else if (command.startsWith("admin_setes"))
{ {
armorType = Inventory.PAPERDOLL_LHAND; slot = Inventory.PAPERDOLL_LHAND;
} }
else if (command.startsWith("admin_setle")) else if (command.startsWith("admin_setle"))
{ {
armorType = Inventory.PAPERDOLL_LEAR; slot = Inventory.PAPERDOLL_LEAR;
} }
else if (command.startsWith("admin_setre")) else if (command.startsWith("admin_setre"))
{ {
armorType = Inventory.PAPERDOLL_REAR; slot = Inventory.PAPERDOLL_REAR;
} }
else if (command.startsWith("admin_setlf")) else if (command.startsWith("admin_setlf"))
{ {
armorType = Inventory.PAPERDOLL_LFINGER; slot = Inventory.PAPERDOLL_LFINGER;
} }
else if (command.startsWith("admin_setrf")) else if (command.startsWith("admin_setrf"))
{ {
armorType = Inventory.PAPERDOLL_RFINGER; slot = Inventory.PAPERDOLL_RFINGER;
} }
else if (command.startsWith("admin_seten")) else if (command.startsWith("admin_seten"))
{ {
armorType = Inventory.PAPERDOLL_NECK; slot = Inventory.PAPERDOLL_NECK;
} }
else if (command.startsWith("admin_setun")) else if (command.startsWith("admin_setun"))
{ {
armorType = Inventory.PAPERDOLL_UNDER; slot = Inventory.PAPERDOLL_UNDER;
} }
else if (command.startsWith("admin_setba")) else if (command.startsWith("admin_setba"))
{ {
armorType = Inventory.PAPERDOLL_CLOAK; slot = Inventory.PAPERDOLL_CLOAK;
} }
else if (command.startsWith("admin_setbe")) else if (command.startsWith("admin_setbe"))
{ {
armorType = Inventory.PAPERDOLL_BELT; slot = Inventory.PAPERDOLL_BELT;
} }
if (armorType != -1) if (slot != -1)
{ {
try try
{ {
@@ -139,7 +139,7 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
setEnchant(activeChar, ench, armorType); setEnchant(activeChar, ench, slot);
} }
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
@@ -166,7 +166,7 @@ public class AdminEnchant implements IAdminCommandHandler
return true; return true;
} }
private void setEnchant(Player activeChar, int ench, int armorType) private void setEnchant(Player activeChar, int ench, int slot)
{ {
// get the target // get the target
@@ -181,10 +181,10 @@ public class AdminEnchant implements IAdminCommandHandler
Item itemInstance = null; Item itemInstance = null;
// only attempt to enchant if there is a weapon equipped // only attempt to enchant if there is a weapon equipped
final Item parmorInstance = player.getInventory().getPaperdollItem(armorType); final Item paperdollInstance = player.getInventory().getPaperdollItem(slot);
if ((parmorInstance != null) && (parmorInstance.getLocationSlot() == armorType)) if ((paperdollInstance != null) && (paperdollInstance.getLocationSlot() == slot))
{ {
itemInstance = parmorInstance; itemInstance = paperdollInstance;
} }
if (itemInstance != null) if (itemInstance != null)
@@ -192,7 +192,7 @@ public class AdminEnchant implements IAdminCommandHandler
final int curEnchant = itemInstance.getEnchantLevel(); final int curEnchant = itemInstance.getEnchantLevel();
// set enchant value // set enchant value
player.getInventory().unEquipItemInSlot(armorType); player.getInventory().unEquipItemInSlot(slot);
itemInstance.setEnchantLevel(ench); itemInstance.setEnchantLevel(ench);
player.getInventory().equipItem(itemInstance); player.getInventory().equipItem(itemInstance);

View File

@@ -64,69 +64,69 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
int armorType = -1; int slot = -1;
if (command.startsWith("admin_seteh")) if (command.startsWith("admin_seteh"))
{ {
armorType = Inventory.PAPERDOLL_HEAD; slot = Inventory.PAPERDOLL_HEAD;
} }
else if (command.startsWith("admin_setec")) else if (command.startsWith("admin_setec"))
{ {
armorType = Inventory.PAPERDOLL_CHEST; slot = Inventory.PAPERDOLL_CHEST;
} }
else if (command.startsWith("admin_seteg")) else if (command.startsWith("admin_seteg"))
{ {
armorType = Inventory.PAPERDOLL_GLOVES; slot = Inventory.PAPERDOLL_GLOVES;
} }
else if (command.startsWith("admin_seteb")) else if (command.startsWith("admin_seteb"))
{ {
armorType = Inventory.PAPERDOLL_FEET; slot = Inventory.PAPERDOLL_FEET;
} }
else if (command.startsWith("admin_setel")) else if (command.startsWith("admin_setel"))
{ {
armorType = Inventory.PAPERDOLL_LEGS; slot = Inventory.PAPERDOLL_LEGS;
} }
else if (command.startsWith("admin_setew")) else if (command.startsWith("admin_setew"))
{ {
armorType = Inventory.PAPERDOLL_RHAND; slot = Inventory.PAPERDOLL_RHAND;
} }
else if (command.startsWith("admin_setes")) else if (command.startsWith("admin_setes"))
{ {
armorType = Inventory.PAPERDOLL_LHAND; slot = Inventory.PAPERDOLL_LHAND;
} }
else if (command.startsWith("admin_setle")) else if (command.startsWith("admin_setle"))
{ {
armorType = Inventory.PAPERDOLL_LEAR; slot = Inventory.PAPERDOLL_LEAR;
} }
else if (command.startsWith("admin_setre")) else if (command.startsWith("admin_setre"))
{ {
armorType = Inventory.PAPERDOLL_REAR; slot = Inventory.PAPERDOLL_REAR;
} }
else if (command.startsWith("admin_setlf")) else if (command.startsWith("admin_setlf"))
{ {
armorType = Inventory.PAPERDOLL_LFINGER; slot = Inventory.PAPERDOLL_LFINGER;
} }
else if (command.startsWith("admin_setrf")) else if (command.startsWith("admin_setrf"))
{ {
armorType = Inventory.PAPERDOLL_RFINGER; slot = Inventory.PAPERDOLL_RFINGER;
} }
else if (command.startsWith("admin_seten")) else if (command.startsWith("admin_seten"))
{ {
armorType = Inventory.PAPERDOLL_NECK; slot = Inventory.PAPERDOLL_NECK;
} }
else if (command.startsWith("admin_setun")) else if (command.startsWith("admin_setun"))
{ {
armorType = Inventory.PAPERDOLL_UNDER; slot = Inventory.PAPERDOLL_UNDER;
} }
else if (command.startsWith("admin_setba")) else if (command.startsWith("admin_setba"))
{ {
armorType = Inventory.PAPERDOLL_CLOAK; slot = Inventory.PAPERDOLL_CLOAK;
} }
else if (command.startsWith("admin_setbe")) else if (command.startsWith("admin_setbe"))
{ {
armorType = Inventory.PAPERDOLL_BELT; slot = Inventory.PAPERDOLL_BELT;
} }
if (armorType != -1) if (slot != -1)
{ {
try try
{ {
@@ -139,7 +139,7 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
setEnchant(activeChar, ench, armorType); setEnchant(activeChar, ench, slot);
} }
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
@@ -166,7 +166,7 @@ public class AdminEnchant implements IAdminCommandHandler
return true; return true;
} }
private void setEnchant(Player activeChar, int ench, int armorType) private void setEnchant(Player activeChar, int ench, int slot)
{ {
// get the target // get the target
@@ -181,10 +181,10 @@ public class AdminEnchant implements IAdminCommandHandler
Item itemInstance = null; Item itemInstance = null;
// only attempt to enchant if there is a weapon equipped // only attempt to enchant if there is a weapon equipped
final Item parmorInstance = player.getInventory().getPaperdollItem(armorType); final Item paperdollInstance = player.getInventory().getPaperdollItem(slot);
if ((parmorInstance != null) && (parmorInstance.getLocationSlot() == armorType)) if ((paperdollInstance != null) && (paperdollInstance.getLocationSlot() == slot))
{ {
itemInstance = parmorInstance; itemInstance = paperdollInstance;
} }
if (itemInstance != null) if (itemInstance != null)
@@ -192,7 +192,7 @@ public class AdminEnchant implements IAdminCommandHandler
final int curEnchant = itemInstance.getEnchantLevel(); final int curEnchant = itemInstance.getEnchantLevel();
// set enchant value // set enchant value
player.getInventory().unEquipItemInSlot(armorType); player.getInventory().unEquipItemInSlot(slot);
itemInstance.setEnchantLevel(ench); itemInstance.setEnchantLevel(ench);
player.getInventory().equipItem(itemInstance); player.getInventory().equipItem(itemInstance);

View File

@@ -64,69 +64,69 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
int armorType = -1; int slot = -1;
if (command.startsWith("admin_seteh")) if (command.startsWith("admin_seteh"))
{ {
armorType = Inventory.PAPERDOLL_HEAD; slot = Inventory.PAPERDOLL_HEAD;
} }
else if (command.startsWith("admin_setec")) else if (command.startsWith("admin_setec"))
{ {
armorType = Inventory.PAPERDOLL_CHEST; slot = Inventory.PAPERDOLL_CHEST;
} }
else if (command.startsWith("admin_seteg")) else if (command.startsWith("admin_seteg"))
{ {
armorType = Inventory.PAPERDOLL_GLOVES; slot = Inventory.PAPERDOLL_GLOVES;
} }
else if (command.startsWith("admin_seteb")) else if (command.startsWith("admin_seteb"))
{ {
armorType = Inventory.PAPERDOLL_FEET; slot = Inventory.PAPERDOLL_FEET;
} }
else if (command.startsWith("admin_setel")) else if (command.startsWith("admin_setel"))
{ {
armorType = Inventory.PAPERDOLL_LEGS; slot = Inventory.PAPERDOLL_LEGS;
} }
else if (command.startsWith("admin_setew")) else if (command.startsWith("admin_setew"))
{ {
armorType = Inventory.PAPERDOLL_RHAND; slot = Inventory.PAPERDOLL_RHAND;
} }
else if (command.startsWith("admin_setes")) else if (command.startsWith("admin_setes"))
{ {
armorType = Inventory.PAPERDOLL_LHAND; slot = Inventory.PAPERDOLL_LHAND;
} }
else if (command.startsWith("admin_setle")) else if (command.startsWith("admin_setle"))
{ {
armorType = Inventory.PAPERDOLL_LEAR; slot = Inventory.PAPERDOLL_LEAR;
} }
else if (command.startsWith("admin_setre")) else if (command.startsWith("admin_setre"))
{ {
armorType = Inventory.PAPERDOLL_REAR; slot = Inventory.PAPERDOLL_REAR;
} }
else if (command.startsWith("admin_setlf")) else if (command.startsWith("admin_setlf"))
{ {
armorType = Inventory.PAPERDOLL_LFINGER; slot = Inventory.PAPERDOLL_LFINGER;
} }
else if (command.startsWith("admin_setrf")) else if (command.startsWith("admin_setrf"))
{ {
armorType = Inventory.PAPERDOLL_RFINGER; slot = Inventory.PAPERDOLL_RFINGER;
} }
else if (command.startsWith("admin_seten")) else if (command.startsWith("admin_seten"))
{ {
armorType = Inventory.PAPERDOLL_NECK; slot = Inventory.PAPERDOLL_NECK;
} }
else if (command.startsWith("admin_setun")) else if (command.startsWith("admin_setun"))
{ {
armorType = Inventory.PAPERDOLL_UNDER; slot = Inventory.PAPERDOLL_UNDER;
} }
else if (command.startsWith("admin_setba")) else if (command.startsWith("admin_setba"))
{ {
armorType = Inventory.PAPERDOLL_CLOAK; slot = Inventory.PAPERDOLL_CLOAK;
} }
else if (command.startsWith("admin_setbe")) else if (command.startsWith("admin_setbe"))
{ {
armorType = Inventory.PAPERDOLL_BELT; slot = Inventory.PAPERDOLL_BELT;
} }
if (armorType != -1) if (slot != -1)
{ {
try try
{ {
@@ -139,7 +139,7 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
setEnchant(activeChar, ench, armorType); setEnchant(activeChar, ench, slot);
} }
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
@@ -166,7 +166,7 @@ public class AdminEnchant implements IAdminCommandHandler
return true; return true;
} }
private void setEnchant(Player activeChar, int ench, int armorType) private void setEnchant(Player activeChar, int ench, int slot)
{ {
// get the target // get the target
@@ -181,10 +181,10 @@ public class AdminEnchant implements IAdminCommandHandler
Item itemInstance = null; Item itemInstance = null;
// only attempt to enchant if there is a weapon equipped // only attempt to enchant if there is a weapon equipped
final Item parmorInstance = player.getInventory().getPaperdollItem(armorType); final Item paperdollInstance = player.getInventory().getPaperdollItem(slot);
if ((parmorInstance != null) && (parmorInstance.getLocationSlot() == armorType)) if ((paperdollInstance != null) && (paperdollInstance.getLocationSlot() == slot))
{ {
itemInstance = parmorInstance; itemInstance = paperdollInstance;
} }
if (itemInstance != null) if (itemInstance != null)
@@ -192,7 +192,7 @@ public class AdminEnchant implements IAdminCommandHandler
final int curEnchant = itemInstance.getEnchantLevel(); final int curEnchant = itemInstance.getEnchantLevel();
// set enchant value // set enchant value
player.getInventory().unEquipItemInSlot(armorType); player.getInventory().unEquipItemInSlot(slot);
itemInstance.setEnchantLevel(ench); itemInstance.setEnchantLevel(ench);
player.getInventory().equipItem(itemInstance); player.getInventory().equipItem(itemInstance);

View File

@@ -64,69 +64,69 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
int armorType = -1; int slot = -1;
if (command.startsWith("admin_seteh")) if (command.startsWith("admin_seteh"))
{ {
armorType = Inventory.PAPERDOLL_HEAD; slot = Inventory.PAPERDOLL_HEAD;
} }
else if (command.startsWith("admin_setec")) else if (command.startsWith("admin_setec"))
{ {
armorType = Inventory.PAPERDOLL_CHEST; slot = Inventory.PAPERDOLL_CHEST;
} }
else if (command.startsWith("admin_seteg")) else if (command.startsWith("admin_seteg"))
{ {
armorType = Inventory.PAPERDOLL_GLOVES; slot = Inventory.PAPERDOLL_GLOVES;
} }
else if (command.startsWith("admin_seteb")) else if (command.startsWith("admin_seteb"))
{ {
armorType = Inventory.PAPERDOLL_FEET; slot = Inventory.PAPERDOLL_FEET;
} }
else if (command.startsWith("admin_setel")) else if (command.startsWith("admin_setel"))
{ {
armorType = Inventory.PAPERDOLL_LEGS; slot = Inventory.PAPERDOLL_LEGS;
} }
else if (command.startsWith("admin_setew")) else if (command.startsWith("admin_setew"))
{ {
armorType = Inventory.PAPERDOLL_RHAND; slot = Inventory.PAPERDOLL_RHAND;
} }
else if (command.startsWith("admin_setes")) else if (command.startsWith("admin_setes"))
{ {
armorType = Inventory.PAPERDOLL_LHAND; slot = Inventory.PAPERDOLL_LHAND;
} }
else if (command.startsWith("admin_setle")) else if (command.startsWith("admin_setle"))
{ {
armorType = Inventory.PAPERDOLL_LEAR; slot = Inventory.PAPERDOLL_LEAR;
} }
else if (command.startsWith("admin_setre")) else if (command.startsWith("admin_setre"))
{ {
armorType = Inventory.PAPERDOLL_REAR; slot = Inventory.PAPERDOLL_REAR;
} }
else if (command.startsWith("admin_setlf")) else if (command.startsWith("admin_setlf"))
{ {
armorType = Inventory.PAPERDOLL_LFINGER; slot = Inventory.PAPERDOLL_LFINGER;
} }
else if (command.startsWith("admin_setrf")) else if (command.startsWith("admin_setrf"))
{ {
armorType = Inventory.PAPERDOLL_RFINGER; slot = Inventory.PAPERDOLL_RFINGER;
} }
else if (command.startsWith("admin_seten")) else if (command.startsWith("admin_seten"))
{ {
armorType = Inventory.PAPERDOLL_NECK; slot = Inventory.PAPERDOLL_NECK;
} }
else if (command.startsWith("admin_setun")) else if (command.startsWith("admin_setun"))
{ {
armorType = Inventory.PAPERDOLL_UNDER; slot = Inventory.PAPERDOLL_UNDER;
} }
else if (command.startsWith("admin_setba")) else if (command.startsWith("admin_setba"))
{ {
armorType = Inventory.PAPERDOLL_CLOAK; slot = Inventory.PAPERDOLL_CLOAK;
} }
else if (command.startsWith("admin_setbe")) else if (command.startsWith("admin_setbe"))
{ {
armorType = Inventory.PAPERDOLL_BELT; slot = Inventory.PAPERDOLL_BELT;
} }
if (armorType != -1) if (slot != -1)
{ {
try try
{ {
@@ -139,7 +139,7 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
setEnchant(activeChar, ench, armorType); setEnchant(activeChar, ench, slot);
} }
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
@@ -166,7 +166,7 @@ public class AdminEnchant implements IAdminCommandHandler
return true; return true;
} }
private void setEnchant(Player activeChar, int ench, int armorType) private void setEnchant(Player activeChar, int ench, int slot)
{ {
// get the target // get the target
@@ -181,10 +181,10 @@ public class AdminEnchant implements IAdminCommandHandler
Item itemInstance = null; Item itemInstance = null;
// only attempt to enchant if there is a weapon equipped // only attempt to enchant if there is a weapon equipped
final Item parmorInstance = player.getInventory().getPaperdollItem(armorType); final Item paperdollInstance = player.getInventory().getPaperdollItem(slot);
if ((parmorInstance != null) && (parmorInstance.getLocationSlot() == armorType)) if ((paperdollInstance != null) && (paperdollInstance.getLocationSlot() == slot))
{ {
itemInstance = parmorInstance; itemInstance = paperdollInstance;
} }
if (itemInstance != null) if (itemInstance != null)
@@ -192,7 +192,7 @@ public class AdminEnchant implements IAdminCommandHandler
final int curEnchant = itemInstance.getEnchantLevel(); final int curEnchant = itemInstance.getEnchantLevel();
// set enchant value // set enchant value
player.getInventory().unEquipItemInSlot(armorType); player.getInventory().unEquipItemInSlot(slot);
itemInstance.setEnchantLevel(ench); itemInstance.setEnchantLevel(ench);
player.getInventory().equipItem(itemInstance); player.getInventory().equipItem(itemInstance);

View File

@@ -64,69 +64,69 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
int armorType = -1; int slot = -1;
if (command.startsWith("admin_seteh")) if (command.startsWith("admin_seteh"))
{ {
armorType = Inventory.PAPERDOLL_HEAD; slot = Inventory.PAPERDOLL_HEAD;
} }
else if (command.startsWith("admin_setec")) else if (command.startsWith("admin_setec"))
{ {
armorType = Inventory.PAPERDOLL_CHEST; slot = Inventory.PAPERDOLL_CHEST;
} }
else if (command.startsWith("admin_seteg")) else if (command.startsWith("admin_seteg"))
{ {
armorType = Inventory.PAPERDOLL_GLOVES; slot = Inventory.PAPERDOLL_GLOVES;
} }
else if (command.startsWith("admin_seteb")) else if (command.startsWith("admin_seteb"))
{ {
armorType = Inventory.PAPERDOLL_FEET; slot = Inventory.PAPERDOLL_FEET;
} }
else if (command.startsWith("admin_setel")) else if (command.startsWith("admin_setel"))
{ {
armorType = Inventory.PAPERDOLL_LEGS; slot = Inventory.PAPERDOLL_LEGS;
} }
else if (command.startsWith("admin_setew")) else if (command.startsWith("admin_setew"))
{ {
armorType = Inventory.PAPERDOLL_RHAND; slot = Inventory.PAPERDOLL_RHAND;
} }
else if (command.startsWith("admin_setes")) else if (command.startsWith("admin_setes"))
{ {
armorType = Inventory.PAPERDOLL_LHAND; slot = Inventory.PAPERDOLL_LHAND;
} }
else if (command.startsWith("admin_setle")) else if (command.startsWith("admin_setle"))
{ {
armorType = Inventory.PAPERDOLL_LEAR; slot = Inventory.PAPERDOLL_LEAR;
} }
else if (command.startsWith("admin_setre")) else if (command.startsWith("admin_setre"))
{ {
armorType = Inventory.PAPERDOLL_REAR; slot = Inventory.PAPERDOLL_REAR;
} }
else if (command.startsWith("admin_setlf")) else if (command.startsWith("admin_setlf"))
{ {
armorType = Inventory.PAPERDOLL_LFINGER; slot = Inventory.PAPERDOLL_LFINGER;
} }
else if (command.startsWith("admin_setrf")) else if (command.startsWith("admin_setrf"))
{ {
armorType = Inventory.PAPERDOLL_RFINGER; slot = Inventory.PAPERDOLL_RFINGER;
} }
else if (command.startsWith("admin_seten")) else if (command.startsWith("admin_seten"))
{ {
armorType = Inventory.PAPERDOLL_NECK; slot = Inventory.PAPERDOLL_NECK;
} }
else if (command.startsWith("admin_setun")) else if (command.startsWith("admin_setun"))
{ {
armorType = Inventory.PAPERDOLL_UNDER; slot = Inventory.PAPERDOLL_UNDER;
} }
else if (command.startsWith("admin_setba")) else if (command.startsWith("admin_setba"))
{ {
armorType = Inventory.PAPERDOLL_CLOAK; slot = Inventory.PAPERDOLL_CLOAK;
} }
else if (command.startsWith("admin_setbe")) else if (command.startsWith("admin_setbe"))
{ {
armorType = Inventory.PAPERDOLL_BELT; slot = Inventory.PAPERDOLL_BELT;
} }
if (armorType != -1) if (slot != -1)
{ {
try try
{ {
@@ -139,7 +139,7 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
setEnchant(activeChar, ench, armorType); setEnchant(activeChar, ench, slot);
} }
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
@@ -166,7 +166,7 @@ public class AdminEnchant implements IAdminCommandHandler
return true; return true;
} }
private void setEnchant(Player activeChar, int ench, int armorType) private void setEnchant(Player activeChar, int ench, int slot)
{ {
// get the target // get the target
@@ -181,10 +181,10 @@ public class AdminEnchant implements IAdminCommandHandler
Item itemInstance = null; Item itemInstance = null;
// only attempt to enchant if there is a weapon equipped // only attempt to enchant if there is a weapon equipped
final Item parmorInstance = player.getInventory().getPaperdollItem(armorType); final Item paperdollInstance = player.getInventory().getPaperdollItem(slot);
if ((parmorInstance != null) && (parmorInstance.getLocationSlot() == armorType)) if ((paperdollInstance != null) && (paperdollInstance.getLocationSlot() == slot))
{ {
itemInstance = parmorInstance; itemInstance = paperdollInstance;
} }
if (itemInstance != null) if (itemInstance != null)
@@ -192,7 +192,7 @@ public class AdminEnchant implements IAdminCommandHandler
final int curEnchant = itemInstance.getEnchantLevel(); final int curEnchant = itemInstance.getEnchantLevel();
// set enchant value // set enchant value
player.getInventory().unEquipItemInSlot(armorType); player.getInventory().unEquipItemInSlot(slot);
itemInstance.setEnchantLevel(ench); itemInstance.setEnchantLevel(ench);
player.getInventory().equipItem(itemInstance); player.getInventory().equipItem(itemInstance);

View File

@@ -64,69 +64,69 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
int armorType = -1; int slot = -1;
if (command.startsWith("admin_seteh")) if (command.startsWith("admin_seteh"))
{ {
armorType = Inventory.PAPERDOLL_HEAD; slot = Inventory.PAPERDOLL_HEAD;
} }
else if (command.startsWith("admin_setec")) else if (command.startsWith("admin_setec"))
{ {
armorType = Inventory.PAPERDOLL_CHEST; slot = Inventory.PAPERDOLL_CHEST;
} }
else if (command.startsWith("admin_seteg")) else if (command.startsWith("admin_seteg"))
{ {
armorType = Inventory.PAPERDOLL_GLOVES; slot = Inventory.PAPERDOLL_GLOVES;
} }
else if (command.startsWith("admin_seteb")) else if (command.startsWith("admin_seteb"))
{ {
armorType = Inventory.PAPERDOLL_FEET; slot = Inventory.PAPERDOLL_FEET;
} }
else if (command.startsWith("admin_setel")) else if (command.startsWith("admin_setel"))
{ {
armorType = Inventory.PAPERDOLL_LEGS; slot = Inventory.PAPERDOLL_LEGS;
} }
else if (command.startsWith("admin_setew")) else if (command.startsWith("admin_setew"))
{ {
armorType = Inventory.PAPERDOLL_RHAND; slot = Inventory.PAPERDOLL_RHAND;
} }
else if (command.startsWith("admin_setes")) else if (command.startsWith("admin_setes"))
{ {
armorType = Inventory.PAPERDOLL_LHAND; slot = Inventory.PAPERDOLL_LHAND;
} }
else if (command.startsWith("admin_setle")) else if (command.startsWith("admin_setle"))
{ {
armorType = Inventory.PAPERDOLL_LEAR; slot = Inventory.PAPERDOLL_LEAR;
} }
else if (command.startsWith("admin_setre")) else if (command.startsWith("admin_setre"))
{ {
armorType = Inventory.PAPERDOLL_REAR; slot = Inventory.PAPERDOLL_REAR;
} }
else if (command.startsWith("admin_setlf")) else if (command.startsWith("admin_setlf"))
{ {
armorType = Inventory.PAPERDOLL_LFINGER; slot = Inventory.PAPERDOLL_LFINGER;
} }
else if (command.startsWith("admin_setrf")) else if (command.startsWith("admin_setrf"))
{ {
armorType = Inventory.PAPERDOLL_RFINGER; slot = Inventory.PAPERDOLL_RFINGER;
} }
else if (command.startsWith("admin_seten")) else if (command.startsWith("admin_seten"))
{ {
armorType = Inventory.PAPERDOLL_NECK; slot = Inventory.PAPERDOLL_NECK;
} }
else if (command.startsWith("admin_setun")) else if (command.startsWith("admin_setun"))
{ {
armorType = Inventory.PAPERDOLL_UNDER; slot = Inventory.PAPERDOLL_UNDER;
} }
else if (command.startsWith("admin_setba")) else if (command.startsWith("admin_setba"))
{ {
armorType = Inventory.PAPERDOLL_CLOAK; slot = Inventory.PAPERDOLL_CLOAK;
} }
else if (command.startsWith("admin_setbe")) else if (command.startsWith("admin_setbe"))
{ {
armorType = Inventory.PAPERDOLL_BELT; slot = Inventory.PAPERDOLL_BELT;
} }
if (armorType != -1) if (slot != -1)
{ {
try try
{ {
@@ -139,7 +139,7 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
setEnchant(activeChar, ench, armorType); setEnchant(activeChar, ench, slot);
} }
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
@@ -166,7 +166,7 @@ public class AdminEnchant implements IAdminCommandHandler
return true; return true;
} }
private void setEnchant(Player activeChar, int ench, int armorType) private void setEnchant(Player activeChar, int ench, int slot)
{ {
// get the target // get the target
@@ -181,10 +181,10 @@ public class AdminEnchant implements IAdminCommandHandler
Item itemInstance = null; Item itemInstance = null;
// only attempt to enchant if there is a weapon equipped // only attempt to enchant if there is a weapon equipped
final Item parmorInstance = player.getInventory().getPaperdollItem(armorType); final Item paperdollInstance = player.getInventory().getPaperdollItem(slot);
if ((parmorInstance != null) && (parmorInstance.getLocationSlot() == armorType)) if ((paperdollInstance != null) && (paperdollInstance.getLocationSlot() == slot))
{ {
itemInstance = parmorInstance; itemInstance = paperdollInstance;
} }
if (itemInstance != null) if (itemInstance != null)
@@ -192,7 +192,7 @@ public class AdminEnchant implements IAdminCommandHandler
final int curEnchant = itemInstance.getEnchantLevel(); final int curEnchant = itemInstance.getEnchantLevel();
// set enchant value // set enchant value
player.getInventory().unEquipItemInSlot(armorType); player.getInventory().unEquipItemInSlot(slot);
itemInstance.setEnchantLevel(ench); itemInstance.setEnchantLevel(ench);
player.getInventory().equipItem(itemInstance); player.getInventory().equipItem(itemInstance);

View File

@@ -64,69 +64,69 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
int armorType = -1; int slot = -1;
if (command.startsWith("admin_seteh")) if (command.startsWith("admin_seteh"))
{ {
armorType = Inventory.PAPERDOLL_HEAD; slot = Inventory.PAPERDOLL_HEAD;
} }
else if (command.startsWith("admin_setec")) else if (command.startsWith("admin_setec"))
{ {
armorType = Inventory.PAPERDOLL_CHEST; slot = Inventory.PAPERDOLL_CHEST;
} }
else if (command.startsWith("admin_seteg")) else if (command.startsWith("admin_seteg"))
{ {
armorType = Inventory.PAPERDOLL_GLOVES; slot = Inventory.PAPERDOLL_GLOVES;
} }
else if (command.startsWith("admin_seteb")) else if (command.startsWith("admin_seteb"))
{ {
armorType = Inventory.PAPERDOLL_FEET; slot = Inventory.PAPERDOLL_FEET;
} }
else if (command.startsWith("admin_setel")) else if (command.startsWith("admin_setel"))
{ {
armorType = Inventory.PAPERDOLL_LEGS; slot = Inventory.PAPERDOLL_LEGS;
} }
else if (command.startsWith("admin_setew")) else if (command.startsWith("admin_setew"))
{ {
armorType = Inventory.PAPERDOLL_RHAND; slot = Inventory.PAPERDOLL_RHAND;
} }
else if (command.startsWith("admin_setes")) else if (command.startsWith("admin_setes"))
{ {
armorType = Inventory.PAPERDOLL_LHAND; slot = Inventory.PAPERDOLL_LHAND;
} }
else if (command.startsWith("admin_setle")) else if (command.startsWith("admin_setle"))
{ {
armorType = Inventory.PAPERDOLL_LEAR; slot = Inventory.PAPERDOLL_LEAR;
} }
else if (command.startsWith("admin_setre")) else if (command.startsWith("admin_setre"))
{ {
armorType = Inventory.PAPERDOLL_REAR; slot = Inventory.PAPERDOLL_REAR;
} }
else if (command.startsWith("admin_setlf")) else if (command.startsWith("admin_setlf"))
{ {
armorType = Inventory.PAPERDOLL_LFINGER; slot = Inventory.PAPERDOLL_LFINGER;
} }
else if (command.startsWith("admin_setrf")) else if (command.startsWith("admin_setrf"))
{ {
armorType = Inventory.PAPERDOLL_RFINGER; slot = Inventory.PAPERDOLL_RFINGER;
} }
else if (command.startsWith("admin_seten")) else if (command.startsWith("admin_seten"))
{ {
armorType = Inventory.PAPERDOLL_NECK; slot = Inventory.PAPERDOLL_NECK;
} }
else if (command.startsWith("admin_setun")) else if (command.startsWith("admin_setun"))
{ {
armorType = Inventory.PAPERDOLL_UNDER; slot = Inventory.PAPERDOLL_UNDER;
} }
else if (command.startsWith("admin_setba")) else if (command.startsWith("admin_setba"))
{ {
armorType = Inventory.PAPERDOLL_CLOAK; slot = Inventory.PAPERDOLL_CLOAK;
} }
else if (command.startsWith("admin_setbe")) else if (command.startsWith("admin_setbe"))
{ {
armorType = Inventory.PAPERDOLL_BELT; slot = Inventory.PAPERDOLL_BELT;
} }
if (armorType != -1) if (slot != -1)
{ {
try try
{ {
@@ -139,7 +139,7 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
setEnchant(activeChar, ench, armorType); setEnchant(activeChar, ench, slot);
} }
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
@@ -166,7 +166,7 @@ public class AdminEnchant implements IAdminCommandHandler
return true; return true;
} }
private void setEnchant(Player activeChar, int ench, int armorType) private void setEnchant(Player activeChar, int ench, int slot)
{ {
// get the target // get the target
@@ -181,10 +181,10 @@ public class AdminEnchant implements IAdminCommandHandler
Item itemInstance = null; Item itemInstance = null;
// only attempt to enchant if there is a weapon equipped // only attempt to enchant if there is a weapon equipped
final Item parmorInstance = player.getInventory().getPaperdollItem(armorType); final Item paperdollInstance = player.getInventory().getPaperdollItem(slot);
if ((parmorInstance != null) && (parmorInstance.getLocationSlot() == armorType)) if ((paperdollInstance != null) && (paperdollInstance.getLocationSlot() == slot))
{ {
itemInstance = parmorInstance; itemInstance = paperdollInstance;
} }
if (itemInstance != null) if (itemInstance != null)
@@ -192,7 +192,7 @@ public class AdminEnchant implements IAdminCommandHandler
final int curEnchant = itemInstance.getEnchantLevel(); final int curEnchant = itemInstance.getEnchantLevel();
// set enchant value // set enchant value
player.getInventory().unEquipItemInSlot(armorType); player.getInventory().unEquipItemInSlot(slot);
itemInstance.setEnchantLevel(ench); itemInstance.setEnchantLevel(ench);
player.getInventory().equipItem(itemInstance); player.getInventory().equipItem(itemInstance);

View File

@@ -64,69 +64,69 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
int armorType = -1; int slot = -1;
if (command.startsWith("admin_seteh")) if (command.startsWith("admin_seteh"))
{ {
armorType = Inventory.PAPERDOLL_HEAD; slot = Inventory.PAPERDOLL_HEAD;
} }
else if (command.startsWith("admin_setec")) else if (command.startsWith("admin_setec"))
{ {
armorType = Inventory.PAPERDOLL_CHEST; slot = Inventory.PAPERDOLL_CHEST;
} }
else if (command.startsWith("admin_seteg")) else if (command.startsWith("admin_seteg"))
{ {
armorType = Inventory.PAPERDOLL_GLOVES; slot = Inventory.PAPERDOLL_GLOVES;
} }
else if (command.startsWith("admin_seteb")) else if (command.startsWith("admin_seteb"))
{ {
armorType = Inventory.PAPERDOLL_FEET; slot = Inventory.PAPERDOLL_FEET;
} }
else if (command.startsWith("admin_setel")) else if (command.startsWith("admin_setel"))
{ {
armorType = Inventory.PAPERDOLL_LEGS; slot = Inventory.PAPERDOLL_LEGS;
} }
else if (command.startsWith("admin_setew")) else if (command.startsWith("admin_setew"))
{ {
armorType = Inventory.PAPERDOLL_RHAND; slot = Inventory.PAPERDOLL_RHAND;
} }
else if (command.startsWith("admin_setes")) else if (command.startsWith("admin_setes"))
{ {
armorType = Inventory.PAPERDOLL_LHAND; slot = Inventory.PAPERDOLL_LHAND;
} }
else if (command.startsWith("admin_setle")) else if (command.startsWith("admin_setle"))
{ {
armorType = Inventory.PAPERDOLL_LEAR; slot = Inventory.PAPERDOLL_LEAR;
} }
else if (command.startsWith("admin_setre")) else if (command.startsWith("admin_setre"))
{ {
armorType = Inventory.PAPERDOLL_REAR; slot = Inventory.PAPERDOLL_REAR;
} }
else if (command.startsWith("admin_setlf")) else if (command.startsWith("admin_setlf"))
{ {
armorType = Inventory.PAPERDOLL_LFINGER; slot = Inventory.PAPERDOLL_LFINGER;
} }
else if (command.startsWith("admin_setrf")) else if (command.startsWith("admin_setrf"))
{ {
armorType = Inventory.PAPERDOLL_RFINGER; slot = Inventory.PAPERDOLL_RFINGER;
} }
else if (command.startsWith("admin_seten")) else if (command.startsWith("admin_seten"))
{ {
armorType = Inventory.PAPERDOLL_NECK; slot = Inventory.PAPERDOLL_NECK;
} }
else if (command.startsWith("admin_setun")) else if (command.startsWith("admin_setun"))
{ {
armorType = Inventory.PAPERDOLL_UNDER; slot = Inventory.PAPERDOLL_UNDER;
} }
else if (command.startsWith("admin_setba")) else if (command.startsWith("admin_setba"))
{ {
armorType = Inventory.PAPERDOLL_CLOAK; slot = Inventory.PAPERDOLL_CLOAK;
} }
else if (command.startsWith("admin_setbe")) else if (command.startsWith("admin_setbe"))
{ {
armorType = Inventory.PAPERDOLL_BELT; slot = Inventory.PAPERDOLL_BELT;
} }
if (armorType != -1) if (slot != -1)
{ {
try try
{ {
@@ -139,7 +139,7 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
setEnchant(activeChar, ench, armorType); setEnchant(activeChar, ench, slot);
} }
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
@@ -166,7 +166,7 @@ public class AdminEnchant implements IAdminCommandHandler
return true; return true;
} }
private void setEnchant(Player activeChar, int ench, int armorType) private void setEnchant(Player activeChar, int ench, int slot)
{ {
// get the target // get the target
@@ -181,10 +181,10 @@ public class AdminEnchant implements IAdminCommandHandler
Item itemInstance = null; Item itemInstance = null;
// only attempt to enchant if there is a weapon equipped // only attempt to enchant if there is a weapon equipped
final Item parmorInstance = player.getInventory().getPaperdollItem(armorType); final Item paperdollInstance = player.getInventory().getPaperdollItem(slot);
if ((parmorInstance != null) && (parmorInstance.getLocationSlot() == armorType)) if ((paperdollInstance != null) && (paperdollInstance.getLocationSlot() == slot))
{ {
itemInstance = parmorInstance; itemInstance = paperdollInstance;
} }
if (itemInstance != null) if (itemInstance != null)
@@ -192,7 +192,7 @@ public class AdminEnchant implements IAdminCommandHandler
final int curEnchant = itemInstance.getEnchantLevel(); final int curEnchant = itemInstance.getEnchantLevel();
// set enchant value // set enchant value
player.getInventory().unEquipItemInSlot(armorType); player.getInventory().unEquipItemInSlot(slot);
itemInstance.setEnchantLevel(ench); itemInstance.setEnchantLevel(ench);
player.getInventory().equipItem(itemInstance); player.getInventory().equipItem(itemInstance);

View File

@@ -64,69 +64,69 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
int armorType = -1; int slot = -1;
if (command.startsWith("admin_seteh")) if (command.startsWith("admin_seteh"))
{ {
armorType = Inventory.PAPERDOLL_HEAD; slot = Inventory.PAPERDOLL_HEAD;
} }
else if (command.startsWith("admin_setec")) else if (command.startsWith("admin_setec"))
{ {
armorType = Inventory.PAPERDOLL_CHEST; slot = Inventory.PAPERDOLL_CHEST;
} }
else if (command.startsWith("admin_seteg")) else if (command.startsWith("admin_seteg"))
{ {
armorType = Inventory.PAPERDOLL_GLOVES; slot = Inventory.PAPERDOLL_GLOVES;
} }
else if (command.startsWith("admin_seteb")) else if (command.startsWith("admin_seteb"))
{ {
armorType = Inventory.PAPERDOLL_FEET; slot = Inventory.PAPERDOLL_FEET;
} }
else if (command.startsWith("admin_setel")) else if (command.startsWith("admin_setel"))
{ {
armorType = Inventory.PAPERDOLL_LEGS; slot = Inventory.PAPERDOLL_LEGS;
} }
else if (command.startsWith("admin_setew")) else if (command.startsWith("admin_setew"))
{ {
armorType = Inventory.PAPERDOLL_RHAND; slot = Inventory.PAPERDOLL_RHAND;
} }
else if (command.startsWith("admin_setes")) else if (command.startsWith("admin_setes"))
{ {
armorType = Inventory.PAPERDOLL_LHAND; slot = Inventory.PAPERDOLL_LHAND;
} }
else if (command.startsWith("admin_setle")) else if (command.startsWith("admin_setle"))
{ {
armorType = Inventory.PAPERDOLL_LEAR; slot = Inventory.PAPERDOLL_LEAR;
} }
else if (command.startsWith("admin_setre")) else if (command.startsWith("admin_setre"))
{ {
armorType = Inventory.PAPERDOLL_REAR; slot = Inventory.PAPERDOLL_REAR;
} }
else if (command.startsWith("admin_setlf")) else if (command.startsWith("admin_setlf"))
{ {
armorType = Inventory.PAPERDOLL_LFINGER; slot = Inventory.PAPERDOLL_LFINGER;
} }
else if (command.startsWith("admin_setrf")) else if (command.startsWith("admin_setrf"))
{ {
armorType = Inventory.PAPERDOLL_RFINGER; slot = Inventory.PAPERDOLL_RFINGER;
} }
else if (command.startsWith("admin_seten")) else if (command.startsWith("admin_seten"))
{ {
armorType = Inventory.PAPERDOLL_NECK; slot = Inventory.PAPERDOLL_NECK;
} }
else if (command.startsWith("admin_setun")) else if (command.startsWith("admin_setun"))
{ {
armorType = Inventory.PAPERDOLL_UNDER; slot = Inventory.PAPERDOLL_UNDER;
} }
else if (command.startsWith("admin_setba")) else if (command.startsWith("admin_setba"))
{ {
armorType = Inventory.PAPERDOLL_CLOAK; slot = Inventory.PAPERDOLL_CLOAK;
} }
else if (command.startsWith("admin_setbe")) else if (command.startsWith("admin_setbe"))
{ {
armorType = Inventory.PAPERDOLL_BELT; slot = Inventory.PAPERDOLL_BELT;
} }
if (armorType != -1) if (slot != -1)
{ {
try try
{ {
@@ -139,7 +139,7 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
setEnchant(activeChar, ench, armorType); setEnchant(activeChar, ench, slot);
} }
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
@@ -166,7 +166,7 @@ public class AdminEnchant implements IAdminCommandHandler
return true; return true;
} }
private void setEnchant(Player activeChar, int ench, int armorType) private void setEnchant(Player activeChar, int ench, int slot)
{ {
// get the target // get the target
@@ -181,10 +181,10 @@ public class AdminEnchant implements IAdminCommandHandler
Item itemInstance = null; Item itemInstance = null;
// only attempt to enchant if there is a weapon equipped // only attempt to enchant if there is a weapon equipped
final Item parmorInstance = player.getInventory().getPaperdollItem(armorType); final Item paperdollInstance = player.getInventory().getPaperdollItem(slot);
if ((parmorInstance != null) && (parmorInstance.getLocationSlot() == armorType)) if ((paperdollInstance != null) && (paperdollInstance.getLocationSlot() == slot))
{ {
itemInstance = parmorInstance; itemInstance = paperdollInstance;
} }
if (itemInstance != null) if (itemInstance != null)
@@ -192,7 +192,7 @@ public class AdminEnchant implements IAdminCommandHandler
final int curEnchant = itemInstance.getEnchantLevel(); final int curEnchant = itemInstance.getEnchantLevel();
// set enchant value // set enchant value
player.getInventory().unEquipItemInSlot(armorType); player.getInventory().unEquipItemInSlot(slot);
itemInstance.setEnchantLevel(ench); itemInstance.setEnchantLevel(ench);
player.getInventory().equipItem(itemInstance); player.getInventory().equipItem(itemInstance);

View File

@@ -64,69 +64,69 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
int armorType = -1; int slot = -1;
if (command.startsWith("admin_seteh")) if (command.startsWith("admin_seteh"))
{ {
armorType = Inventory.PAPERDOLL_HEAD; slot = Inventory.PAPERDOLL_HEAD;
} }
else if (command.startsWith("admin_setec")) else if (command.startsWith("admin_setec"))
{ {
armorType = Inventory.PAPERDOLL_CHEST; slot = Inventory.PAPERDOLL_CHEST;
} }
else if (command.startsWith("admin_seteg")) else if (command.startsWith("admin_seteg"))
{ {
armorType = Inventory.PAPERDOLL_GLOVES; slot = Inventory.PAPERDOLL_GLOVES;
} }
else if (command.startsWith("admin_seteb")) else if (command.startsWith("admin_seteb"))
{ {
armorType = Inventory.PAPERDOLL_FEET; slot = Inventory.PAPERDOLL_FEET;
} }
else if (command.startsWith("admin_setel")) else if (command.startsWith("admin_setel"))
{ {
armorType = Inventory.PAPERDOLL_LEGS; slot = Inventory.PAPERDOLL_LEGS;
} }
else if (command.startsWith("admin_setew")) else if (command.startsWith("admin_setew"))
{ {
armorType = Inventory.PAPERDOLL_RHAND; slot = Inventory.PAPERDOLL_RHAND;
} }
else if (command.startsWith("admin_setes")) else if (command.startsWith("admin_setes"))
{ {
armorType = Inventory.PAPERDOLL_LHAND; slot = Inventory.PAPERDOLL_LHAND;
} }
else if (command.startsWith("admin_setle")) else if (command.startsWith("admin_setle"))
{ {
armorType = Inventory.PAPERDOLL_LEAR; slot = Inventory.PAPERDOLL_LEAR;
} }
else if (command.startsWith("admin_setre")) else if (command.startsWith("admin_setre"))
{ {
armorType = Inventory.PAPERDOLL_REAR; slot = Inventory.PAPERDOLL_REAR;
} }
else if (command.startsWith("admin_setlf")) else if (command.startsWith("admin_setlf"))
{ {
armorType = Inventory.PAPERDOLL_LFINGER; slot = Inventory.PAPERDOLL_LFINGER;
} }
else if (command.startsWith("admin_setrf")) else if (command.startsWith("admin_setrf"))
{ {
armorType = Inventory.PAPERDOLL_RFINGER; slot = Inventory.PAPERDOLL_RFINGER;
} }
else if (command.startsWith("admin_seten")) else if (command.startsWith("admin_seten"))
{ {
armorType = Inventory.PAPERDOLL_NECK; slot = Inventory.PAPERDOLL_NECK;
} }
else if (command.startsWith("admin_setun")) else if (command.startsWith("admin_setun"))
{ {
armorType = Inventory.PAPERDOLL_UNDER; slot = Inventory.PAPERDOLL_UNDER;
} }
else if (command.startsWith("admin_setba")) else if (command.startsWith("admin_setba"))
{ {
armorType = Inventory.PAPERDOLL_CLOAK; slot = Inventory.PAPERDOLL_CLOAK;
} }
else if (command.startsWith("admin_setbe")) else if (command.startsWith("admin_setbe"))
{ {
armorType = Inventory.PAPERDOLL_BELT; slot = Inventory.PAPERDOLL_BELT;
} }
if (armorType != -1) if (slot != -1)
{ {
try try
{ {
@@ -139,7 +139,7 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
setEnchant(activeChar, ench, armorType); setEnchant(activeChar, ench, slot);
} }
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
@@ -166,7 +166,7 @@ public class AdminEnchant implements IAdminCommandHandler
return true; return true;
} }
private void setEnchant(Player activeChar, int ench, int armorType) private void setEnchant(Player activeChar, int ench, int slot)
{ {
// get the target // get the target
@@ -181,10 +181,10 @@ public class AdminEnchant implements IAdminCommandHandler
Item itemInstance = null; Item itemInstance = null;
// only attempt to enchant if there is a weapon equipped // only attempt to enchant if there is a weapon equipped
final Item parmorInstance = player.getInventory().getPaperdollItem(armorType); final Item paperdollInstance = player.getInventory().getPaperdollItem(slot);
if ((parmorInstance != null) && (parmorInstance.getLocationSlot() == armorType)) if ((paperdollInstance != null) && (paperdollInstance.getLocationSlot() == slot))
{ {
itemInstance = parmorInstance; itemInstance = paperdollInstance;
} }
if (itemInstance != null) if (itemInstance != null)
@@ -192,7 +192,7 @@ public class AdminEnchant implements IAdminCommandHandler
final int curEnchant = itemInstance.getEnchantLevel(); final int curEnchant = itemInstance.getEnchantLevel();
// set enchant value // set enchant value
player.getInventory().unEquipItemInSlot(armorType); player.getInventory().unEquipItemInSlot(slot);
itemInstance.setEnchantLevel(ench); itemInstance.setEnchantLevel(ench);
player.getInventory().equipItem(itemInstance); player.getInventory().equipItem(itemInstance);

View File

@@ -64,69 +64,69 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
int armorType = -1; int slot = -1;
if (command.startsWith("admin_seteh")) if (command.startsWith("admin_seteh"))
{ {
armorType = Inventory.PAPERDOLL_HEAD; slot = Inventory.PAPERDOLL_HEAD;
} }
else if (command.startsWith("admin_setec")) else if (command.startsWith("admin_setec"))
{ {
armorType = Inventory.PAPERDOLL_CHEST; slot = Inventory.PAPERDOLL_CHEST;
} }
else if (command.startsWith("admin_seteg")) else if (command.startsWith("admin_seteg"))
{ {
armorType = Inventory.PAPERDOLL_GLOVES; slot = Inventory.PAPERDOLL_GLOVES;
} }
else if (command.startsWith("admin_seteb")) else if (command.startsWith("admin_seteb"))
{ {
armorType = Inventory.PAPERDOLL_FEET; slot = Inventory.PAPERDOLL_FEET;
} }
else if (command.startsWith("admin_setel")) else if (command.startsWith("admin_setel"))
{ {
armorType = Inventory.PAPERDOLL_LEGS; slot = Inventory.PAPERDOLL_LEGS;
} }
else if (command.startsWith("admin_setew")) else if (command.startsWith("admin_setew"))
{ {
armorType = Inventory.PAPERDOLL_RHAND; slot = Inventory.PAPERDOLL_RHAND;
} }
else if (command.startsWith("admin_setes")) else if (command.startsWith("admin_setes"))
{ {
armorType = Inventory.PAPERDOLL_LHAND; slot = Inventory.PAPERDOLL_LHAND;
} }
else if (command.startsWith("admin_setle")) else if (command.startsWith("admin_setle"))
{ {
armorType = Inventory.PAPERDOLL_LEAR; slot = Inventory.PAPERDOLL_LEAR;
} }
else if (command.startsWith("admin_setre")) else if (command.startsWith("admin_setre"))
{ {
armorType = Inventory.PAPERDOLL_REAR; slot = Inventory.PAPERDOLL_REAR;
} }
else if (command.startsWith("admin_setlf")) else if (command.startsWith("admin_setlf"))
{ {
armorType = Inventory.PAPERDOLL_LFINGER; slot = Inventory.PAPERDOLL_LFINGER;
} }
else if (command.startsWith("admin_setrf")) else if (command.startsWith("admin_setrf"))
{ {
armorType = Inventory.PAPERDOLL_RFINGER; slot = Inventory.PAPERDOLL_RFINGER;
} }
else if (command.startsWith("admin_seten")) else if (command.startsWith("admin_seten"))
{ {
armorType = Inventory.PAPERDOLL_NECK; slot = Inventory.PAPERDOLL_NECK;
} }
else if (command.startsWith("admin_setun")) else if (command.startsWith("admin_setun"))
{ {
armorType = Inventory.PAPERDOLL_UNDER; slot = Inventory.PAPERDOLL_UNDER;
} }
else if (command.startsWith("admin_setba")) else if (command.startsWith("admin_setba"))
{ {
armorType = Inventory.PAPERDOLL_CLOAK; slot = Inventory.PAPERDOLL_CLOAK;
} }
else if (command.startsWith("admin_setbe")) else if (command.startsWith("admin_setbe"))
{ {
armorType = Inventory.PAPERDOLL_BELT; slot = Inventory.PAPERDOLL_BELT;
} }
if (armorType != -1) if (slot != -1)
{ {
try try
{ {
@@ -139,7 +139,7 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
setEnchant(activeChar, ench, armorType); setEnchant(activeChar, ench, slot);
} }
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
@@ -166,7 +166,7 @@ public class AdminEnchant implements IAdminCommandHandler
return true; return true;
} }
private void setEnchant(Player activeChar, int ench, int armorType) private void setEnchant(Player activeChar, int ench, int slot)
{ {
// get the target // get the target
@@ -181,10 +181,10 @@ public class AdminEnchant implements IAdminCommandHandler
Item itemInstance = null; Item itemInstance = null;
// only attempt to enchant if there is a weapon equipped // only attempt to enchant if there is a weapon equipped
final Item parmorInstance = player.getInventory().getPaperdollItem(armorType); final Item paperdollInstance = player.getInventory().getPaperdollItem(slot);
if ((parmorInstance != null) && (parmorInstance.getLocationSlot() == armorType)) if ((paperdollInstance != null) && (paperdollInstance.getLocationSlot() == slot))
{ {
itemInstance = parmorInstance; itemInstance = paperdollInstance;
} }
if (itemInstance != null) if (itemInstance != null)
@@ -192,7 +192,7 @@ public class AdminEnchant implements IAdminCommandHandler
final int curEnchant = itemInstance.getEnchantLevel(); final int curEnchant = itemInstance.getEnchantLevel();
// set enchant value // set enchant value
player.getInventory().unEquipItemInSlot(armorType); player.getInventory().unEquipItemInSlot(slot);
itemInstance.setEnchantLevel(ench); itemInstance.setEnchantLevel(ench);
player.getInventory().equipItem(itemInstance); player.getInventory().equipItem(itemInstance);

View File

@@ -64,69 +64,69 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
int armorType = -1; int slot = -1;
if (command.startsWith("admin_seteh")) if (command.startsWith("admin_seteh"))
{ {
armorType = Inventory.PAPERDOLL_HEAD; slot = Inventory.PAPERDOLL_HEAD;
} }
else if (command.startsWith("admin_setec")) else if (command.startsWith("admin_setec"))
{ {
armorType = Inventory.PAPERDOLL_CHEST; slot = Inventory.PAPERDOLL_CHEST;
} }
else if (command.startsWith("admin_seteg")) else if (command.startsWith("admin_seteg"))
{ {
armorType = Inventory.PAPERDOLL_GLOVES; slot = Inventory.PAPERDOLL_GLOVES;
} }
else if (command.startsWith("admin_seteb")) else if (command.startsWith("admin_seteb"))
{ {
armorType = Inventory.PAPERDOLL_FEET; slot = Inventory.PAPERDOLL_FEET;
} }
else if (command.startsWith("admin_setel")) else if (command.startsWith("admin_setel"))
{ {
armorType = Inventory.PAPERDOLL_LEGS; slot = Inventory.PAPERDOLL_LEGS;
} }
else if (command.startsWith("admin_setew")) else if (command.startsWith("admin_setew"))
{ {
armorType = Inventory.PAPERDOLL_RHAND; slot = Inventory.PAPERDOLL_RHAND;
} }
else if (command.startsWith("admin_setes")) else if (command.startsWith("admin_setes"))
{ {
armorType = Inventory.PAPERDOLL_LHAND; slot = Inventory.PAPERDOLL_LHAND;
} }
else if (command.startsWith("admin_setle")) else if (command.startsWith("admin_setle"))
{ {
armorType = Inventory.PAPERDOLL_LEAR; slot = Inventory.PAPERDOLL_LEAR;
} }
else if (command.startsWith("admin_setre")) else if (command.startsWith("admin_setre"))
{ {
armorType = Inventory.PAPERDOLL_REAR; slot = Inventory.PAPERDOLL_REAR;
} }
else if (command.startsWith("admin_setlf")) else if (command.startsWith("admin_setlf"))
{ {
armorType = Inventory.PAPERDOLL_LFINGER; slot = Inventory.PAPERDOLL_LFINGER;
} }
else if (command.startsWith("admin_setrf")) else if (command.startsWith("admin_setrf"))
{ {
armorType = Inventory.PAPERDOLL_RFINGER; slot = Inventory.PAPERDOLL_RFINGER;
} }
else if (command.startsWith("admin_seten")) else if (command.startsWith("admin_seten"))
{ {
armorType = Inventory.PAPERDOLL_NECK; slot = Inventory.PAPERDOLL_NECK;
} }
else if (command.startsWith("admin_setun")) else if (command.startsWith("admin_setun"))
{ {
armorType = Inventory.PAPERDOLL_UNDER; slot = Inventory.PAPERDOLL_UNDER;
} }
else if (command.startsWith("admin_setba")) else if (command.startsWith("admin_setba"))
{ {
armorType = Inventory.PAPERDOLL_CLOAK; slot = Inventory.PAPERDOLL_CLOAK;
} }
else if (command.startsWith("admin_setbe")) else if (command.startsWith("admin_setbe"))
{ {
armorType = Inventory.PAPERDOLL_BELT; slot = Inventory.PAPERDOLL_BELT;
} }
if (armorType != -1) if (slot != -1)
{ {
try try
{ {
@@ -139,7 +139,7 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
setEnchant(activeChar, ench, armorType); setEnchant(activeChar, ench, slot);
} }
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
@@ -166,7 +166,7 @@ public class AdminEnchant implements IAdminCommandHandler
return true; return true;
} }
private void setEnchant(Player activeChar, int ench, int armorType) private void setEnchant(Player activeChar, int ench, int slot)
{ {
// get the target // get the target
@@ -181,10 +181,10 @@ public class AdminEnchant implements IAdminCommandHandler
Item itemInstance = null; Item itemInstance = null;
// only attempt to enchant if there is a weapon equipped // only attempt to enchant if there is a weapon equipped
final Item parmorInstance = player.getInventory().getPaperdollItem(armorType); final Item paperdollInstance = player.getInventory().getPaperdollItem(slot);
if ((parmorInstance != null) && (parmorInstance.getLocationSlot() == armorType)) if ((paperdollInstance != null) && (paperdollInstance.getLocationSlot() == slot))
{ {
itemInstance = parmorInstance; itemInstance = paperdollInstance;
} }
if (itemInstance != null) if (itemInstance != null)
@@ -192,7 +192,7 @@ public class AdminEnchant implements IAdminCommandHandler
final int curEnchant = itemInstance.getEnchantLevel(); final int curEnchant = itemInstance.getEnchantLevel();
// set enchant value // set enchant value
player.getInventory().unEquipItemInSlot(armorType); player.getInventory().unEquipItemInSlot(slot);
itemInstance.setEnchantLevel(ench); itemInstance.setEnchantLevel(ench);
player.getInventory().equipItem(itemInstance); player.getInventory().equipItem(itemInstance);

View File

@@ -64,69 +64,69 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
int armorType = -1; int slot = -1;
if (command.startsWith("admin_seteh")) if (command.startsWith("admin_seteh"))
{ {
armorType = Inventory.PAPERDOLL_HEAD; slot = Inventory.PAPERDOLL_HEAD;
} }
else if (command.startsWith("admin_setec")) else if (command.startsWith("admin_setec"))
{ {
armorType = Inventory.PAPERDOLL_CHEST; slot = Inventory.PAPERDOLL_CHEST;
} }
else if (command.startsWith("admin_seteg")) else if (command.startsWith("admin_seteg"))
{ {
armorType = Inventory.PAPERDOLL_GLOVES; slot = Inventory.PAPERDOLL_GLOVES;
} }
else if (command.startsWith("admin_seteb")) else if (command.startsWith("admin_seteb"))
{ {
armorType = Inventory.PAPERDOLL_FEET; slot = Inventory.PAPERDOLL_FEET;
} }
else if (command.startsWith("admin_setel")) else if (command.startsWith("admin_setel"))
{ {
armorType = Inventory.PAPERDOLL_LEGS; slot = Inventory.PAPERDOLL_LEGS;
} }
else if (command.startsWith("admin_setew")) else if (command.startsWith("admin_setew"))
{ {
armorType = Inventory.PAPERDOLL_RHAND; slot = Inventory.PAPERDOLL_RHAND;
} }
else if (command.startsWith("admin_setes")) else if (command.startsWith("admin_setes"))
{ {
armorType = Inventory.PAPERDOLL_LHAND; slot = Inventory.PAPERDOLL_LHAND;
} }
else if (command.startsWith("admin_setle")) else if (command.startsWith("admin_setle"))
{ {
armorType = Inventory.PAPERDOLL_LEAR; slot = Inventory.PAPERDOLL_LEAR;
} }
else if (command.startsWith("admin_setre")) else if (command.startsWith("admin_setre"))
{ {
armorType = Inventory.PAPERDOLL_REAR; slot = Inventory.PAPERDOLL_REAR;
} }
else if (command.startsWith("admin_setlf")) else if (command.startsWith("admin_setlf"))
{ {
armorType = Inventory.PAPERDOLL_LFINGER; slot = Inventory.PAPERDOLL_LFINGER;
} }
else if (command.startsWith("admin_setrf")) else if (command.startsWith("admin_setrf"))
{ {
armorType = Inventory.PAPERDOLL_RFINGER; slot = Inventory.PAPERDOLL_RFINGER;
} }
else if (command.startsWith("admin_seten")) else if (command.startsWith("admin_seten"))
{ {
armorType = Inventory.PAPERDOLL_NECK; slot = Inventory.PAPERDOLL_NECK;
} }
else if (command.startsWith("admin_setun")) else if (command.startsWith("admin_setun"))
{ {
armorType = Inventory.PAPERDOLL_UNDER; slot = Inventory.PAPERDOLL_UNDER;
} }
else if (command.startsWith("admin_setba")) else if (command.startsWith("admin_setba"))
{ {
armorType = Inventory.PAPERDOLL_CLOAK; slot = Inventory.PAPERDOLL_CLOAK;
} }
else if (command.startsWith("admin_setbe")) else if (command.startsWith("admin_setbe"))
{ {
armorType = Inventory.PAPERDOLL_BELT; slot = Inventory.PAPERDOLL_BELT;
} }
if (armorType != -1) if (slot != -1)
{ {
try try
{ {
@@ -139,7 +139,7 @@ public class AdminEnchant implements IAdminCommandHandler
} }
else else
{ {
setEnchant(activeChar, ench, armorType); setEnchant(activeChar, ench, slot);
} }
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
@@ -166,7 +166,7 @@ public class AdminEnchant implements IAdminCommandHandler
return true; return true;
} }
private void setEnchant(Player activeChar, int ench, int armorType) private void setEnchant(Player activeChar, int ench, int slot)
{ {
// get the target // get the target
@@ -181,10 +181,10 @@ public class AdminEnchant implements IAdminCommandHandler
Item itemInstance = null; Item itemInstance = null;
// only attempt to enchant if there is a weapon equipped // only attempt to enchant if there is a weapon equipped
final Item parmorInstance = player.getInventory().getPaperdollItem(armorType); final Item paperdollInstance = player.getInventory().getPaperdollItem(slot);
if ((parmorInstance != null) && (parmorInstance.getLocationSlot() == armorType)) if ((paperdollInstance != null) && (paperdollInstance.getLocationSlot() == slot))
{ {
itemInstance = parmorInstance; itemInstance = paperdollInstance;
} }
if (itemInstance != null) if (itemInstance != null)
@@ -192,7 +192,7 @@ public class AdminEnchant implements IAdminCommandHandler
final int curEnchant = itemInstance.getEnchantLevel(); final int curEnchant = itemInstance.getEnchantLevel();
// set enchant value // set enchant value
player.getInventory().unEquipItemInSlot(armorType); player.getInventory().unEquipItemInSlot(slot);
itemInstance.setEnchantLevel(ench); itemInstance.setEnchantLevel(ench);
player.getInventory().equipItem(itemInstance); player.getInventory().equipItem(itemInstance);