Since no one knows how to solve this problem some additional information.
When we go to gameserver/model/itemcontainer/Invertory.java
we will see
Code: Select all
public static final int PAPERDOLL_UNDER = 0;
This will make the itemtype 0.
Then we go to data/scripts/handlers/telnethandlers/PlayerHandler.java
And we find this part.
Code: Select all
if ((player != null) && (itemType > 0)) { success = setEnchant(player, enchant, itemType); if (success) { _print.println("Item enchanted successfully."); } } else if (!su
Now if i change this
Code: Select all
if ((player != null) && (itemType > 0))
To this
Code: Select all
if (((player != null) && (itemType > 0)) || (itemType == 0))
Now i'm able to enchant the shirt.
But when i try to enchant a empty slot it will take the weapon slot, and then it will enchant that item instead saying "item failed to enchant".
When i try to enchant the weapon when nothing is equipped the telnet console will say nothing, not failed or successfully.
update:
changed itemtype to -1
still the same result happens.
Code: Select all
else if (command.startsWith("enchant")) { StringTokenizer st = new StringTokenizer(command.substring(8), " "); int enchant = 0, itemType = -1; try { L2PcInstance player = L2World.getInstance().getPlayer(st.nextToken()); itemType = Integer.parseInt(st.nextToken()); enchant = Integer.parseInt(st.nextToken()); switch (itemType) { case 1: itemType = Inventory.PAPERDOLL_HEAD; break; case 2: itemType = Inventory.PAPERDOLL_CHEST; break; case 3: itemType = Inventory.PAPERDOLL_GLOVES; break; case 4: itemType = Inventory.PAPERDOLL_FEET; break; case 5: itemType = Inventory.PAPERDOLL_LEGS; break; case 6: itemType = Inventory.PAPERDOLL_RHAND; break; case 7: itemType = Inventory.PAPERDOLL_LHAND; break; case 8: itemType = Inventory.PAPERDOLL_LEAR; break; case 9: itemType = Inventory.PAPERDOLL_REAR; break; case 10: itemType = Inventory.PAPERDOLL_LFINGER; break; case 11: itemType = Inventory.PAPERDOLL_RFINGER; break; case 12: itemType = Inventory.PAPERDOLL_NECK; break; case 13: itemType = Inventory.PAPERDOLL_UNDER; break; case 14: itemType = Inventory.PAPERDOLL_CLOAK; break; case 15: itemType = Inventory.PAPERDOLL_BELT; break; default: itemType = -1; } if (enchant > 65535) { enchant = 65535; } else if (enchant < 0) { enchant = 0; } boolean success = false; if ((player != null) && (itemType != -1)) { success = setEnchant(player, enchant, itemType); if (success) { _print.println("Item enchanted successfully."); } } else if (!success) { _print.println("Item failed to enchant."); } } catch (Exception e) { } }