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