Package lineage2.gameserver.templates.item

Examples of lineage2.gameserver.templates.item.ItemTemplate


        break;
      }
      case ItemTemplate.SLOT_L_HAND:
      {
        final ItemInstance rHandItem = getPaperdollItem(PAPERDOLL_RHAND);
        final ItemTemplate rHandItemTemplate = rHandItem == null ? null : rHandItem.getTemplate();
        final ItemTemplate newItem = item.getTemplate();
        if (newItem.getItemType() == EtcItemType.ARROW)
        {
          if (rHandItemTemplate == null)
          {
            return;
          }
          if (rHandItemTemplate.getItemType() != WeaponType.BOW)
          {
            return;
          }
          if (rHandItemTemplate.getCrystalType() != newItem.getCrystalType())
          {
            return;
          }
        }
        else if (newItem.getItemType() == EtcItemType.BOLT)
        {
          if (rHandItemTemplate == null)
          {
            return;
          }
          if (rHandItemTemplate.getItemType() != WeaponType.CROSSBOW)
          {
            return;
          }
          if (rHandItemTemplate.getCrystalType() != newItem.getCrystalType())
          {
            return;
          }
        }
        else if (newItem.getItemType() == EtcItemType.BAIT)
        {
          if (rHandItemTemplate == null)
          {
            return;
          }
View Full Code Here


   * @param count long
   * @return boolean
   */
  public boolean validateCapacity(int itemId, long count)
  {
    ItemTemplate item = ItemHolder.getInstance().getTemplate(itemId);
    return validateCapacity(item, count);
  }
View Full Code Here

    }
    if (count <= 0)
    {
      count = 1;
    }
    ItemTemplate template = ItemHolder.getInstance().getTemplate(itemId);
    if (template == null)
    {
      return;
    }
    for (int i = 0; i < count; i++)
    {
      ItemInstance item = ItemFunctions.createItem(itemId);
      if (element != Element.NONE)
      {
        item.setAttributeElement(element, power);
      }
      player.getInventory().addItem(item);
    }
    player.sendPacket(SystemMessage2.obtainItems(template.getItemId(), count, 0));
    player.sendChanges();
  }
View Full Code Here

   * @param count long
   * @return boolean
   */
  public boolean validateWeight(int itemId, long count)
  {
    ItemTemplate item = ItemHolder.getInstance().getTemplate(itemId);
    return validateWeight(item, count);
  }
View Full Code Here

  {
    for (int id : ids)
    {
      if (id != 0)
      {
        ItemTemplate i = null;
        i = ItemHolder.getInstance().getTemplate(id);
        if (_questItems.contains(id))
        {
          _log.warn("Item " + i + " multiple times in quest drop in " + getName());
        }
View Full Code Here

   * @param seedId int
   * @return int
   */
  public int getSeedBasicPrice(int seedId)
  {
    ItemTemplate seedItem = ItemHolder.getInstance().getTemplate(seedId);
    if (seedItem != null)
    {
      return seedItem.getReferencePrice();
    }
    return 0;
  }
View Full Code Here

   * @param cropId int
   * @return int
   */
  public int getCropBasicPrice(int cropId)
  {
    ItemTemplate cropItem = ItemHolder.getInstance().getTemplate(cropId);
    if (cropItem != null)
    {
      return cropItem.getReferencePrice();
    }
    return 0;
  }
View Full Code Here

    {
      jobLevel = 5;
    }
    if ((((level >= 20) && (jobLevel == 1)) || ((level >= 40) && (jobLevel == 2)) || ((level >= 76) && (jobLevel == 3)) || ((level >= 85) && (jobLevel == 4))) && Config.ALLOW_CLASS_MASTERS_LIST.contains(jobLevel))
    {
      ItemTemplate item = ItemHolder.getInstance().getTemplate(Config.CLASS_MASTERS_PRICE_ITEM_LIST[jobLevel]);
      if (Config.CLASS_MASTERS_PRICE_LIST[jobLevel] > 0)
      {
        html.append("Price: ").append(Util.formatAdena(Config.CLASS_MASTERS_PRICE_LIST[jobLevel])).append(' ').append(item.getName()).append("<br1>");
      }
      for (ClassId cid : ClassId.VALUES)
      {
        if (cid == ClassId.INSPECTOR)
        {
View Full Code Here

                        for (Node i = d2.getFirstChild(); i != null; i = i.getNextSibling())
                        {
                          if ("item".equalsIgnoreCase(i.getNodeName()))
                          {
                            final int itemId = Integer.parseInt(i.getAttributes().getNamedItem("id").getNodeValue());
                            final ItemTemplate template = ItemHolder.getInstance().getTemplate(itemId);
                            if (template == null)
                            {
                              _log.warn("Template not found for itemId: " + itemId + " for shop " + shop_id);
                              continue;
                            }
                            if (!checkItem(template))
                            {
                              continue;
                            }
                            counterItems++;
                            long price = i.getAttributes().getNamedItem("price") != null ? Long.parseLong(i.getAttributes().getNamedItem("price").getNodeValue()) : Math.round(template.getReferencePrice() * markup);
                            TradeItem item = new TradeItem();
                            item.setItemId(itemId);
                            final int itemCount = i.getAttributes().getNamedItem("count") != null ? Integer.parseInt(i.getAttributes().getNamedItem("count").getNodeValue()) : 0;
                            final int itemRechargeTime = i.getAttributes().getNamedItem("time") != null ? Integer.parseInt(i.getAttributes().getNamedItem("time").getNodeValue()) : 0;
                            item.setOwnersPrice(price);
View Full Code Here

      writeH(ent.getProduction().size());
      writeH(ingredients.size());
      for (MultiSellIngredient prod : ent.getProduction())
      {
        int itemId = prod.getItemId();
        ItemTemplate template = itemId > 0 ? ItemHolder.getInstance().getTemplate(prod.getItemId()) : null;
        writeD(itemId);
        writeD(itemId > 0 ? template.getBodyPart() : 0);
        writeH(itemId > 0 ? template.getType2ForPackets() : 0);
        writeQ(prod.getItemCount());
        writeH(prod.getItemEnchant());
        writeD(prod.getChance());
        writeD(0x00);
        writeD(0x00);
        writeItemElements(prod);
      }
      for (MultiSellIngredient i : ingredients)
      {
        int itemId = i.getItemId();
        final ItemTemplate item = itemId > 0 ? ItemHolder.getInstance().getTemplate(i.getItemId()) : null;
        writeD(itemId);
        writeH(itemId > 0 ? item.getType2() : 0xffff);
        writeQ(i.getItemCount());
        writeH(i.getItemEnchant());
        writeD(0x00);
        writeD(0x00);
        writeItemElements(i);
View Full Code Here

TOP

Related Classes of lineage2.gameserver.templates.item.ItemTemplate

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.