Enchantment level support for multisells.

This commit is contained in:
mobius
2015-01-31 22:49:02 +00:00
parent bf7b56f0ba
commit 1289171727
6 changed files with 18 additions and 12 deletions

View File

@@ -205,7 +205,7 @@ public class MultiSellChoose extends L2GameClientPacket
// if this is not a list that maintains enchantment, check the count of all items that have the given id.
// otherwise, check only the count of items with exactly the needed enchantment level
final long required = ((Config.ALT_BLACKSMITH_USE_RECIPES || !e.getMaintainIngredient()) ? (e.getItemCount() * _amount) : e.getItemCount());
if (inv.getInventoryItemCount(e.getItemId(), list.getMaintainEnchantment() ? e.getEnchantLevel() : -1, false) < required)
if (inv.getInventoryItemCount(e.getItemId(), (list.getMaintainEnchantment() || (e.getEnchantLevel() > 0)) ? e.getEnchantLevel() : -1, false) < required)
{
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_NEED_S2_S1_S);
sm.addItemName(e.getTemplate());
@@ -267,7 +267,7 @@ public class MultiSellChoose extends L2GameClientPacket
// b) list does not maintain enchantment: get the instances with the LOWEST enchantment level
// a) if enchantment is maintained, then get a list of items that exactly match this enchantment
if (list.getMaintainEnchantment())
if (list.getMaintainEnchantment() || (e.getEnchantLevel() > 0))
{
// loop through this list and remove (one by one) each item until the required amount is taken.
L2ItemInstance[] inventoryContents = inv.getAllItemsByItemId(e.getItemId(), e.getEnchantLevel(), false);
@@ -400,7 +400,7 @@ public class MultiSellChoose extends L2GameClientPacket
for (int i = 0; i < (e.getItemCount() * _amount); i++)
{
product = inv.addItem("Multisell", e.getItemId(), 1, player, player.getTarget());
if ((product != null) && list.getMaintainEnchantment())
if ((product != null) && (list.getMaintainEnchantment() || (e.getEnchantLevel() > 0)))
{
if (i < augmentation.size())
{

View File

@@ -110,7 +110,7 @@ public final class MultiSellList extends L2GameServerPacket
}
else
{
writeH(0x00); // enchant level
writeH(ing.getEnchantLevel()); // enchant level
writeD(ing.getChance()); // augment id
writeD(0x00); // mana
writeD(0x00); // time ?
@@ -146,7 +146,7 @@ public final class MultiSellList extends L2GameServerPacket
}
else
{
writeH(0x00); // enchant level
writeH(ing.getEnchantLevel()); // enchant level
writeD(ing.getChance()); // augment id
writeD(0x00); // mana
writeH(0x00); // attack element