Package lineage2.gameserver.model.items

Examples of lineage2.gameserver.model.items.ItemInstance


     * @param slot int
     * @return int
     */
    public int getPaperdollItemId(int slot)
    {
      ItemInstance item = _paperdoll[slot];
      if (item != null)
      {
        return item.getItemId();
      }
      return 0;
    }
View Full Code Here


      return 0;
    }
   
    public int getVisualItemId(int slot)
    {
      ItemInstance item = _paperdoll[slot];
      if(item != null)
      {
        return item.getVisualId();
      }
      return 0;
    }
View Full Code Here

     * @param slot int
     * @return int
     */
    public int getPaperdollEnchantEffect(int slot)
    {
      ItemInstance item = _paperdoll[slot];
      if (item != null)
      {
        return item.getEnchantLevel();
      }
      return 0;
    }
View Full Code Here

    if(!canBypassCheck(player, this))
      return;
    super.onBypassFeedback(player, command);
    if(command.startsWith("bmarket"))
    {
      ItemInstance ancientAdena = player.getInventory().getItemByItemId(ANCIENT_ADENA_ID);
      long ancientAdenaAmount = ancientAdena != null ? ancientAdena.getCount() : 0L;
      int val = Integer.parseInt(command.substring(11, 12).trim());
      if(command.length() > 12)
        val = Integer.parseInt(command.substring(11, 13).trim());
      switch(val)
      {
View Full Code Here

    if (Equip_Id != MASTER_YOGI_STAFF)
    {
      show("scripts/events/MasterOfEnchanting/32599-rewardnostaff.htm", player);
      return;
    }
    final ItemInstance enchanteditem = player.getInventory().getItemByItemId(Equip_Id);
    final int Ench_Lvl = enchanteditem.getEnchantLevel();
    if ((Equip_Id == MASTER_YOGI_STAFF) && (Ench_Lvl > 3))
    {
      switch (Ench_Lvl)
      {
        case 4:
View Full Code Here

   * @return ItemInstance
   */
  @Override
  public ItemInstance load(Integer objectId)
  {
    ItemInstance item;
    Element ce = cache.get(objectId);
    if (ce != null)
    {
      item = (ItemInstance) ce.getObjectValue();
      return item;
    }
    try
    {
      item = load0(objectId);
      if (item == null)
      {
        return null;
      }
      item.setJdbcState(JdbcEntityState.STORED);
    }
    catch (SQLException e)
    {
      _log.error("Error while restoring item : " + objectId, e);
      return null;
    }
    cache.put(new Element(item.getObjectId(), item));
    return item;
  }
View Full Code Here

    }
    if ((_colorNum < 0) || (_colorNum >= COLORS.length))
    {
      return;
    }
    ItemInstance item = activeChar.getInventory().getItemByObjectId(_itemObjectId);
    if (item == null)
    {
      return;
    }
    if (activeChar.consumeItem(item.getItemId(), 1))
    {
      activeChar.setTitleColor(COLORS[_colorNum]);
      activeChar.setTitle(_title);
      activeChar.broadcastUserInfo();
    }
View Full Code Here

    if (objectIds.isEmpty())
    {
      return list;
    }
    list = new ArrayList<>(objectIds.size());
    ItemInstance item;
    for (Integer objectId : objectIds)
    {
      item = load(objectId);
      if (item != null)
      {
View Full Code Here

      case ShortCut.TYPE_ITEM:
        int reuseGroup = -1,
        currentReuse = 0,
        reuse = 0,
        augmentationId = 0;
        ItemInstance item = player.getInventory().getItemByObjectId(shortCut.getId());
        if (item != null)
        {
          augmentationId = item.getAugmentationId();
          reuseGroup = item.getTemplate().getDisplayReuseGroup();
          if (item.getTemplate().getReuseDelay() > 0)
          {
            TimeStamp timeStamp = player.getSharedGroupReuse(item.getTemplate().getReuseGroup());
            if (timeStamp != null)
            {
              currentReuse = (int) (timeStamp.getReuseCurrent() / 1000L);
              reuse = (int) (timeStamp.getReuseBasic() / 1000L);
            }
View Full Code Here

    if (!activeChar.isPlayer())
    {
      return false;
    }
    Player player = (Player) activeChar;
    ItemInstance item = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LBRACELET);
    if ((item == null) || ((item.getTemplate().getAgathionEnergy() - item.getAgathionEnergy()) < _addEnergy))
    {
      player.sendPacket(SystemMsg.YOUR_ENERGY_CANNOT_BE_REPLENISHED_BECAUSE_CONDITIONS_ARE_NOT_MET);
      return false;
    }
    return true;
View Full Code Here

TOP

Related Classes of lineage2.gameserver.model.items.ItemInstance

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.