}
if (player.isTradeDisabled())
{
player.sendMessage("Trade are disable here. Try in another place.");
player.sendPacket(new PrivateStoreManageListSell(player));
player.sendPacket(ActionFailed.STATIC_PACKET);
return;
}
if (player.isCastingNow() || player.isCastingPotionNow() || player.isMovementDisabled() || player.inObserverMode() || player.getActiveEnchantItem() != null)
{
player.sendMessage("You cannot start store now..");
player.sendPacket(new PrivateStoreManageListSell(player));
player.sendPacket(ActionFailed.STATIC_PACKET);
return;
}
if (player.isInsideZone(L2Character.ZONE_NOSTORE))
{
player.sendPacket(new PrivateStoreManageListSell(player));
player.sendMessage("Trade are disable here. Try in another place.");
player.sendPacket(ActionFailed.STATIC_PACKET);
return;
}
TradeList tradeList = player.getSellList();
tradeList.clear();
tradeList.setPackaged(_packageSale);
long totalCost = player.getAdena();
for (int i = 0; i < _count; i++)
{
int objectId = _items[i * 3 + 0];
int count = _items[i * 3 + 1];
int price = _items[i * 3 + 2];
if (price <= 0)
{
String msgErr = "[SetPrivateStoreListSell] player " + getClient().getActiveChar().getName() + " tried an overflow exploit (use PHX), ban this player!";
Util.handleIllegalPlayerAction(getClient().getActiveChar(), msgErr, Config.DEFAULT_PUNISH);
_count = 0;
_items = null;
return;
}
totalCost += price;
if (totalCost > Integer.MAX_VALUE)
{
player.sendPacket(new PrivateStoreManageListSell(player));
player.sendPacket(new SystemMessage(SystemMessageId.YOU_HAVE_EXCEEDED_QUANTITY_THAT_CAN_BE_INPUTTED));
return;
}
tradeList.addItem(objectId, count, price);
}
if (_count <= 0)
{
player.setPrivateStoreType(L2PcInstance.STORE_PRIVATE_NONE);
player.broadcastUserInfo();
return;
}
if (player.isProcessingTransaction())
{
player.sendPacket(new PrivateStoreManageListSell(player));
player.sendMessage("Store mode are disable while trading.");
return;
}
// Check maximum number of allowed slots for pvt shops
if (_count > player.GetPrivateSellStoreLimit())
{
player.sendPacket(new PrivateStoreManageListSell(player));
player.sendPacket(new SystemMessage(SystemMessageId.YOU_HAVE_EXCEEDED_QUANTITY_THAT_CAN_BE_INPUTTED));
return;
}
player.sitDown();