resource merchant work

This commit is contained in:
2024-02-18 18:12:09 -06:00
parent a7bc1d5a6a
commit 2222a335a1
+11 -9
View File
@@ -1389,7 +1389,15 @@ public class ClientMessagePump implements NetMsgHandler {
return;
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()) {
ArrayList<MobEquipment> sellInventory = npc.getContract().getSellInventory();
if (sellInventory == null)
@@ -1583,15 +1591,9 @@ public class ClientMessagePump implements NetMsgHandler {
// msg.setItemID(buy.getObjectUUID());
Dispatch dispatch = Dispatch.borrow(sourcePlayer, msg);
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 {
origin.buyLock.unlock();
}