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 {
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)
@ -1413,8 +1405,6 @@ public class ClientMessagePump implements NetMsgHandler {
return; return;
int cost = me.getMagicValue(); int cost = me.getMagicValue();
if(me.getItemBase().isStatRune())
cost = 10000000;
float bargain = sourcePlayer.getBargain(); float bargain = sourcePlayer.getBargain();
@ -1426,6 +1416,7 @@ public class ClientMessagePump implements NetMsgHandler {
cost *= profit; cost *= profit;
if (gold.getNumOfItems() - cost < 0) { if (gold.getNumOfItems() - cost < 0) {
//dont' have enough goldItem exit! //dont' have enough goldItem exit!
// chatMan.chatSystemInfo(pc, "" + "You dont have enough gold."); // chatMan.chatSystemInfo(pc, "" + "You dont have enough gold.");
@ -1585,6 +1576,7 @@ public class ClientMessagePump implements NetMsgHandler {
return; return;
if (buy != null) { if (buy != null) {
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());
@ -1600,6 +1592,7 @@ public class ClientMessagePump implements NetMsgHandler {
} 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) {

Loading…
Cancel
Save