|
|
@ -1472,6 +1472,7 @@ public class ClientMessagePump implements NetMsgHandler { |
|
|
|
} |
|
|
|
} |
|
|
|
if(me.getItemBase().getType().equals(ItemType.RESOURCE) && npc.getContractID() == 900){ |
|
|
|
if(me.getItemBase().getType().equals(ItemType.RESOURCE) && npc.getContractID() == 900){ |
|
|
|
boolean stacked = false; |
|
|
|
boolean stacked = false; |
|
|
|
|
|
|
|
int buystack = Warehouse.getSellStackSize(me.getItemBase().getUUID()); |
|
|
|
for(Item item : itemMan.getInventory()){ |
|
|
|
for(Item item : itemMan.getInventory()){ |
|
|
|
int itemID = item.getItemBaseID(); |
|
|
|
int itemID = item.getItemBaseID(); |
|
|
|
int meID = me.getItemBase().getUUID(); |
|
|
|
int meID = me.getItemBase().getUUID(); |
|
|
@ -1479,8 +1480,8 @@ public class ClientMessagePump implements NetMsgHandler { |
|
|
|
if(Warehouse.maxResources.isEmpty()) |
|
|
|
if(Warehouse.maxResources.isEmpty()) |
|
|
|
Warehouse.getMaxResources(); |
|
|
|
Warehouse.getMaxResources(); |
|
|
|
int maxStack = Warehouse.maxResources.get(itemID); |
|
|
|
int maxStack = Warehouse.maxResources.get(itemID); |
|
|
|
if(maxStack > item.getNumOfItems() + 1){ |
|
|
|
if(maxStack > item.getNumOfItems() + buystack){ |
|
|
|
item.setNumOfItems(item.getNumOfItems() + 1); |
|
|
|
item.setNumOfItems(item.getNumOfItems() + buystack); |
|
|
|
stacked = true; |
|
|
|
stacked = true; |
|
|
|
itemMan.updateInventory(); |
|
|
|
itemMan.updateInventory(); |
|
|
|
DbManager.ItemQueries.UPDATE_NUM_ITEMS(item,item.getNumOfItems(),0); |
|
|
|
DbManager.ItemQueries.UPDATE_NUM_ITEMS(item,item.getNumOfItems(),0); |
|
|
@ -1493,7 +1494,8 @@ public class ClientMessagePump implements NetMsgHandler { |
|
|
|
if (buy != null) { |
|
|
|
if (buy != null) { |
|
|
|
me.transferEnchants(buy); |
|
|
|
me.transferEnchants(buy); |
|
|
|
itemMan.addItemToInventory(buy); |
|
|
|
itemMan.addItemToInventory(buy); |
|
|
|
//itemMan.updateInventory();
|
|
|
|
buy.setNumOfItems(buystack); |
|
|
|
|
|
|
|
DbManager.ItemQueries.UPDATE_NUM_ITEMS(buy,buy.getNumOfItems(),0); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}else { |
|
|
|
}else { |
|
|
|