Package net.sf.l2j.gameserver.serverpackets

Examples of net.sf.l2j.gameserver.serverpackets.PetInventoryUpdate


      return false;
    }

      // Send Pet inventory update packet
    PetInventoryUpdate petIU = new PetInventoryUpdate();
    petIU.addItem(item);
      getOwner().sendPacket(petIU);

    if (sendMessage)
    {
            SystemMessage sm = new SystemMessage(SystemMessageId.DISSAPEARED_ITEM);
View Full Code Here


            if (sendMessage) getOwner().sendPacket(new SystemMessage(SystemMessageId.NOT_ENOUGH_ITEMS));
      return false;
    }

      // Send Pet inventory update packet
    PetInventoryUpdate petIU = new PetInventoryUpdate();
    petIU.addItem(item);
      getOwner().sendPacket(petIU);

    if (sendMessage)
    {
            SystemMessage sm = new SystemMessage(SystemMessageId.DISSAPEARED_ITEM);
View Full Code Here

      L2ItemInstance newItem = getInventory().transferItem(process, objectId, count, target, actor, reference);

    if (newItem == null) return null;

      // Send inventory update packet
    PetInventoryUpdate petIU = new PetInventoryUpdate();
      if (oldItem.getCount() > 0 && oldItem != newItem) petIU.addModifiedItem(oldItem);
      else petIU.addRemovedItem(oldItem);
    getOwner().sendPacket(petIU);

      // Send target update packet
      if (target instanceof PcInventory)
      {
        L2PcInstance targetPlayer = ((PcInventory)target).getOwner();
        InventoryUpdate playerUI = new InventoryUpdate();
        if (newItem.getCount() > count) playerUI.addModifiedItem(newItem);
          else playerUI.addNewItem(newItem);
        targetPlayer.sendPacket(playerUI);

        // Update current load as well
        StatusUpdate playerSU = new StatusUpdate(targetPlayer.getObjectId());
        playerSU.addAttribute(StatusUpdate.CUR_LOAD, targetPlayer.getCurrentLoad());
        targetPlayer.sendPacket(playerSU);
      }
      else if (target instanceof PetInventory)
      {
        petIU = new PetInventoryUpdate();
          if (newItem.getCount() > count) petIU.addRemovedItem(newItem);
          else petIU.addNewItem(newItem);
        ((PetInventory)target).getOwner().getOwner().sendPacket(petIU);
    }
      return newItem;
    }
View Full Code Here

  public void giveItemToOwner(L2ItemInstance item)
  {
    try
    {
      getInventory().transferItem("PetTransfer", item.getObjectId(), item.getCount(), getOwner().getInventory(), getOwner(), this);
      PetInventoryUpdate petiu = new PetInventoryUpdate();
      ItemList PlayerUI = new ItemList(getOwner(), false);
      petiu.addRemovedItem(item);
      getOwner().sendPacket(petiu);
      getOwner().sendPacket(PlayerUI);
    }
    catch (Exception e)
        {
View Full Code Here

      playerSU.addAttribute(StatusUpdate.CUR_LOAD, targetPlayer.getCurrentLoad());
      targetPlayer.sendPacket(playerSU);
    }
    else if (target instanceof PetInventory)
    {
      PetInventoryUpdate petIU = new PetInventoryUpdate();
     
      if (newItem.getCount() > count)
      {
        petIU.addModifiedItem(newItem);
      }
      else
      {
        petIU.addNewItem(newItem);
      }
     
      ((PetInventory) target).getOwner().getOwner().sendPacket(petIU);
    }
   
View Full Code Here

TOP

Related Classes of net.sf.l2j.gameserver.serverpackets.PetInventoryUpdate

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.