Package net.sf.l2j.gameserver.serverpackets

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


        // the player should know that he has less sp now :p
        StatusUpdate su = new StatusUpdate(player.getObjectId());
        su.addAttribute(StatusUpdate.SP, player.getSp());
        player.sendPacket(su);

        ItemList il = new ItemList(player, false);
        player.sendPacket(il);

        changeLevel(getLevel() + 1);
    }
View Full Code Here


      else
        iu.addNewItem(createditem);

      activeChar.sendPacket(iu);
    } else
      activeChar.sendPacket(new ItemList(activeChar, false));

    // status & user info
    StatusUpdate su = new StatusUpdate(activeChar.getObjectId());
    su.addAttribute(StatusUpdate.CUR_LOAD, activeChar.getCurrentLoad());
    activeChar.sendPacket(su);
View Full Code Here

      // update load and mana bar of craft window
      updateCurMp();
      updateCurLoad();
      _activeMakers.remove(_player);
      _player.isInCraftMode(false);
      _target.sendPacket(new ItemList(_target, false));
    }
View Full Code Here

            }
    }

        // Send updated item list to the player
    if (playerIU != null) player.sendPacket(playerIU);
    else player.sendPacket(new ItemList(player, false));

    // Update current load status on player
    StatusUpdate su = new StatusUpdate(player.getObjectId());
    su.addAttribute(StatusUpdate.CUR_LOAD, player.getCurrentLoad());
    player.sendPacket(su);
View Full Code Here

  {
    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

    }

    StatusUpdate su = new StatusUpdate(player.getObjectId());
    su.addAttribute(StatusUpdate.CUR_LOAD, player.getCurrentLoad());
    player.sendPacket(su);
    player.sendPacket(new ItemList(player, true));
  }
View Full Code Here

                SystemMessage smsg = new SystemMessage(SystemMessageId.EARNED_ITEM);
                smsg.addItemName(item.getItemId());
                getPlayer().sendPacket(smsg);
            }
    }
        getPlayer().sendPacket(new ItemList(getPlayer(), false));

        StatusUpdate su = new StatusUpdate(getPlayer().getObjectId());
        su.addAttribute(StatusUpdate.CUR_LOAD, getPlayer().getCurrentLoad());
        getPlayer().sendPacket(su);
  }
View Full Code Here

            }
    }

        // Send updated item list to the player
    if (playerIU != null) player.sendPacket(playerIU);
    else player.sendPacket(new ItemList(player, false));

    // Update current load status on player
    StatusUpdate su = new StatusUpdate(player.getObjectId());
    su.addAttribute(StatusUpdate.CUR_LOAD, player.getCurrentLoad());
    player.sendPacket(su);
View Full Code Here

            if (removedItem.getCount() == 0) iu.addRemovedItem(removedItem);
            else iu.addModifiedItem(removedItem);

            _player.sendPacket(iu);
          }
          else _player.sendPacket(new ItemList(_player, true));

          _player.broadcastUserInfo();
        } else
        {
          // Remove from Db
          _log.info(_name + " being removed offline." );

          java.sql.Connection con = null;
          try
          {
            con = L2DatabaseFactory.getInstance().getConnection();

            // Delete the item
            PreparedStatement statement = con.prepareStatement("DELETE FROM items WHERE owner_id=? AND item_id=?");
            statement.setInt(1, _playerId);
            statement.setInt(2, _itemId);
            if (statement.executeUpdate() != 1)
            {
              _log.warning("Error while deleting itemId "+ _itemId +" from userId "+ _playerId);
            }
            statement.close();
            /* Yesod: Skill is not stored into database any more.
            // Delete the skill
            statement = con.prepareStatement("DELETE FROM character_skills WHERE char_obj_id=? AND skill_id=?");
            statement.setInt(1, _playerId);
            statement.setInt(2, _skillId);
            if (statement.executeUpdate() != 1)
            {
              _log.warning("Error while deleting skillId "+ _skillId +" from userId "+_playerId);
            }
          */
            // Restore the karma
            statement = con.prepareStatement("UPDATE characters SET karma=?, pkkills=? WHERE obj_id=?");
            statement.setInt(1, _playerKarma);
            statement.setInt(2, _playerPkKills);
            statement.setInt(3, _playerId);
            if (statement.executeUpdate() != 1)
            {
              _log.warning("Error while updating karma & pkkills for userId "+_playerId);
            }

            statement.close();
          }
          catch (Exception e)
          {
            _log.warning("Could not delete : " + e);
          }
          finally
          {
            try { con.close(); } catch (Exception e) {}
          }
        }
    } else
    {
      // either this cursed weapon is in the inventory of someone who has another cursed weapon equipped,
      // OR this cursed weapon is on the ground.
      if ((_player != null) && (_player.getInventory().getItemByItemId(_itemId) != null))
      {
          // Destroy
          L2ItemInstance removedItem = _player.getInventory().destroyItemByItemId("", _itemId, 1, _player, null);
          if (!Config.FORCE_INVENTORY_UPDATE)
          {
            InventoryUpdate iu = new InventoryUpdate();
            if (removedItem.getCount() == 0) iu.addRemovedItem(removedItem);
            else iu.addModifiedItem(removedItem);

            _player.sendPacket(iu);
          }
          else _player.sendPacket(new ItemList(_player, true));

          _player.broadcastUserInfo();
      }
      //  is dropped on the ground
      else if (_item != null)
View Full Code Here

      InventoryUpdate iu = new InventoryUpdate();
      iu.addItem(_item);
      //iu.addItems(Arrays.asList(items));
      _player.sendPacket(iu);
    }
    else _player.sendPacket(new ItemList(_player, false));

    // Refresh player stats
    _player.broadcastUserInfo();

    SocialAction atk = new SocialAction(_player.getObjectId(), 17);
View Full Code Here

TOP

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

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.