|
|
@ -56,7 +56,6 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler { |
|
|
|
else |
|
|
|
else |
|
|
|
targetItem = null; |
|
|
|
targetItem = null; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (targetItem == null) |
|
|
|
if (targetItem == null) |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
@ -88,10 +87,6 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler { |
|
|
|
dispatch = Dispatch.borrow(player, outMsg); |
|
|
|
dispatch = Dispatch.borrow(player, outMsg); |
|
|
|
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); |
|
|
|
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Set item's price
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Method sets the price on an item in the vendor inventory
|
|
|
|
// Method sets the price on an item in the vendor inventory
|
|
|
@ -119,7 +114,6 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler { |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
if (!vendor.charItemManager.hasRoomInventory(targetItem.template.item_wt)) { |
|
|
|
if (!vendor.charItemManager.hasRoomInventory(targetItem.template.item_wt)) { |
|
|
|
|
|
|
|
|
|
|
|
ErrorPopupMsg.sendErrorPopup(player, 21); |
|
|
|
ErrorPopupMsg.sendErrorPopup(player, 21); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
@ -146,7 +140,6 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
outMsg = new ItemProductionMsg(vendor.getBuilding(), vendor, targetItem, mbEnums.ProductionActionType.DEPOSIT.ordinal(), true); |
|
|
|
outMsg = new ItemProductionMsg(vendor.getBuilding(), vendor, targetItem, mbEnums.ProductionActionType.DEPOSIT.ordinal(), true); |
|
|
|
dispatch = Dispatch.borrow(player, outMsg); |
|
|
|
dispatch = Dispatch.borrow(player, outMsg); |
|
|
|
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); |
|
|
|
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); |
|
|
@ -161,59 +154,8 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler { |
|
|
|
} finally { |
|
|
|
} finally { |
|
|
|
origin.sellLock.unlock(); |
|
|
|
origin.sellLock.unlock(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Method adds an item from the players inventory to the vendor.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static void completeItem(int itemUUID, NPC vendor, ClientConnection origin, ItemProductionMsg msg) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Item targetItem; |
|
|
|
|
|
|
|
ManageNPCMsg outMsg; |
|
|
|
|
|
|
|
Dispatch dispatch; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PlayerCharacter player = origin.getPlayerCharacter(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (player == null) |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (origin.buyLock.tryLock()) { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
targetItem = Item.getFromCache(itemUUID); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (targetItem == null) |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!vendor.charItemManager.forgeContains(targetItem, vendor)) |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
boolean worked = DbManager.ItemQueries.UPDATE_FORGE_TO_INVENTORY(targetItem); |
|
|
|
|
|
|
|
if (!worked) { |
|
|
|
|
|
|
|
Guild guild = vendor.getGuild(); |
|
|
|
|
|
|
|
if (guild == null) |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
//ChatManager.chatGuildInfo(guild, "Failed to complete Item " + targetItem.getName());
|
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
targetItem.containerType = mbEnums.ItemContainerType.INVENTORY; |
|
|
|
|
|
|
|
targetItem.setOwner(vendor); |
|
|
|
|
|
|
|
vendor.charItemManager.addItemToInventory(targetItem); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor.removeItemFromForge(targetItem); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
outMsg = new ManageNPCMsg(vendor); |
|
|
|
|
|
|
|
outMsg.setMessageType(mbEnums.ProductionActionType.PRODUCE.ordinal()); |
|
|
|
|
|
|
|
dispatch = Dispatch.borrow(player, outMsg); |
|
|
|
|
|
|
|
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); |
|
|
|
|
|
|
|
} finally { |
|
|
|
|
|
|
|
origin.buyLock.unlock(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Method completes an item that has been previously rolled
|
|
|
|
// Method completes an item that has been previously rolled
|
|
|
@ -224,7 +166,6 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler { |
|
|
|
Item targetItem; |
|
|
|
Item targetItem; |
|
|
|
ItemProductionMsg outMsg; |
|
|
|
ItemProductionMsg outMsg; |
|
|
|
int totalValue = 0; |
|
|
|
int totalValue = 0; |
|
|
|
int currentStrongbox; |
|
|
|
|
|
|
|
Dispatch dispatch; |
|
|
|
Dispatch dispatch; |
|
|
|
|
|
|
|
|
|
|
|
if (vendor.getBuilding() == null) |
|
|
|
if (vendor.getBuilding() == null) |
|
|
|