Package com.l2jfrozen.gameserver.network.serverpackets

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


            int amount = Integer.parseInt(st.nextToken());
           
            if (player != null)
            {
              L2ItemInstance item = player.getInventory().addItem("Status-Give", itemId, amount, null, null);
              InventoryUpdate iu = new InventoryUpdate();
              iu.addItem(item);
              player.sendPacket(iu);
              SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_PICKED_UP_S1_S2);
              sm.addItemName(itemId);
              sm.addNumber(amount);
              player.sendPacket(sm);
View Full Code Here


      activeChar.getInventory().unEquipItemInSlot(armorType);
      itemInstance.setEnchantLevel(ench);
      activeChar.getInventory().equipItem(itemInstance);
     
      // send packets
      InventoryUpdate iu = new InventoryUpdate();
      iu.addModifiedItem(itemInstance);
      activeChar.sendPacket(iu);
      activeChar.broadcastPacket(new CharInfo(activeChar));
      activeChar.sendPacket(new UserInfo(activeChar));
      //activeChar.broadcastPacket(new ExBrExtraUserInfo(activeChar));
     
View Full Code Here

      sendPacket(new SystemMessage(SystemMessageId.YOU_NOT_ENOUGH_ADENA));
      return;
    }

    // Proceed to the transfer
    InventoryUpdate playerIU = Config.FORCE_INVENTORY_UPDATE ? null : new InventoryUpdate();
    for(int i = 0; i < _count; i++)
    {
      int objectId = _items[i * 2 + 0];
      int count = _items[i * 2 + 1];

      // check for an invalid item
      if(objectId == 0 && count == 0)
      {
        continue;
      }

      L2ItemInstance oldItem = player.getInventory().getItemByObjectId(objectId);
      if(oldItem == null)
      {
        _log.warning("Error depositing a warehouse object for char " + player.getName() + " (olditem == null)");
        continue;
      }
     
      int itemId = oldItem.getItemId();

      if(itemId >= 6611 && itemId <= 6621 || itemId == 6842)
      {
        continue;
      }
     
      if(CursedWeaponsManager.getInstance().isCursed(itemId))
      {
        _log.warning(player.getName()+" try to deposit Cursed Weapon on wherehouse.");
        continue;
      }
     
      L2ItemInstance newItem = player.getInventory().transferItem("Warehouse", objectId, count, warehouse, player, player.getLastFolkNPC());
      if(newItem == null)
      {
        _log.warning("Error depositing a warehouse object for char " + player.getName() + " (newitem == null)");
        continue;
      }

      if (playerIU != null)
      {
        if (oldItem.getCount() > 0 && oldItem != newItem)
          playerIU.addModifiedItem(oldItem);
        else
          playerIU.addRemovedItem(oldItem);
      }
    }

    // Send updated item list to the player
    if (playerIU != null)
View Full Code Here

     
      activeChar.getInventory().reduceAdena("Henna", temp.getPrice(), activeChar, activeChar.getLastFolkNPC());
      L2ItemInstance dyeToUpdate = activeChar.getInventory().destroyItemByItemId("Henna", temp.getItemIdDye(), temp.getAmountDyeRequire(), activeChar, activeChar.getLastFolkNPC());

      //update inventory
      InventoryUpdate iu = new InventoryUpdate();
      iu.addModifiedItem(activeChar.getInventory().getAdenaInstance());
      iu.addModifiedItem(dyeToUpdate);
      activeChar.sendPacket(iu);
     
      ItemList il = new ItemList(getClient().getActiveChar(), true);
      sendPacket(il);
     
View Full Code Here

            L2ItemInstance it;
            it = player.getInventory().getItemByItemId(_t1.idWTicket1);
            if(it != null && it.getCount() >= 1)
            {
              player.getInventory().destroyItem("Boat", it.getObjectId(), 1, player, this);
              InventoryUpdate iu = new InventoryUpdate();
              iu.addModifiedItem(it);
              player.sendPacket(iu);
              _inboat.put(i, player);
              i++;
            }
            else if(it == null && _t1.idWTicket1 == 0)
            {
              _inboat.put(i, player);
              i++;
            }
            else
            {
              player.teleToLocation(_t1.ntx1, _t1.nty1, _t1.ntz1, false);
            }
          }
        }
        knownPlayers = null;
      }
      Boatrun bc = new Boatrun(0, this);
      ThreadPoolManager.getInstance().scheduleGeneral(bc, 0);
      bc = null;
    }
    else if(_cycle == 2)
    {
      Collection<L2PcInstance> knownPlayers = getKnownList().getKnownPlayers().values();
      if(knownPlayers != null && !knownPlayers.isEmpty())
      {
        _inboat = new FastMap<Integer, L2PcInstance>();
        int i = 0;
        for(L2PcInstance player : knownPlayers)
        {
          if(player.isInBoat() && player.getBoat() == this)
          {
            L2ItemInstance it;
            it = player.getInventory().getItemByItemId(_t2.idWTicket1);
            if(it != null && it.getCount() >= 1)
            {
              player.getInventory().destroyItem("Boat", it.getObjectId(), 1, player, this);
              InventoryUpdate iu = new InventoryUpdate();
              iu.addModifiedItem(it);
              player.sendPacket(iu);
              _inboat.put(i, player);
              i++;
            }
            else if(it == null && _t2.idWTicket1 == 0)
View Full Code Here

      }
     
      // Send update packet
      if (!Config.FORCE_INVENTORY_UPDATE)
      {
        InventoryUpdate iu = new InventoryUpdate();
        iu.addItem(_inventory.getAdenaInstance());
        sendPacket(iu);
        iu = null;
      }
      else
      {
View Full Code Here

      _inventory.reduceAdena(process, count, this, reference);

      // Send update packet
      if(!Config.FORCE_INVENTORY_UPDATE)
      {
        InventoryUpdate iu = new InventoryUpdate();
        iu.addItem(adenaItem);
        sendPacket(iu);
        iu = null;
      }
      else
      {
View Full Code Here

    {
      _inventory.addAncientAdena(process, count, this, reference);

      if(!Config.FORCE_INVENTORY_UPDATE)
      {
        InventoryUpdate iu = new InventoryUpdate();
        iu.addItem(_inventory.getAncientAdenaInstance());
        sendPacket(iu);
        iu = null;
      }
      else
      {
View Full Code Here

      L2ItemInstance ancientAdenaItem = _inventory.getAncientAdenaInstance();
      _inventory.reduceAncientAdena(process, count, this, reference);

      if(!Config.FORCE_INVENTORY_UPDATE)
      {
        InventoryUpdate iu = new InventoryUpdate();
        iu.addItem(ancientAdenaItem);
        sendPacket(iu);
        iu = null;
      }
      else
      {
View Full Code Here

        {
          _inventory.addPvptoken(process, count, this, reference);
   
          if(!Config.FORCE_INVENTORY_UPDATE)
          {
            InventoryUpdate iu = new InventoryUpdate();
            iu.addItem(_inventory.getPvptokenInstance());
            sendPacket(iu);
            iu = null;
          }
          else
          {
View Full Code Here

TOP

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

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.