Added missing multisell part for previous commit.
This commit is contained in:
@@ -96,7 +96,7 @@ public final class MultisellData implements IGameXmlReader
|
||||
if ("list".equalsIgnoreCase(n.getNodeName()))
|
||||
{
|
||||
list.setApplyTaxes(parseBoolean(n.getAttributes(), "applyTaxes", false));
|
||||
list.setNewMultisell(parseBoolean(n.getAttributes(), "isNewMultisell", false));
|
||||
list.setIsChanceMultisell(parseBoolean(n.getAttributes(), "isChanceMultisell", false));
|
||||
list.setMaintainEnchantment(parseBoolean(n.getAttributes(), "maintainEnchantment", false));
|
||||
|
||||
att = n.getAttributes().getNamedItem("useRate");
|
||||
|
@@ -35,14 +35,14 @@ public class Ingredient
|
||||
private boolean _maintainIngredient;
|
||||
private L2Item _template = null;
|
||||
private ItemInfo _itemInfo = null;
|
||||
private final int _chance;
|
||||
private final double _chance;
|
||||
|
||||
public Ingredient(StatsSet set)
|
||||
{
|
||||
this(set.getInt("id"), set.getLong("count"), set.getInt("enchantmentLevel", 0), set.getInt("chance", 0), set.getBoolean("isTaxIngredient", false), set.getBoolean("maintainIngredient", false));
|
||||
this(set.getInt("id"), set.getLong("count"), set.getInt("enchantmentLevel", 0), set.getDouble("chance", 0), set.getBoolean("isTaxIngredient", false), set.getBoolean("maintainIngredient", false));
|
||||
}
|
||||
|
||||
public Ingredient(int itemId, long itemCount, int enchantmentLevel, int chance, boolean isTaxIngredient, boolean maintainIngredient)
|
||||
public Ingredient(int itemId, long itemCount, int enchantmentLevel, double chance, boolean isTaxIngredient, boolean maintainIngredient)
|
||||
{
|
||||
_itemId = itemId;
|
||||
_itemCount = itemCount;
|
||||
@@ -109,7 +109,7 @@ public class Ingredient
|
||||
return _itemCount;
|
||||
}
|
||||
|
||||
public int getChance()
|
||||
public double getChance()
|
||||
{
|
||||
return _chance;
|
||||
}
|
||||
|
@@ -27,7 +27,7 @@ import java.util.Set;
|
||||
public class ListContainer
|
||||
{
|
||||
private final int _listId;
|
||||
private boolean _isNewMultisell;
|
||||
private boolean _isChanceMultisell;
|
||||
private boolean _applyTaxes = false;
|
||||
private boolean _maintainEnchantment = false;
|
||||
private double _useRate = 1.0;
|
||||
@@ -43,7 +43,7 @@ public class ListContainer
|
||||
public ListContainer(ListContainer container)
|
||||
{
|
||||
_listId = container.getListId();
|
||||
_isNewMultisell = container.isNewMultisell();
|
||||
_isChanceMultisell = container.isChanceMultisell();
|
||||
_maintainEnchantment = container.getMaintainEnchantment();
|
||||
}
|
||||
|
||||
@@ -57,14 +57,14 @@ public class ListContainer
|
||||
return _listId;
|
||||
}
|
||||
|
||||
public boolean isNewMultisell()
|
||||
public boolean isChanceMultisell()
|
||||
{
|
||||
return _isNewMultisell;
|
||||
return _isChanceMultisell;
|
||||
}
|
||||
|
||||
public void setNewMultisell(boolean val)
|
||||
public void setIsChanceMultisell(boolean val)
|
||||
{
|
||||
_isNewMultisell = val;
|
||||
_isChanceMultisell = val;
|
||||
}
|
||||
|
||||
public final void setApplyTaxes(boolean applyTaxes)
|
||||
|
@@ -368,7 +368,7 @@ public class MultiSellChoose implements IClientIncomingPacket
|
||||
// Generate the appropriate items
|
||||
for (Ingredient e : entry.getProducts())
|
||||
{
|
||||
if (list.isNewMultisell())
|
||||
if (list.isChanceMultisell())
|
||||
{
|
||||
// Skip first entry.
|
||||
if (e.getChance() < 1)
|
||||
|
@@ -59,7 +59,7 @@ public final class MultiSellList implements IClientOutgoingPacket
|
||||
packet.writeD(_finished ? 0x01 : 0x00); // finished
|
||||
packet.writeD(PAGE_SIZE); // size of pages
|
||||
packet.writeD(_size); // list length
|
||||
packet.writeC(_list.isNewMultisell() ? 0x01 : 0x00); // new multisell window
|
||||
packet.writeC(_list.isChanceMultisell() ? 0x01 : 0x00); // new multisell window
|
||||
|
||||
Entry ent;
|
||||
while (_size-- > 0)
|
||||
@@ -100,7 +100,7 @@ public final class MultiSellList implements IClientOutgoingPacket
|
||||
{
|
||||
final ItemInfo item = ing.getItemInfo();
|
||||
packet.writeH(item.getEnchantLevel()); // enchant level
|
||||
packet.writeD(_list.isNewMultisell() ? ing.getChance() : item.getAugmentId()); // augment id
|
||||
packet.writeD((int) (_list.isChanceMultisell() ? ing.getChance() : item.getAugmentId())); // augment id
|
||||
packet.writeD(0x00); // mana
|
||||
packet.writeD(0x00); // time ?
|
||||
packet.writeH(item.getElementId()); // attack element
|
||||
@@ -115,7 +115,7 @@ public final class MultiSellList implements IClientOutgoingPacket
|
||||
else
|
||||
{
|
||||
packet.writeH(ing.getEnchantLevel()); // enchant level
|
||||
packet.writeD(ing.getChance()); // augment id
|
||||
packet.writeD((int) ing.getChance()); // augment id
|
||||
packet.writeD(0x00); // mana
|
||||
packet.writeD(0x00); // time ?
|
||||
packet.writeH(0x00); // attack element
|
||||
@@ -138,7 +138,7 @@ public final class MultiSellList implements IClientOutgoingPacket
|
||||
{
|
||||
final ItemInfo item = ing.getItemInfo();
|
||||
packet.writeH(item.getEnchantLevel()); // enchant level
|
||||
packet.writeD(_list.isNewMultisell() ? ing.getChance() : item.getAugmentId()); // augment id
|
||||
packet.writeD((int) (_list.isChanceMultisell() ? ing.getChance() : item.getAugmentId())); // augment id
|
||||
packet.writeD(0x00); // mana
|
||||
packet.writeH(item.getElementId()); // attack element
|
||||
packet.writeH(item.getElementPower()); // element power
|
||||
@@ -151,7 +151,7 @@ public final class MultiSellList implements IClientOutgoingPacket
|
||||
else
|
||||
{
|
||||
packet.writeH(ing.getEnchantLevel()); // enchant level
|
||||
packet.writeD(ing.getChance()); // augment id
|
||||
packet.writeD((int) ing.getChance()); // augment id
|
||||
packet.writeD(0x00); // mana
|
||||
packet.writeH(0x00); // attack element
|
||||
packet.writeH(0x00); // element power
|
||||
|
Reference in New Issue
Block a user