Package l2p.gameserver.model.base

Examples of l2p.gameserver.model.base.MultiSellIngredient


        if(d.getAttributes().getNamedItem("elementValue") != null)
        {
          elementValue = Integer.parseInt(d.getAttributes().getNamedItem("elementValue").getNodeValue());
        }
        l2p.util.Log.add(MultiSellId + " loaded ingredient " + id + " count " + count, "multiselldebug");
        entry.addIngredient(new MultiSellIngredient(id, count, enchant, element, elementValue));
      }
      else if(NODE_PRODUCTION.equalsIgnoreCase(d.getNodeName()))
      {
        int id = Integer.parseInt(d.getAttributes().getNamedItem("id").getNodeValue());
        long count = Long.parseLong(d.getAttributes().getNamedItem("count").getNodeValue());
        int enchant = 0, element = L2Item.ATTRIBUTE_NONE, elementValue = 0;
        if(d.getAttributes().getNamedItem("enchant") != null)
        {
          enchant = Integer.parseInt(d.getAttributes().getNamedItem("enchant").getNodeValue());
        }
        if(d.getAttributes().getNamedItem("element") != null)
        {
          element = Integer.parseInt(d.getAttributes().getNamedItem("element").getNodeValue());
        }
        if(d.getAttributes().getNamedItem("elementValue") != null)
        {
          elementValue = Integer.parseInt(d.getAttributes().getNamedItem("elementValue").getNodeValue());
        }
        if(!Config.ALT_ALLOW_SHADOW_WEAPONS && id > 0)
        {
          L2Item item = ItemTable.getInstance().getTemplate(id);
          if(item != null && item.isShadowItem() && item.isWeapon() && !Config.ALT_ALLOW_SHADOW_WEAPONS)
          {
            return null;
          }
        }
        l2p.util.Log.add(MultiSellId + " loaded product " + id + " count " + count, "multiselldebug");
        entry.addProduct(new MultiSellIngredient(id, count, enchant, element, elementValue));
      }
      else
      {
        l2p.util.Log.add(MultiSellId + " skipping node " + d.getNodeName(), "multiselldebug");
      }
View Full Code Here


    if((ingredient = parseItemIdAndCount(a[0])) == null || (production = parseItemIdAndCount(a[1])) == null)
    {
      return null;
    }
    MultiSellEntry entry = new MultiSellEntry();
    entry.addIngredient(new MultiSellIngredient((int) ingredient[0], ingredient[1]));
    entry.addProduct(new MultiSellIngredient((int) production[0], production[1]));
    return entry;
  }
View Full Code Here

            final int entry = new int[]
            {
              itm.getItemId(), i.getItemId(), itm.getEnchantLevel()
            }.hashCode();
            MultiSellEntry possibleEntry = new MultiSellEntry(entry, i.getItemId(), 1, itm.getEnchantLevel());
            possibleEntry.addIngredient(new MultiSellIngredient(itm.getItemId(), 1, itm.getEnchantLevel()));
            list.entries.add(possibleEntry);
          }
        }
      }
    }
    // Hardcoded  - обмен вещей с доплатой за AA
    else if(listId == 9998)
    {
      list.setShowAll(false);
      list.setKeepEnchant(false);
      list.setNoTax(true);
      final Inventory inv = player.getInventory();
      _items = new GArray<L2ItemInstance>();
      for(final L2ItemInstance itm : inv.getItems())
      {
        if(itm.getItem().getAdditionalName().isEmpty() // Менять можно только обычные предметы
           && !itm.getItem().isSa() // SA менять нельзя
           && !itm.getItem().isRare() // Rare менять нельзя
           && !itm.getItem().isCommonItem() // Common менять нельзя
           && !itm.getItem().isPvP() // PvP менять нельзя
           && !itm.getItem().isShadowItem() // Shadow менять нельзя
           && !itm.isTemporalItem() // Temporal менять нельзя
           && !itm.isStackable() //
           && itm.getItem().getType2() == L2Item.TYPE2_WEAPON //
           && itm.getItem().getCrystalType() != Grade.NONE //
           && itm.getReferencePrice() <= Config.ALT_MAMMON_UPGRADE //
           && itm.getItem().getCrystalCount() > 0 //
           && !itm.isEquipped() //
           && itm.getItem().isTradeable() //
           && (itm.getCustomFlags() & L2ItemInstance.FLAG_NO_TRADE) != L2ItemInstance.FLAG_NO_TRADE //
        )
        {
          _items.add(itm);
        }
      }
      for(final L2ItemInstance itemtosell : _items)
      {
        for(final L2Weapon itemtobuy : ItemTable.getInstance().getAllWeapons())
        {
          if(itemtobuy.getAdditionalName().isEmpty() // Менять можно только обычные предметы
             && !itemtobuy.isSa() // На SA менять нельзя
             && !itemtobuy.isRare() // На Rare менять нельзя
             && !itemtobuy.isCommonItem() // На Common менять нельзя
             && !itemtobuy.isPvP() // На PvP менять нельзя
             && !itemtobuy.isShadowItem() // На Shadow менять нельзя
             && itemtobuy.isTradeable() //
             && itemtobuy.getType2() == L2Item.TYPE2_WEAPON //
             && itemtobuy.getItemType() == WeaponType.DUAL == (itemtosell.getItem().getItemType() == WeaponType.DUAL) //
             && itemtobuy.getCrystalType().ordinal() >= itemtosell.getItem().getCrystalType().ordinal() //
             && itemtobuy.getReferencePrice() <= Config.ALT_MAMMON_UPGRADE //
             && itemtosell.getItem().getReferencePrice() < itemtobuy.getReferencePrice() //
             && itemtosell.getReferencePrice() * 1.7 > itemtobuy.getReferencePrice() //
          )
          {
            final int entry = new int[]
            {
              itemtosell.getItemId(), itemtobuy.getItemId(), itemtosell.getEnchantLevel()
            }.hashCode();
            MultiSellEntry possibleEntry = new MultiSellEntry(entry, itemtobuy.getItemId(), 1, 0);
            possibleEntry.addIngredient(new MultiSellIngredient(itemtosell.getItemId(), 1, itemtosell.getEnchantLevel()));
            possibleEntry.addIngredient(new MultiSellIngredient((short) 5575, (int) ((itemtobuy.getReferencePrice() - itemtosell.getReferencePrice()) * 1.2), 0));
            list.entries.add(possibleEntry);
          }
        }
      }
    }
    // Hardcoded  - обмен вещей на кристаллы
    else if(listId == 9997)
    {
      list.setShowAll(false);
      list.setKeepEnchant(true);
      list.setNoTax(false);
      final Inventory inv = player.getInventory();
      for(final L2ItemInstance itm : inv.getItems())
      {
        if(!itm.isStackable() && itm.getItem().isCrystallizable() && itm.getItem().getCrystalType() != Grade.NONE && itm.getItem().getCrystalCount() > 0 && !itm.isShadowItem() && !itm.isTemporalItem() && !itm.isEquipped() && (itm.getCustomFlags() & L2ItemInstance.FLAG_NO_CRYSTALLIZE) != L2ItemInstance.FLAG_NO_CRYSTALLIZE)
        {
          final L2Item crystal = ItemTable.getInstance().getTemplate(itm.getItem().getCrystalType().cry);
          final int entry = new int[]
          {
            itm.getItemId(), itm.getEnchantLevel()
          }.hashCode();
          MultiSellEntry possibleEntry = new MultiSellEntry(entry, crystal.getItemId(), itm.getItem().getCrystalCount(), 0);
          possibleEntry.addIngredient(new MultiSellIngredient(itm.getItemId(), 1, itm.getEnchantLevel()));
          possibleEntry.addIngredient(new MultiSellIngredient((short) 57, (int) (itm.getItem().getCrystalCount() * crystal.getReferencePrice() * 0.05), 0));
          list.entries.add(possibleEntry);
        }
      }
    }
    // Все мультиселлы из датапака
    else
    {
      MultiSellListContainer container = L2Multisell.getInstance().getList(listId);
      if(container == null)
      {
        _log.warning("Not found myltisell " + listId);
        return null;
      }
      else if(container.isEmpty())
      {
        player.sendMessage(new CustomMessage("common.Disabled", player));
        return null;
      }
      boolean enchant = container.isKeepEnchant();
      boolean notax = container.isNoTax();
      boolean showall = container.isShowAll();
      boolean nokey = container.isNoKey();
      list.setShowAll(showall);
      list.setKeepEnchant(enchant);
      list.setNoTax(notax);
      list.setNoKey(nokey);
      final Inventory inv = player.getInventory();
      for(MultiSellEntry origEntry : container.getEntries())
      {
        MultiSellEntry ent = origEntry.clone();
        // Обработка налога, если лист не безналоговый
        // Адены добавляются в лист если отсутствуют или прибавляются к существующим
        GArray<MultiSellIngredient> ingridients;
        if(!notax && taxRate > 0.)
        {
          double tax = 0, adena = 0;
          ingridients = new GArray<MultiSellIngredient>(ent.getIngredients().size() + 1);
          for(MultiSellIngredient i : ent.getIngredients())
          {
            if(i.getItemId() == 57)
            {
              adena += i.getItemCount();
              tax += i.getItemCount() * (taxRate);
              continue;
            }
            ingridients.add(i);
            if(i.getItemId() == L2Item.ITEM_ID_CLAN_REPUTATION_SCORE)
            // hardcoded. Налог на клановую репутацию. Формула проверена на с6 и соответсвует на 100%.
            //TODO: Проверить на корейском(?) оффе налог на банг поинты и fame
            {
              tax += i.getItemCount() / 120 * 1000 * taxRate * 100;
            }
            if(i.getItemId() < 1)
            {
              continue;
            }
            final L2Item item = ItemTable.getInstance().getTemplate(i.getItemId());
            if(item == null)
            {
              System.out.println("Not found template for itemId: " + i.getItemId());
            }
            else if(item.isStackable())
            {
              tax += item.getReferencePrice() * i.getItemCount() * taxRate;
            }
          }
          adena = Math.round(adena + tax);
          if(adena >= 1)
          {
            ingridients.add(new MultiSellIngredient(57, (long) adena));
          }
          tax = Math.round(tax);
          if(tax >= 1)
          {
            ent.setTax((long) tax);
View Full Code Here

        continue;
      }
      if(item[ItemTable.WEX_SA1] > 0 && item[ItemTable.WEX_SA_CRY1] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(i, 1));
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.WEX_SA_CRY1], 1));
        e1.addIngredient(new MultiSellIngredient(price[0], price[1]));
        if(price[2] > 0)
        {
          e1.addIngredient(new MultiSellIngredient(57, price[2]));
        }
        e1.addProduct(new MultiSellIngredient(item[ItemTable.WEX_SA1], 1));
        list.addEntry(e1);
      }
      if(item[ItemTable.WEX_SA2] > 0 && item[ItemTable.WEX_SA_CRY2] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(i, 1));
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.WEX_SA_CRY2], 1));
        e1.addIngredient(new MultiSellIngredient(price[0], price[1]));
        if(price[2] > 0)
        {
          e1.addIngredient(new MultiSellIngredient(57, price[2]));
        }
        e1.addProduct(new MultiSellIngredient(item[ItemTable.WEX_SA2], 1));
        list.addEntry(e1);
      }
      if(item[ItemTable.WEX_SA3] > 0 && item[ItemTable.WEX_SA_CRY3] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(i, 1));
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.WEX_SA_CRY3], 1));
        e1.addIngredient(new MultiSellIngredient(price[0], price[1]));
        if(price[2] > 0)
        {
          e1.addIngredient(new MultiSellIngredient(57, price[2]));
        }
        e1.addProduct(new MultiSellIngredient(item[ItemTable.WEX_SA3], 1));
        list.addEntry(e1);
      }
      if(item[ItemTable.WEX_RARE_SA1] > 0 && item[ItemTable.WEX_SA_CRY1] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.WEX_RARE], 1));
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.WEX_SA_CRY1], 1));
        e1.addIngredient(new MultiSellIngredient(price[0], price[1]));
        if(price[2] > 0)
        {
          e1.addIngredient(new MultiSellIngredient(57, price[2]));
        }
        e1.addProduct(new MultiSellIngredient(item[ItemTable.WEX_RARE_SA1], 1));
        list.addEntry(e1);
      }
      if(item[ItemTable.WEX_RARE_SA2] > 0 && item[ItemTable.WEX_SA_CRY2] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.WEX_RARE], 1));
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.WEX_SA_CRY2], 1));
        e1.addIngredient(new MultiSellIngredient(price[0], price[1]));
        if(price[2] > 0)
        {
          e1.addIngredient(new MultiSellIngredient(57, price[2]));
        }
        e1.addProduct(new MultiSellIngredient(item[ItemTable.WEX_RARE_SA2], 1));
        list.addEntry(e1);
      }
      if(item[ItemTable.WEX_RARE_SA3] > 0 && item[ItemTable.WEX_SA_CRY3] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.WEX_RARE], 1));
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.WEX_SA_CRY3], 1));
        e1.addIngredient(new MultiSellIngredient(price[0], price[1]));
        if(price[2] > 0)
        {
          e1.addIngredient(new MultiSellIngredient(57, price[2]));
        }
        e1.addProduct(new MultiSellIngredient(item[ItemTable.WEX_RARE_SA3], 1));
        list.addEntry(e1);
      }
    }
  }
View Full Code Here

      L2Item itm = ItemTable.getInstance().getTemplate(i);
      int price = getSARemovePrice(itm);
      if(item[ItemTable.WEX_SA1] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.WEX_SA1], 1));
        if(price > 0)
        {
          e1.addIngredient(new MultiSellIngredient(5575, price));
        }
        e1.addProduct(new MultiSellIngredient(i, 1));
        list.addEntry(e1);
      }
      if(item[ItemTable.WEX_SA2] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.WEX_SA2], 1));
        if(price > 0)
        {
          e1.addIngredient(new MultiSellIngredient(5575, price));
        }
        e1.addProduct(new MultiSellIngredient(i, 1));
        list.addEntry(e1);
      }
      if(item[ItemTable.WEX_SA3] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.WEX_SA3], 1));
        if(price > 0)
        {
          e1.addIngredient(new MultiSellIngredient(5575, price));
        }
        e1.addProduct(new MultiSellIngredient(i, 1));
        list.addEntry(e1);
      }
      if(item[ItemTable.WEX_RARE_SA1] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.WEX_RARE_SA1], 1));
        if(price > 0)
        {
          e1.addIngredient(new MultiSellIngredient(5575, price));
        }
        e1.addProduct(new MultiSellIngredient(item[ItemTable.WEX_RARE], 1));
        list.addEntry(e1);
      }
      if(item[ItemTable.WEX_RARE_SA2] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.WEX_RARE_SA2], 1));
        if(price > 0)
        {
          e1.addIngredient(new MultiSellIngredient(5575, price));
        }
        e1.addProduct(new MultiSellIngredient(item[ItemTable.WEX_RARE], 1));
        list.addEntry(e1);
      }
      if(item[ItemTable.WEX_RARE_SA3] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.WEX_RARE_SA3], 1));
        if(price > 0)
        {
          e1.addIngredient(new MultiSellIngredient(5575, price));
        }
        e1.addProduct(new MultiSellIngredient(item[ItemTable.WEX_RARE], 1));
        list.addEntry(e1);
      }
    }
  }
View Full Code Here

        continue;
      }
      if(item[ItemTable.WEX_FOUNDATION] > 0 && item[ItemTable.WEX_RARE] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.WEX_FOUNDATION], 1));
        if(item[ItemTable.WEX_VARNISH_COUNT] > 0)
        {
          e1.addIngredient(new MultiSellIngredient(12374, item[ItemTable.WEX_VARNISH_COUNT]));
        }
        e1.addProduct(new MultiSellIngredient(item[ItemTable.WEX_RARE], 1));
        list.addEntry(e1);
      }
    }
    int[][] armors = ItemTable.getInstance().getArmorEx();
    for(int i = 0; i < armors.length; i++)
    {
      int[] item = armors[i];
      if(item == null)
      {
        continue;
      }
      if(item[ItemTable.AEX_FOUNDATION] <= 0)
      {
        continue;
      }
      if(item[ItemTable.AEX_SEALED_RARE_1] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.AEX_FOUNDATION], 1));
        if(item[ItemTable.AEX_VARNISH] > 0)
        {
          e1.addIngredient(new MultiSellIngredient(12374, item[ItemTable.AEX_VARNISH]));
        }
        e1.addProduct(new MultiSellIngredient(item[ItemTable.AEX_SEALED_RARE_1], 1));
        list.addEntry(e1);
        if(item[ItemTable.AEX_SEALED_RARE_2] > 0)
        {
          MultiSellEntry e2 = new MultiSellEntry(entId++);
          e2.addIngredient(new MultiSellIngredient(item[ItemTable.AEX_FOUNDATION], 1));
          if(item[ItemTable.AEX_VARNISH] > 0)
          {
            e2.addIngredient(new MultiSellIngredient(12374, item[ItemTable.AEX_VARNISH]));
          }
          e2.addProduct(new MultiSellIngredient(item[ItemTable.AEX_SEALED_RARE_2], 1));
          list.addEntry(e2);
        }
        if(item[ItemTable.AEX_SEALED_RARE_3] > 0)
        {
          MultiSellEntry e3 = new MultiSellEntry(entId++);
          e3.addIngredient(new MultiSellIngredient(item[ItemTable.AEX_FOUNDATION], 1));
          if(item[ItemTable.AEX_VARNISH] > 0)
          {
            e3.addIngredient(new MultiSellIngredient(12374, item[ItemTable.AEX_VARNISH]));
          }
          e3.addProduct(new MultiSellIngredient(item[ItemTable.AEX_SEALED_RARE_3], 1));
          list.addEntry(e3);
        }
      }
      else if(item[ItemTable.AEX_UNSEALED_RARE_1] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.AEX_FOUNDATION], 1));
        if(item[ItemTable.AEX_VARNISH] > 0)
        {
          e1.addIngredient(new MultiSellIngredient(12374, item[ItemTable.AEX_VARNISH]));
        }
        e1.addProduct(new MultiSellIngredient(item[ItemTable.AEX_UNSEALED_RARE_1], 1));
        list.addEntry(e1);
        if(item[ItemTable.AEX_UNSEALED_RARE_2] > 0)
        {
          MultiSellEntry e2 = new MultiSellEntry(entId++);
          e2.addIngredient(new MultiSellIngredient(item[ItemTable.AEX_FOUNDATION], 1));
          if(item[ItemTable.AEX_VARNISH] > 0)
          {
            e2.addIngredient(new MultiSellIngredient(12374, item[ItemTable.AEX_VARNISH]));
          }
          e2.addProduct(new MultiSellIngredient(item[ItemTable.AEX_UNSEALED_RARE_2], 1));
          list.addEntry(e2);
        }
        if(item[ItemTable.AEX_UNSEALED_RARE_3] > 0)
        {
          MultiSellEntry e3 = new MultiSellEntry(entId++);
          e3.addIngredient(new MultiSellIngredient(item[ItemTable.AEX_FOUNDATION], 1));
          if(item[ItemTable.AEX_VARNISH] > 0)
          {
            e3.addIngredient(new MultiSellIngredient(12374, item[ItemTable.AEX_VARNISH]));
          }
          e3.addProduct(new MultiSellIngredient(item[ItemTable.AEX_UNSEALED_RARE_3], 1));
          list.addEntry(e3);
        }
      }
    }
  }
View Full Code Here

        continue;
      }
      if(item[ItemTable.WEX_PVP1] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.WEX_SA1] > 0 ? item[ItemTable.WEX_SA1] : i, 1));
        e1.addIngredient(new MultiSellIngredient(L2Item.ITEM_ID_FAME, price[0]));
        e1.addIngredient(new MultiSellIngredient(57, price[1]));
        e1.addProduct(new MultiSellIngredient(item[ItemTable.WEX_PVP1], 1));
        list.addEntry(e1);
      }
      if(item[ItemTable.WEX_PVP2] > 0 && item[ItemTable.WEX_SA2] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.WEX_SA2], 1));
        e1.addIngredient(new MultiSellIngredient(L2Item.ITEM_ID_FAME, price[0]));
        e1.addIngredient(new MultiSellIngredient(57, price[1]));
        e1.addProduct(new MultiSellIngredient(item[ItemTable.WEX_PVP2], 1));
        list.addEntry(e1);
      }
      if(item[ItemTable.WEX_PVP3] > 0 && item[ItemTable.WEX_SA3] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.WEX_SA3], 1));
        e1.addIngredient(new MultiSellIngredient(L2Item.ITEM_ID_FAME, price[0]));
        e1.addIngredient(new MultiSellIngredient(57, price[1]));
        e1.addProduct(new MultiSellIngredient(item[ItemTable.WEX_PVP3], 1));
        list.addEntry(e1);
      }
      if(item[ItemTable.WEX_RARE_PVP1] > 0 && (item[ItemTable.WEX_RARE_SA1] > 0 || item[ItemTable.WEX_RARE] > 0))
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.WEX_RARE_SA1] > 0 ? item[ItemTable.WEX_RARE_SA1] : item[ItemTable.WEX_RARE], 1));
        e1.addIngredient(new MultiSellIngredient(L2Item.ITEM_ID_FAME, price[0]));
        e1.addIngredient(new MultiSellIngredient(57, price[1]));
        e1.addProduct(new MultiSellIngredient(item[ItemTable.WEX_RARE_PVP1], 1));
        list.addEntry(e1);
      }
      if(item[ItemTable.WEX_RARE_PVP2] > 0 && item[ItemTable.WEX_RARE_SA2] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.WEX_RARE_SA2], 1));
        e1.addIngredient(new MultiSellIngredient(L2Item.ITEM_ID_FAME, price[0]));
        e1.addIngredient(new MultiSellIngredient(57, price[1]));
        e1.addProduct(new MultiSellIngredient(item[ItemTable.WEX_RARE_PVP2], 1));
        list.addEntry(e1);
      }
      if(item[ItemTable.WEX_RARE_PVP3] > 0 && item[ItemTable.WEX_RARE_SA3] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.WEX_RARE_SA3], 1));
        e1.addIngredient(new MultiSellIngredient(L2Item.ITEM_ID_FAME, price[0]));
        e1.addIngredient(new MultiSellIngredient(57, price[1]));
        e1.addProduct(new MultiSellIngredient(item[ItemTable.WEX_RARE_PVP3], 1));
        list.addEntry(e1);
      }
    }
    int[][] armors = ItemTable.getInstance().getArmorEx();
    for(int i = 0; i < armors.length; i++)
    {
      int[] item = armors[i];
      if(item == null || item[ItemTable.AEX_PvP] <= 0)
      {
        continue;
      }
      L2Item itm = ItemTable.getInstance().getTemplate(item[ItemTable.AEX_UNSEALED_1] > 0 ? item[ItemTable.AEX_UNSEALED_1] : i);
      int[] price = getPvPArmorPrice(itm);
      if(price == null)
      {
        continue;
      }
      if(item[ItemTable.AEX_PvP] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(itm.getItemId(), 1));
        e1.addIngredient(new MultiSellIngredient(L2Item.ITEM_ID_FAME, price[0]));
        e1.addIngredient(new MultiSellIngredient(57, price[1]));
        e1.addProduct(new MultiSellIngredient(item[ItemTable.AEX_PvP], 1));
        list.addEntry(e1);
      }
    }
  }
View Full Code Here

        continue;
      }
      if(item[ItemTable.WEX_PVP1] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.WEX_PVP1], 1));
        e1.addProduct(new MultiSellIngredient(item[ItemTable.WEX_SA1] > 0 ? item[ItemTable.WEX_SA1] : i, 1));
        list.addEntry(e1);
      }
      if(item[ItemTable.WEX_PVP2] > 0 && item[ItemTable.WEX_SA2] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.WEX_PVP2], 1));
        e1.addProduct(new MultiSellIngredient(item[ItemTable.WEX_SA2], 1));
        list.addEntry(e1);
      }
      if(item[ItemTable.WEX_PVP3] > 0 && item[ItemTable.WEX_SA3] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.WEX_PVP3], 1));
        e1.addProduct(new MultiSellIngredient(item[ItemTable.WEX_SA3], 1));
        list.addEntry(e1);
      }
      if(item[ItemTable.WEX_RARE_PVP1] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.WEX_RARE_PVP1], 1));
        e1.addProduct(new MultiSellIngredient(item[ItemTable.WEX_RARE_SA1] > 0 ? item[ItemTable.WEX_RARE_SA1] : item[ItemTable.WEX_RARE], 1));
        list.addEntry(e1);
      }
      if(item[ItemTable.WEX_RARE_PVP2] > 0 && item[ItemTable.WEX_RARE_SA2] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.WEX_RARE_PVP2], 1));
        e1.addProduct(new MultiSellIngredient(item[ItemTable.WEX_RARE_SA2], 1));
        list.addEntry(e1);
      }
      if(item[ItemTable.WEX_RARE_PVP3] > 0 && item[ItemTable.WEX_RARE_SA3] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.WEX_RARE_PVP3], 1));
        e1.addProduct(new MultiSellIngredient(item[ItemTable.WEX_RARE_SA3], 1));
        list.addEntry(e1);
      }
    }
    int[][] armors = ItemTable.getInstance().getArmorEx();
    for(int i = 0; i < armors.length; i++)
    {
      int[] item = armors[i];
      if(item == null)
      {
        continue;
      }
      L2Item itm = ItemTable.getInstance().getTemplate(i);
      int[] price = getPvPArmorPrice(itm);
      if(price == null)
      {
        continue;
      }
      if(item[ItemTable.AEX_PvP] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.AEX_PvP], 1));
        if(item[ItemTable.AEX_UNSEALED_1] > 0)
        {
          e1.addProduct(new MultiSellIngredient(item[ItemTable.AEX_UNSEALED_1], 1));
        }
        else
        {
          e1.addProduct(new MultiSellIngredient(i, 1));
        }
        list.addEntry(e1);
      }
    }
  }
View Full Code Here

        continue;
      }
      if(item[ItemTable.AEX_UNSEALED_1] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(i, 1));
        if(item[ItemTable.AEX_UNSEAL_PRICE] > 0)
        {
          e1.addIngredient(new MultiSellIngredient(unsealItem, item[ItemTable.AEX_UNSEAL_PRICE] * priceMult));
        }
        e1.addProduct(new MultiSellIngredient(item[ItemTable.AEX_UNSEALED_1], 1));
        list.addEntry(e1);
      }
      if(item[ItemTable.AEX_UNSEALED_2] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(i, 1));
        if(item[ItemTable.AEX_UNSEAL_PRICE] > 0)
        {
          e1.addIngredient(new MultiSellIngredient(unsealItem, item[ItemTable.AEX_UNSEAL_PRICE] * priceMult));
        }
        e1.addProduct(new MultiSellIngredient(item[ItemTable.AEX_UNSEALED_2], 1));
        list.addEntry(e1);
      }
      if(item[ItemTable.AEX_UNSEALED_3] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(i, 1));
        if(item[ItemTable.AEX_UNSEAL_PRICE] > 0)
        {
          e1.addIngredient(new MultiSellIngredient(unsealItem, item[ItemTable.AEX_UNSEAL_PRICE] * priceMult));
        }
        e1.addProduct(new MultiSellIngredient(item[ItemTable.AEX_UNSEALED_3], 1));
        list.addEntry(e1);
      }
      if(item[ItemTable.AEX_UNSEALED_RARE_1] > 0 && item[ItemTable.AEX_SEALED_RARE_1] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.AEX_SEALED_RARE_1], 1));
        if(item[ItemTable.AEX_UNSEAL_PRICE] > 0)
        {
          e1.addIngredient(new MultiSellIngredient(unsealItem, item[ItemTable.AEX_UNSEAL_PRICE] * priceMult));
        }
        e1.addProduct(new MultiSellIngredient(item[ItemTable.AEX_UNSEALED_RARE_1], 1));
        list.addEntry(e1);
      }
      if(item[ItemTable.AEX_UNSEALED_RARE_2] > 0 && (item[ItemTable.AEX_SEALED_RARE_2] > 0 || item[ItemTable.AEX_SEALED_RARE_1] > 0))
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        if(item[ItemTable.AEX_SEALED_RARE_2] > 0)
        {
          e1.addIngredient(new MultiSellIngredient(item[ItemTable.AEX_SEALED_RARE_2], 1));
        }
        else
        {
          e1.addIngredient(new MultiSellIngredient(item[ItemTable.AEX_SEALED_RARE_1], 1));
        }
        if(item[ItemTable.AEX_UNSEAL_PRICE] > 0)
        {
          e1.addIngredient(new MultiSellIngredient(unsealItem, item[ItemTable.AEX_UNSEAL_PRICE] * priceMult));
        }
        e1.addProduct(new MultiSellIngredient(item[ItemTable.AEX_UNSEALED_RARE_2], 1));
        list.addEntry(e1);
      }
      if(item[ItemTable.AEX_UNSEALED_RARE_3] > 0 && (item[ItemTable.AEX_SEALED_RARE_3] > 0 || item[ItemTable.AEX_SEALED_RARE_2] > 0 || item[ItemTable.AEX_SEALED_RARE_1] > 0))
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        if(item[ItemTable.AEX_SEALED_RARE_3] > 0)
        {
          e1.addIngredient(new MultiSellIngredient(item[ItemTable.AEX_SEALED_RARE_3], 1));
        }
        else
        {
          e1.addIngredient(new MultiSellIngredient(item[ItemTable.AEX_SEALED_RARE_1], 1));
        }
        if(item[ItemTable.AEX_UNSEAL_PRICE] > 0)
        {
          e1.addIngredient(new MultiSellIngredient(unsealItem, item[ItemTable.AEX_UNSEAL_PRICE] * priceMult));
        }
        e1.addProduct(new MultiSellIngredient(item[ItemTable.AEX_UNSEALED_RARE_3], 1));
        list.addEntry(e1);
      }
      if(item[ItemTable.AEX_UNSEALED_COMMON_1] > 0 && item[ItemTable.AEX_COMMON] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.AEX_COMMON], 1));
        if(item[ItemTable.AEX_UNSEAL_PRICE] > 0)
        {
          e1.addIngredient(new MultiSellIngredient(unsealItem, item[ItemTable.AEX_UNSEAL_PRICE] * priceMult / 20));
        }
        e1.addProduct(new MultiSellIngredient(item[ItemTable.AEX_UNSEALED_COMMON_1], 1));
        list.addEntry(e1);
      }
      if(item[ItemTable.AEX_UNSEALED_COMMON_2] > 0 && item[ItemTable.AEX_COMMON] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.AEX_COMMON], 1));
        if(item[ItemTable.AEX_UNSEAL_PRICE] > 0)
        {
          e1.addIngredient(new MultiSellIngredient(unsealItem, item[ItemTable.AEX_UNSEAL_PRICE] * priceMult / 20));
        }
        e1.addProduct(new MultiSellIngredient(item[ItemTable.AEX_UNSEALED_COMMON_2], 1));
        list.addEntry(e1);
      }
      if(item[ItemTable.AEX_UNSEALED_COMMON_3] > 0 && item[ItemTable.AEX_COMMON] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.AEX_COMMON], 1));
        if(item[ItemTable.AEX_UNSEAL_PRICE] > 0)
        {
          e1.addIngredient(new MultiSellIngredient(unsealItem, item[ItemTable.AEX_UNSEAL_PRICE] * priceMult / 20));
        }
        e1.addProduct(new MultiSellIngredient(item[ItemTable.AEX_UNSEALED_COMMON_3], 1));
        list.addEntry(e1);
      }
    }
  }
View Full Code Here

        continue;
      }
      if(item[ItemTable.AEX_UNSEALED_1] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.AEX_UNSEALED_1], 1));
        if(item[ItemTable.AEX_RESEAL_PRICE] > 0)
        {
          e1.addIngredient(new MultiSellIngredient(5575, item[ItemTable.AEX_RESEAL_PRICE]));
        }
        e1.addProduct(new MultiSellIngredient(i, 1));
        list.addEntry(e1);
      }
      if(item[ItemTable.AEX_UNSEALED_2] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.AEX_UNSEALED_2], 1));
        if(item[ItemTable.AEX_RESEAL_PRICE] > 0)
        {
          e1.addIngredient(new MultiSellIngredient(5575, item[ItemTable.AEX_RESEAL_PRICE]));
        }
        e1.addProduct(new MultiSellIngredient(i, 1));
        list.addEntry(e1);
      }
      if(item[ItemTable.AEX_UNSEALED_3] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.AEX_UNSEALED_3], 1));
        if(item[ItemTable.AEX_RESEAL_PRICE] > 0)
        {
          e1.addIngredient(new MultiSellIngredient(5575, item[ItemTable.AEX_RESEAL_PRICE]));
        }
        e1.addProduct(new MultiSellIngredient(i, 1));
        list.addEntry(e1);
      }
      if(item[ItemTable.AEX_UNSEALED_RARE_1] > 0 && item[ItemTable.AEX_UNSEALED_RARE_2] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.AEX_UNSEALED_RARE_1], 1));
        if(item[ItemTable.AEX_RESEAL_PRICE] > 0)
        {
          e1.addIngredient(new MultiSellIngredient(5575, item[ItemTable.AEX_RESEAL_PRICE]));
        }
        e1.addProduct(new MultiSellIngredient(item[ItemTable.AEX_UNSEALED_RARE_2], 1));
        list.addEntry(e1);
      }
      if(item[ItemTable.AEX_UNSEALED_RARE_1] > 0 && item[ItemTable.AEX_UNSEALED_RARE_3] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.AEX_UNSEALED_RARE_1], 1));
        if(item[ItemTable.AEX_RESEAL_PRICE] > 0)
        {
          e1.addIngredient(new MultiSellIngredient(5575, item[ItemTable.AEX_RESEAL_PRICE]));
        }
        e1.addProduct(new MultiSellIngredient(item[ItemTable.AEX_UNSEALED_RARE_3], 1));
        list.addEntry(e1);
      }
      if(item[ItemTable.AEX_UNSEALED_RARE_2] > 0 && item[ItemTable.AEX_UNSEALED_RARE_1] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.AEX_UNSEALED_RARE_2], 1));
        if(item[ItemTable.AEX_RESEAL_PRICE] > 0)
        {
          e1.addIngredient(new MultiSellIngredient(5575, item[ItemTable.AEX_RESEAL_PRICE]));
        }
        e1.addProduct(new MultiSellIngredient(item[ItemTable.AEX_UNSEALED_RARE_1], 1));
        list.addEntry(e1);
      }
      if(item[ItemTable.AEX_UNSEALED_RARE_2] > 0 && item[ItemTable.AEX_UNSEALED_RARE_3] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.AEX_UNSEALED_RARE_2], 1));
        if(item[ItemTable.AEX_RESEAL_PRICE] > 0)
        {
          e1.addIngredient(new MultiSellIngredient(5575, item[ItemTable.AEX_RESEAL_PRICE]));
        }
        e1.addProduct(new MultiSellIngredient(item[ItemTable.AEX_UNSEALED_RARE_3], 1));
        list.addEntry(e1);
      }
      if(item[ItemTable.AEX_UNSEALED_RARE_3] > 0 && item[ItemTable.AEX_UNSEALED_RARE_1] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.AEX_UNSEALED_RARE_3], 1));
        if(item[ItemTable.AEX_RESEAL_PRICE] > 0)
        {
          e1.addIngredient(new MultiSellIngredient(5575, item[ItemTable.AEX_RESEAL_PRICE]));
        }
        e1.addProduct(new MultiSellIngredient(item[ItemTable.AEX_UNSEALED_RARE_1], 1));
        list.addEntry(e1);
      }
      if(item[ItemTable.AEX_UNSEALED_RARE_3] > 0 && item[ItemTable.AEX_UNSEALED_RARE_2] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.AEX_UNSEALED_RARE_3], 1));
        if(item[ItemTable.AEX_RESEAL_PRICE] > 0)
        {
          e1.addIngredient(new MultiSellIngredient(5575, item[ItemTable.AEX_RESEAL_PRICE]));
        }
        e1.addProduct(new MultiSellIngredient(item[ItemTable.AEX_UNSEALED_RARE_2], 1));
        list.addEntry(e1);
      }
      if(item[ItemTable.AEX_UNSEALED_COMMON_1] > 0 && item[ItemTable.AEX_COMMON] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.AEX_UNSEALED_COMMON_1], 1));
        if(item[ItemTable.AEX_RESEAL_PRICE] > 0)
        {
          e1.addIngredient(new MultiSellIngredient(5575, item[ItemTable.AEX_RESEAL_PRICE] / 20));
        }
        e1.addProduct(new MultiSellIngredient(item[ItemTable.AEX_COMMON], 1));
        list.addEntry(e1);
      }
      if(item[ItemTable.AEX_UNSEALED_COMMON_2] > 0 && item[ItemTable.AEX_COMMON] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.AEX_UNSEALED_COMMON_2], 1));
        if(item[ItemTable.AEX_RESEAL_PRICE] > 0)
        {
          e1.addIngredient(new MultiSellIngredient(5575, item[ItemTable.AEX_RESEAL_PRICE] / 20));
        }
        e1.addProduct(new MultiSellIngredient(item[ItemTable.AEX_COMMON], 1));
        list.addEntry(e1);
      }
      if(item[ItemTable.AEX_UNSEALED_COMMON_3] > 0 && item[ItemTable.AEX_COMMON] > 0)
      {
        MultiSellEntry e1 = new MultiSellEntry(entId++);
        e1.addIngredient(new MultiSellIngredient(item[ItemTable.AEX_UNSEALED_COMMON_3], 1));
        if(item[ItemTable.AEX_RESEAL_PRICE] > 0)
        {
          e1.addIngredient(new MultiSellIngredient(5575, item[ItemTable.AEX_RESEAL_PRICE] / 20));
        }
        e1.addProduct(new MultiSellIngredient(item[ItemTable.AEX_COMMON], 1));
        list.addEntry(e1);
      }
    }
  }
View Full Code Here

TOP

Related Classes of l2p.gameserver.model.base.MultiSellIngredient

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.