|
|
@ -1577,12 +1577,6 @@ public class ClientMessagePump implements NetMsgHandler { |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
if (buy != null) { |
|
|
|
if (buy != null) { |
|
|
|
if(npc.getName().equals("Resource Merchant")) { |
|
|
|
|
|
|
|
MobLoot resource = new MobLoot(npc, ItemBase.getItemBase(buy.getItemBaseID()), 1, true); |
|
|
|
|
|
|
|
resource.setValue(Warehouse.getCostForResource(buy.getItemBaseID())); |
|
|
|
|
|
|
|
npc.getCharItemManager().addItemToInventory(resource); |
|
|
|
|
|
|
|
npc.getCharItemManager().updateInventory(resource, true); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
msg.setItem(buy); |
|
|
|
msg.setItem(buy); |
|
|
|
//send the buy message back to update player
|
|
|
|
//send the buy message back to update player
|
|
|
|
// msg.setItemType(buy.getObjectType().ordinal());
|
|
|
|
// msg.setItemType(buy.getObjectType().ordinal());
|
|
|
@ -1592,13 +1586,18 @@ public class ClientMessagePump implements NetMsgHandler { |
|
|
|
|
|
|
|
|
|
|
|
itemMan.updateInventory(); |
|
|
|
itemMan.updateInventory(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if(npc.getName().equals("Resource Merchant")) { |
|
|
|
|
|
|
|
MobLoot resource = new MobLoot(npc, ItemBase.getItemBase(buy.getItemBaseID()), 1, true); |
|
|
|
|
|
|
|
resource.setValue(Warehouse.getCostForResource(buy.getItemBaseID())); |
|
|
|
|
|
|
|
npc.getCharItemManager().addItemToInventory(resource); |
|
|
|
|
|
|
|
npc.getCharItemManager().updateInventory(resource, true); |
|
|
|
|
|
|
|
} |
|
|
|
} finally { |
|
|
|
} finally { |
|
|
|
origin.buyLock.unlock(); |
|
|
|
origin.buyLock.unlock(); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
ErrorPopupMsg.sendErrorPopup(origin.getPlayerCharacter(), 12); // All production slots taken
|
|
|
|
ErrorPopupMsg.sendErrorPopup(origin.getPlayerCharacter(), 12); // All production slots taken
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static void Repair(RepairMsg msg, ClientConnection origin) { |
|
|
|
private static void Repair(RepairMsg msg, ClientConnection origin) { |
|
|
|