Package com.l2jfrozen.gameserver.network.serverpackets

Examples of com.l2jfrozen.gameserver.network.serverpackets.PrivateStoreManageListSell


    }
   
    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();
View Full Code Here


        CreatureSay cs11 = new CreatureSay(0, 15, "", "ATTENTION: Store System is not based on Adena, be careful!"); // 8D
        player.sendPacket(cs11);
      }
     
      player.setPrivateStoreType(L2PcInstance.STORE_PRIVATE_SELL + 1);
      player.sendPacket(new PrivateStoreManageListSell(player));
    }
  }
View Full Code Here

TOP

Related Classes of com.l2jfrozen.gameserver.network.serverpackets.PrivateStoreManageListSell

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.