continue; // do not adena yet, as taxIngredient adena entries might occur next (order not guaranteed)
}
// if it is an armor/weapon, modify the enchantment level appropriately, if necessary
else if (maintainEnchantment)
{
L2Item tempItem = ItemTable.getInstance().createDummyItem(ing.getItemId()).getItem();
if ((tempItem instanceof L2Armor) || (tempItem instanceof L2Weapon))
newIngredient.setEnchantmentLevel(enchantLevel);
}
// finally, add this ingredient to the entry
newEntry.addIngredient(newIngredient);
}
// now add the adena, if any.
if (adenaAmount > 0 )
{
newEntry.addIngredient(L2Multisell.getInstance().new MultiSellIngredient(57,adenaAmount,0,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(ing.getItemId()).getItem();
if ((tempItem instanceof L2Armor) || (tempItem instanceof L2Weapon))
newIngredient.setEnchantmentLevel(enchantLevel);
}
newEntry.addProduct(newIngredient);
}