Package lineage2.gameserver.model.items

Examples of lineage2.gameserver.model.items.ItemInstance


      show("scripts/services/petevolve/no_level.htm", player, npc);
      return;
    }
    int controlItemId = pl_pet.getControlItemObjId();
    player.getSummonList().unsummonPet(false);
    ItemInstance control = player.getInventory().getItemByObjectId(controlItemId);
    control.setItemId(IN_COUGAR_CHIME);
    control.setEnchantLevel(L2Pet.IMPROVED_BABY_COUGAR.getMinLevel());
    control.setJdbcState(JdbcEntityState.UPDATED);
    control.update();
    player.sendItemList(false);
    show("scripts/services/petevolve/yes_pet.htm", player, npc);
  }
View Full Code Here


      show("scripts/services/petevolve/no_level_gw.htm", player, npc);
      return;
    }
    int controlItemId = pl_pet.getControlItemObjId();
    player.getSummonList().unsummonPet(false);
    ItemInstance control = player.getInventory().getItemByObjectId(controlItemId);
    control.setItemId(FENRIR_NECKLACE);
    control.setEnchantLevel(L2Pet.FENRIR_WOLF.getMinLevel());
    control.setJdbcState(JdbcEntityState.UPDATED);
    control.update();
    player.sendItemList(false);
    show("scripts/services/petevolve/yes_wolf.htm", player, npc);
  }
View Full Code Here

    if (activeChar == null)
    {
      return;
    }
    PcInventory inventory = activeChar.getInventory();
    ItemInstance _item = inventory.getItemByObjectId(_itemObjId);
    ItemFunctions.removeItem(activeChar, _consumeItemId, 1, true);
    boolean equipped = _item.isEquipped();
    if (equipped)
    {
      activeChar.getInventory().isRefresh = true;
      activeChar.getInventory().unEquipItem(_item);
    }
    Element oldElement = _item.getAttackElement();
    int elementVal = _item.getAttributeElementValue(oldElement, false);
    _item.setAttributeElement(oldElement, 0);
    Element newElement = Element.VALUES[_newElementId];
    _item.setAttributeElement(newElement, _item.getAttributeElementValue(newElement, false) + elementVal);
    _item.setJdbcState(JdbcEntityState.UPDATED);
    _item.update();
    if (equipped)
    {
      activeChar.getInventory().equipItem(_item);
      activeChar.getInventory().isRefresh = false;
    }
View Full Code Here

          mail.setSenderName(StringHolder.getInstance().getNotNull(activeChar, "birthday.npc"));
          mail.setReceiverId(activeChar.getObjectId());
          mail.setReceiverName(activeChar.getName());
          mail.setTopic(StringHolder.getInstance().getNotNull(activeChar, "birthday.title"));
          mail.setBody(StringHolder.getInstance().getNotNull(activeChar, "birthday.text"));
          ItemInstance item = ItemFunctions.createItem(21169);
          item.setLocation(ItemInstance.ItemLocation.MAIL);
          item.setCount(1L);
          item.save();
          mail.addAttachment(item);
          mail.setUnread(true);
          mail.setType(Mail.SenderType.BIRTHDAY);
          mail.setExpireTime((720 * 3600) + (int) (System.currentTimeMillis() / 1000L));
          mail.save();
View Full Code Here

      statement.setInt(1, player.getObjectId());
      rset = statement.executeQuery();
      while (rset.next())
      {
        int objectId = rset.getInt("obj_id");
        ItemInstance item;
        if ((item = container.getItemByObjectId(objectId)) == null)
        {
          continue;
        }
        CommissionItemInfo itemInfo = new CommissionItemInfo(item);
View Full Code Here

      List<CommissionItemInfo> list = new ArrayList<>(120);
      items.add(list);
      while (rset.next() && (i <= 999))
      {
        int objectId = rset.getInt("obj_id");
        ItemInstance item;
        if ((item = container.getItemByObjectId(objectId)) == null)
        {
          continue;
        }
        if (((rareType == 1) && !item.getTemplate().isBlessed()) || ((rareType == 0) && item.getTemplate().isBlessed()))
        {
          continue;
        }
        if ((grade > -1) && (item.getTemplate().getItemGrade().ordinal() != grade))
        {
          continue;
        }
        if (!searchName.isEmpty() && !rset.getString("item_name").toLowerCase().contains(searchName.toLowerCase()))
        {
View Full Code Here

      statement.setString(2, exItemType.name());
      rset = statement.executeQuery();
      while (rset.next())
      {
        int objectId = rset.getInt("obj_id");
        ItemInstance item;
        if ((item = container.getItemByObjectId(objectId)) == null)
        {
          return null;
        }
        itemInfo = new CommissionItemInfo(item);
View Full Code Here

      statement.setLong(1, expireTime);
      rset = statement.executeQuery();
      while (rset.next())
      {
        int objectId = rset.getInt("obj_id");
        ItemInstance item;
        if ((item = container.getItemByObjectId(objectId)) == null)
        {
          continue;
        }
        CommissionItemInfo itemInfo = new CommissionItemInfo(item);
View Full Code Here

      rset = statement.executeQuery();
      while (rset.next())
      {
        int itemId = rset.getInt("item_id");
        Location loc = new Location(rset.getInt("x"), rset.getInt("y"), rset.getInt("z"));
        ItemInstance item = ItemFunctions.createItem(itemId);
        item.spawnMe(loc);
        r.getSpawnMerchantTickets().add(item);
      }
    }
    catch (Exception e)
    {
View Full Code Here

      if (env.value == 0)
      {
        return;
      }
      Creature cha = env.character;
      ItemInstance shld = ((Player) cha).getInventory().getPaperdollItem(Inventory.PAPERDOLL_LHAND);
      if ((shld == null) || (shld.getItemType() != WeaponType.NONE))
      {
        return;
      }
      env.value *= BaseStats.DEX.calcBonus(env.character);
    }
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.