|
|
@ -43,28 +43,28 @@ public class TransferItemFromInventoryToEquipHandler extends AbstractClientMsgHa |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int uuid = transferMsg.getUUID(); |
|
|
|
int itemUUID = transferMsg.getUUID(); |
|
|
|
int slot = transferMsg.getSlotNumber(); |
|
|
|
int slotOrdinal = transferMsg.getSlotNumber(); |
|
|
|
//System.out.println("loading to slot: " + slot);
|
|
|
|
Enum.EquipSlotType equipSlot = Enum.EquipSlotType.values()[slotOrdinal]; |
|
|
|
|
|
|
|
|
|
|
|
Item i = itemManager.getItemByUUID(uuid); |
|
|
|
Item item = itemManager.getItemByUUID(itemUUID); |
|
|
|
|
|
|
|
|
|
|
|
if (i == null) { |
|
|
|
if (item == null) { |
|
|
|
forceTransferFromEquipToInventory(transferMsg, origin, "Item not found in your item manager"); |
|
|
|
forceTransferFromEquipToInventory(transferMsg, origin, "Item not found in your item manager"); |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!itemManager.doesCharOwnThisItem(i.getObjectUUID())) { |
|
|
|
if (!itemManager.doesCharOwnThisItem(item.getObjectUUID())) { |
|
|
|
forceTransferFromEquipToInventory(transferMsg, origin, "You do not own this item"); |
|
|
|
forceTransferFromEquipToInventory(transferMsg, origin, "You do not own this item"); |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//dupe check
|
|
|
|
//dupe check
|
|
|
|
if (!i.validForInventory(origin, playerCharacter, itemManager)) |
|
|
|
if (!item.validForInventory(origin, playerCharacter, itemManager)) |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
|
|
|
|
|
|
|
|
if (i.containerType == Enum.ItemContainerType.INVENTORY) { |
|
|
|
if (item.containerType == Enum.ItemContainerType.INVENTORY) { |
|
|
|
if (!itemManager.equipItem(i, (byte) slot)) { |
|
|
|
if (!itemManager.equipItem(item, equipSlot)) { |
|
|
|
forceTransferFromEquipToInventory(transferMsg, origin, "Failed to transfer item."); |
|
|
|
forceTransferFromEquipToInventory(transferMsg, origin, "Failed to transfer item."); |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
@ -77,8 +77,8 @@ public class TransferItemFromInventoryToEquipHandler extends AbstractClientMsgHa |
|
|
|
playerCharacter.applyBonuses(); |
|
|
|
playerCharacter.applyBonuses(); |
|
|
|
DispatchMessage.dispatchMsgToInterestArea(playerCharacter, transferMsg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false); |
|
|
|
DispatchMessage.dispatchMsgToInterestArea(playerCharacter, transferMsg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false); |
|
|
|
|
|
|
|
|
|
|
|
for (String name : i.getEffects().keySet()) { |
|
|
|
for (String name : item.getEffects().keySet()) { |
|
|
|
Effect eff = i.getEffects().get(name); |
|
|
|
Effect eff = item.getEffects().get(name); |
|
|
|
|
|
|
|
|
|
|
|
if (eff == null) |
|
|
|
if (eff == null) |
|
|
|
return true; |
|
|
|
return true; |
|
|
@ -92,8 +92,8 @@ public class TransferItemFromInventoryToEquipHandler extends AbstractClientMsgHa |
|
|
|
pum.setNumTrains(eff.getTrains()); |
|
|
|
pum.setNumTrains(eff.getTrains()); |
|
|
|
pum.setUnknown05(1); |
|
|
|
pum.setUnknown05(1); |
|
|
|
pum.setUnknown06((byte) 1); |
|
|
|
pum.setUnknown06((byte) 1); |
|
|
|
pum.setEffectSourceType(i.getObjectType().ordinal()); |
|
|
|
pum.setEffectSourceType(item.getObjectType().ordinal()); |
|
|
|
pum.setEffectSourceID(i.getObjectUUID()); |
|
|
|
pum.setEffectSourceID(item.getObjectUUID()); |
|
|
|
pum.setDuration(-1); |
|
|
|
pum.setDuration(-1); |
|
|
|
|
|
|
|
|
|
|
|
DispatchMessage.dispatchMsgToInterestArea(playerCharacter, pum, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false); |
|
|
|
DispatchMessage.dispatchMsgToInterestArea(playerCharacter, pum, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false); |
|
|
|