case L2Player.STORE_PRIVATE_SELL:
items = info.bestSellItems;
tradeList = pl.getSellList();
for(TradeItem item : tradeList)
{
L2Item temp = ItemTable.getInstance().getTemplate(item.getItemId());
if(temp == null)
{
continue;
}
TreeMap<Long, Item> oldItems = items.get(temp.getName());
if(oldItems == null)
{
oldItems = new TreeMap<Long, Item>();
items.put(temp.getName(), oldItems);
}
Item newItem = new Item(item.getItemId(), type, item.getOwnersPrice(), item.getCount(), item.getEnchantLevel(), temp.getName(), pl.getStoredId(), pl.getName(), path, item.getObjectId(), new Element(item));
long key = newItem.price * 100;
while(key < newItem.price * 100 + 100 && oldItems.containsKey(key))
// До 100 предметов с одинаковыми ценами
{
key++;
}
oldItems.put(key, newItem);
}
break;
case L2Player.STORE_PRIVATE_BUY:
items = info.bestBuyItems;
tradeList = pl.getBuyList();
for(TradeItem item : tradeList)
{
L2Item temp = ItemTable.getInstance().getTemplate(item.getItemId());
if(temp == null)
{
continue;
}
TreeMap<Long, Item> oldItems = items.get(temp.getName());
if(oldItems == null)
{
oldItems = new TreeMap<Long, Item>();
items.put(temp.getName(), oldItems);
}
Item newItem = new Item(item.getItemId(), type, item.getOwnersPrice(), item.getCount(), item.getEnchantLevel(), temp.getName(), pl.getStoredId(), pl.getName(), path, itemObjId++, new Element(item));
long key = newItem.price * 100;
while(key < newItem.price * 100 + 100 && oldItems.containsKey(key))
// До 100 предметов с одинаковыми ценами
{
key++;
}
oldItems.put(key, newItem);
}
break;
case L2Player.STORE_PRIVATE_MANUFACTURE:
items = info.bestCraftItems;
L2ManufactureList createList = pl.getCreateList();
if(createList == null)
{
continue;
}
for(L2ManufactureItem mitem : createList.getList())
{
int recipeId = mitem.getRecipeId();
L2Recipe recipe = RecipeController.getInstance().getRecipeByRecipeId(recipeId);
if(recipe == null)
{
continue;
}
L2Item temp = ItemTable.getInstance().getTemplate(recipe.getItemId());
if(temp == null)
{
continue;
}
TreeMap<Long, Item> oldItems = items.get(temp.getName());
if(oldItems == null)
{
oldItems = new TreeMap<Long, Item>();
items.put(temp.getName(), oldItems);
}
Item newItem = new Item(recipe.getItemId(), type, mitem.getCost(), recipe.getCount(), 0, temp.getName(), pl.getStoredId(), pl.getName(), path, itemObjId++, null);
long key = newItem.price * 100;
while(key < newItem.price * 100 + 100 && oldItems.containsKey(key))
// До 100 предметов с одинаковыми ценами
{
key++;