|
|
@ -1389,7 +1389,15 @@ public class ClientMessagePump implements NetMsgHandler { |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
Item buy = null; |
|
|
|
Item buy = null; |
|
|
|
|
|
|
|
if(npc.getName().equals("Resource Merchant")) { |
|
|
|
|
|
|
|
MobLoot resource = new MobLoot(npc, ItemBase.getItemBase(msg.getItemID()), 1, true); |
|
|
|
|
|
|
|
resource.setValue(Warehouse.getCostForResource(msg.getItemID())); |
|
|
|
|
|
|
|
npc.getCharItemManager().addItemToInventory(resource); |
|
|
|
|
|
|
|
npc.getCharItemManager().updateInventory(resource, true); |
|
|
|
|
|
|
|
Dispatch dispatch = Dispatch.borrow(sourcePlayer, msg); |
|
|
|
|
|
|
|
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); |
|
|
|
|
|
|
|
itemMan.updateInventory(); |
|
|
|
|
|
|
|
} |
|
|
|
if (msg.getItemType() == GameObjectType.MobEquipment.ordinal()) { |
|
|
|
if (msg.getItemType() == GameObjectType.MobEquipment.ordinal()) { |
|
|
|
ArrayList<MobEquipment> sellInventory = npc.getContract().getSellInventory(); |
|
|
|
ArrayList<MobEquipment> sellInventory = npc.getContract().getSellInventory(); |
|
|
|
if (sellInventory == null) |
|
|
|
if (sellInventory == null) |
|
|
@ -1583,15 +1591,9 @@ public class ClientMessagePump implements NetMsgHandler { |
|
|
|
// msg.setItemID(buy.getObjectUUID());
|
|
|
|
// msg.setItemID(buy.getObjectUUID());
|
|
|
|
Dispatch dispatch = Dispatch.borrow(sourcePlayer, msg); |
|
|
|
Dispatch dispatch = Dispatch.borrow(sourcePlayer, msg); |
|
|
|
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); |
|
|
|
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); |
|
|
|
|
|
|
|
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(); |
|
|
|
} |
|
|
|
} |
|
|
|