Package l2p.gameserver.templates

Examples of l2p.gameserver.templates.L2Item


      if(crop == null)
      {
        return;
      }
      int rewardId = L2Manor.getInstance().getRewardItem(itemId, crop.getReward());
      L2Item template = ItemTable.getInstance().getTemplate(rewardId);
      weight += count * template.getWeight();
      long add_slot = 0;
      if(!template.isStackable())
      {
        add_slot = count;
      }
      else if(player.getInventory().getItemByItemId(itemId) == null)
      {
View Full Code Here


        sendResult(player, BR_BUY_LACK_OF_POINT);
        return;
      }
    }
    validateMyPoints(player);
    L2Item dummy = ItemTable.getInstance().getTemplate(item.template.itemId);
    if(dummy.isStackable())
    {
      if(!player.getInventory().validateWeight(dummy.getWeight() * item.count * count))
      {
        sendResult(player, BR_BUY_INVENTROY_OVERFLOW);
        return;
      }
      if(player.getInventory().getItemByItemId(item.template.itemId) == null && !player.getInventory().validateCapacity(1))
      {
        sendResult(player, BR_BUY_INVENTROY_OVERFLOW);
        return;
      }
      player.getInventory().addItem(item.template.itemId, item.count * count);
      player.sendPacket(new SystemMessage(53).addItemName(item.template.itemId).addNumber(count));
    }
    else
    {
      if(!player.getInventory().validateCapacity(item.count * count) || !player.getInventory().validateWeight(dummy.getWeight() * item.count * count))
      {
        sendResult(player, BR_BUY_INVENTROY_OVERFLOW);
        return;
      }
      for(int i = 0; i < count * item.count; i++)
View Full Code Here

        item.iStartMin = result.getInt("iStartMin");
        item.iEndHour = result.getInt("iEndHour");
        item.iEndMin = result.getInt("iEndMin");
        item.iStock = result.getInt("iStock");
        item.iMaxStock = result.getInt("iMaxStock");
        L2Item dummy = ItemTable.getInstance().getTemplate(itemId);
        item.iWeight = dummy.getWeight();
        item.iDropable = dummy.isDropable();
        shop.put(item.template.brId, item);
      }
    }
    catch(final Exception e)
    {
View Full Code Here

          recipePartList.add(rp);
        }
        // Верхняя или fullbody часть не может быть foundation
        if(!Config.CRAFT_MASTERWORK_CHEST && foundation > 0)
        {
          L2Item foundationItem = ItemTable.getInstance().getTemplate(foundation);
          if(foundationItem.getBodyPart() == L2Item.SLOT_CHEST || foundationItem.getBodyPart() == L2Item.SLOT_FULL_ARMOR)
          {
            foundation = 0;
          }
        }
        L2Recipe recipeList = new L2Recipe(id, level, recipeId, recipeName, successRate, mpCost, itemId, foundation, count, exp, sp, isDvarvenCraft);
View Full Code Here

    if(item.getItemId() <= 0)
    {
      writeItemElements();
      return;
    }
    L2Item i = ItemTable.getInstance().getTemplate(item.getItemId());
    if(i.isWeapon())
    {
      writeH(item.getElement()); // attack element (-2 - none)
      writeH(item.getElementValue()); // attack element value
      writeH(0); // водная стихия (fire pdef)
      writeH(0); // огненная стихия (water pdef)
      writeH(0); // земляная стихия (wind pdef)
      writeH(0); // воздушная стихия (earth pdef)
      writeH(0); // темная стихия (holy pdef)
      writeH(0); // светлая стихия (dark pdef)
    }
    else if(i.isArmor())
    {
      writeH(-2); // attack element (-2 - none)
      writeH(0); // attack element value
      writeH(item.getElement() == L2Item.ATTRIBUTE_FIRE ? item.getElementValue() : 0); // водная стихия (fire pdef)
      writeH(item.getElement() == L2Item.ATTRIBUTE_WATER ? item.getElementValue() : 0); // огненная стихия (water pdef)
View Full Code Here

    writeH(_type);
    writeQ(_money);
    writeH(_items.length);
    for(L2ItemInstance temp : _items)
    {
      L2Item item = temp.getItem();
      writeH(item.getType1());
      writeD(temp.getObjectId());
      writeD(temp.getItemId());
      writeQ(temp.getCount());
      writeH(item.getType2ForPackets());
      writeH(temp.getCustomType1());
      writeD(temp.getBodyPart());
      writeH(temp.getEnchantLevel());
      writeH(temp.getCustomType2());
      writeH(0); // ?
View Full Code Here

    final L2ItemInstance weapon = getSecondaryWeaponInstance();
    if(weapon == null)
    {
      return getFistsWeaponItem();
    }
    final L2Item item = weapon.getItem();
    if(item instanceof L2Weapon)
    {
      return (L2Weapon) item;
    }
    return null;
View Full Code Here

      }
      try
      {
        CropProcure crop = CastleManager.getInstance().getCastleByIndex(manorId).getCrop(itemId, CastleManorManager.PERIOD_CURRENT);
        int rewardItemId = L2Manor.getInstance().getRewardItem(itemId, crop.getReward());
        L2Item template = ItemTable.getInstance().getTemplate(rewardItemId);
        weight += count * template.getWeight();
        if(!template.isStackable())
        {
          slots += count;
        }
        else if(player.getInventory().getItemByItemId(itemId) == null)
        {
View Full Code Here

    writeH(0xB2);
    // TODO dx[ddQhhdhhhhhhhhhh]
    writeD(_itemslist.size());
    for(L2ItemInstance temp : _itemslist)
    {
      L2Item item = temp.getItem();
      writeD(temp.getObjectId());
      writeD(temp.getItemId());
      writeQ(temp.getCount());
      writeH(item.getType2ForPackets());
      writeH(temp.getCustomType1());
      writeD(temp.getBodyPart());
      writeH(temp.getEnchantLevel());
      writeH(temp.getCustomType2());
      writeItemElements(temp);
View Full Code Here

    writeD(_package ? 1 : 0);
    writeQ(buyer_adena);
    writeD(_sellList.size());
    for(TradeItem ti : _sellList)
    {
      L2Item tempItem = ItemTable.getInstance().getTemplate(ti.getItemId());
      writeD(tempItem.getType2ForPackets());
      writeD(ti.getObjectId());
      writeD(ti.getItemId());
      writeQ(ti.getCount());
      writeH(0);
      writeH(ti.getEnchantLevel());
      writeH(0x00);
      writeD(tempItem.getBodyPart());
      writeQ(ti.getOwnersPrice());
      writeQ(ti.getStorePrice());
      writeItemElements(ti);
      writeItemRev152();
    }
View Full Code Here

TOP

Related Classes of l2p.gameserver.templates.L2Item

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.