Fixed private store list buy.
This commit is contained in:
@@ -33,8 +33,8 @@ public class TradeItem
|
||||
private long _count;
|
||||
private long _storeCount;
|
||||
private long _price;
|
||||
private final byte _elemAtkType;
|
||||
private final int _elemAtkPower;
|
||||
private byte _elemAtkType;
|
||||
private int _elemAtkPower;
|
||||
private final int[] _elemDefAttr =
|
||||
{
|
||||
0,
|
||||
@@ -88,7 +88,7 @@ public class TradeItem
|
||||
_count = count;
|
||||
_storeCount = count;
|
||||
_price = price;
|
||||
_elemAtkType = Elementals.NONE;
|
||||
_elemAtkType = AttributeType.NONE.getClientId();
|
||||
_elemAtkPower = 0;
|
||||
_enchantOptions = L2ItemInstance.DEFAULT_ENCHANT_OPTIONS;
|
||||
}
|
||||
@@ -180,16 +180,31 @@ public class TradeItem
|
||||
return _price;
|
||||
}
|
||||
|
||||
public void setAttackElementType(AttributeType attackElement)
|
||||
{
|
||||
_elemAtkType = attackElement.getClientId();
|
||||
}
|
||||
|
||||
public byte getAttackElementType()
|
||||
{
|
||||
return _elemAtkType;
|
||||
}
|
||||
|
||||
public void setAttackElementPower(int attackElementPower)
|
||||
{
|
||||
_elemAtkPower = attackElementPower;
|
||||
}
|
||||
|
||||
public int getAttackElementPower()
|
||||
{
|
||||
return _elemAtkPower;
|
||||
}
|
||||
|
||||
public void setElementDefAttr(AttributeType element, int value)
|
||||
{
|
||||
_elemDefAttr[element.getClientId()] = value;
|
||||
}
|
||||
|
||||
public int getElementDefAttr(byte i)
|
||||
{
|
||||
return _elemDefAttr[i];
|
||||
@@ -216,6 +231,11 @@ public class TradeItem
|
||||
return _augmentationOption2;
|
||||
}
|
||||
|
||||
public void setVisualId(int visualItemId)
|
||||
{
|
||||
_visualId = visualItemId;
|
||||
}
|
||||
|
||||
public int getVisualId()
|
||||
{
|
||||
return _visualId;
|
||||
|
@@ -20,9 +20,13 @@ import static com.l2jmobius.gameserver.model.itemcontainer.Inventory.MAX_ADENA;
|
||||
|
||||
import com.l2jmobius.Config;
|
||||
import com.l2jmobius.commons.network.PacketReader;
|
||||
import com.l2jmobius.gameserver.datatables.ItemTable;
|
||||
import com.l2jmobius.gameserver.enums.AttributeType;
|
||||
import com.l2jmobius.gameserver.enums.PrivateStoreType;
|
||||
import com.l2jmobius.gameserver.model.TradeItem;
|
||||
import com.l2jmobius.gameserver.model.TradeList;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.items.L2Item;
|
||||
import com.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import com.l2jmobius.gameserver.network.L2GameClient;
|
||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
@@ -32,47 +36,65 @@ import com.l2jmobius.gameserver.network.serverpackets.PrivateStoreMsgBuy;
|
||||
import com.l2jmobius.gameserver.taskmanager.AttackStanceTaskManager;
|
||||
import com.l2jmobius.gameserver.util.Util;
|
||||
|
||||
/**
|
||||
* This class ...
|
||||
* @version $Revision: 1.2.2.1.2.5 $ $Date: 2005/03/27 15:29:30 $ CPU Disasm Packets: ddhhQQ cddb
|
||||
*/
|
||||
public final class SetPrivateStoreListBuy implements IClientIncomingPacket
|
||||
{
|
||||
private static final int BATCH_LENGTH = 44; // length of the one item
|
||||
|
||||
private Item[] _items = null;
|
||||
private TradeItem[] _items = null;
|
||||
|
||||
@Override
|
||||
public boolean read(L2GameClient client, PacketReader packet)
|
||||
{
|
||||
final int count = packet.readD();
|
||||
if ((count < 1) || (count > Config.MAX_ITEM_IN_PACKET) || ((count * BATCH_LENGTH) != packet.getReadableBytes()))
|
||||
if ((count < 1) || (count > Config.MAX_ITEM_IN_PACKET))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
_items = new Item[count];
|
||||
_items = new TradeItem[count];
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
final int itemId = packet.readD();
|
||||
int itemId = packet.readD();
|
||||
|
||||
packet.readH(); // TODO analyse this
|
||||
final L2Item template = ItemTable.getInstance().getTemplate(itemId);
|
||||
if (template == null)
|
||||
{
|
||||
_items = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
final int enchantLevel = packet.readH();
|
||||
packet.readH(); // TODO analyse this
|
||||
|
||||
final long cnt = packet.readQ();
|
||||
final long price = packet.readQ();
|
||||
long cnt = packet.readQ();
|
||||
long price = packet.readQ();
|
||||
|
||||
if ((itemId < 1) || (cnt < 1) || (price < 0))
|
||||
{
|
||||
_items = null;
|
||||
return false;
|
||||
}
|
||||
packet.readD(); // Unk
|
||||
packet.readD(); // Unk
|
||||
packet.readD(); // Unk
|
||||
packet.readD(); // Unk
|
||||
|
||||
_items[i] = new Item(itemId, cnt, price);
|
||||
final short attackAttributeId = (short) packet.readH();
|
||||
final int attackAttributeValue = packet.readH();
|
||||
final int defenceFire = packet.readH();
|
||||
final int defenceWater = packet.readH();
|
||||
final int defenceWind = packet.readH();
|
||||
final int defenceEarth = packet.readH();
|
||||
final int defenceHoly = packet.readH();
|
||||
final int defenceDark = packet.readH();
|
||||
final int visualId = packet.readD();
|
||||
|
||||
final TradeItem item = new TradeItem(template, cnt, price);
|
||||
item.setEnchant(enchantLevel);
|
||||
item.setAttackElementType(AttributeType.findByClientId(attackAttributeId));
|
||||
item.setAttackElementPower(attackAttributeValue);
|
||||
item.setElementDefAttr(AttributeType.FIRE, defenceFire);
|
||||
item.setElementDefAttr(AttributeType.WATER, defenceWater);
|
||||
item.setElementDefAttr(AttributeType.WIND, defenceWind);
|
||||
item.setElementDefAttr(AttributeType.EARTH, defenceEarth);
|
||||
item.setElementDefAttr(AttributeType.HOLY, defenceHoly);
|
||||
item.setElementDefAttr(AttributeType.DARK, defenceDark);
|
||||
item.setVisualId(visualId);
|
||||
_items[i] = item;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -115,7 +137,7 @@ public final class SetPrivateStoreListBuy implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
final TradeList tradeList = player.getBuyList();
|
||||
TradeList tradeList = player.getBuyList();
|
||||
tradeList.clear();
|
||||
|
||||
// Check maximum number of allowed slots for pvt shops
|
||||
@@ -127,15 +149,17 @@ public final class SetPrivateStoreListBuy implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
long totalCost = 0;
|
||||
for (Item i : _items)
|
||||
for (TradeItem i : _items)
|
||||
{
|
||||
if (!i.addToTradeList(tradeList))
|
||||
if ((MAX_ADENA / i.getCount()) < i.getPrice())
|
||||
{
|
||||
Util.handleIllegalPlayerAction(player, "Warning!! Character " + player.getName() + " of account " + player.getAccountName() + " tried to set price more than " + MAX_ADENA + " adena in Private Store - Buy.", Config.DEFAULT_PUNISH);
|
||||
return;
|
||||
}
|
||||
|
||||
totalCost += i.getCost();
|
||||
tradeList.addItemByItemId(i.getItem().getId(), i.getCount(), i.getPrice());
|
||||
|
||||
totalCost += (i.getCount() * i.getPrice());
|
||||
if (totalCost > MAX_ADENA)
|
||||
{
|
||||
Util.handleIllegalPlayerAction(player, "Warning!! Character " + player.getName() + " of account " + player.getAccountName() + " tried to set total price more than " + MAX_ADENA + " adena in Private Store - Buy.", Config.DEFAULT_PUNISH);
|
||||
@@ -156,34 +180,4 @@ public final class SetPrivateStoreListBuy implements IClientIncomingPacket
|
||||
player.broadcastUserInfo();
|
||||
player.broadcastPacket(new PrivateStoreMsgBuy(player));
|
||||
}
|
||||
|
||||
private static class Item
|
||||
{
|
||||
private final int _itemId;
|
||||
private final long _count;
|
||||
private final long _price;
|
||||
|
||||
public Item(int id, long num, long pri)
|
||||
{
|
||||
_itemId = id;
|
||||
_count = num;
|
||||
_price = pri;
|
||||
}
|
||||
|
||||
public boolean addToTradeList(TradeList list)
|
||||
{
|
||||
if ((MAX_ADENA / _count) < _price)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
list.addItemByItemId(_itemId, _count, _price);
|
||||
return true;
|
||||
}
|
||||
|
||||
public long getCost()
|
||||
{
|
||||
return _count * _price;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -36,8 +36,8 @@ public class TradeItem
|
||||
private long _count;
|
||||
private long _storeCount;
|
||||
private long _price;
|
||||
private final byte _elemAtkType;
|
||||
private final int _elemAtkPower;
|
||||
private byte _elemAtkType;
|
||||
private int _elemAtkPower;
|
||||
private final int[] _elemDefAttr =
|
||||
{
|
||||
0,
|
||||
@@ -48,8 +48,8 @@ public class TradeItem
|
||||
0
|
||||
};
|
||||
private final int[] _enchantOptions;
|
||||
private final Collection<EnsoulOption> _soulCrystalOptions;
|
||||
private final Collection<EnsoulOption> _soulCrystalSpecialOptions;
|
||||
private Collection<EnsoulOption> _soulCrystalOptions;
|
||||
private Collection<EnsoulOption> _soulCrystalSpecialOptions;
|
||||
private int _visualId;
|
||||
private int _augmentationOption1 = -1;
|
||||
private int _augmentationOption2 = -1;
|
||||
@@ -95,7 +95,7 @@ public class TradeItem
|
||||
_count = count;
|
||||
_storeCount = count;
|
||||
_price = price;
|
||||
_elemAtkType = Elementals.NONE;
|
||||
_elemAtkType = AttributeType.NONE.getClientId();
|
||||
_elemAtkPower = 0;
|
||||
_enchantOptions = L2ItemInstance.DEFAULT_ENCHANT_OPTIONS;
|
||||
_soulCrystalOptions = Collections.emptyList();
|
||||
@@ -191,16 +191,31 @@ public class TradeItem
|
||||
return _price;
|
||||
}
|
||||
|
||||
public void setAttackElementType(AttributeType attackElement)
|
||||
{
|
||||
_elemAtkType = attackElement.getClientId();
|
||||
}
|
||||
|
||||
public byte getAttackElementType()
|
||||
{
|
||||
return _elemAtkType;
|
||||
}
|
||||
|
||||
public void setAttackElementPower(int attackElementPower)
|
||||
{
|
||||
_elemAtkPower = attackElementPower;
|
||||
}
|
||||
|
||||
public int getAttackElementPower()
|
||||
{
|
||||
return _elemAtkPower;
|
||||
}
|
||||
|
||||
public void setElementDefAttr(AttributeType element, int value)
|
||||
{
|
||||
_elemDefAttr[element.getClientId()] = value;
|
||||
}
|
||||
|
||||
public int getElementDefAttr(byte i)
|
||||
{
|
||||
return _elemDefAttr[i];
|
||||
@@ -211,14 +226,24 @@ public class TradeItem
|
||||
return _enchantOptions;
|
||||
}
|
||||
|
||||
public void setSoulCrystalOptions(Collection<EnsoulOption> soulCrystalOptions)
|
||||
{
|
||||
_soulCrystalOptions = soulCrystalOptions;
|
||||
}
|
||||
|
||||
public Collection<EnsoulOption> getSoulCrystalOptions()
|
||||
{
|
||||
return _soulCrystalOptions;
|
||||
return _soulCrystalOptions == null ? Collections.emptyList() : _soulCrystalOptions;
|
||||
}
|
||||
|
||||
public void setSoulCrystalSpecialOptions(Collection<EnsoulOption> soulCrystalSpecialOptions)
|
||||
{
|
||||
_soulCrystalSpecialOptions = soulCrystalSpecialOptions;
|
||||
}
|
||||
|
||||
public Collection<EnsoulOption> getSoulCrystalSpecialOptions()
|
||||
{
|
||||
return _soulCrystalSpecialOptions;
|
||||
return _soulCrystalSpecialOptions == null ? Collections.emptyList() : _soulCrystalSpecialOptions;
|
||||
}
|
||||
|
||||
public void setAugmentation(int option1, int option2)
|
||||
@@ -237,6 +262,11 @@ public class TradeItem
|
||||
return _augmentationOption2;
|
||||
}
|
||||
|
||||
public void setVisualId(int visualItemId)
|
||||
{
|
||||
_visualId = visualItemId;
|
||||
}
|
||||
|
||||
public int getVisualId()
|
||||
{
|
||||
return _visualId;
|
||||
|
@@ -18,11 +18,19 @@ package com.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import static com.l2jmobius.gameserver.model.itemcontainer.Inventory.MAX_ADENA;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import com.l2jmobius.Config;
|
||||
import com.l2jmobius.commons.network.PacketReader;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.EnsoulData;
|
||||
import com.l2jmobius.gameserver.datatables.ItemTable;
|
||||
import com.l2jmobius.gameserver.enums.AttributeType;
|
||||
import com.l2jmobius.gameserver.enums.PrivateStoreType;
|
||||
import com.l2jmobius.gameserver.model.TradeItem;
|
||||
import com.l2jmobius.gameserver.model.TradeList;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.ensoul.EnsoulOption;
|
||||
import com.l2jmobius.gameserver.model.items.L2Item;
|
||||
import com.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import com.l2jmobius.gameserver.network.L2GameClient;
|
||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
@@ -32,47 +40,78 @@ import com.l2jmobius.gameserver.network.serverpackets.PrivateStoreMsgBuy;
|
||||
import com.l2jmobius.gameserver.taskmanager.AttackStanceTaskManager;
|
||||
import com.l2jmobius.gameserver.util.Util;
|
||||
|
||||
/**
|
||||
* This class ...
|
||||
* @version $Revision: 1.2.2.1.2.5 $ $Date: 2005/03/27 15:29:30 $ CPU Disasm Packets: ddhhQQ cddb
|
||||
*/
|
||||
public final class SetPrivateStoreListBuy implements IClientIncomingPacket
|
||||
{
|
||||
private static final int BATCH_LENGTH = 44; // length of the one item
|
||||
|
||||
private Item[] _items = null;
|
||||
private TradeItem[] _items = null;
|
||||
|
||||
@Override
|
||||
public boolean read(L2GameClient client, PacketReader packet)
|
||||
{
|
||||
final int count = packet.readD();
|
||||
if ((count < 1) || (count > Config.MAX_ITEM_IN_PACKET) || ((count * BATCH_LENGTH) != packet.getReadableBytes()))
|
||||
if ((count < 1) || (count > Config.MAX_ITEM_IN_PACKET))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
_items = new Item[count];
|
||||
_items = new TradeItem[count];
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
final int itemId = packet.readD();
|
||||
int itemId = packet.readD();
|
||||
|
||||
packet.readH(); // TODO analyse this
|
||||
final L2Item template = ItemTable.getInstance().getTemplate(itemId);
|
||||
if (template == null)
|
||||
{
|
||||
_items = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
final int enchantLevel = packet.readH();
|
||||
packet.readH(); // TODO analyse this
|
||||
|
||||
final long cnt = packet.readQ();
|
||||
final long price = packet.readQ();
|
||||
long cnt = packet.readQ();
|
||||
long price = packet.readQ();
|
||||
|
||||
if ((itemId < 1) || (cnt < 1) || (price < 0))
|
||||
{
|
||||
_items = null;
|
||||
return false;
|
||||
}
|
||||
packet.readD(); // Unk
|
||||
packet.readD(); // Unk
|
||||
packet.readD(); // Unk
|
||||
packet.readD(); // Unk
|
||||
|
||||
_items[i] = new Item(itemId, cnt, price);
|
||||
final short attackAttributeId = (short) packet.readH();
|
||||
final int attackAttributeValue = packet.readH();
|
||||
final int defenceFire = packet.readH();
|
||||
final int defenceWater = packet.readH();
|
||||
final int defenceWind = packet.readH();
|
||||
final int defenceEarth = packet.readH();
|
||||
final int defenceHoly = packet.readH();
|
||||
final int defenceDark = packet.readH();
|
||||
final int visualId = packet.readD();
|
||||
|
||||
final EnsoulOption[] soulCrystalOptions = new EnsoulOption[packet.readC()];
|
||||
for (int k = 0; k < soulCrystalOptions.length; k++)
|
||||
{
|
||||
soulCrystalOptions[k] = EnsoulData.getInstance().getOption(packet.readD());
|
||||
}
|
||||
final EnsoulOption[] soulCrystalSpecialOptions = new EnsoulOption[packet.readC()];
|
||||
for (int k = 0; k < soulCrystalSpecialOptions.length; k++)
|
||||
{
|
||||
soulCrystalSpecialOptions[k] = EnsoulData.getInstance().getOption(packet.readD());
|
||||
}
|
||||
|
||||
final TradeItem item = new TradeItem(template, cnt, price);
|
||||
item.setEnchant(enchantLevel);
|
||||
item.setAttackElementType(AttributeType.findByClientId(attackAttributeId));
|
||||
item.setAttackElementPower(attackAttributeValue);
|
||||
item.setElementDefAttr(AttributeType.FIRE, defenceFire);
|
||||
item.setElementDefAttr(AttributeType.WATER, defenceWater);
|
||||
item.setElementDefAttr(AttributeType.WIND, defenceWind);
|
||||
item.setElementDefAttr(AttributeType.EARTH, defenceEarth);
|
||||
item.setElementDefAttr(AttributeType.HOLY, defenceHoly);
|
||||
item.setElementDefAttr(AttributeType.DARK, defenceDark);
|
||||
item.setVisualId(visualId);
|
||||
item.setSoulCrystalOptions(Arrays.asList(soulCrystalOptions));
|
||||
item.setSoulCrystalSpecialOptions(Arrays.asList(soulCrystalSpecialOptions));
|
||||
_items[i] = item;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -115,7 +154,7 @@ public final class SetPrivateStoreListBuy implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
final TradeList tradeList = player.getBuyList();
|
||||
TradeList tradeList = player.getBuyList();
|
||||
tradeList.clear();
|
||||
|
||||
// Check maximum number of allowed slots for pvt shops
|
||||
@@ -127,15 +166,17 @@ public final class SetPrivateStoreListBuy implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
long totalCost = 0;
|
||||
for (Item i : _items)
|
||||
for (TradeItem i : _items)
|
||||
{
|
||||
if (!i.addToTradeList(tradeList))
|
||||
if ((MAX_ADENA / i.getCount()) < i.getPrice())
|
||||
{
|
||||
Util.handleIllegalPlayerAction(player, "Warning!! Character " + player.getName() + " of account " + player.getAccountName() + " tried to set price more than " + MAX_ADENA + " adena in Private Store - Buy.", Config.DEFAULT_PUNISH);
|
||||
return;
|
||||
}
|
||||
|
||||
totalCost += i.getCost();
|
||||
tradeList.addItemByItemId(i.getItem().getId(), i.getCount(), i.getPrice());
|
||||
|
||||
totalCost += (i.getCount() * i.getPrice());
|
||||
if (totalCost > MAX_ADENA)
|
||||
{
|
||||
Util.handleIllegalPlayerAction(player, "Warning!! Character " + player.getName() + " of account " + player.getAccountName() + " tried to set total price more than " + MAX_ADENA + " adena in Private Store - Buy.", Config.DEFAULT_PUNISH);
|
||||
@@ -156,34 +197,4 @@ public final class SetPrivateStoreListBuy implements IClientIncomingPacket
|
||||
player.broadcastUserInfo();
|
||||
player.broadcastPacket(new PrivateStoreMsgBuy(player));
|
||||
}
|
||||
|
||||
private static class Item
|
||||
{
|
||||
private final int _itemId;
|
||||
private final long _count;
|
||||
private final long _price;
|
||||
|
||||
public Item(int id, long num, long pri)
|
||||
{
|
||||
_itemId = id;
|
||||
_count = num;
|
||||
_price = pri;
|
||||
}
|
||||
|
||||
public boolean addToTradeList(TradeList list)
|
||||
{
|
||||
if ((MAX_ADENA / _count) < _price)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
list.addItemByItemId(_itemId, _count, _price);
|
||||
return true;
|
||||
}
|
||||
|
||||
public long getCost()
|
||||
{
|
||||
return _count * _price;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -18,14 +18,18 @@ package com.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import static com.l2jmobius.gameserver.model.itemcontainer.Inventory.MAX_ADENA;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import com.l2jmobius.Config;
|
||||
import com.l2jmobius.commons.network.PacketReader;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.EnsoulData;
|
||||
import com.l2jmobius.gameserver.datatables.ItemTable;
|
||||
import com.l2jmobius.gameserver.enums.AttributeType;
|
||||
import com.l2jmobius.gameserver.enums.PrivateStoreType;
|
||||
import com.l2jmobius.gameserver.model.TradeItem;
|
||||
import com.l2jmobius.gameserver.model.TradeList;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.ensoul.EnsoulOption;
|
||||
import com.l2jmobius.gameserver.model.items.L2Item;
|
||||
import com.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import com.l2jmobius.gameserver.network.L2GameClient;
|
||||
@@ -83,6 +87,18 @@ public final class SetPrivateStoreListBuy implements IClientIncomingPacket
|
||||
final int defenceEarth = packet.readH();
|
||||
final int defenceHoly = packet.readH();
|
||||
final int defenceDark = packet.readH();
|
||||
final int visualId = packet.readD();
|
||||
|
||||
final EnsoulOption[] soulCrystalOptions = new EnsoulOption[packet.readC()];
|
||||
for (int k = 0; k < soulCrystalOptions.length; k++)
|
||||
{
|
||||
soulCrystalOptions[k] = EnsoulData.getInstance().getOption(packet.readD());
|
||||
}
|
||||
final EnsoulOption[] soulCrystalSpecialOptions = new EnsoulOption[packet.readC()];
|
||||
for (int k = 0; k < soulCrystalSpecialOptions.length; k++)
|
||||
{
|
||||
soulCrystalSpecialOptions[k] = EnsoulData.getInstance().getOption(packet.readD());
|
||||
}
|
||||
|
||||
final TradeItem item = new TradeItem(template, cnt, price);
|
||||
item.setEnchant(enchantLevel);
|
||||
@@ -95,6 +111,9 @@ public final class SetPrivateStoreListBuy implements IClientIncomingPacket
|
||||
item.setElementDefAttr(AttributeType.EARTH, defenceEarth);
|
||||
item.setElementDefAttr(AttributeType.HOLY, defenceHoly);
|
||||
item.setElementDefAttr(AttributeType.DARK, defenceDark);
|
||||
item.setVisualId(visualId);
|
||||
item.setSoulCrystalOptions(Arrays.asList(soulCrystalOptions));
|
||||
item.setSoulCrystalSpecialOptions(Arrays.asList(soulCrystalSpecialOptions));
|
||||
_items[i] = item;
|
||||
}
|
||||
return true;
|
||||
|
@@ -18,14 +18,18 @@ package com.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import static com.l2jmobius.gameserver.model.itemcontainer.Inventory.MAX_ADENA;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import com.l2jmobius.Config;
|
||||
import com.l2jmobius.commons.network.PacketReader;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.EnsoulData;
|
||||
import com.l2jmobius.gameserver.datatables.ItemTable;
|
||||
import com.l2jmobius.gameserver.enums.AttributeType;
|
||||
import com.l2jmobius.gameserver.enums.PrivateStoreType;
|
||||
import com.l2jmobius.gameserver.model.TradeItem;
|
||||
import com.l2jmobius.gameserver.model.TradeList;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.ensoul.EnsoulOption;
|
||||
import com.l2jmobius.gameserver.model.items.L2Item;
|
||||
import com.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import com.l2jmobius.gameserver.network.L2GameClient;
|
||||
@@ -83,6 +87,18 @@ public final class SetPrivateStoreListBuy implements IClientIncomingPacket
|
||||
final int defenceEarth = packet.readH();
|
||||
final int defenceHoly = packet.readH();
|
||||
final int defenceDark = packet.readH();
|
||||
final int visualId = packet.readD();
|
||||
|
||||
final EnsoulOption[] soulCrystalOptions = new EnsoulOption[packet.readC()];
|
||||
for (int k = 0; k < soulCrystalOptions.length; k++)
|
||||
{
|
||||
soulCrystalOptions[k] = EnsoulData.getInstance().getOption(packet.readD());
|
||||
}
|
||||
final EnsoulOption[] soulCrystalSpecialOptions = new EnsoulOption[packet.readC()];
|
||||
for (int k = 0; k < soulCrystalSpecialOptions.length; k++)
|
||||
{
|
||||
soulCrystalSpecialOptions[k] = EnsoulData.getInstance().getOption(packet.readD());
|
||||
}
|
||||
|
||||
final TradeItem item = new TradeItem(template, cnt, price);
|
||||
item.setEnchant(enchantLevel);
|
||||
@@ -95,6 +111,9 @@ public final class SetPrivateStoreListBuy implements IClientIncomingPacket
|
||||
item.setElementDefAttr(AttributeType.EARTH, defenceEarth);
|
||||
item.setElementDefAttr(AttributeType.HOLY, defenceHoly);
|
||||
item.setElementDefAttr(AttributeType.DARK, defenceDark);
|
||||
item.setVisualId(visualId);
|
||||
item.setSoulCrystalOptions(Arrays.asList(soulCrystalOptions));
|
||||
item.setSoulCrystalSpecialOptions(Arrays.asList(soulCrystalSpecialOptions));
|
||||
_items[i] = item;
|
||||
}
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user