forked from MagicBane/Server
item_wt refactored to template
This commit is contained in:
@@ -370,7 +370,7 @@ public class ClientMessagePump implements NetMsgHandler {
|
||||
|
||||
} else {
|
||||
|
||||
if (!itemManager.hasRoomBank(item.getItemBase().getWeight()))
|
||||
if (!itemManager.hasRoomBank(item.template.item_wt))
|
||||
return;
|
||||
|
||||
if (!itemManager.moveItemToBank(item))
|
||||
@@ -430,7 +430,7 @@ public class ClientMessagePump implements NetMsgHandler {
|
||||
|
||||
// Not gold, process update here
|
||||
|
||||
if (!itemManager.hasRoomInventory(item.getItemBase().getWeight()))
|
||||
if (!itemManager.hasRoomInventory(item.template.item_wt))
|
||||
return;
|
||||
|
||||
if (itemManager.moveItemToInventory(item) == false)
|
||||
@@ -1224,13 +1224,11 @@ public class ClientMessagePump implements NetMsgHandler {
|
||||
|
||||
//get item to sell
|
||||
|
||||
ItemBase ib = sell.getItemBase();
|
||||
|
||||
if (ib == null)
|
||||
if (sell.template == null)
|
||||
return;
|
||||
|
||||
if (npc.getParentZone() != null && npc.getParentZone().playerCityUUID != 0)
|
||||
if (!npc.getCharItemManager().hasRoomInventory(ib.getWeight())) {
|
||||
if (!npc.getCharItemManager().hasRoomInventory(sell.template.item_wt)) {
|
||||
|
||||
ErrorPopupMsg.sendErrorPopup(player, 21);
|
||||
return;
|
||||
@@ -1390,12 +1388,14 @@ public class ClientMessagePump implements NetMsgHandler {
|
||||
return;
|
||||
for (MobEquipment me : sellInventory) {
|
||||
if (me.getObjectUUID() == msg.getItemID()) {
|
||||
|
||||
ItemBase ib = me.getItemBase();
|
||||
|
||||
if (ib == null)
|
||||
return;
|
||||
|
||||
//test room available for item
|
||||
if (!itemMan.hasRoomInventory(ib.getWeight()))
|
||||
if (!itemMan.hasRoomInventory(me.template.item_wt))
|
||||
return;
|
||||
|
||||
int cost = me.getMagicValue();
|
||||
@@ -1407,10 +1407,8 @@ public class ClientMessagePump implements NetMsgHandler {
|
||||
if (profit < 1)
|
||||
profit = 1;
|
||||
|
||||
|
||||
cost *= profit;
|
||||
|
||||
|
||||
if (gold.getNumOfItems() - cost < 0) {
|
||||
//dont' have enough goldItem exit!
|
||||
// chatMan.chatSystemInfo(pc, "" + "You dont have enough gold.");
|
||||
@@ -1453,16 +1451,11 @@ public class ClientMessagePump implements NetMsgHandler {
|
||||
if (buy == null)
|
||||
return;
|
||||
|
||||
ItemBase ib = buy.getItemBase();
|
||||
|
||||
if (ib == null)
|
||||
return;
|
||||
|
||||
if (!npcCim.inventoryContains(buy))
|
||||
return;
|
||||
|
||||
//test room available for item
|
||||
if (!itemMan.hasRoomInventory(ib.getWeight()))
|
||||
if (!itemMan.hasRoomInventory(buy.template.item_wt))
|
||||
return;
|
||||
|
||||
//TODO test cost and subtract goldItem
|
||||
@@ -1524,16 +1517,11 @@ public class ClientMessagePump implements NetMsgHandler {
|
||||
if (buy == null)
|
||||
return;
|
||||
|
||||
ItemBase ib = buy.getItemBase();
|
||||
|
||||
if (ib == null)
|
||||
return;
|
||||
|
||||
if (!npcCim.inventoryContains(buy))
|
||||
return;
|
||||
|
||||
//test room available for item
|
||||
if (!itemMan.hasRoomInventory(ib.getWeight()))
|
||||
if (!itemMan.hasRoomInventory(buy.template.item_wt))
|
||||
return;
|
||||
|
||||
//TODO test cost and subtract goldItem
|
||||
|
||||
@@ -129,7 +129,7 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler {
|
||||
if (targetItem.getItemBase().getType() == ItemType.GOLD)
|
||||
return;
|
||||
|
||||
if (!vendor.getCharItemManager().hasRoomInventory(targetItem.getItemBase().getWeight())) {
|
||||
if (!vendor.getCharItemManager().hasRoomInventory(targetItem.template.item_wt)) {
|
||||
|
||||
ErrorPopupMsg.sendErrorPopup(player, 21);
|
||||
return;
|
||||
@@ -407,7 +407,7 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler {
|
||||
if (vendor.getCharItemManager().inventoryContains(targetItem) == false)
|
||||
return;
|
||||
|
||||
if (player.getCharItemManager().hasRoomInventory(targetItem.getItemBase().getWeight()) == false)
|
||||
if (player.getCharItemManager().hasRoomInventory(targetItem.template.item_wt) == false)
|
||||
return;
|
||||
|
||||
player.getCharItemManager().buyFromNPC(targetItem, vendor);
|
||||
|
||||
Reference in New Issue
Block a user