Removed stream usage from MultiSellChoose clientpacket.
This commit is contained in:
parent
7c8a32d266
commit
231eb957d9
@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.OptionalLong;
|
|
||||||
|
|
||||||
import org.l2jmobius.commons.network.ReadablePacket;
|
import org.l2jmobius.commons.network.ReadablePacket;
|
||||||
import org.l2jmobius.gameserver.data.ItemTable;
|
import org.l2jmobius.gameserver.data.ItemTable;
|
||||||
@ -561,10 +560,17 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
// Finally, give the tax to the castle.
|
// Finally, give the tax to the castle.
|
||||||
if ((npc != null) && list.isApplyTaxes())
|
if ((npc != null) && list.isApplyTaxes())
|
||||||
{
|
{
|
||||||
final OptionalLong taxPaid = entry.getIngredients().stream().filter(i -> i.getId() == Inventory.ADENA_ID).mapToLong(i -> Math.round(i.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount).reduce(Math::multiplyExact);
|
long taxPaid = 0;
|
||||||
if (taxPaid.isPresent())
|
for (ItemChanceHolder ingredient : entry.getIngredients())
|
||||||
{
|
{
|
||||||
npc.handleTaxPayment(taxPaid.getAsLong());
|
if (ingredient.getId() == Inventory.ADENA_ID)
|
||||||
|
{
|
||||||
|
taxPaid += Math.round(ingredient.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (taxPaid > 0)
|
||||||
|
{
|
||||||
|
npc.handleTaxPayment(taxPaid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -397,11 +397,65 @@ public class ItemInfo
|
|||||||
return _soulCrystalOptions != null ? _soulCrystalOptions : Collections.emptyList();
|
return _soulCrystalOptions != null ? _soulCrystalOptions : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean soulCrystalOptionsMatch(EnsoulOption[] soulCrystalOptions)
|
||||||
|
{
|
||||||
|
if ((_soulCrystalOptions == null))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnsoulOption soulCrystalOption1 : _soulCrystalOptions)
|
||||||
|
{
|
||||||
|
boolean found = false;
|
||||||
|
SEARCH: for (EnsoulOption soulCrystalOption2 : soulCrystalOptions)
|
||||||
|
{
|
||||||
|
if (soulCrystalOption1.equals(soulCrystalOption2))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break SEARCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
||||||
{
|
{
|
||||||
return _soulCrystalSpecialOptions != null ? _soulCrystalSpecialOptions : Collections.emptyList();
|
return _soulCrystalSpecialOptions != null ? _soulCrystalSpecialOptions : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean soulCrystalSpecialOptionsMatch(EnsoulOption[] soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
if (_soulCrystalSpecialOptions == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnsoulOption soulCrystalSpecialOption1 : _soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
boolean found = false;
|
||||||
|
SEARCH: for (EnsoulOption soulCrystalSpecialOption2 : soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
if (soulCrystalSpecialOption1.equals(soulCrystalSpecialOption2))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break SEARCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public long getVisualExpiration()
|
public long getVisualExpiration()
|
||||||
{
|
{
|
||||||
return _visualExpiration;
|
return _visualExpiration;
|
||||||
|
@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.OptionalLong;
|
|
||||||
|
|
||||||
import org.l2jmobius.commons.network.ReadablePacket;
|
import org.l2jmobius.commons.network.ReadablePacket;
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
@ -206,9 +205,9 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
|| (itemEnchantment.getAttributeDefence(AttributeType.DARK) != _darkDefence)
|
|| (itemEnchantment.getAttributeDefence(AttributeType.DARK) != _darkDefence)
|
||||||
|| ((itemEnchantment.getAugmentation() == null) && ((_augmentOption1 != 0) || (_augmentOption2 != 0)))
|
|| ((itemEnchantment.getAugmentation() == null) && ((_augmentOption1 != 0) || (_augmentOption2 != 0)))
|
||||||
|| ((itemEnchantment.getAugmentation() != null) && ((itemEnchantment.getAugmentation().getOption1Id() != _augmentOption1) || (itemEnchantment.getAugmentation().getOption2Id() != _augmentOption2)))
|
|| ((itemEnchantment.getAugmentation() != null) && ((itemEnchantment.getAugmentation().getOption1Id() != _augmentOption1) || (itemEnchantment.getAugmentation().getOption2Id() != _augmentOption2)))
|
||||||
|| ((_soulCrystalOptions != null) && itemEnchantment.getSoulCrystalOptions().stream().anyMatch(e -> !CommonUtil.contains(_soulCrystalOptions, e)))
|
|| ((_soulCrystalOptions != null) && !itemEnchantment.soulCrystalOptionsMatch(_soulCrystalOptions))
|
||||||
|| ((_soulCrystalOptions == null) && !itemEnchantment.getSoulCrystalOptions().isEmpty())
|
|| ((_soulCrystalOptions == null) && !itemEnchantment.getSoulCrystalOptions().isEmpty())
|
||||||
|| ((_soulCrystalSpecialOptions != null) && itemEnchantment.getSoulCrystalSpecialOptions().stream().anyMatch(e -> !CommonUtil.contains(_soulCrystalSpecialOptions, e)))
|
|| ((_soulCrystalSpecialOptions != null) && !itemEnchantment.soulCrystalSpecialOptionsMatch(_soulCrystalSpecialOptions))
|
||||||
|| ((_soulCrystalSpecialOptions == null) && !itemEnchantment.getSoulCrystalSpecialOptions().isEmpty())
|
|| ((_soulCrystalSpecialOptions == null) && !itemEnchantment.getSoulCrystalSpecialOptions().isEmpty())
|
||||||
))
|
))
|
||||||
//@formatter:on
|
//@formatter:on
|
||||||
@ -605,10 +604,17 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
// Finally, give the tax to the castle.
|
// Finally, give the tax to the castle.
|
||||||
if ((npc != null) && list.isApplyTaxes())
|
if ((npc != null) && list.isApplyTaxes())
|
||||||
{
|
{
|
||||||
final OptionalLong taxPaid = entry.getIngredients().stream().filter(i -> i.getId() == Inventory.ADENA_ID).mapToLong(i -> Math.round(i.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount).reduce(Math::multiplyExact);
|
long taxPaid = 0;
|
||||||
if (taxPaid.isPresent())
|
for (ItemChanceHolder ingredient : entry.getIngredients())
|
||||||
{
|
{
|
||||||
npc.handleTaxPayment(taxPaid.getAsLong());
|
if (ingredient.getId() == Inventory.ADENA_ID)
|
||||||
|
{
|
||||||
|
taxPaid += Math.round(ingredient.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (taxPaid > 0)
|
||||||
|
{
|
||||||
|
npc.handleTaxPayment(taxPaid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -397,11 +397,65 @@ public class ItemInfo
|
|||||||
return _soulCrystalOptions != null ? _soulCrystalOptions : Collections.emptyList();
|
return _soulCrystalOptions != null ? _soulCrystalOptions : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean soulCrystalOptionsMatch(EnsoulOption[] soulCrystalOptions)
|
||||||
|
{
|
||||||
|
if ((_soulCrystalOptions == null))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnsoulOption soulCrystalOption1 : _soulCrystalOptions)
|
||||||
|
{
|
||||||
|
boolean found = false;
|
||||||
|
SEARCH: for (EnsoulOption soulCrystalOption2 : soulCrystalOptions)
|
||||||
|
{
|
||||||
|
if (soulCrystalOption1.equals(soulCrystalOption2))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break SEARCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
||||||
{
|
{
|
||||||
return _soulCrystalSpecialOptions != null ? _soulCrystalSpecialOptions : Collections.emptyList();
|
return _soulCrystalSpecialOptions != null ? _soulCrystalSpecialOptions : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean soulCrystalSpecialOptionsMatch(EnsoulOption[] soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
if (_soulCrystalSpecialOptions == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnsoulOption soulCrystalSpecialOption1 : _soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
boolean found = false;
|
||||||
|
SEARCH: for (EnsoulOption soulCrystalSpecialOption2 : soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
if (soulCrystalSpecialOption1.equals(soulCrystalSpecialOption2))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break SEARCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public long getVisualExpiration()
|
public long getVisualExpiration()
|
||||||
{
|
{
|
||||||
return _visualExpiration;
|
return _visualExpiration;
|
||||||
|
@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.OptionalLong;
|
|
||||||
|
|
||||||
import org.l2jmobius.commons.network.ReadablePacket;
|
import org.l2jmobius.commons.network.ReadablePacket;
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
@ -207,9 +206,9 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
|| (itemEnchantment.getAttributeDefence(AttributeType.DARK) != _darkDefence)
|
|| (itemEnchantment.getAttributeDefence(AttributeType.DARK) != _darkDefence)
|
||||||
|| ((itemEnchantment.getAugmentation() == null) && ((_augmentOption1 != 0) || (_augmentOption2 != 0)))
|
|| ((itemEnchantment.getAugmentation() == null) && ((_augmentOption1 != 0) || (_augmentOption2 != 0)))
|
||||||
|| ((itemEnchantment.getAugmentation() != null) && ((itemEnchantment.getAugmentation().getOption1Id() != _augmentOption1) || (itemEnchantment.getAugmentation().getOption2Id() != _augmentOption2)))
|
|| ((itemEnchantment.getAugmentation() != null) && ((itemEnchantment.getAugmentation().getOption1Id() != _augmentOption1) || (itemEnchantment.getAugmentation().getOption2Id() != _augmentOption2)))
|
||||||
|| ((_soulCrystalOptions != null) && itemEnchantment.getSoulCrystalOptions().stream().anyMatch(e -> !CommonUtil.contains(_soulCrystalOptions, e)))
|
|| ((_soulCrystalOptions != null) && !itemEnchantment.soulCrystalOptionsMatch(_soulCrystalOptions))
|
||||||
|| ((_soulCrystalOptions == null) && !itemEnchantment.getSoulCrystalOptions().isEmpty())
|
|| ((_soulCrystalOptions == null) && !itemEnchantment.getSoulCrystalOptions().isEmpty())
|
||||||
|| ((_soulCrystalSpecialOptions != null) && itemEnchantment.getSoulCrystalSpecialOptions().stream().anyMatch(e -> !CommonUtil.contains(_soulCrystalSpecialOptions, e)))
|
|| ((_soulCrystalSpecialOptions != null) && !itemEnchantment.soulCrystalSpecialOptionsMatch(_soulCrystalSpecialOptions))
|
||||||
|| ((_soulCrystalSpecialOptions == null) && !itemEnchantment.getSoulCrystalSpecialOptions().isEmpty())
|
|| ((_soulCrystalSpecialOptions == null) && !itemEnchantment.getSoulCrystalSpecialOptions().isEmpty())
|
||||||
))
|
))
|
||||||
//@formatter:on
|
//@formatter:on
|
||||||
@ -607,10 +606,17 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
// Finally, give the tax to the castle.
|
// Finally, give the tax to the castle.
|
||||||
if ((npc != null) && list.isApplyTaxes())
|
if ((npc != null) && list.isApplyTaxes())
|
||||||
{
|
{
|
||||||
final OptionalLong taxPaid = entry.getIngredients().stream().filter(i -> i.getId() == Inventory.ADENA_ID).mapToLong(i -> Math.round(i.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount).reduce(Math::multiplyExact);
|
long taxPaid = 0;
|
||||||
if (taxPaid.isPresent())
|
for (ItemChanceHolder ingredient : entry.getIngredients())
|
||||||
{
|
{
|
||||||
npc.handleTaxPayment(taxPaid.getAsLong());
|
if (ingredient.getId() == Inventory.ADENA_ID)
|
||||||
|
{
|
||||||
|
taxPaid += Math.round(ingredient.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (taxPaid > 0)
|
||||||
|
{
|
||||||
|
npc.handleTaxPayment(taxPaid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -397,11 +397,65 @@ public class ItemInfo
|
|||||||
return _soulCrystalOptions != null ? _soulCrystalOptions : Collections.emptyList();
|
return _soulCrystalOptions != null ? _soulCrystalOptions : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean soulCrystalOptionsMatch(EnsoulOption[] soulCrystalOptions)
|
||||||
|
{
|
||||||
|
if ((_soulCrystalOptions == null))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnsoulOption soulCrystalOption1 : _soulCrystalOptions)
|
||||||
|
{
|
||||||
|
boolean found = false;
|
||||||
|
SEARCH: for (EnsoulOption soulCrystalOption2 : soulCrystalOptions)
|
||||||
|
{
|
||||||
|
if (soulCrystalOption1.equals(soulCrystalOption2))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break SEARCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
||||||
{
|
{
|
||||||
return _soulCrystalSpecialOptions != null ? _soulCrystalSpecialOptions : Collections.emptyList();
|
return _soulCrystalSpecialOptions != null ? _soulCrystalSpecialOptions : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean soulCrystalSpecialOptionsMatch(EnsoulOption[] soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
if (_soulCrystalSpecialOptions == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnsoulOption soulCrystalSpecialOption1 : _soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
boolean found = false;
|
||||||
|
SEARCH: for (EnsoulOption soulCrystalSpecialOption2 : soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
if (soulCrystalSpecialOption1.equals(soulCrystalSpecialOption2))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break SEARCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public long getVisualExpiration()
|
public long getVisualExpiration()
|
||||||
{
|
{
|
||||||
return _visualExpiration;
|
return _visualExpiration;
|
||||||
|
@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.OptionalLong;
|
|
||||||
|
|
||||||
import org.l2jmobius.commons.network.ReadablePacket;
|
import org.l2jmobius.commons.network.ReadablePacket;
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
@ -207,9 +206,9 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
|| (itemEnchantment.getAttributeDefence(AttributeType.DARK) != _darkDefence)
|
|| (itemEnchantment.getAttributeDefence(AttributeType.DARK) != _darkDefence)
|
||||||
|| ((itemEnchantment.getAugmentation() == null) && ((_augmentOption1 != 0) || (_augmentOption2 != 0)))
|
|| ((itemEnchantment.getAugmentation() == null) && ((_augmentOption1 != 0) || (_augmentOption2 != 0)))
|
||||||
|| ((itemEnchantment.getAugmentation() != null) && ((itemEnchantment.getAugmentation().getOption1Id() != _augmentOption1) || (itemEnchantment.getAugmentation().getOption2Id() != _augmentOption2)))
|
|| ((itemEnchantment.getAugmentation() != null) && ((itemEnchantment.getAugmentation().getOption1Id() != _augmentOption1) || (itemEnchantment.getAugmentation().getOption2Id() != _augmentOption2)))
|
||||||
|| ((_soulCrystalOptions != null) && itemEnchantment.getSoulCrystalOptions().stream().anyMatch(e -> !CommonUtil.contains(_soulCrystalOptions, e)))
|
|| ((_soulCrystalOptions != null) && !itemEnchantment.soulCrystalOptionsMatch(_soulCrystalOptions))
|
||||||
|| ((_soulCrystalOptions == null) && !itemEnchantment.getSoulCrystalOptions().isEmpty())
|
|| ((_soulCrystalOptions == null) && !itemEnchantment.getSoulCrystalOptions().isEmpty())
|
||||||
|| ((_soulCrystalSpecialOptions != null) && itemEnchantment.getSoulCrystalSpecialOptions().stream().anyMatch(e -> !CommonUtil.contains(_soulCrystalSpecialOptions, e)))
|
|| ((_soulCrystalSpecialOptions != null) && !itemEnchantment.soulCrystalSpecialOptionsMatch(_soulCrystalSpecialOptions))
|
||||||
|| ((_soulCrystalSpecialOptions == null) && !itemEnchantment.getSoulCrystalSpecialOptions().isEmpty())
|
|| ((_soulCrystalSpecialOptions == null) && !itemEnchantment.getSoulCrystalSpecialOptions().isEmpty())
|
||||||
))
|
))
|
||||||
//@formatter:on
|
//@formatter:on
|
||||||
@ -607,10 +606,17 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
// Finally, give the tax to the castle.
|
// Finally, give the tax to the castle.
|
||||||
if ((npc != null) && list.isApplyTaxes())
|
if ((npc != null) && list.isApplyTaxes())
|
||||||
{
|
{
|
||||||
final OptionalLong taxPaid = entry.getIngredients().stream().filter(i -> i.getId() == Inventory.ADENA_ID).mapToLong(i -> Math.round(i.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount).reduce(Math::multiplyExact);
|
long taxPaid = 0;
|
||||||
if (taxPaid.isPresent())
|
for (ItemChanceHolder ingredient : entry.getIngredients())
|
||||||
{
|
{
|
||||||
npc.handleTaxPayment(taxPaid.getAsLong());
|
if (ingredient.getId() == Inventory.ADENA_ID)
|
||||||
|
{
|
||||||
|
taxPaid += Math.round(ingredient.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (taxPaid > 0)
|
||||||
|
{
|
||||||
|
npc.handleTaxPayment(taxPaid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -397,11 +397,65 @@ public class ItemInfo
|
|||||||
return _soulCrystalOptions != null ? _soulCrystalOptions : Collections.emptyList();
|
return _soulCrystalOptions != null ? _soulCrystalOptions : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean soulCrystalOptionsMatch(EnsoulOption[] soulCrystalOptions)
|
||||||
|
{
|
||||||
|
if ((_soulCrystalOptions == null))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnsoulOption soulCrystalOption1 : _soulCrystalOptions)
|
||||||
|
{
|
||||||
|
boolean found = false;
|
||||||
|
SEARCH: for (EnsoulOption soulCrystalOption2 : soulCrystalOptions)
|
||||||
|
{
|
||||||
|
if (soulCrystalOption1.equals(soulCrystalOption2))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break SEARCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
||||||
{
|
{
|
||||||
return _soulCrystalSpecialOptions != null ? _soulCrystalSpecialOptions : Collections.emptyList();
|
return _soulCrystalSpecialOptions != null ? _soulCrystalSpecialOptions : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean soulCrystalSpecialOptionsMatch(EnsoulOption[] soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
if (_soulCrystalSpecialOptions == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnsoulOption soulCrystalSpecialOption1 : _soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
boolean found = false;
|
||||||
|
SEARCH: for (EnsoulOption soulCrystalSpecialOption2 : soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
if (soulCrystalSpecialOption1.equals(soulCrystalSpecialOption2))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break SEARCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public long getVisualExpiration()
|
public long getVisualExpiration()
|
||||||
{
|
{
|
||||||
return _visualExpiration;
|
return _visualExpiration;
|
||||||
|
@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.OptionalLong;
|
|
||||||
|
|
||||||
import org.l2jmobius.commons.network.ReadablePacket;
|
import org.l2jmobius.commons.network.ReadablePacket;
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
@ -207,9 +206,9 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
|| (itemEnchantment.getAttributeDefence(AttributeType.DARK) != _darkDefence)
|
|| (itemEnchantment.getAttributeDefence(AttributeType.DARK) != _darkDefence)
|
||||||
|| ((itemEnchantment.getAugmentation() == null) && ((_augmentOption1 != 0) || (_augmentOption2 != 0)))
|
|| ((itemEnchantment.getAugmentation() == null) && ((_augmentOption1 != 0) || (_augmentOption2 != 0)))
|
||||||
|| ((itemEnchantment.getAugmentation() != null) && ((itemEnchantment.getAugmentation().getOption1Id() != _augmentOption1) || (itemEnchantment.getAugmentation().getOption2Id() != _augmentOption2)))
|
|| ((itemEnchantment.getAugmentation() != null) && ((itemEnchantment.getAugmentation().getOption1Id() != _augmentOption1) || (itemEnchantment.getAugmentation().getOption2Id() != _augmentOption2)))
|
||||||
|| ((_soulCrystalOptions != null) && itemEnchantment.getSoulCrystalOptions().stream().anyMatch(e -> !CommonUtil.contains(_soulCrystalOptions, e)))
|
|| ((_soulCrystalOptions != null) && !itemEnchantment.soulCrystalOptionsMatch(_soulCrystalOptions))
|
||||||
|| ((_soulCrystalOptions == null) && !itemEnchantment.getSoulCrystalOptions().isEmpty())
|
|| ((_soulCrystalOptions == null) && !itemEnchantment.getSoulCrystalOptions().isEmpty())
|
||||||
|| ((_soulCrystalSpecialOptions != null) && itemEnchantment.getSoulCrystalSpecialOptions().stream().anyMatch(e -> !CommonUtil.contains(_soulCrystalSpecialOptions, e)))
|
|| ((_soulCrystalSpecialOptions != null) && !itemEnchantment.soulCrystalSpecialOptionsMatch(_soulCrystalSpecialOptions))
|
||||||
|| ((_soulCrystalSpecialOptions == null) && !itemEnchantment.getSoulCrystalSpecialOptions().isEmpty())
|
|| ((_soulCrystalSpecialOptions == null) && !itemEnchantment.getSoulCrystalSpecialOptions().isEmpty())
|
||||||
))
|
))
|
||||||
//@formatter:on
|
//@formatter:on
|
||||||
@ -607,10 +606,17 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
// Finally, give the tax to the castle.
|
// Finally, give the tax to the castle.
|
||||||
if ((npc != null) && list.isApplyTaxes())
|
if ((npc != null) && list.isApplyTaxes())
|
||||||
{
|
{
|
||||||
final OptionalLong taxPaid = entry.getIngredients().stream().filter(i -> i.getId() == Inventory.ADENA_ID).mapToLong(i -> Math.round(i.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount).reduce(Math::multiplyExact);
|
long taxPaid = 0;
|
||||||
if (taxPaid.isPresent())
|
for (ItemChanceHolder ingredient : entry.getIngredients())
|
||||||
{
|
{
|
||||||
npc.handleTaxPayment(taxPaid.getAsLong());
|
if (ingredient.getId() == Inventory.ADENA_ID)
|
||||||
|
{
|
||||||
|
taxPaid += Math.round(ingredient.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (taxPaid > 0)
|
||||||
|
{
|
||||||
|
npc.handleTaxPayment(taxPaid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -397,11 +397,65 @@ public class ItemInfo
|
|||||||
return _soulCrystalOptions != null ? _soulCrystalOptions : Collections.emptyList();
|
return _soulCrystalOptions != null ? _soulCrystalOptions : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean soulCrystalOptionsMatch(EnsoulOption[] soulCrystalOptions)
|
||||||
|
{
|
||||||
|
if ((_soulCrystalOptions == null))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnsoulOption soulCrystalOption1 : _soulCrystalOptions)
|
||||||
|
{
|
||||||
|
boolean found = false;
|
||||||
|
SEARCH: for (EnsoulOption soulCrystalOption2 : soulCrystalOptions)
|
||||||
|
{
|
||||||
|
if (soulCrystalOption1.equals(soulCrystalOption2))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break SEARCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
||||||
{
|
{
|
||||||
return _soulCrystalSpecialOptions != null ? _soulCrystalSpecialOptions : Collections.emptyList();
|
return _soulCrystalSpecialOptions != null ? _soulCrystalSpecialOptions : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean soulCrystalSpecialOptionsMatch(EnsoulOption[] soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
if (_soulCrystalSpecialOptions == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnsoulOption soulCrystalSpecialOption1 : _soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
boolean found = false;
|
||||||
|
SEARCH: for (EnsoulOption soulCrystalSpecialOption2 : soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
if (soulCrystalSpecialOption1.equals(soulCrystalSpecialOption2))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break SEARCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public long getVisualExpiration()
|
public long getVisualExpiration()
|
||||||
{
|
{
|
||||||
return _visualExpiration;
|
return _visualExpiration;
|
||||||
|
@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.OptionalLong;
|
|
||||||
|
|
||||||
import org.l2jmobius.commons.network.ReadablePacket;
|
import org.l2jmobius.commons.network.ReadablePacket;
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
@ -207,9 +206,9 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
|| (itemEnchantment.getAttributeDefence(AttributeType.DARK) != _darkDefence)
|
|| (itemEnchantment.getAttributeDefence(AttributeType.DARK) != _darkDefence)
|
||||||
|| ((itemEnchantment.getAugmentation() == null) && ((_augmentOption1 != 0) || (_augmentOption2 != 0)))
|
|| ((itemEnchantment.getAugmentation() == null) && ((_augmentOption1 != 0) || (_augmentOption2 != 0)))
|
||||||
|| ((itemEnchantment.getAugmentation() != null) && ((itemEnchantment.getAugmentation().getOption1Id() != _augmentOption1) || (itemEnchantment.getAugmentation().getOption2Id() != _augmentOption2)))
|
|| ((itemEnchantment.getAugmentation() != null) && ((itemEnchantment.getAugmentation().getOption1Id() != _augmentOption1) || (itemEnchantment.getAugmentation().getOption2Id() != _augmentOption2)))
|
||||||
|| ((_soulCrystalOptions != null) && itemEnchantment.getSoulCrystalOptions().stream().anyMatch(e -> !CommonUtil.contains(_soulCrystalOptions, e)))
|
|| ((_soulCrystalOptions != null) && !itemEnchantment.soulCrystalOptionsMatch(_soulCrystalOptions))
|
||||||
|| ((_soulCrystalOptions == null) && !itemEnchantment.getSoulCrystalOptions().isEmpty())
|
|| ((_soulCrystalOptions == null) && !itemEnchantment.getSoulCrystalOptions().isEmpty())
|
||||||
|| ((_soulCrystalSpecialOptions != null) && itemEnchantment.getSoulCrystalSpecialOptions().stream().anyMatch(e -> !CommonUtil.contains(_soulCrystalSpecialOptions, e)))
|
|| ((_soulCrystalSpecialOptions != null) && !itemEnchantment.soulCrystalSpecialOptionsMatch(_soulCrystalSpecialOptions))
|
||||||
|| ((_soulCrystalSpecialOptions == null) && !itemEnchantment.getSoulCrystalSpecialOptions().isEmpty())
|
|| ((_soulCrystalSpecialOptions == null) && !itemEnchantment.getSoulCrystalSpecialOptions().isEmpty())
|
||||||
))
|
))
|
||||||
//@formatter:on
|
//@formatter:on
|
||||||
@ -607,10 +606,17 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
// Finally, give the tax to the castle.
|
// Finally, give the tax to the castle.
|
||||||
if ((npc != null) && list.isApplyTaxes())
|
if ((npc != null) && list.isApplyTaxes())
|
||||||
{
|
{
|
||||||
final OptionalLong taxPaid = entry.getIngredients().stream().filter(i -> i.getId() == Inventory.ADENA_ID).mapToLong(i -> Math.round(i.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount).reduce(Math::multiplyExact);
|
long taxPaid = 0;
|
||||||
if (taxPaid.isPresent())
|
for (ItemChanceHolder ingredient : entry.getIngredients())
|
||||||
{
|
{
|
||||||
npc.handleTaxPayment(taxPaid.getAsLong());
|
if (ingredient.getId() == Inventory.ADENA_ID)
|
||||||
|
{
|
||||||
|
taxPaid += Math.round(ingredient.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (taxPaid > 0)
|
||||||
|
{
|
||||||
|
npc.handleTaxPayment(taxPaid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -397,11 +397,65 @@ public class ItemInfo
|
|||||||
return _soulCrystalOptions != null ? _soulCrystalOptions : Collections.emptyList();
|
return _soulCrystalOptions != null ? _soulCrystalOptions : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean soulCrystalOptionsMatch(EnsoulOption[] soulCrystalOptions)
|
||||||
|
{
|
||||||
|
if ((_soulCrystalOptions == null))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnsoulOption soulCrystalOption1 : _soulCrystalOptions)
|
||||||
|
{
|
||||||
|
boolean found = false;
|
||||||
|
SEARCH: for (EnsoulOption soulCrystalOption2 : soulCrystalOptions)
|
||||||
|
{
|
||||||
|
if (soulCrystalOption1.equals(soulCrystalOption2))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break SEARCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
||||||
{
|
{
|
||||||
return _soulCrystalSpecialOptions != null ? _soulCrystalSpecialOptions : Collections.emptyList();
|
return _soulCrystalSpecialOptions != null ? _soulCrystalSpecialOptions : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean soulCrystalSpecialOptionsMatch(EnsoulOption[] soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
if (_soulCrystalSpecialOptions == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnsoulOption soulCrystalSpecialOption1 : _soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
boolean found = false;
|
||||||
|
SEARCH: for (EnsoulOption soulCrystalSpecialOption2 : soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
if (soulCrystalSpecialOption1.equals(soulCrystalSpecialOption2))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break SEARCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public long getVisualExpiration()
|
public long getVisualExpiration()
|
||||||
{
|
{
|
||||||
return _visualExpiration;
|
return _visualExpiration;
|
||||||
|
@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.OptionalLong;
|
|
||||||
|
|
||||||
import org.l2jmobius.commons.network.ReadablePacket;
|
import org.l2jmobius.commons.network.ReadablePacket;
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
@ -207,9 +206,9 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
|| (itemEnchantment.getAttributeDefence(AttributeType.DARK) != _darkDefence)
|
|| (itemEnchantment.getAttributeDefence(AttributeType.DARK) != _darkDefence)
|
||||||
|| ((itemEnchantment.getAugmentation() == null) && ((_augmentOption1 != 0) || (_augmentOption2 != 0)))
|
|| ((itemEnchantment.getAugmentation() == null) && ((_augmentOption1 != 0) || (_augmentOption2 != 0)))
|
||||||
|| ((itemEnchantment.getAugmentation() != null) && ((itemEnchantment.getAugmentation().getOption1Id() != _augmentOption1) || (itemEnchantment.getAugmentation().getOption2Id() != _augmentOption2)))
|
|| ((itemEnchantment.getAugmentation() != null) && ((itemEnchantment.getAugmentation().getOption1Id() != _augmentOption1) || (itemEnchantment.getAugmentation().getOption2Id() != _augmentOption2)))
|
||||||
|| ((_soulCrystalOptions != null) && itemEnchantment.getSoulCrystalOptions().stream().anyMatch(e -> !CommonUtil.contains(_soulCrystalOptions, e)))
|
|| ((_soulCrystalOptions != null) && !itemEnchantment.soulCrystalOptionsMatch(_soulCrystalOptions))
|
||||||
|| ((_soulCrystalOptions == null) && !itemEnchantment.getSoulCrystalOptions().isEmpty())
|
|| ((_soulCrystalOptions == null) && !itemEnchantment.getSoulCrystalOptions().isEmpty())
|
||||||
|| ((_soulCrystalSpecialOptions != null) && itemEnchantment.getSoulCrystalSpecialOptions().stream().anyMatch(e -> !CommonUtil.contains(_soulCrystalSpecialOptions, e)))
|
|| ((_soulCrystalSpecialOptions != null) && !itemEnchantment.soulCrystalSpecialOptionsMatch(_soulCrystalSpecialOptions))
|
||||||
|| ((_soulCrystalSpecialOptions == null) && !itemEnchantment.getSoulCrystalSpecialOptions().isEmpty())
|
|| ((_soulCrystalSpecialOptions == null) && !itemEnchantment.getSoulCrystalSpecialOptions().isEmpty())
|
||||||
))
|
))
|
||||||
//@formatter:on
|
//@formatter:on
|
||||||
@ -607,10 +606,17 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
// Finally, give the tax to the castle.
|
// Finally, give the tax to the castle.
|
||||||
if ((npc != null) && list.isApplyTaxes())
|
if ((npc != null) && list.isApplyTaxes())
|
||||||
{
|
{
|
||||||
final OptionalLong taxPaid = entry.getIngredients().stream().filter(i -> i.getId() == Inventory.ADENA_ID).mapToLong(i -> Math.round(i.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount).reduce(Math::multiplyExact);
|
long taxPaid = 0;
|
||||||
if (taxPaid.isPresent())
|
for (ItemChanceHolder ingredient : entry.getIngredients())
|
||||||
{
|
{
|
||||||
npc.handleTaxPayment(taxPaid.getAsLong());
|
if (ingredient.getId() == Inventory.ADENA_ID)
|
||||||
|
{
|
||||||
|
taxPaid += Math.round(ingredient.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (taxPaid > 0)
|
||||||
|
{
|
||||||
|
npc.handleTaxPayment(taxPaid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -397,11 +397,65 @@ public class ItemInfo
|
|||||||
return _soulCrystalOptions != null ? _soulCrystalOptions : Collections.emptyList();
|
return _soulCrystalOptions != null ? _soulCrystalOptions : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean soulCrystalOptionsMatch(EnsoulOption[] soulCrystalOptions)
|
||||||
|
{
|
||||||
|
if ((_soulCrystalOptions == null))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnsoulOption soulCrystalOption1 : _soulCrystalOptions)
|
||||||
|
{
|
||||||
|
boolean found = false;
|
||||||
|
SEARCH: for (EnsoulOption soulCrystalOption2 : soulCrystalOptions)
|
||||||
|
{
|
||||||
|
if (soulCrystalOption1.equals(soulCrystalOption2))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break SEARCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
||||||
{
|
{
|
||||||
return _soulCrystalSpecialOptions != null ? _soulCrystalSpecialOptions : Collections.emptyList();
|
return _soulCrystalSpecialOptions != null ? _soulCrystalSpecialOptions : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean soulCrystalSpecialOptionsMatch(EnsoulOption[] soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
if (_soulCrystalSpecialOptions == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnsoulOption soulCrystalSpecialOption1 : _soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
boolean found = false;
|
||||||
|
SEARCH: for (EnsoulOption soulCrystalSpecialOption2 : soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
if (soulCrystalSpecialOption1.equals(soulCrystalSpecialOption2))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break SEARCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public long getVisualExpiration()
|
public long getVisualExpiration()
|
||||||
{
|
{
|
||||||
return _visualExpiration;
|
return _visualExpiration;
|
||||||
|
@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.OptionalLong;
|
|
||||||
|
|
||||||
import org.l2jmobius.commons.network.ReadablePacket;
|
import org.l2jmobius.commons.network.ReadablePacket;
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
@ -207,9 +206,9 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
|| (itemEnchantment.getAttributeDefence(AttributeType.DARK) != _darkDefence)
|
|| (itemEnchantment.getAttributeDefence(AttributeType.DARK) != _darkDefence)
|
||||||
|| ((itemEnchantment.getAugmentation() == null) && ((_augmentOption1 != 0) || (_augmentOption2 != 0)))
|
|| ((itemEnchantment.getAugmentation() == null) && ((_augmentOption1 != 0) || (_augmentOption2 != 0)))
|
||||||
|| ((itemEnchantment.getAugmentation() != null) && ((itemEnchantment.getAugmentation().getOption1Id() != _augmentOption1) || (itemEnchantment.getAugmentation().getOption2Id() != _augmentOption2)))
|
|| ((itemEnchantment.getAugmentation() != null) && ((itemEnchantment.getAugmentation().getOption1Id() != _augmentOption1) || (itemEnchantment.getAugmentation().getOption2Id() != _augmentOption2)))
|
||||||
|| ((_soulCrystalOptions != null) && itemEnchantment.getSoulCrystalOptions().stream().anyMatch(e -> !CommonUtil.contains(_soulCrystalOptions, e)))
|
|| ((_soulCrystalOptions != null) && !itemEnchantment.soulCrystalOptionsMatch(_soulCrystalOptions))
|
||||||
|| ((_soulCrystalOptions == null) && !itemEnchantment.getSoulCrystalOptions().isEmpty())
|
|| ((_soulCrystalOptions == null) && !itemEnchantment.getSoulCrystalOptions().isEmpty())
|
||||||
|| ((_soulCrystalSpecialOptions != null) && itemEnchantment.getSoulCrystalSpecialOptions().stream().anyMatch(e -> !CommonUtil.contains(_soulCrystalSpecialOptions, e)))
|
|| ((_soulCrystalSpecialOptions != null) && !itemEnchantment.soulCrystalSpecialOptionsMatch(_soulCrystalSpecialOptions))
|
||||||
|| ((_soulCrystalSpecialOptions == null) && !itemEnchantment.getSoulCrystalSpecialOptions().isEmpty())
|
|| ((_soulCrystalSpecialOptions == null) && !itemEnchantment.getSoulCrystalSpecialOptions().isEmpty())
|
||||||
))
|
))
|
||||||
//@formatter:on
|
//@formatter:on
|
||||||
@ -607,10 +606,17 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
// Finally, give the tax to the castle.
|
// Finally, give the tax to the castle.
|
||||||
if ((npc != null) && list.isApplyTaxes())
|
if ((npc != null) && list.isApplyTaxes())
|
||||||
{
|
{
|
||||||
final OptionalLong taxPaid = entry.getIngredients().stream().filter(i -> i.getId() == Inventory.ADENA_ID).mapToLong(i -> Math.round(i.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount).reduce(Math::multiplyExact);
|
long taxPaid = 0;
|
||||||
if (taxPaid.isPresent())
|
for (ItemChanceHolder ingredient : entry.getIngredients())
|
||||||
{
|
{
|
||||||
npc.handleTaxPayment(taxPaid.getAsLong());
|
if (ingredient.getId() == Inventory.ADENA_ID)
|
||||||
|
{
|
||||||
|
taxPaid += Math.round(ingredient.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (taxPaid > 0)
|
||||||
|
{
|
||||||
|
npc.handleTaxPayment(taxPaid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -397,11 +397,65 @@ public class ItemInfo
|
|||||||
return _soulCrystalOptions != null ? _soulCrystalOptions : Collections.emptyList();
|
return _soulCrystalOptions != null ? _soulCrystalOptions : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean soulCrystalOptionsMatch(EnsoulOption[] soulCrystalOptions)
|
||||||
|
{
|
||||||
|
if ((_soulCrystalOptions == null))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnsoulOption soulCrystalOption1 : _soulCrystalOptions)
|
||||||
|
{
|
||||||
|
boolean found = false;
|
||||||
|
SEARCH: for (EnsoulOption soulCrystalOption2 : soulCrystalOptions)
|
||||||
|
{
|
||||||
|
if (soulCrystalOption1.equals(soulCrystalOption2))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break SEARCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
||||||
{
|
{
|
||||||
return _soulCrystalSpecialOptions != null ? _soulCrystalSpecialOptions : Collections.emptyList();
|
return _soulCrystalSpecialOptions != null ? _soulCrystalSpecialOptions : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean soulCrystalSpecialOptionsMatch(EnsoulOption[] soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
if (_soulCrystalSpecialOptions == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnsoulOption soulCrystalSpecialOption1 : _soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
boolean found = false;
|
||||||
|
SEARCH: for (EnsoulOption soulCrystalSpecialOption2 : soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
if (soulCrystalSpecialOption1.equals(soulCrystalSpecialOption2))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break SEARCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public long getVisualExpiration()
|
public long getVisualExpiration()
|
||||||
{
|
{
|
||||||
return _visualExpiration;
|
return _visualExpiration;
|
||||||
|
@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.OptionalLong;
|
|
||||||
|
|
||||||
import org.l2jmobius.commons.network.ReadablePacket;
|
import org.l2jmobius.commons.network.ReadablePacket;
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
@ -207,9 +206,9 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
|| (itemEnchantment.getAttributeDefence(AttributeType.DARK) != _darkDefence)
|
|| (itemEnchantment.getAttributeDefence(AttributeType.DARK) != _darkDefence)
|
||||||
|| ((itemEnchantment.getAugmentation() == null) && ((_augmentOption1 != 0) || (_augmentOption2 != 0)))
|
|| ((itemEnchantment.getAugmentation() == null) && ((_augmentOption1 != 0) || (_augmentOption2 != 0)))
|
||||||
|| ((itemEnchantment.getAugmentation() != null) && ((itemEnchantment.getAugmentation().getOption1Id() != _augmentOption1) || (itemEnchantment.getAugmentation().getOption2Id() != _augmentOption2)))
|
|| ((itemEnchantment.getAugmentation() != null) && ((itemEnchantment.getAugmentation().getOption1Id() != _augmentOption1) || (itemEnchantment.getAugmentation().getOption2Id() != _augmentOption2)))
|
||||||
|| ((_soulCrystalOptions != null) && itemEnchantment.getSoulCrystalOptions().stream().anyMatch(e -> !CommonUtil.contains(_soulCrystalOptions, e)))
|
|| ((_soulCrystalOptions != null) && !itemEnchantment.soulCrystalOptionsMatch(_soulCrystalOptions))
|
||||||
|| ((_soulCrystalOptions == null) && !itemEnchantment.getSoulCrystalOptions().isEmpty())
|
|| ((_soulCrystalOptions == null) && !itemEnchantment.getSoulCrystalOptions().isEmpty())
|
||||||
|| ((_soulCrystalSpecialOptions != null) && itemEnchantment.getSoulCrystalSpecialOptions().stream().anyMatch(e -> !CommonUtil.contains(_soulCrystalSpecialOptions, e)))
|
|| ((_soulCrystalSpecialOptions != null) && !itemEnchantment.soulCrystalSpecialOptionsMatch(_soulCrystalSpecialOptions))
|
||||||
|| ((_soulCrystalSpecialOptions == null) && !itemEnchantment.getSoulCrystalSpecialOptions().isEmpty())
|
|| ((_soulCrystalSpecialOptions == null) && !itemEnchantment.getSoulCrystalSpecialOptions().isEmpty())
|
||||||
))
|
))
|
||||||
//@formatter:on
|
//@formatter:on
|
||||||
@ -607,10 +606,17 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
// Finally, give the tax to the castle.
|
// Finally, give the tax to the castle.
|
||||||
if ((npc != null) && list.isApplyTaxes())
|
if ((npc != null) && list.isApplyTaxes())
|
||||||
{
|
{
|
||||||
final OptionalLong taxPaid = entry.getIngredients().stream().filter(i -> i.getId() == Inventory.ADENA_ID).mapToLong(i -> Math.round(i.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount).reduce(Math::multiplyExact);
|
long taxPaid = 0;
|
||||||
if (taxPaid.isPresent())
|
for (ItemChanceHolder ingredient : entry.getIngredients())
|
||||||
{
|
{
|
||||||
npc.handleTaxPayment(taxPaid.getAsLong());
|
if (ingredient.getId() == Inventory.ADENA_ID)
|
||||||
|
{
|
||||||
|
taxPaid += Math.round(ingredient.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (taxPaid > 0)
|
||||||
|
{
|
||||||
|
npc.handleTaxPayment(taxPaid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -397,11 +397,65 @@ public class ItemInfo
|
|||||||
return _soulCrystalOptions != null ? _soulCrystalOptions : Collections.emptyList();
|
return _soulCrystalOptions != null ? _soulCrystalOptions : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean soulCrystalOptionsMatch(EnsoulOption[] soulCrystalOptions)
|
||||||
|
{
|
||||||
|
if ((_soulCrystalOptions == null))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnsoulOption soulCrystalOption1 : _soulCrystalOptions)
|
||||||
|
{
|
||||||
|
boolean found = false;
|
||||||
|
SEARCH: for (EnsoulOption soulCrystalOption2 : soulCrystalOptions)
|
||||||
|
{
|
||||||
|
if (soulCrystalOption1.equals(soulCrystalOption2))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break SEARCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
||||||
{
|
{
|
||||||
return _soulCrystalSpecialOptions != null ? _soulCrystalSpecialOptions : Collections.emptyList();
|
return _soulCrystalSpecialOptions != null ? _soulCrystalSpecialOptions : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean soulCrystalSpecialOptionsMatch(EnsoulOption[] soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
if (_soulCrystalSpecialOptions == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnsoulOption soulCrystalSpecialOption1 : _soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
boolean found = false;
|
||||||
|
SEARCH: for (EnsoulOption soulCrystalSpecialOption2 : soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
if (soulCrystalSpecialOption1.equals(soulCrystalSpecialOption2))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break SEARCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public long getVisualExpiration()
|
public long getVisualExpiration()
|
||||||
{
|
{
|
||||||
return _visualExpiration;
|
return _visualExpiration;
|
||||||
|
@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.OptionalLong;
|
|
||||||
|
|
||||||
import org.l2jmobius.commons.network.ReadablePacket;
|
import org.l2jmobius.commons.network.ReadablePacket;
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
@ -207,9 +206,9 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
|| (itemEnchantment.getAttributeDefence(AttributeType.DARK) != _darkDefence)
|
|| (itemEnchantment.getAttributeDefence(AttributeType.DARK) != _darkDefence)
|
||||||
|| ((itemEnchantment.getAugmentation() == null) && ((_augmentOption1 != 0) || (_augmentOption2 != 0)))
|
|| ((itemEnchantment.getAugmentation() == null) && ((_augmentOption1 != 0) || (_augmentOption2 != 0)))
|
||||||
|| ((itemEnchantment.getAugmentation() != null) && ((itemEnchantment.getAugmentation().getOption1Id() != _augmentOption1) || (itemEnchantment.getAugmentation().getOption2Id() != _augmentOption2)))
|
|| ((itemEnchantment.getAugmentation() != null) && ((itemEnchantment.getAugmentation().getOption1Id() != _augmentOption1) || (itemEnchantment.getAugmentation().getOption2Id() != _augmentOption2)))
|
||||||
|| ((_soulCrystalOptions != null) && itemEnchantment.getSoulCrystalOptions().stream().anyMatch(e -> !CommonUtil.contains(_soulCrystalOptions, e)))
|
|| ((_soulCrystalOptions != null) && !itemEnchantment.soulCrystalOptionsMatch(_soulCrystalOptions))
|
||||||
|| ((_soulCrystalOptions == null) && !itemEnchantment.getSoulCrystalOptions().isEmpty())
|
|| ((_soulCrystalOptions == null) && !itemEnchantment.getSoulCrystalOptions().isEmpty())
|
||||||
|| ((_soulCrystalSpecialOptions != null) && itemEnchantment.getSoulCrystalSpecialOptions().stream().anyMatch(e -> !CommonUtil.contains(_soulCrystalSpecialOptions, e)))
|
|| ((_soulCrystalSpecialOptions != null) && !itemEnchantment.soulCrystalSpecialOptionsMatch(_soulCrystalSpecialOptions))
|
||||||
|| ((_soulCrystalSpecialOptions == null) && !itemEnchantment.getSoulCrystalSpecialOptions().isEmpty())
|
|| ((_soulCrystalSpecialOptions == null) && !itemEnchantment.getSoulCrystalSpecialOptions().isEmpty())
|
||||||
))
|
))
|
||||||
//@formatter:on
|
//@formatter:on
|
||||||
@ -616,10 +615,17 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
// Finally, give the tax to the castle.
|
// Finally, give the tax to the castle.
|
||||||
if ((npc != null) && list.isApplyTaxes())
|
if ((npc != null) && list.isApplyTaxes())
|
||||||
{
|
{
|
||||||
final OptionalLong taxPaid = entry.getIngredients().stream().filter(i -> i.getId() == Inventory.ADENA_ID).mapToLong(i -> Math.round(i.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount).reduce(Math::multiplyExact);
|
long taxPaid = 0;
|
||||||
if (taxPaid.isPresent())
|
for (ItemChanceHolder ingredient : entry.getIngredients())
|
||||||
{
|
{
|
||||||
npc.handleTaxPayment(taxPaid.getAsLong());
|
if (ingredient.getId() == Inventory.ADENA_ID)
|
||||||
|
{
|
||||||
|
taxPaid += Math.round(ingredient.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (taxPaid > 0)
|
||||||
|
{
|
||||||
|
npc.handleTaxPayment(taxPaid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -403,11 +403,65 @@ public class ItemInfo
|
|||||||
return _soulCrystalOptions != null ? _soulCrystalOptions : Collections.emptyList();
|
return _soulCrystalOptions != null ? _soulCrystalOptions : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean soulCrystalOptionsMatch(EnsoulOption[] soulCrystalOptions)
|
||||||
|
{
|
||||||
|
if ((_soulCrystalOptions == null))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnsoulOption soulCrystalOption1 : _soulCrystalOptions)
|
||||||
|
{
|
||||||
|
boolean found = false;
|
||||||
|
SEARCH: for (EnsoulOption soulCrystalOption2 : soulCrystalOptions)
|
||||||
|
{
|
||||||
|
if (soulCrystalOption1.equals(soulCrystalOption2))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break SEARCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
||||||
{
|
{
|
||||||
return _soulCrystalSpecialOptions != null ? _soulCrystalSpecialOptions : Collections.emptyList();
|
return _soulCrystalSpecialOptions != null ? _soulCrystalSpecialOptions : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean soulCrystalSpecialOptionsMatch(EnsoulOption[] soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
if (_soulCrystalSpecialOptions == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnsoulOption soulCrystalSpecialOption1 : _soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
boolean found = false;
|
||||||
|
SEARCH: for (EnsoulOption soulCrystalSpecialOption2 : soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
if (soulCrystalSpecialOption1.equals(soulCrystalSpecialOption2))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break SEARCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public long getVisualExpiration()
|
public long getVisualExpiration()
|
||||||
{
|
{
|
||||||
return _visualExpiration;
|
return _visualExpiration;
|
||||||
|
@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.OptionalLong;
|
|
||||||
|
|
||||||
import org.l2jmobius.commons.network.ReadablePacket;
|
import org.l2jmobius.commons.network.ReadablePacket;
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
@ -207,9 +206,9 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
|| (itemEnchantment.getAttributeDefence(AttributeType.DARK) != _darkDefence)
|
|| (itemEnchantment.getAttributeDefence(AttributeType.DARK) != _darkDefence)
|
||||||
|| ((itemEnchantment.getAugmentation() == null) && ((_augmentOption1 != 0) || (_augmentOption2 != 0)))
|
|| ((itemEnchantment.getAugmentation() == null) && ((_augmentOption1 != 0) || (_augmentOption2 != 0)))
|
||||||
|| ((itemEnchantment.getAugmentation() != null) && ((itemEnchantment.getAugmentation().getOption1Id() != _augmentOption1) || (itemEnchantment.getAugmentation().getOption2Id() != _augmentOption2)))
|
|| ((itemEnchantment.getAugmentation() != null) && ((itemEnchantment.getAugmentation().getOption1Id() != _augmentOption1) || (itemEnchantment.getAugmentation().getOption2Id() != _augmentOption2)))
|
||||||
|| ((_soulCrystalOptions != null) && itemEnchantment.getSoulCrystalOptions().stream().anyMatch(e -> !CommonUtil.contains(_soulCrystalOptions, e)))
|
|| ((_soulCrystalOptions != null) && !itemEnchantment.soulCrystalOptionsMatch(_soulCrystalOptions))
|
||||||
|| ((_soulCrystalOptions == null) && !itemEnchantment.getSoulCrystalOptions().isEmpty())
|
|| ((_soulCrystalOptions == null) && !itemEnchantment.getSoulCrystalOptions().isEmpty())
|
||||||
|| ((_soulCrystalSpecialOptions != null) && itemEnchantment.getSoulCrystalSpecialOptions().stream().anyMatch(e -> !CommonUtil.contains(_soulCrystalSpecialOptions, e)))
|
|| ((_soulCrystalSpecialOptions != null) && !itemEnchantment.soulCrystalSpecialOptionsMatch(_soulCrystalSpecialOptions))
|
||||||
|| ((_soulCrystalSpecialOptions == null) && !itemEnchantment.getSoulCrystalSpecialOptions().isEmpty())
|
|| ((_soulCrystalSpecialOptions == null) && !itemEnchantment.getSoulCrystalSpecialOptions().isEmpty())
|
||||||
))
|
))
|
||||||
//@formatter:on
|
//@formatter:on
|
||||||
@ -616,10 +615,17 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
// Finally, give the tax to the castle.
|
// Finally, give the tax to the castle.
|
||||||
if ((npc != null) && list.isApplyTaxes())
|
if ((npc != null) && list.isApplyTaxes())
|
||||||
{
|
{
|
||||||
final OptionalLong taxPaid = entry.getIngredients().stream().filter(i -> i.getId() == Inventory.ADENA_ID).mapToLong(i -> Math.round(i.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount).reduce(Math::multiplyExact);
|
long taxPaid = 0;
|
||||||
if (taxPaid.isPresent())
|
for (ItemChanceHolder ingredient : entry.getIngredients())
|
||||||
{
|
{
|
||||||
npc.handleTaxPayment(taxPaid.getAsLong());
|
if (ingredient.getId() == Inventory.ADENA_ID)
|
||||||
|
{
|
||||||
|
taxPaid += Math.round(ingredient.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (taxPaid > 0)
|
||||||
|
{
|
||||||
|
npc.handleTaxPayment(taxPaid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -403,11 +403,65 @@ public class ItemInfo
|
|||||||
return _soulCrystalOptions != null ? _soulCrystalOptions : Collections.emptyList();
|
return _soulCrystalOptions != null ? _soulCrystalOptions : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean soulCrystalOptionsMatch(EnsoulOption[] soulCrystalOptions)
|
||||||
|
{
|
||||||
|
if ((_soulCrystalOptions == null))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnsoulOption soulCrystalOption1 : _soulCrystalOptions)
|
||||||
|
{
|
||||||
|
boolean found = false;
|
||||||
|
SEARCH: for (EnsoulOption soulCrystalOption2 : soulCrystalOptions)
|
||||||
|
{
|
||||||
|
if (soulCrystalOption1.equals(soulCrystalOption2))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break SEARCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
||||||
{
|
{
|
||||||
return _soulCrystalSpecialOptions != null ? _soulCrystalSpecialOptions : Collections.emptyList();
|
return _soulCrystalSpecialOptions != null ? _soulCrystalSpecialOptions : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean soulCrystalSpecialOptionsMatch(EnsoulOption[] soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
if (_soulCrystalSpecialOptions == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnsoulOption soulCrystalSpecialOption1 : _soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
boolean found = false;
|
||||||
|
SEARCH: for (EnsoulOption soulCrystalSpecialOption2 : soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
if (soulCrystalSpecialOption1.equals(soulCrystalSpecialOption2))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break SEARCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public long getVisualExpiration()
|
public long getVisualExpiration()
|
||||||
{
|
{
|
||||||
return _visualExpiration;
|
return _visualExpiration;
|
||||||
|
@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.OptionalLong;
|
|
||||||
|
|
||||||
import org.l2jmobius.commons.network.ReadablePacket;
|
import org.l2jmobius.commons.network.ReadablePacket;
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
@ -207,9 +206,9 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
|| (itemEnchantment.getAttributeDefence(AttributeType.DARK) != _darkDefence)
|
|| (itemEnchantment.getAttributeDefence(AttributeType.DARK) != _darkDefence)
|
||||||
|| ((itemEnchantment.getAugmentation() == null) && ((_augmentOption1 != 0) || (_augmentOption2 != 0)))
|
|| ((itemEnchantment.getAugmentation() == null) && ((_augmentOption1 != 0) || (_augmentOption2 != 0)))
|
||||||
|| ((itemEnchantment.getAugmentation() != null) && ((itemEnchantment.getAugmentation().getOption1Id() != _augmentOption1) || (itemEnchantment.getAugmentation().getOption2Id() != _augmentOption2)))
|
|| ((itemEnchantment.getAugmentation() != null) && ((itemEnchantment.getAugmentation().getOption1Id() != _augmentOption1) || (itemEnchantment.getAugmentation().getOption2Id() != _augmentOption2)))
|
||||||
|| ((_soulCrystalOptions != null) && itemEnchantment.getSoulCrystalOptions().stream().anyMatch(e -> !CommonUtil.contains(_soulCrystalOptions, e)))
|
|| ((_soulCrystalOptions != null) && !itemEnchantment.soulCrystalOptionsMatch(_soulCrystalOptions))
|
||||||
|| ((_soulCrystalOptions == null) && !itemEnchantment.getSoulCrystalOptions().isEmpty())
|
|| ((_soulCrystalOptions == null) && !itemEnchantment.getSoulCrystalOptions().isEmpty())
|
||||||
|| ((_soulCrystalSpecialOptions != null) && itemEnchantment.getSoulCrystalSpecialOptions().stream().anyMatch(e -> !CommonUtil.contains(_soulCrystalSpecialOptions, e)))
|
|| ((_soulCrystalSpecialOptions != null) && !itemEnchantment.soulCrystalSpecialOptionsMatch(_soulCrystalSpecialOptions))
|
||||||
|| ((_soulCrystalSpecialOptions == null) && !itemEnchantment.getSoulCrystalSpecialOptions().isEmpty())
|
|| ((_soulCrystalSpecialOptions == null) && !itemEnchantment.getSoulCrystalSpecialOptions().isEmpty())
|
||||||
))
|
))
|
||||||
//@formatter:on
|
//@formatter:on
|
||||||
@ -616,10 +615,17 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
// Finally, give the tax to the castle.
|
// Finally, give the tax to the castle.
|
||||||
if ((npc != null) && list.isApplyTaxes())
|
if ((npc != null) && list.isApplyTaxes())
|
||||||
{
|
{
|
||||||
final OptionalLong taxPaid = entry.getIngredients().stream().filter(i -> i.getId() == Inventory.ADENA_ID).mapToLong(i -> Math.round(i.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount).reduce(Math::multiplyExact);
|
long taxPaid = 0;
|
||||||
if (taxPaid.isPresent())
|
for (ItemChanceHolder ingredient : entry.getIngredients())
|
||||||
{
|
{
|
||||||
npc.handleTaxPayment(taxPaid.getAsLong());
|
if (ingredient.getId() == Inventory.ADENA_ID)
|
||||||
|
{
|
||||||
|
taxPaid += Math.round(ingredient.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (taxPaid > 0)
|
||||||
|
{
|
||||||
|
npc.handleTaxPayment(taxPaid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.OptionalLong;
|
|
||||||
|
|
||||||
import org.l2jmobius.commons.network.ReadablePacket;
|
import org.l2jmobius.commons.network.ReadablePacket;
|
||||||
import org.l2jmobius.gameserver.data.ItemTable;
|
import org.l2jmobius.gameserver.data.ItemTable;
|
||||||
@ -561,10 +560,17 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
// Finally, give the tax to the castle.
|
// Finally, give the tax to the castle.
|
||||||
if ((npc != null) && list.isApplyTaxes())
|
if ((npc != null) && list.isApplyTaxes())
|
||||||
{
|
{
|
||||||
final OptionalLong taxPaid = entry.getIngredients().stream().filter(i -> i.getId() == Inventory.ADENA_ID).mapToLong(i -> Math.round(i.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount).reduce(Math::multiplyExact);
|
long taxPaid = 0;
|
||||||
if (taxPaid.isPresent())
|
for (ItemChanceHolder ingredient : entry.getIngredients())
|
||||||
{
|
{
|
||||||
npc.handleTaxPayment(taxPaid.getAsLong());
|
if (ingredient.getId() == Inventory.ADENA_ID)
|
||||||
|
{
|
||||||
|
taxPaid += Math.round(ingredient.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (taxPaid > 0)
|
||||||
|
{
|
||||||
|
npc.handleTaxPayment(taxPaid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.OptionalLong;
|
|
||||||
|
|
||||||
import org.l2jmobius.commons.network.ReadablePacket;
|
import org.l2jmobius.commons.network.ReadablePacket;
|
||||||
import org.l2jmobius.gameserver.data.ItemTable;
|
import org.l2jmobius.gameserver.data.ItemTable;
|
||||||
@ -561,10 +560,17 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
// Finally, give the tax to the castle.
|
// Finally, give the tax to the castle.
|
||||||
if ((npc != null) && list.isApplyTaxes())
|
if ((npc != null) && list.isApplyTaxes())
|
||||||
{
|
{
|
||||||
final OptionalLong taxPaid = entry.getIngredients().stream().filter(i -> i.getId() == Inventory.ADENA_ID).mapToLong(i -> Math.round(i.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount).reduce(Math::multiplyExact);
|
long taxPaid = 0;
|
||||||
if (taxPaid.isPresent())
|
for (ItemChanceHolder ingredient : entry.getIngredients())
|
||||||
{
|
{
|
||||||
npc.handleTaxPayment(taxPaid.getAsLong());
|
if (ingredient.getId() == Inventory.ADENA_ID)
|
||||||
|
{
|
||||||
|
taxPaid += Math.round(ingredient.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (taxPaid > 0)
|
||||||
|
{
|
||||||
|
npc.handleTaxPayment(taxPaid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -397,11 +397,65 @@ public class ItemInfo
|
|||||||
return _soulCrystalOptions != null ? _soulCrystalOptions : Collections.emptyList();
|
return _soulCrystalOptions != null ? _soulCrystalOptions : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean soulCrystalOptionsMatch(EnsoulOption[] soulCrystalOptions)
|
||||||
|
{
|
||||||
|
if ((_soulCrystalOptions == null))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnsoulOption soulCrystalOption1 : _soulCrystalOptions)
|
||||||
|
{
|
||||||
|
boolean found = false;
|
||||||
|
SEARCH: for (EnsoulOption soulCrystalOption2 : soulCrystalOptions)
|
||||||
|
{
|
||||||
|
if (soulCrystalOption1.equals(soulCrystalOption2))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break SEARCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
||||||
{
|
{
|
||||||
return _soulCrystalSpecialOptions != null ? _soulCrystalSpecialOptions : Collections.emptyList();
|
return _soulCrystalSpecialOptions != null ? _soulCrystalSpecialOptions : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean soulCrystalSpecialOptionsMatch(EnsoulOption[] soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
if (_soulCrystalSpecialOptions == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnsoulOption soulCrystalSpecialOption1 : _soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
boolean found = false;
|
||||||
|
SEARCH: for (EnsoulOption soulCrystalSpecialOption2 : soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
if (soulCrystalSpecialOption1.equals(soulCrystalSpecialOption2))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break SEARCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public long getVisualExpiration()
|
public long getVisualExpiration()
|
||||||
{
|
{
|
||||||
return _visualExpiration;
|
return _visualExpiration;
|
||||||
|
@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.OptionalLong;
|
|
||||||
|
|
||||||
import org.l2jmobius.commons.network.ReadablePacket;
|
import org.l2jmobius.commons.network.ReadablePacket;
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
@ -207,9 +206,9 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
|| (itemEnchantment.getAttributeDefence(AttributeType.DARK) != _darkDefence)
|
|| (itemEnchantment.getAttributeDefence(AttributeType.DARK) != _darkDefence)
|
||||||
|| ((itemEnchantment.getAugmentation() == null) && ((_augmentOption1 != 0) || (_augmentOption2 != 0)))
|
|| ((itemEnchantment.getAugmentation() == null) && ((_augmentOption1 != 0) || (_augmentOption2 != 0)))
|
||||||
|| ((itemEnchantment.getAugmentation() != null) && ((itemEnchantment.getAugmentation().getOption1Id() != _augmentOption1) || (itemEnchantment.getAugmentation().getOption2Id() != _augmentOption2)))
|
|| ((itemEnchantment.getAugmentation() != null) && ((itemEnchantment.getAugmentation().getOption1Id() != _augmentOption1) || (itemEnchantment.getAugmentation().getOption2Id() != _augmentOption2)))
|
||||||
|| ((_soulCrystalOptions != null) && itemEnchantment.getSoulCrystalOptions().stream().anyMatch(e -> !CommonUtil.contains(_soulCrystalOptions, e)))
|
|| ((_soulCrystalOptions != null) && !itemEnchantment.soulCrystalOptionsMatch(_soulCrystalOptions))
|
||||||
|| ((_soulCrystalOptions == null) && !itemEnchantment.getSoulCrystalOptions().isEmpty())
|
|| ((_soulCrystalOptions == null) && !itemEnchantment.getSoulCrystalOptions().isEmpty())
|
||||||
|| ((_soulCrystalSpecialOptions != null) && itemEnchantment.getSoulCrystalSpecialOptions().stream().anyMatch(e -> !CommonUtil.contains(_soulCrystalSpecialOptions, e)))
|
|| ((_soulCrystalSpecialOptions != null) && !itemEnchantment.soulCrystalSpecialOptionsMatch(_soulCrystalSpecialOptions))
|
||||||
|| ((_soulCrystalSpecialOptions == null) && !itemEnchantment.getSoulCrystalSpecialOptions().isEmpty())
|
|| ((_soulCrystalSpecialOptions == null) && !itemEnchantment.getSoulCrystalSpecialOptions().isEmpty())
|
||||||
))
|
))
|
||||||
//@formatter:on
|
//@formatter:on
|
||||||
@ -607,10 +606,17 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
// Finally, give the tax to the castle.
|
// Finally, give the tax to the castle.
|
||||||
if ((npc != null) && list.isApplyTaxes())
|
if ((npc != null) && list.isApplyTaxes())
|
||||||
{
|
{
|
||||||
final OptionalLong taxPaid = entry.getIngredients().stream().filter(i -> i.getId() == Inventory.ADENA_ID).mapToLong(i -> Math.round(i.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount).reduce(Math::multiplyExact);
|
long taxPaid = 0;
|
||||||
if (taxPaid.isPresent())
|
for (ItemChanceHolder ingredient : entry.getIngredients())
|
||||||
{
|
{
|
||||||
npc.handleTaxPayment(taxPaid.getAsLong());
|
if (ingredient.getId() == Inventory.ADENA_ID)
|
||||||
|
{
|
||||||
|
taxPaid += Math.round(ingredient.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (taxPaid > 0)
|
||||||
|
{
|
||||||
|
npc.handleTaxPayment(taxPaid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -397,11 +397,65 @@ public class ItemInfo
|
|||||||
return _soulCrystalOptions != null ? _soulCrystalOptions : Collections.emptyList();
|
return _soulCrystalOptions != null ? _soulCrystalOptions : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean soulCrystalOptionsMatch(EnsoulOption[] soulCrystalOptions)
|
||||||
|
{
|
||||||
|
if ((_soulCrystalOptions == null))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnsoulOption soulCrystalOption1 : _soulCrystalOptions)
|
||||||
|
{
|
||||||
|
boolean found = false;
|
||||||
|
SEARCH: for (EnsoulOption soulCrystalOption2 : soulCrystalOptions)
|
||||||
|
{
|
||||||
|
if (soulCrystalOption1.equals(soulCrystalOption2))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break SEARCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
||||||
{
|
{
|
||||||
return _soulCrystalSpecialOptions != null ? _soulCrystalSpecialOptions : Collections.emptyList();
|
return _soulCrystalSpecialOptions != null ? _soulCrystalSpecialOptions : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean soulCrystalSpecialOptionsMatch(EnsoulOption[] soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
if (_soulCrystalSpecialOptions == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnsoulOption soulCrystalSpecialOption1 : _soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
boolean found = false;
|
||||||
|
SEARCH: for (EnsoulOption soulCrystalSpecialOption2 : soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
if (soulCrystalSpecialOption1.equals(soulCrystalSpecialOption2))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break SEARCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public long getVisualExpiration()
|
public long getVisualExpiration()
|
||||||
{
|
{
|
||||||
return _visualExpiration;
|
return _visualExpiration;
|
||||||
|
@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.OptionalLong;
|
|
||||||
|
|
||||||
import org.l2jmobius.commons.network.ReadablePacket;
|
import org.l2jmobius.commons.network.ReadablePacket;
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
@ -207,9 +206,9 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
|| (itemEnchantment.getAttributeDefence(AttributeType.DARK) != _darkDefence)
|
|| (itemEnchantment.getAttributeDefence(AttributeType.DARK) != _darkDefence)
|
||||||
|| ((itemEnchantment.getAugmentation() == null) && ((_augmentOption1 != 0) || (_augmentOption2 != 0)))
|
|| ((itemEnchantment.getAugmentation() == null) && ((_augmentOption1 != 0) || (_augmentOption2 != 0)))
|
||||||
|| ((itemEnchantment.getAugmentation() != null) && ((itemEnchantment.getAugmentation().getOption1Id() != _augmentOption1) || (itemEnchantment.getAugmentation().getOption2Id() != _augmentOption2)))
|
|| ((itemEnchantment.getAugmentation() != null) && ((itemEnchantment.getAugmentation().getOption1Id() != _augmentOption1) || (itemEnchantment.getAugmentation().getOption2Id() != _augmentOption2)))
|
||||||
|| ((_soulCrystalOptions != null) && itemEnchantment.getSoulCrystalOptions().stream().anyMatch(e -> !CommonUtil.contains(_soulCrystalOptions, e)))
|
|| ((_soulCrystalOptions != null) && !itemEnchantment.soulCrystalOptionsMatch(_soulCrystalOptions))
|
||||||
|| ((_soulCrystalOptions == null) && !itemEnchantment.getSoulCrystalOptions().isEmpty())
|
|| ((_soulCrystalOptions == null) && !itemEnchantment.getSoulCrystalOptions().isEmpty())
|
||||||
|| ((_soulCrystalSpecialOptions != null) && itemEnchantment.getSoulCrystalSpecialOptions().stream().anyMatch(e -> !CommonUtil.contains(_soulCrystalSpecialOptions, e)))
|
|| ((_soulCrystalSpecialOptions != null) && !itemEnchantment.soulCrystalSpecialOptionsMatch(_soulCrystalSpecialOptions))
|
||||||
|| ((_soulCrystalSpecialOptions == null) && !itemEnchantment.getSoulCrystalSpecialOptions().isEmpty())
|
|| ((_soulCrystalSpecialOptions == null) && !itemEnchantment.getSoulCrystalSpecialOptions().isEmpty())
|
||||||
))
|
))
|
||||||
//@formatter:on
|
//@formatter:on
|
||||||
@ -607,10 +606,17 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
// Finally, give the tax to the castle.
|
// Finally, give the tax to the castle.
|
||||||
if ((npc != null) && list.isApplyTaxes())
|
if ((npc != null) && list.isApplyTaxes())
|
||||||
{
|
{
|
||||||
final OptionalLong taxPaid = entry.getIngredients().stream().filter(i -> i.getId() == Inventory.ADENA_ID).mapToLong(i -> Math.round(i.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount).reduce(Math::multiplyExact);
|
long taxPaid = 0;
|
||||||
if (taxPaid.isPresent())
|
for (ItemChanceHolder ingredient : entry.getIngredients())
|
||||||
{
|
{
|
||||||
npc.handleTaxPayment(taxPaid.getAsLong());
|
if (ingredient.getId() == Inventory.ADENA_ID)
|
||||||
|
{
|
||||||
|
taxPaid += Math.round(ingredient.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (taxPaid > 0)
|
||||||
|
{
|
||||||
|
npc.handleTaxPayment(taxPaid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -397,11 +397,65 @@ public class ItemInfo
|
|||||||
return _soulCrystalOptions != null ? _soulCrystalOptions : Collections.emptyList();
|
return _soulCrystalOptions != null ? _soulCrystalOptions : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean soulCrystalOptionsMatch(EnsoulOption[] soulCrystalOptions)
|
||||||
|
{
|
||||||
|
if ((_soulCrystalOptions == null))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnsoulOption soulCrystalOption1 : _soulCrystalOptions)
|
||||||
|
{
|
||||||
|
boolean found = false;
|
||||||
|
SEARCH: for (EnsoulOption soulCrystalOption2 : soulCrystalOptions)
|
||||||
|
{
|
||||||
|
if (soulCrystalOption1.equals(soulCrystalOption2))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break SEARCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
||||||
{
|
{
|
||||||
return _soulCrystalSpecialOptions != null ? _soulCrystalSpecialOptions : Collections.emptyList();
|
return _soulCrystalSpecialOptions != null ? _soulCrystalSpecialOptions : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean soulCrystalSpecialOptionsMatch(EnsoulOption[] soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
if (_soulCrystalSpecialOptions == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnsoulOption soulCrystalSpecialOption1 : _soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
boolean found = false;
|
||||||
|
SEARCH: for (EnsoulOption soulCrystalSpecialOption2 : soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
if (soulCrystalSpecialOption1.equals(soulCrystalSpecialOption2))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break SEARCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public long getVisualExpiration()
|
public long getVisualExpiration()
|
||||||
{
|
{
|
||||||
return _visualExpiration;
|
return _visualExpiration;
|
||||||
|
@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.OptionalLong;
|
|
||||||
|
|
||||||
import org.l2jmobius.commons.network.ReadablePacket;
|
import org.l2jmobius.commons.network.ReadablePacket;
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
@ -207,9 +206,9 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
|| (itemEnchantment.getAttributeDefence(AttributeType.DARK) != _darkDefence)
|
|| (itemEnchantment.getAttributeDefence(AttributeType.DARK) != _darkDefence)
|
||||||
|| ((itemEnchantment.getAugmentation() == null) && ((_augmentOption1 != 0) || (_augmentOption2 != 0)))
|
|| ((itemEnchantment.getAugmentation() == null) && ((_augmentOption1 != 0) || (_augmentOption2 != 0)))
|
||||||
|| ((itemEnchantment.getAugmentation() != null) && ((itemEnchantment.getAugmentation().getOption1Id() != _augmentOption1) || (itemEnchantment.getAugmentation().getOption2Id() != _augmentOption2)))
|
|| ((itemEnchantment.getAugmentation() != null) && ((itemEnchantment.getAugmentation().getOption1Id() != _augmentOption1) || (itemEnchantment.getAugmentation().getOption2Id() != _augmentOption2)))
|
||||||
|| ((_soulCrystalOptions != null) && itemEnchantment.getSoulCrystalOptions().stream().anyMatch(e -> !CommonUtil.contains(_soulCrystalOptions, e)))
|
|| ((_soulCrystalOptions != null) && !itemEnchantment.soulCrystalOptionsMatch(_soulCrystalOptions))
|
||||||
|| ((_soulCrystalOptions == null) && !itemEnchantment.getSoulCrystalOptions().isEmpty())
|
|| ((_soulCrystalOptions == null) && !itemEnchantment.getSoulCrystalOptions().isEmpty())
|
||||||
|| ((_soulCrystalSpecialOptions != null) && itemEnchantment.getSoulCrystalSpecialOptions().stream().anyMatch(e -> !CommonUtil.contains(_soulCrystalSpecialOptions, e)))
|
|| ((_soulCrystalSpecialOptions != null) && !itemEnchantment.soulCrystalSpecialOptionsMatch(_soulCrystalSpecialOptions))
|
||||||
|| ((_soulCrystalSpecialOptions == null) && !itemEnchantment.getSoulCrystalSpecialOptions().isEmpty())
|
|| ((_soulCrystalSpecialOptions == null) && !itemEnchantment.getSoulCrystalSpecialOptions().isEmpty())
|
||||||
))
|
))
|
||||||
//@formatter:on
|
//@formatter:on
|
||||||
@ -607,10 +606,17 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
// Finally, give the tax to the castle.
|
// Finally, give the tax to the castle.
|
||||||
if ((npc != null) && list.isApplyTaxes())
|
if ((npc != null) && list.isApplyTaxes())
|
||||||
{
|
{
|
||||||
final OptionalLong taxPaid = entry.getIngredients().stream().filter(i -> i.getId() == Inventory.ADENA_ID).mapToLong(i -> Math.round(i.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount).reduce(Math::multiplyExact);
|
long taxPaid = 0;
|
||||||
if (taxPaid.isPresent())
|
for (ItemChanceHolder ingredient : entry.getIngredients())
|
||||||
{
|
{
|
||||||
npc.handleTaxPayment(taxPaid.getAsLong());
|
if (ingredient.getId() == Inventory.ADENA_ID)
|
||||||
|
{
|
||||||
|
taxPaid += Math.round(ingredient.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (taxPaid > 0)
|
||||||
|
{
|
||||||
|
npc.handleTaxPayment(taxPaid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -397,11 +397,65 @@ public class ItemInfo
|
|||||||
return _soulCrystalOptions != null ? _soulCrystalOptions : Collections.emptyList();
|
return _soulCrystalOptions != null ? _soulCrystalOptions : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean soulCrystalOptionsMatch(EnsoulOption[] soulCrystalOptions)
|
||||||
|
{
|
||||||
|
if ((_soulCrystalOptions == null))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnsoulOption soulCrystalOption1 : _soulCrystalOptions)
|
||||||
|
{
|
||||||
|
boolean found = false;
|
||||||
|
SEARCH: for (EnsoulOption soulCrystalOption2 : soulCrystalOptions)
|
||||||
|
{
|
||||||
|
if (soulCrystalOption1.equals(soulCrystalOption2))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break SEARCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
||||||
{
|
{
|
||||||
return _soulCrystalSpecialOptions != null ? _soulCrystalSpecialOptions : Collections.emptyList();
|
return _soulCrystalSpecialOptions != null ? _soulCrystalSpecialOptions : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean soulCrystalSpecialOptionsMatch(EnsoulOption[] soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
if (_soulCrystalSpecialOptions == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnsoulOption soulCrystalSpecialOption1 : _soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
boolean found = false;
|
||||||
|
SEARCH: for (EnsoulOption soulCrystalSpecialOption2 : soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
if (soulCrystalSpecialOption1.equals(soulCrystalSpecialOption2))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break SEARCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public long getVisualExpiration()
|
public long getVisualExpiration()
|
||||||
{
|
{
|
||||||
return _visualExpiration;
|
return _visualExpiration;
|
||||||
|
@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.OptionalLong;
|
|
||||||
|
|
||||||
import org.l2jmobius.commons.network.ReadablePacket;
|
import org.l2jmobius.commons.network.ReadablePacket;
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
@ -207,9 +206,9 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
|| (itemEnchantment.getAttributeDefence(AttributeType.DARK) != _darkDefence)
|
|| (itemEnchantment.getAttributeDefence(AttributeType.DARK) != _darkDefence)
|
||||||
|| ((itemEnchantment.getAugmentation() == null) && ((_augmentOption1 != 0) || (_augmentOption2 != 0)))
|
|| ((itemEnchantment.getAugmentation() == null) && ((_augmentOption1 != 0) || (_augmentOption2 != 0)))
|
||||||
|| ((itemEnchantment.getAugmentation() != null) && ((itemEnchantment.getAugmentation().getOption1Id() != _augmentOption1) || (itemEnchantment.getAugmentation().getOption2Id() != _augmentOption2)))
|
|| ((itemEnchantment.getAugmentation() != null) && ((itemEnchantment.getAugmentation().getOption1Id() != _augmentOption1) || (itemEnchantment.getAugmentation().getOption2Id() != _augmentOption2)))
|
||||||
|| ((_soulCrystalOptions != null) && itemEnchantment.getSoulCrystalOptions().stream().anyMatch(e -> !CommonUtil.contains(_soulCrystalOptions, e)))
|
|| ((_soulCrystalOptions != null) && !itemEnchantment.soulCrystalOptionsMatch(_soulCrystalOptions))
|
||||||
|| ((_soulCrystalOptions == null) && !itemEnchantment.getSoulCrystalOptions().isEmpty())
|
|| ((_soulCrystalOptions == null) && !itemEnchantment.getSoulCrystalOptions().isEmpty())
|
||||||
|| ((_soulCrystalSpecialOptions != null) && itemEnchantment.getSoulCrystalSpecialOptions().stream().anyMatch(e -> !CommonUtil.contains(_soulCrystalSpecialOptions, e)))
|
|| ((_soulCrystalSpecialOptions != null) && !itemEnchantment.soulCrystalSpecialOptionsMatch(_soulCrystalSpecialOptions))
|
||||||
|| ((_soulCrystalSpecialOptions == null) && !itemEnchantment.getSoulCrystalSpecialOptions().isEmpty())
|
|| ((_soulCrystalSpecialOptions == null) && !itemEnchantment.getSoulCrystalSpecialOptions().isEmpty())
|
||||||
))
|
))
|
||||||
//@formatter:on
|
//@formatter:on
|
||||||
@ -607,10 +606,17 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
// Finally, give the tax to the castle.
|
// Finally, give the tax to the castle.
|
||||||
if ((npc != null) && list.isApplyTaxes())
|
if ((npc != null) && list.isApplyTaxes())
|
||||||
{
|
{
|
||||||
final OptionalLong taxPaid = entry.getIngredients().stream().filter(i -> i.getId() == Inventory.ADENA_ID).mapToLong(i -> Math.round(i.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount).reduce(Math::multiplyExact);
|
long taxPaid = 0;
|
||||||
if (taxPaid.isPresent())
|
for (ItemChanceHolder ingredient : entry.getIngredients())
|
||||||
{
|
{
|
||||||
npc.handleTaxPayment(taxPaid.getAsLong());
|
if (ingredient.getId() == Inventory.ADENA_ID)
|
||||||
|
{
|
||||||
|
taxPaid += Math.round(ingredient.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (taxPaid > 0)
|
||||||
|
{
|
||||||
|
npc.handleTaxPayment(taxPaid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -397,11 +397,65 @@ public class ItemInfo
|
|||||||
return _soulCrystalOptions != null ? _soulCrystalOptions : Collections.emptyList();
|
return _soulCrystalOptions != null ? _soulCrystalOptions : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean soulCrystalOptionsMatch(EnsoulOption[] soulCrystalOptions)
|
||||||
|
{
|
||||||
|
if ((_soulCrystalOptions == null))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnsoulOption soulCrystalOption1 : _soulCrystalOptions)
|
||||||
|
{
|
||||||
|
boolean found = false;
|
||||||
|
SEARCH: for (EnsoulOption soulCrystalOption2 : soulCrystalOptions)
|
||||||
|
{
|
||||||
|
if (soulCrystalOption1.equals(soulCrystalOption2))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break SEARCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
||||||
{
|
{
|
||||||
return _soulCrystalSpecialOptions != null ? _soulCrystalSpecialOptions : Collections.emptyList();
|
return _soulCrystalSpecialOptions != null ? _soulCrystalSpecialOptions : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean soulCrystalSpecialOptionsMatch(EnsoulOption[] soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
if (_soulCrystalSpecialOptions == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnsoulOption soulCrystalSpecialOption1 : _soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
boolean found = false;
|
||||||
|
SEARCH: for (EnsoulOption soulCrystalSpecialOption2 : soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
if (soulCrystalSpecialOption1.equals(soulCrystalSpecialOption2))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break SEARCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public long getVisualExpiration()
|
public long getVisualExpiration()
|
||||||
{
|
{
|
||||||
return _visualExpiration;
|
return _visualExpiration;
|
||||||
|
@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.OptionalLong;
|
|
||||||
|
|
||||||
import org.l2jmobius.commons.network.ReadablePacket;
|
import org.l2jmobius.commons.network.ReadablePacket;
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
@ -207,9 +206,9 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
|| (itemEnchantment.getAttributeDefence(AttributeType.DARK) != _darkDefence)
|
|| (itemEnchantment.getAttributeDefence(AttributeType.DARK) != _darkDefence)
|
||||||
|| ((itemEnchantment.getAugmentation() == null) && ((_augmentOption1 != 0) || (_augmentOption2 != 0)))
|
|| ((itemEnchantment.getAugmentation() == null) && ((_augmentOption1 != 0) || (_augmentOption2 != 0)))
|
||||||
|| ((itemEnchantment.getAugmentation() != null) && ((itemEnchantment.getAugmentation().getOption1Id() != _augmentOption1) || (itemEnchantment.getAugmentation().getOption2Id() != _augmentOption2)))
|
|| ((itemEnchantment.getAugmentation() != null) && ((itemEnchantment.getAugmentation().getOption1Id() != _augmentOption1) || (itemEnchantment.getAugmentation().getOption2Id() != _augmentOption2)))
|
||||||
|| ((_soulCrystalOptions != null) && itemEnchantment.getSoulCrystalOptions().stream().anyMatch(e -> !CommonUtil.contains(_soulCrystalOptions, e)))
|
|| ((_soulCrystalOptions != null) && !itemEnchantment.soulCrystalOptionsMatch(_soulCrystalOptions))
|
||||||
|| ((_soulCrystalOptions == null) && !itemEnchantment.getSoulCrystalOptions().isEmpty())
|
|| ((_soulCrystalOptions == null) && !itemEnchantment.getSoulCrystalOptions().isEmpty())
|
||||||
|| ((_soulCrystalSpecialOptions != null) && itemEnchantment.getSoulCrystalSpecialOptions().stream().anyMatch(e -> !CommonUtil.contains(_soulCrystalSpecialOptions, e)))
|
|| ((_soulCrystalSpecialOptions != null) && !itemEnchantment.soulCrystalSpecialOptionsMatch(_soulCrystalSpecialOptions))
|
||||||
|| ((_soulCrystalSpecialOptions == null) && !itemEnchantment.getSoulCrystalSpecialOptions().isEmpty())
|
|| ((_soulCrystalSpecialOptions == null) && !itemEnchantment.getSoulCrystalSpecialOptions().isEmpty())
|
||||||
))
|
))
|
||||||
//@formatter:on
|
//@formatter:on
|
||||||
@ -607,10 +606,17 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
// Finally, give the tax to the castle.
|
// Finally, give the tax to the castle.
|
||||||
if ((npc != null) && list.isApplyTaxes())
|
if ((npc != null) && list.isApplyTaxes())
|
||||||
{
|
{
|
||||||
final OptionalLong taxPaid = entry.getIngredients().stream().filter(i -> i.getId() == Inventory.ADENA_ID).mapToLong(i -> Math.round(i.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount).reduce(Math::multiplyExact);
|
long taxPaid = 0;
|
||||||
if (taxPaid.isPresent())
|
for (ItemChanceHolder ingredient : entry.getIngredients())
|
||||||
{
|
{
|
||||||
npc.handleTaxPayment(taxPaid.getAsLong());
|
if (ingredient.getId() == Inventory.ADENA_ID)
|
||||||
|
{
|
||||||
|
taxPaid += Math.round(ingredient.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (taxPaid > 0)
|
||||||
|
{
|
||||||
|
npc.handleTaxPayment(taxPaid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -397,11 +397,65 @@ public class ItemInfo
|
|||||||
return _soulCrystalOptions != null ? _soulCrystalOptions : Collections.emptyList();
|
return _soulCrystalOptions != null ? _soulCrystalOptions : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean soulCrystalOptionsMatch(EnsoulOption[] soulCrystalOptions)
|
||||||
|
{
|
||||||
|
if ((_soulCrystalOptions == null))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnsoulOption soulCrystalOption1 : _soulCrystalOptions)
|
||||||
|
{
|
||||||
|
boolean found = false;
|
||||||
|
SEARCH: for (EnsoulOption soulCrystalOption2 : soulCrystalOptions)
|
||||||
|
{
|
||||||
|
if (soulCrystalOption1.equals(soulCrystalOption2))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break SEARCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
||||||
{
|
{
|
||||||
return _soulCrystalSpecialOptions != null ? _soulCrystalSpecialOptions : Collections.emptyList();
|
return _soulCrystalSpecialOptions != null ? _soulCrystalSpecialOptions : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean soulCrystalSpecialOptionsMatch(EnsoulOption[] soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
if (_soulCrystalSpecialOptions == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnsoulOption soulCrystalSpecialOption1 : _soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
boolean found = false;
|
||||||
|
SEARCH: for (EnsoulOption soulCrystalSpecialOption2 : soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
if (soulCrystalSpecialOption1.equals(soulCrystalSpecialOption2))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break SEARCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public long getVisualExpiration()
|
public long getVisualExpiration()
|
||||||
{
|
{
|
||||||
return _visualExpiration;
|
return _visualExpiration;
|
||||||
|
@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.OptionalLong;
|
|
||||||
|
|
||||||
import org.l2jmobius.commons.network.ReadablePacket;
|
import org.l2jmobius.commons.network.ReadablePacket;
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
@ -207,9 +206,9 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
|| (itemEnchantment.getAttributeDefence(AttributeType.DARK) != _darkDefence)
|
|| (itemEnchantment.getAttributeDefence(AttributeType.DARK) != _darkDefence)
|
||||||
|| ((itemEnchantment.getAugmentation() == null) && ((_augmentOption1 != 0) || (_augmentOption2 != 0)))
|
|| ((itemEnchantment.getAugmentation() == null) && ((_augmentOption1 != 0) || (_augmentOption2 != 0)))
|
||||||
|| ((itemEnchantment.getAugmentation() != null) && ((itemEnchantment.getAugmentation().getOption1Id() != _augmentOption1) || (itemEnchantment.getAugmentation().getOption2Id() != _augmentOption2)))
|
|| ((itemEnchantment.getAugmentation() != null) && ((itemEnchantment.getAugmentation().getOption1Id() != _augmentOption1) || (itemEnchantment.getAugmentation().getOption2Id() != _augmentOption2)))
|
||||||
|| ((_soulCrystalOptions != null) && itemEnchantment.getSoulCrystalOptions().stream().anyMatch(e -> !CommonUtil.contains(_soulCrystalOptions, e)))
|
|| ((_soulCrystalOptions != null) && !itemEnchantment.soulCrystalOptionsMatch(_soulCrystalOptions))
|
||||||
|| ((_soulCrystalOptions == null) && !itemEnchantment.getSoulCrystalOptions().isEmpty())
|
|| ((_soulCrystalOptions == null) && !itemEnchantment.getSoulCrystalOptions().isEmpty())
|
||||||
|| ((_soulCrystalSpecialOptions != null) && itemEnchantment.getSoulCrystalSpecialOptions().stream().anyMatch(e -> !CommonUtil.contains(_soulCrystalSpecialOptions, e)))
|
|| ((_soulCrystalSpecialOptions != null) && !itemEnchantment.soulCrystalSpecialOptionsMatch(_soulCrystalSpecialOptions))
|
||||||
|| ((_soulCrystalSpecialOptions == null) && !itemEnchantment.getSoulCrystalSpecialOptions().isEmpty())
|
|| ((_soulCrystalSpecialOptions == null) && !itemEnchantment.getSoulCrystalSpecialOptions().isEmpty())
|
||||||
))
|
))
|
||||||
//@formatter:on
|
//@formatter:on
|
||||||
@ -607,10 +606,17 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
// Finally, give the tax to the castle.
|
// Finally, give the tax to the castle.
|
||||||
if ((npc != null) && list.isApplyTaxes())
|
if ((npc != null) && list.isApplyTaxes())
|
||||||
{
|
{
|
||||||
final OptionalLong taxPaid = entry.getIngredients().stream().filter(i -> i.getId() == Inventory.ADENA_ID).mapToLong(i -> Math.round(i.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount).reduce(Math::multiplyExact);
|
long taxPaid = 0;
|
||||||
if (taxPaid.isPresent())
|
for (ItemChanceHolder ingredient : entry.getIngredients())
|
||||||
{
|
{
|
||||||
npc.handleTaxPayment(taxPaid.getAsLong());
|
if (ingredient.getId() == Inventory.ADENA_ID)
|
||||||
|
{
|
||||||
|
taxPaid += Math.round(ingredient.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (taxPaid > 0)
|
||||||
|
{
|
||||||
|
npc.handleTaxPayment(taxPaid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -397,11 +397,65 @@ public class ItemInfo
|
|||||||
return _soulCrystalOptions != null ? _soulCrystalOptions : Collections.emptyList();
|
return _soulCrystalOptions != null ? _soulCrystalOptions : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean soulCrystalOptionsMatch(EnsoulOption[] soulCrystalOptions)
|
||||||
|
{
|
||||||
|
if ((_soulCrystalOptions == null))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnsoulOption soulCrystalOption1 : _soulCrystalOptions)
|
||||||
|
{
|
||||||
|
boolean found = false;
|
||||||
|
SEARCH: for (EnsoulOption soulCrystalOption2 : soulCrystalOptions)
|
||||||
|
{
|
||||||
|
if (soulCrystalOption1.equals(soulCrystalOption2))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break SEARCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
||||||
{
|
{
|
||||||
return _soulCrystalSpecialOptions != null ? _soulCrystalSpecialOptions : Collections.emptyList();
|
return _soulCrystalSpecialOptions != null ? _soulCrystalSpecialOptions : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean soulCrystalSpecialOptionsMatch(EnsoulOption[] soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
if (_soulCrystalSpecialOptions == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnsoulOption soulCrystalSpecialOption1 : _soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
boolean found = false;
|
||||||
|
SEARCH: for (EnsoulOption soulCrystalSpecialOption2 : soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
if (soulCrystalSpecialOption1.equals(soulCrystalSpecialOption2))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break SEARCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public long getVisualExpiration()
|
public long getVisualExpiration()
|
||||||
{
|
{
|
||||||
return _visualExpiration;
|
return _visualExpiration;
|
||||||
|
@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.OptionalLong;
|
|
||||||
|
|
||||||
import org.l2jmobius.commons.network.ReadablePacket;
|
import org.l2jmobius.commons.network.ReadablePacket;
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
@ -207,9 +206,9 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
|| (itemEnchantment.getAttributeDefence(AttributeType.DARK) != _darkDefence)
|
|| (itemEnchantment.getAttributeDefence(AttributeType.DARK) != _darkDefence)
|
||||||
|| ((itemEnchantment.getAugmentation() == null) && ((_augmentOption1 != 0) || (_augmentOption2 != 0)))
|
|| ((itemEnchantment.getAugmentation() == null) && ((_augmentOption1 != 0) || (_augmentOption2 != 0)))
|
||||||
|| ((itemEnchantment.getAugmentation() != null) && ((itemEnchantment.getAugmentation().getOption1Id() != _augmentOption1) || (itemEnchantment.getAugmentation().getOption2Id() != _augmentOption2)))
|
|| ((itemEnchantment.getAugmentation() != null) && ((itemEnchantment.getAugmentation().getOption1Id() != _augmentOption1) || (itemEnchantment.getAugmentation().getOption2Id() != _augmentOption2)))
|
||||||
|| ((_soulCrystalOptions != null) && itemEnchantment.getSoulCrystalOptions().stream().anyMatch(e -> !CommonUtil.contains(_soulCrystalOptions, e)))
|
|| ((_soulCrystalOptions != null) && !itemEnchantment.soulCrystalOptionsMatch(_soulCrystalOptions))
|
||||||
|| ((_soulCrystalOptions == null) && !itemEnchantment.getSoulCrystalOptions().isEmpty())
|
|| ((_soulCrystalOptions == null) && !itemEnchantment.getSoulCrystalOptions().isEmpty())
|
||||||
|| ((_soulCrystalSpecialOptions != null) && itemEnchantment.getSoulCrystalSpecialOptions().stream().anyMatch(e -> !CommonUtil.contains(_soulCrystalSpecialOptions, e)))
|
|| ((_soulCrystalSpecialOptions != null) && !itemEnchantment.soulCrystalSpecialOptionsMatch(_soulCrystalSpecialOptions))
|
||||||
|| ((_soulCrystalSpecialOptions == null) && !itemEnchantment.getSoulCrystalSpecialOptions().isEmpty())
|
|| ((_soulCrystalSpecialOptions == null) && !itemEnchantment.getSoulCrystalSpecialOptions().isEmpty())
|
||||||
))
|
))
|
||||||
//@formatter:on
|
//@formatter:on
|
||||||
@ -607,10 +606,17 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
// Finally, give the tax to the castle.
|
// Finally, give the tax to the castle.
|
||||||
if ((npc != null) && list.isApplyTaxes())
|
if ((npc != null) && list.isApplyTaxes())
|
||||||
{
|
{
|
||||||
final OptionalLong taxPaid = entry.getIngredients().stream().filter(i -> i.getId() == Inventory.ADENA_ID).mapToLong(i -> Math.round(i.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount).reduce(Math::multiplyExact);
|
long taxPaid = 0;
|
||||||
if (taxPaid.isPresent())
|
for (ItemChanceHolder ingredient : entry.getIngredients())
|
||||||
{
|
{
|
||||||
npc.handleTaxPayment(taxPaid.getAsLong());
|
if (ingredient.getId() == Inventory.ADENA_ID)
|
||||||
|
{
|
||||||
|
taxPaid += Math.round(ingredient.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (taxPaid > 0)
|
||||||
|
{
|
||||||
|
npc.handleTaxPayment(taxPaid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.OptionalLong;
|
|
||||||
|
|
||||||
import org.l2jmobius.commons.network.ReadablePacket;
|
import org.l2jmobius.commons.network.ReadablePacket;
|
||||||
import org.l2jmobius.gameserver.data.ItemTable;
|
import org.l2jmobius.gameserver.data.ItemTable;
|
||||||
@ -556,10 +555,17 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
// Finally, give the tax to the castle.
|
// Finally, give the tax to the castle.
|
||||||
if ((npc != null) && list.isApplyTaxes())
|
if ((npc != null) && list.isApplyTaxes())
|
||||||
{
|
{
|
||||||
final OptionalLong taxPaid = entry.getIngredients().stream().filter(i -> i.getId() == Inventory.ADENA_ID).mapToLong(i -> Math.round(i.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount).reduce(Math::multiplyExact);
|
long taxPaid = 0;
|
||||||
if (taxPaid.isPresent())
|
for (ItemChanceHolder ingredient : entry.getIngredients())
|
||||||
{
|
{
|
||||||
npc.handleTaxPayment(taxPaid.getAsLong());
|
if (ingredient.getId() == Inventory.ADENA_ID)
|
||||||
|
{
|
||||||
|
taxPaid += Math.round(ingredient.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (taxPaid > 0)
|
||||||
|
{
|
||||||
|
npc.handleTaxPayment(taxPaid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -403,11 +403,65 @@ public class ItemInfo
|
|||||||
return _soulCrystalOptions != null ? _soulCrystalOptions : Collections.emptyList();
|
return _soulCrystalOptions != null ? _soulCrystalOptions : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean soulCrystalOptionsMatch(EnsoulOption[] soulCrystalOptions)
|
||||||
|
{
|
||||||
|
if ((_soulCrystalOptions == null))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnsoulOption soulCrystalOption1 : _soulCrystalOptions)
|
||||||
|
{
|
||||||
|
boolean found = false;
|
||||||
|
SEARCH: for (EnsoulOption soulCrystalOption2 : soulCrystalOptions)
|
||||||
|
{
|
||||||
|
if (soulCrystalOption1.equals(soulCrystalOption2))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break SEARCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
||||||
{
|
{
|
||||||
return _soulCrystalSpecialOptions != null ? _soulCrystalSpecialOptions : Collections.emptyList();
|
return _soulCrystalSpecialOptions != null ? _soulCrystalSpecialOptions : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean soulCrystalSpecialOptionsMatch(EnsoulOption[] soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
if (_soulCrystalSpecialOptions == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnsoulOption soulCrystalSpecialOption1 : _soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
boolean found = false;
|
||||||
|
SEARCH: for (EnsoulOption soulCrystalSpecialOption2 : soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
if (soulCrystalSpecialOption1.equals(soulCrystalSpecialOption2))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break SEARCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public long getVisualExpiration()
|
public long getVisualExpiration()
|
||||||
{
|
{
|
||||||
return _visualExpiration;
|
return _visualExpiration;
|
||||||
|
@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.OptionalLong;
|
|
||||||
|
|
||||||
import org.l2jmobius.commons.network.ReadablePacket;
|
import org.l2jmobius.commons.network.ReadablePacket;
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
@ -207,9 +206,9 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
|| (itemEnchantment.getAttributeDefence(AttributeType.DARK) != _darkDefence)
|
|| (itemEnchantment.getAttributeDefence(AttributeType.DARK) != _darkDefence)
|
||||||
|| ((itemEnchantment.getAugmentation() == null) && ((_augmentOption1 != 0) || (_augmentOption2 != 0)))
|
|| ((itemEnchantment.getAugmentation() == null) && ((_augmentOption1 != 0) || (_augmentOption2 != 0)))
|
||||||
|| ((itemEnchantment.getAugmentation() != null) && ((itemEnchantment.getAugmentation().getOption1Id() != _augmentOption1) || (itemEnchantment.getAugmentation().getOption2Id() != _augmentOption2)))
|
|| ((itemEnchantment.getAugmentation() != null) && ((itemEnchantment.getAugmentation().getOption1Id() != _augmentOption1) || (itemEnchantment.getAugmentation().getOption2Id() != _augmentOption2)))
|
||||||
|| ((_soulCrystalOptions != null) && itemEnchantment.getSoulCrystalOptions().stream().anyMatch(e -> !CommonUtil.contains(_soulCrystalOptions, e)))
|
|| ((_soulCrystalOptions != null) && !itemEnchantment.soulCrystalOptionsMatch(_soulCrystalOptions))
|
||||||
|| ((_soulCrystalOptions == null) && !itemEnchantment.getSoulCrystalOptions().isEmpty())
|
|| ((_soulCrystalOptions == null) && !itemEnchantment.getSoulCrystalOptions().isEmpty())
|
||||||
|| ((_soulCrystalSpecialOptions != null) && itemEnchantment.getSoulCrystalSpecialOptions().stream().anyMatch(e -> !CommonUtil.contains(_soulCrystalSpecialOptions, e)))
|
|| ((_soulCrystalSpecialOptions != null) && !itemEnchantment.soulCrystalSpecialOptionsMatch(_soulCrystalSpecialOptions))
|
||||||
|| ((_soulCrystalSpecialOptions == null) && !itemEnchantment.getSoulCrystalSpecialOptions().isEmpty())
|
|| ((_soulCrystalSpecialOptions == null) && !itemEnchantment.getSoulCrystalSpecialOptions().isEmpty())
|
||||||
))
|
))
|
||||||
//@formatter:on
|
//@formatter:on
|
||||||
@ -607,10 +606,17 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
// Finally, give the tax to the castle.
|
// Finally, give the tax to the castle.
|
||||||
if ((npc != null) && list.isApplyTaxes())
|
if ((npc != null) && list.isApplyTaxes())
|
||||||
{
|
{
|
||||||
final OptionalLong taxPaid = entry.getIngredients().stream().filter(i -> i.getId() == Inventory.ADENA_ID).mapToLong(i -> Math.round(i.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount).reduce(Math::multiplyExact);
|
long taxPaid = 0;
|
||||||
if (taxPaid.isPresent())
|
for (ItemChanceHolder ingredient : entry.getIngredients())
|
||||||
{
|
{
|
||||||
npc.handleTaxPayment(taxPaid.getAsLong());
|
if (ingredient.getId() == Inventory.ADENA_ID)
|
||||||
|
{
|
||||||
|
taxPaid += Math.round(ingredient.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (taxPaid > 0)
|
||||||
|
{
|
||||||
|
npc.handleTaxPayment(taxPaid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -403,11 +403,65 @@ public class ItemInfo
|
|||||||
return _soulCrystalOptions != null ? _soulCrystalOptions : Collections.emptyList();
|
return _soulCrystalOptions != null ? _soulCrystalOptions : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean soulCrystalOptionsMatch(EnsoulOption[] soulCrystalOptions)
|
||||||
|
{
|
||||||
|
if ((_soulCrystalOptions == null))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnsoulOption soulCrystalOption1 : _soulCrystalOptions)
|
||||||
|
{
|
||||||
|
boolean found = false;
|
||||||
|
SEARCH: for (EnsoulOption soulCrystalOption2 : soulCrystalOptions)
|
||||||
|
{
|
||||||
|
if (soulCrystalOption1.equals(soulCrystalOption2))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break SEARCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
||||||
{
|
{
|
||||||
return _soulCrystalSpecialOptions != null ? _soulCrystalSpecialOptions : Collections.emptyList();
|
return _soulCrystalSpecialOptions != null ? _soulCrystalSpecialOptions : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean soulCrystalSpecialOptionsMatch(EnsoulOption[] soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
if (_soulCrystalSpecialOptions == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnsoulOption soulCrystalSpecialOption1 : _soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
boolean found = false;
|
||||||
|
SEARCH: for (EnsoulOption soulCrystalSpecialOption2 : soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
if (soulCrystalSpecialOption1.equals(soulCrystalSpecialOption2))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break SEARCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public long getVisualExpiration()
|
public long getVisualExpiration()
|
||||||
{
|
{
|
||||||
return _visualExpiration;
|
return _visualExpiration;
|
||||||
|
@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.OptionalLong;
|
|
||||||
|
|
||||||
import org.l2jmobius.commons.network.ReadablePacket;
|
import org.l2jmobius.commons.network.ReadablePacket;
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
@ -207,9 +206,9 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
|| (itemEnchantment.getAttributeDefence(AttributeType.DARK) != _darkDefence)
|
|| (itemEnchantment.getAttributeDefence(AttributeType.DARK) != _darkDefence)
|
||||||
|| ((itemEnchantment.getAugmentation() == null) && ((_augmentOption1 != 0) || (_augmentOption2 != 0)))
|
|| ((itemEnchantment.getAugmentation() == null) && ((_augmentOption1 != 0) || (_augmentOption2 != 0)))
|
||||||
|| ((itemEnchantment.getAugmentation() != null) && ((itemEnchantment.getAugmentation().getOption1Id() != _augmentOption1) || (itemEnchantment.getAugmentation().getOption2Id() != _augmentOption2)))
|
|| ((itemEnchantment.getAugmentation() != null) && ((itemEnchantment.getAugmentation().getOption1Id() != _augmentOption1) || (itemEnchantment.getAugmentation().getOption2Id() != _augmentOption2)))
|
||||||
|| ((_soulCrystalOptions != null) && itemEnchantment.getSoulCrystalOptions().stream().anyMatch(e -> !CommonUtil.contains(_soulCrystalOptions, e)))
|
|| ((_soulCrystalOptions != null) && !itemEnchantment.soulCrystalOptionsMatch(_soulCrystalOptions))
|
||||||
|| ((_soulCrystalOptions == null) && !itemEnchantment.getSoulCrystalOptions().isEmpty())
|
|| ((_soulCrystalOptions == null) && !itemEnchantment.getSoulCrystalOptions().isEmpty())
|
||||||
|| ((_soulCrystalSpecialOptions != null) && itemEnchantment.getSoulCrystalSpecialOptions().stream().anyMatch(e -> !CommonUtil.contains(_soulCrystalSpecialOptions, e)))
|
|| ((_soulCrystalSpecialOptions != null) && !itemEnchantment.soulCrystalSpecialOptionsMatch(_soulCrystalSpecialOptions))
|
||||||
|| ((_soulCrystalSpecialOptions == null) && !itemEnchantment.getSoulCrystalSpecialOptions().isEmpty())
|
|| ((_soulCrystalSpecialOptions == null) && !itemEnchantment.getSoulCrystalSpecialOptions().isEmpty())
|
||||||
))
|
))
|
||||||
//@formatter:on
|
//@formatter:on
|
||||||
@ -616,10 +615,17 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
// Finally, give the tax to the castle.
|
// Finally, give the tax to the castle.
|
||||||
if ((npc != null) && list.isApplyTaxes())
|
if ((npc != null) && list.isApplyTaxes())
|
||||||
{
|
{
|
||||||
final OptionalLong taxPaid = entry.getIngredients().stream().filter(i -> i.getId() == Inventory.ADENA_ID).mapToLong(i -> Math.round(i.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount).reduce(Math::multiplyExact);
|
long taxPaid = 0;
|
||||||
if (taxPaid.isPresent())
|
for (ItemChanceHolder ingredient : entry.getIngredients())
|
||||||
{
|
{
|
||||||
npc.handleTaxPayment(taxPaid.getAsLong());
|
if (ingredient.getId() == Inventory.ADENA_ID)
|
||||||
|
{
|
||||||
|
taxPaid += Math.round(ingredient.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (taxPaid > 0)
|
||||||
|
{
|
||||||
|
npc.handleTaxPayment(taxPaid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -406,11 +406,65 @@ public class ItemInfo
|
|||||||
return _soulCrystalOptions != null ? _soulCrystalOptions : Collections.emptyList();
|
return _soulCrystalOptions != null ? _soulCrystalOptions : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean soulCrystalOptionsMatch(EnsoulOption[] soulCrystalOptions)
|
||||||
|
{
|
||||||
|
if ((_soulCrystalOptions == null))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnsoulOption soulCrystalOption1 : _soulCrystalOptions)
|
||||||
|
{
|
||||||
|
boolean found = false;
|
||||||
|
SEARCH: for (EnsoulOption soulCrystalOption2 : soulCrystalOptions)
|
||||||
|
{
|
||||||
|
if (soulCrystalOption1.equals(soulCrystalOption2))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break SEARCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
||||||
{
|
{
|
||||||
return _soulCrystalSpecialOptions != null ? _soulCrystalSpecialOptions : Collections.emptyList();
|
return _soulCrystalSpecialOptions != null ? _soulCrystalSpecialOptions : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean soulCrystalSpecialOptionsMatch(EnsoulOption[] soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
if (_soulCrystalSpecialOptions == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnsoulOption soulCrystalSpecialOption1 : _soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
boolean found = false;
|
||||||
|
SEARCH: for (EnsoulOption soulCrystalSpecialOption2 : soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
if (soulCrystalSpecialOption1.equals(soulCrystalSpecialOption2))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break SEARCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public long getVisualExpiration()
|
public long getVisualExpiration()
|
||||||
{
|
{
|
||||||
return _visualExpiration;
|
return _visualExpiration;
|
||||||
|
@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.OptionalLong;
|
|
||||||
|
|
||||||
import org.l2jmobius.commons.network.ReadablePacket;
|
import org.l2jmobius.commons.network.ReadablePacket;
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
@ -207,9 +206,9 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
|| (itemEnchantment.getAttributeDefence(AttributeType.DARK) != _darkDefence)
|
|| (itemEnchantment.getAttributeDefence(AttributeType.DARK) != _darkDefence)
|
||||||
|| ((itemEnchantment.getAugmentation() == null) && ((_augmentOption1 != 0) || (_augmentOption2 != 0)))
|
|| ((itemEnchantment.getAugmentation() == null) && ((_augmentOption1 != 0) || (_augmentOption2 != 0)))
|
||||||
|| ((itemEnchantment.getAugmentation() != null) && ((itemEnchantment.getAugmentation().getOption1Id() != _augmentOption1) || (itemEnchantment.getAugmentation().getOption2Id() != _augmentOption2)))
|
|| ((itemEnchantment.getAugmentation() != null) && ((itemEnchantment.getAugmentation().getOption1Id() != _augmentOption1) || (itemEnchantment.getAugmentation().getOption2Id() != _augmentOption2)))
|
||||||
|| ((_soulCrystalOptions != null) && itemEnchantment.getSoulCrystalOptions().stream().anyMatch(e -> !CommonUtil.contains(_soulCrystalOptions, e)))
|
|| ((_soulCrystalOptions != null) && !itemEnchantment.soulCrystalOptionsMatch(_soulCrystalOptions))
|
||||||
|| ((_soulCrystalOptions == null) && !itemEnchantment.getSoulCrystalOptions().isEmpty())
|
|| ((_soulCrystalOptions == null) && !itemEnchantment.getSoulCrystalOptions().isEmpty())
|
||||||
|| ((_soulCrystalSpecialOptions != null) && itemEnchantment.getSoulCrystalSpecialOptions().stream().anyMatch(e -> !CommonUtil.contains(_soulCrystalSpecialOptions, e)))
|
|| ((_soulCrystalSpecialOptions != null) && !itemEnchantment.soulCrystalSpecialOptionsMatch(_soulCrystalSpecialOptions))
|
||||||
|| ((_soulCrystalSpecialOptions == null) && !itemEnchantment.getSoulCrystalSpecialOptions().isEmpty())
|
|| ((_soulCrystalSpecialOptions == null) && !itemEnchantment.getSoulCrystalSpecialOptions().isEmpty())
|
||||||
))
|
))
|
||||||
//@formatter:on
|
//@formatter:on
|
||||||
@ -616,10 +615,17 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
// Finally, give the tax to the castle.
|
// Finally, give the tax to the castle.
|
||||||
if ((npc != null) && list.isApplyTaxes())
|
if ((npc != null) && list.isApplyTaxes())
|
||||||
{
|
{
|
||||||
final OptionalLong taxPaid = entry.getIngredients().stream().filter(i -> i.getId() == Inventory.ADENA_ID).mapToLong(i -> Math.round(i.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount).reduce(Math::multiplyExact);
|
long taxPaid = 0;
|
||||||
if (taxPaid.isPresent())
|
for (ItemChanceHolder ingredient : entry.getIngredients())
|
||||||
{
|
{
|
||||||
npc.handleTaxPayment(taxPaid.getAsLong());
|
if (ingredient.getId() == Inventory.ADENA_ID)
|
||||||
|
{
|
||||||
|
taxPaid += Math.round(ingredient.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (taxPaid > 0)
|
||||||
|
{
|
||||||
|
npc.handleTaxPayment(taxPaid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -406,11 +406,65 @@ public class ItemInfo
|
|||||||
return _soulCrystalOptions != null ? _soulCrystalOptions : Collections.emptyList();
|
return _soulCrystalOptions != null ? _soulCrystalOptions : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean soulCrystalOptionsMatch(EnsoulOption[] soulCrystalOptions)
|
||||||
|
{
|
||||||
|
if ((_soulCrystalOptions == null))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnsoulOption soulCrystalOption1 : _soulCrystalOptions)
|
||||||
|
{
|
||||||
|
boolean found = false;
|
||||||
|
SEARCH: for (EnsoulOption soulCrystalOption2 : soulCrystalOptions)
|
||||||
|
{
|
||||||
|
if (soulCrystalOption1.equals(soulCrystalOption2))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break SEARCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
||||||
{
|
{
|
||||||
return _soulCrystalSpecialOptions != null ? _soulCrystalSpecialOptions : Collections.emptyList();
|
return _soulCrystalSpecialOptions != null ? _soulCrystalSpecialOptions : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean soulCrystalSpecialOptionsMatch(EnsoulOption[] soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
if (_soulCrystalSpecialOptions == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnsoulOption soulCrystalSpecialOption1 : _soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
boolean found = false;
|
||||||
|
SEARCH: for (EnsoulOption soulCrystalSpecialOption2 : soulCrystalSpecialOptions)
|
||||||
|
{
|
||||||
|
if (soulCrystalSpecialOption1.equals(soulCrystalSpecialOption2))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break SEARCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public long getVisualExpiration()
|
public long getVisualExpiration()
|
||||||
{
|
{
|
||||||
return _visualExpiration;
|
return _visualExpiration;
|
||||||
|
@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.OptionalLong;
|
|
||||||
|
|
||||||
import org.l2jmobius.commons.network.ReadablePacket;
|
import org.l2jmobius.commons.network.ReadablePacket;
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
@ -207,9 +206,9 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
|| (itemEnchantment.getAttributeDefence(AttributeType.DARK) != _darkDefence)
|
|| (itemEnchantment.getAttributeDefence(AttributeType.DARK) != _darkDefence)
|
||||||
|| ((itemEnchantment.getAugmentation() == null) && ((_augmentOption1 != 0) || (_augmentOption2 != 0)))
|
|| ((itemEnchantment.getAugmentation() == null) && ((_augmentOption1 != 0) || (_augmentOption2 != 0)))
|
||||||
|| ((itemEnchantment.getAugmentation() != null) && ((itemEnchantment.getAugmentation().getOption1Id() != _augmentOption1) || (itemEnchantment.getAugmentation().getOption2Id() != _augmentOption2)))
|
|| ((itemEnchantment.getAugmentation() != null) && ((itemEnchantment.getAugmentation().getOption1Id() != _augmentOption1) || (itemEnchantment.getAugmentation().getOption2Id() != _augmentOption2)))
|
||||||
|| ((_soulCrystalOptions != null) && itemEnchantment.getSoulCrystalOptions().stream().anyMatch(e -> !CommonUtil.contains(_soulCrystalOptions, e)))
|
|| ((_soulCrystalOptions != null) && !itemEnchantment.soulCrystalOptionsMatch(_soulCrystalOptions))
|
||||||
|| ((_soulCrystalOptions == null) && !itemEnchantment.getSoulCrystalOptions().isEmpty())
|
|| ((_soulCrystalOptions == null) && !itemEnchantment.getSoulCrystalOptions().isEmpty())
|
||||||
|| ((_soulCrystalSpecialOptions != null) && itemEnchantment.getSoulCrystalSpecialOptions().stream().anyMatch(e -> !CommonUtil.contains(_soulCrystalSpecialOptions, e)))
|
|| ((_soulCrystalSpecialOptions != null) && !itemEnchantment.soulCrystalSpecialOptionsMatch(_soulCrystalSpecialOptions))
|
||||||
|| ((_soulCrystalSpecialOptions == null) && !itemEnchantment.getSoulCrystalSpecialOptions().isEmpty())
|
|| ((_soulCrystalSpecialOptions == null) && !itemEnchantment.getSoulCrystalSpecialOptions().isEmpty())
|
||||||
))
|
))
|
||||||
//@formatter:on
|
//@formatter:on
|
||||||
@ -616,10 +615,17 @@ public class MultiSellChoose implements ClientPacket
|
|||||||
// Finally, give the tax to the castle.
|
// Finally, give the tax to the castle.
|
||||||
if ((npc != null) && list.isApplyTaxes())
|
if ((npc != null) && list.isApplyTaxes())
|
||||||
{
|
{
|
||||||
final OptionalLong taxPaid = entry.getIngredients().stream().filter(i -> i.getId() == Inventory.ADENA_ID).mapToLong(i -> Math.round(i.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount).reduce(Math::multiplyExact);
|
long taxPaid = 0;
|
||||||
if (taxPaid.isPresent())
|
for (ItemChanceHolder ingredient : entry.getIngredients())
|
||||||
{
|
{
|
||||||
npc.handleTaxPayment(taxPaid.getAsLong());
|
if (ingredient.getId() == Inventory.ADENA_ID)
|
||||||
|
{
|
||||||
|
taxPaid += Math.round(ingredient.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (taxPaid > 0)
|
||||||
|
{
|
||||||
|
npc.handleTaxPayment(taxPaid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user