Browse Source

resource merchant work

lakebane-master
FatBoy-DOTC 9 months ago
parent
commit
8f0e19a10c
  1. 15
      src/engine/net/client/ClientMessagePump.java

15
src/engine/net/client/ClientMessagePump.java

@ -1389,15 +1389,7 @@ public class ClientMessagePump implements NetMsgHandler { @@ -1389,15 +1389,7 @@ 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)
@ -1413,8 +1405,6 @@ public class ClientMessagePump implements NetMsgHandler { @@ -1413,8 +1405,6 @@ public class ClientMessagePump implements NetMsgHandler {
return;
int cost = me.getMagicValue();
if(me.getItemBase().isStatRune())
cost = 10000000;
float bargain = sourcePlayer.getBargain();
@ -1426,6 +1416,7 @@ public class ClientMessagePump implements NetMsgHandler { @@ -1426,6 +1416,7 @@ public class ClientMessagePump implements NetMsgHandler {
cost *= profit;
if (gold.getNumOfItems() - cost < 0) {
//dont' have enough goldItem exit!
// chatMan.chatSystemInfo(pc, "" + "You dont have enough gold.");
@ -1585,6 +1576,7 @@ public class ClientMessagePump implements NetMsgHandler { @@ -1585,6 +1576,7 @@ public class ClientMessagePump implements NetMsgHandler {
return;
if (buy != null) {
msg.setItem(buy);
//send the buy message back to update player
// msg.setItemType(buy.getObjectType().ordinal());
@ -1600,6 +1592,7 @@ public class ClientMessagePump implements NetMsgHandler { @@ -1600,6 +1592,7 @@ public class ClientMessagePump implements NetMsgHandler {
} else {
ErrorPopupMsg.sendErrorPopup(origin.getPlayerCharacter(), 12); // All production slots taken
}
}
private static void Repair(RepairMsg msg, ClientConnection origin) {

Loading…
Cancel
Save