Browse Source

Resource Merchant

lakebane-master
FatBoy-DOTC 10 months ago
parent
commit
9d75116790
  1. 17
      src/engine/net/client/ClientMessagePump.java

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

@ -1392,18 +1392,22 @@ public class ClientMessagePump implements NetMsgHandler { @@ -1392,18 +1392,22 @@ public class ClientMessagePump implements NetMsgHandler {
if (msg.getItemType() == GameObjectType.MobEquipment.ordinal()) {
ArrayList<MobEquipment> sellInventory = npc.getContract().getSellInventory();
if (sellInventory == null)
if (sellInventory == null) {
ChatManager.chatSystemError(sourcePlayer,"Sell Inventory Null");
return;
}
for (MobEquipment me : sellInventory) {
if (me.getObjectUUID() == msg.getItemID()) {
ItemBase ib = me.getItemBase();
if (ib == null)
if (ib == null) {
ChatManager.chatSystemError(sourcePlayer,"Item Base Null");
return;
}
//test room available for item
if (!itemMan.hasRoomInventory(ib.getWeight()))
if (!itemMan.hasRoomInventory(ib.getWeight())) {
ChatManager.chatSystemError(sourcePlayer,"No Room In Inventory");
return;
}
int cost = me.getMagicValue();
float bargain = sourcePlayer.getBargain();
@ -1420,6 +1424,7 @@ public class ClientMessagePump implements NetMsgHandler { @@ -1420,6 +1424,7 @@ public class ClientMessagePump implements NetMsgHandler {
if (gold.getNumOfItems() - cost < 0) {
//dont' have enough goldItem exit!
// chatMan.chatSystemInfo(pc, "" + "You dont have enough gold.");
ChatManager.chatSystemError(sourcePlayer,"Not Enough Gold");
return;
}
@ -1435,11 +1440,11 @@ public class ClientMessagePump implements NetMsgHandler { @@ -1435,11 +1440,11 @@ public class ClientMessagePump implements NetMsgHandler {
if (!itemMan.buyFromNPC(b, cost, buildingDeposit)) {
// chatMan.chatSystemInfo(pc, "" + "You Failed to buy the item.");
ChatManager.chatSystemError(sourcePlayer,"Failed To Buy Item");
return;
}
buy = Item.createItemForPlayer(sourcePlayer, ib);
if (buy != null) {
me.transferEnchants(buy);
itemMan.addItemToInventory(buy);

Loading…
Cancel
Save