Examples of MultiSellIngredient


Examples of l2p.gameserver.model.base.MultiSellIngredient

        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

Examples of l2p.gameserver.model.base.MultiSellIngredient

        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

Examples of l2p.gameserver.model.base.MultiSellIngredient

    }
    if(needFix == 0)
    {
      return ingredients;
    }
    MultiSellIngredient temp;
    GArray<MultiSellIngredient> result = new GArray<MultiSellIngredient>(ingredients.size() + needFix);
    for(MultiSellIngredient ingredient : ingredients)
    {
      ingredient = ingredient.clone();
      while(ingredient.getItemCount() > Integer.MAX_VALUE)
      {
        temp = ingredient.clone();
        temp.setItemCount(2000000000);
        result.add(temp);
        ingredient.setItemCount(ingredient.getItemCount() - 2000000000);
      }
      if(ingredient.getItemCount() > 0)
      {
View Full Code Here

Examples of lineage2.gameserver.model.base.MultiSellIngredient

    }
    if (needFix == 0)
    {
      return ingredients;
    }
    MultiSellIngredient temp;
    List<MultiSellIngredient> result = new ArrayList<>(ingredients.size() + needFix);
    for (MultiSellIngredient ingredient : ingredients)
    {
      ingredient = ingredient.clone();
      while (ingredient.getItemCount() > Integer.MAX_VALUE)
      {
        temp = ingredient.clone();
        temp.setItemCount(2000000000);
        result.add(temp);
        ingredient.setItemCount(ingredient.getItemCount() - 2000000000);
      }
      if (ingredient.getItemCount() > 0)
      {
View Full Code Here

Examples of lineage2.gameserver.model.base.MultiSellIngredient

    {
      if (NODE_INGRIDIENT.equalsIgnoreCase(d.getNodeName()))
      {
        int id = Integer.parseInt(d.getAttributes().getNamedItem("id").getNodeValue());
        long count = Long.parseLong(d.getAttributes().getNamedItem("count").getNodeValue());
        MultiSellIngredient mi = new MultiSellIngredient(id, count);
        if (d.getAttributes().getNamedItem("enchant") != null)
        {
          mi.setItemEnchant(Integer.parseInt(d.getAttributes().getNamedItem("enchant").getNodeValue()));
        }
        if (d.getAttributes().getNamedItem("mantainIngredient") != null)
        {
          mi.setMantainIngredient(Boolean.parseBoolean(d.getAttributes().getNamedItem("mantainIngredient").getNodeValue()));
        }
        if (d.getAttributes().getNamedItem("fireAttr") != null)
        {
          mi.getItemAttributes().setFire(Integer.parseInt(d.getAttributes().getNamedItem("fireAttr").getNodeValue()));
        }
        if (d.getAttributes().getNamedItem("waterAttr") != null)
        {
          mi.getItemAttributes().setWater(Integer.parseInt(d.getAttributes().getNamedItem("waterAttr").getNodeValue()));
        }
        if (d.getAttributes().getNamedItem("earthAttr") != null)
        {
          mi.getItemAttributes().setEarth(Integer.parseInt(d.getAttributes().getNamedItem("earthAttr").getNodeValue()));
        }
        if (d.getAttributes().getNamedItem("windAttr") != null)
        {
          mi.getItemAttributes().setWind(Integer.parseInt(d.getAttributes().getNamedItem("windAttr").getNodeValue()));
        }
        if (d.getAttributes().getNamedItem("holyAttr") != null)
        {
          mi.getItemAttributes().setHoly(Integer.parseInt(d.getAttributes().getNamedItem("holyAttr").getNodeValue()));
        }
        if (d.getAttributes().getNamedItem("unholyAttr") != null)
        {
          mi.getItemAttributes().setUnholy(Integer.parseInt(d.getAttributes().getNamedItem("unholyAttr").getNodeValue()));
        }
        entry.addIngredient(mi);
      }
      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());
        MultiSellIngredient mi = new MultiSellIngredient(id, count);
        if (d.getAttributes().getNamedItem("enchant") != null)
        {
          mi.setItemEnchant(Integer.parseInt(d.getAttributes().getNamedItem("enchant").getNodeValue()));
        }
        if (d.getAttributes().getNamedItem("chance") != null)
        {
          mi.setChance(Integer.parseInt(d.getAttributes().getNamedItem("chance").getNodeValue()));
        }
        if (d.getAttributes().getNamedItem("fireAttr") != null)
        {
          mi.getItemAttributes().setFire(Integer.parseInt(d.getAttributes().getNamedItem("fireAttr").getNodeValue()));
        }
        if (d.getAttributes().getNamedItem("waterAttr") != null)
        {
          mi.getItemAttributes().setWater(Integer.parseInt(d.getAttributes().getNamedItem("waterAttr").getNodeValue()));
        }
        if (d.getAttributes().getNamedItem("earthAttr") != null)
        {
          mi.getItemAttributes().setEarth(Integer.parseInt(d.getAttributes().getNamedItem("earthAttr").getNodeValue()));
        }
        if (d.getAttributes().getNamedItem("windAttr") != null)
        {
          mi.getItemAttributes().setWind(Integer.parseInt(d.getAttributes().getNamedItem("windAttr").getNodeValue()));
        }
        if (d.getAttributes().getNamedItem("holyAttr") != null)
        {
          mi.getItemAttributes().setHoly(Integer.parseInt(d.getAttributes().getNamedItem("holyAttr").getNodeValue()));
        }
        if (d.getAttributes().getNamedItem("unholyAttr") != null)
        {
          mi.getItemAttributes().setUnholy(Integer.parseInt(d.getAttributes().getNamedItem("unholyAttr").getNodeValue()));
        }
        if (!Config.ALT_ALLOW_SHADOW_WEAPONS && (id > 0))
        {
          ItemTemplate item = ItemHolder.getInstance().getTemplate(id);
          if ((item != null) && item.isShadowItem() && item.isWeapon() && !Config.ALT_ALLOW_SHADOW_WEAPONS)
View Full Code Here

Examples of lineage2.gameserver.model.base.MultiSellIngredient

    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

Examples of lineage2.gameserver.model.base.MultiSellIngredient

          }
        }
        adena = Math.round(adena + tax);
        if (adena > 0)
        {
          ingridients.add(new MultiSellIngredient(57, adena));
        }
        ent.setTax(Math.round(tax));
        ent.getIngredients().clear();
        ent.getIngredients().addAll(ingridients);
      }
View Full Code Here

Examples of lineage2.gameserver.model.base.MultiSellIngredient

    {
      if (itm.canBeCrystallized(player))
      {
        final ItemTemplate crystal = ItemHolder.getInstance().getTemplate(itm.getTemplate().getCrystalType().cry);
        MultiSellEntry possibleEntry = new MultiSellEntry(++entry, crystal.getItemId(), itm.getTemplate().getCrystalCount(), 0);
        possibleEntry.addIngredient(new MultiSellIngredient(itm.getItemId(), 1, itm.getEnchantLevel()));
        possibleEntry.addIngredient(new MultiSellIngredient(ItemTemplate.ITEM_ID_ADENA, Math.round(itm.getTemplate().getCrystalCount() * crystal.getReferencePrice() * 0.05), 0));
        list.addEntry(possibleEntry);
      }
    }
    MultiSellHolder.getInstance().SeparateAndSend(list, player, castle == null ? 0. : castle.getTaxRate());
  }
View Full Code Here

Examples of net.sf.l2j.gameserver.model.L2Multisell.MultiSellIngredient

          }
        }
        if(newIng)
        {
          // if it's a new ingredient, just store its info directly (item id, count, enchantment)
          _ingredientsList.add(L2Multisell.getInstance().new MultiSellIngredient(e));
        }
      }
      // now check if the player has sufficient items in the inventory to cover the ingredients' expences
      for(MultiSellIngredient e : _ingredientsList)
      {
View Full Code Here

Examples of net.sf.l2j.gameserver.model.L2Multisell.MultiSellIngredient

      int totalAdenaCount = 0;

        for (MultiSellIngredient ing : templateEntry.getIngredients())
        {
          // load the ingredient from the template
          MultiSellIngredient newIngredient = L2Multisell.getInstance().new MultiSellIngredient(ing);

          if (newIngredient.getItemId() == 57 && newIngredient.isTaxIngredient())
          {
              double taxRate = 0.0;
            if (applyTaxes)
            {
                  if (merchant != null && merchant.getIsInTown())
                    taxRate = merchant.getCastle().getTaxRate();
            }

                 _transactionTax = (int)Math.round(newIngredient.getItemCount()*taxRate);
                 totalAdenaCount += _transactionTax;
            continue// do not yet add this adena amount to the list as non-taxIngredient adena might be entered later (order not guaranteed)
          }
          else if (ing.getItemId() == 57) // && !ing.isTaxIngredient()
          {
            totalAdenaCount += newIngredient.getItemCount();
            continue// do not yet add this adena amount to the list as taxIngredient adena might be entered later (order not guaranteed)
          }
          // if it is an armor/weapon, modify the enchantment level appropriately, if necessary
          else if (maintainEnchantment)
          {
              L2Item tempItem = ItemTable.getInstance().createDummyItem(newIngredient.getItemId()).getItem();
              if ((tempItem instanceof L2Armor) || (tempItem instanceof L2Weapon))
                newIngredient.setEnchantmentLevel(enchantLevel);
          }

          // finally, add this ingredient to the entry
          newEntry.addIngredient(newIngredient);
        }
        // Next add the adena amount, if any
        if (totalAdenaCount > 0)
          newEntry.addIngredient(L2Multisell.getInstance().new MultiSellIngredient(57, totalAdenaCount, false, false));

        // Now modify the enchantment level of products, if necessary
        for (MultiSellIngredient ing : templateEntry.getProducts())
        {
          // load the ingredient from the template
          MultiSellIngredient newIngredient = L2Multisell.getInstance().new MultiSellIngredient(ing);

          if (maintainEnchantment)
            {
              // if it is an armor/weapon, modify the enchantment level appropriately
              // (note, if maintain enchantment is "false" this modification will result to a +0)
              L2Item tempItem = ItemTable.getInstance().createDummyItem(newIngredient.getItemId()).getItem();
              if ((tempItem instanceof L2Armor) || (tempItem instanceof L2Weapon))
                newIngredient.setEnchantmentLevel(enchantLevel);
            }
          newEntry.addProduct(newIngredient);
        }
        return newEntry;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.