Package lineage2.gameserver.model.items

Examples of lineage2.gameserver.model.items.ItemInstance$FuncAttack


   * @return boolean
   */
  public boolean containAll(Player player)
  {
    Inventory inv = player.getInventory();
    ItemInstance chestItem = inv.getPaperdollItem(Inventory.PAPERDOLL_CHEST);
    ItemInstance legsItem = inv.getPaperdollItem(Inventory.PAPERDOLL_LEGS);
    ItemInstance headItem = inv.getPaperdollItem(Inventory.PAPERDOLL_HEAD);
    ItemInstance glovesItem = inv.getPaperdollItem(Inventory.PAPERDOLL_GLOVES);
    ItemInstance feetItem = inv.getPaperdollItem(Inventory.PAPERDOLL_FEET);
    int chest = 0;
    int legs = 0;
    int head = 0;
    int gloves = 0;
    int feet = 0;
    if (chestItem != null)
    {
      chest = chestItem.getItemId();
    }
    if (legsItem != null)
    {
      legs = legsItem.getItemId();
    }
    if (headItem != null)
    {
      head = headItem.getItemId();
    }
    if (glovesItem != null)
    {
      gloves = glovesItem.getItemId();
    }
    if (feetItem != null)
    {
      feet = feetItem.getItemId();
    }
    return containAll(chest, legs, head, gloves, feet);
  }
View Full Code Here


   * @return int
   */
  public int getEquipedSetPartsCount(Player player)
  {
    Inventory inv = player.getInventory();
    ItemInstance chestItem = inv.getPaperdollItem(Inventory.PAPERDOLL_CHEST);
    ItemInstance legsItem = inv.getPaperdollItem(Inventory.PAPERDOLL_LEGS);
    ItemInstance headItem = inv.getPaperdollItem(Inventory.PAPERDOLL_HEAD);
    ItemInstance glovesItem = inv.getPaperdollItem(Inventory.PAPERDOLL_GLOVES);
    ItemInstance feetItem = inv.getPaperdollItem(Inventory.PAPERDOLL_FEET);
    int chest = 0;
    int legs = 0;
    int head = 0;
    int gloves = 0;
    int feet = 0;
    if (chestItem != null)
    {
      chest = chestItem.getItemId();
    }
    if (legsItem != null)
    {
      legs = legsItem.getItemId();
    }
    if (headItem != null)
    {
      head = headItem.getItemId();
    }
    if (glovesItem != null)
    {
      gloves = glovesItem.getItemId();
    }
    if (feetItem != null)
    {
      feet = feetItem.getItemId();
    }
    int result = 0;
    if (!_chests.isEmpty() && _chests.contains(chest))
    {
      result++;
View Full Code Here

   * @return boolean
   */
  public boolean containShield(Player player)
  {
    Inventory inv = player.getInventory();
    ItemInstance shieldItem = inv.getPaperdollItem(Inventory.PAPERDOLL_LHAND);
    if ((shieldItem != null) && _shield.contains(shieldItem.getItemId()))
    {
      return true;
    }
    return false;
  }
View Full Code Here

    if (!containAll(player))
    {
      return false;
    }
    Inventory inv = player.getInventory();
    ItemInstance chestItem = inv.getPaperdollItem(Inventory.PAPERDOLL_CHEST);
    ItemInstance legsItem = inv.getPaperdollItem(Inventory.PAPERDOLL_LEGS);
    ItemInstance headItem = inv.getPaperdollItem(Inventory.PAPERDOLL_HEAD);
    ItemInstance glovesItem = inv.getPaperdollItem(Inventory.PAPERDOLL_GLOVES);
    ItemInstance feetItem = inv.getPaperdollItem(Inventory.PAPERDOLL_FEET);
    if (!_chests.isEmpty() && (chestItem.getEnchantLevel() < 6))
    {
      return false;
    }
    if (!_legs.isEmpty() && (legsItem.getEnchantLevel() < 6))
    {
      return false;
    }
    if (!_gloves.isEmpty() && (glovesItem.getEnchantLevel() < 6))
    {
      return false;
    }
    if (!_head.isEmpty() && (headItem.getEnchantLevel() < 6))
    {
      return false;
    }
    if (!_feet.isEmpty() && (feetItem.getEnchantLevel() < 6))
    {
      return false;
    }
    return true;
  }
View Full Code Here

    {
      newChar.setTitle("");
    }
    for (StartItem i : template.getStartItems())
    {
      ItemInstance item = ItemFunctions.createItem(i.getItemId());
      long count = i.getCount();
      if (item.isStackable())
      {
        item.setCount(count);
        newChar.getInventory().addItem(item);
      }
      else
      {
        for (long n = 0; n < count; n++)
        {
          item = ItemFunctions.createItem(i.getItemId());
          newChar.getInventory().addItem(item);
        }
        if (item.isEquipable() && i.isEquiped())
        {
          newChar.getInventory().equipItem(item);
        }
      }
      if (item.getItemId() == 5588)
      {
        newChar.registerShortCut(new ShortCut(11, 0, ShortCut.TYPE_ITEM, item.getObjectId(), -1, 1));
      }
    }
    newChar.rewardSkills(false,false);
    if (newChar.getSkillLevel(1001) > 0)
    {
View Full Code Here

    _cropsItems = new TreeMap<Integer, ItemInstance>();

    List<Integer> allCrops = Manor.getInstance().getAllCrops();
    for (int cropId : allCrops)
    {
      ItemInstance item = player.getInventory().getItemByItemId(cropId);
      if (item != null)
        _cropsItems.put(cropId, item);
    }

    for (CropProcure crop : crops)
View Full Code Here

            continue;
          }
          activeChar.sendPacket(SystemMsg.YOU_DO_NOT_HAVE_ENOUGH_MATERIALS_TO_PERFORM_THAT_ACTION, new RecipeItemMakeInfo(activeChar, recipe, 0));
          return;
        }
        ItemInstance item = activeChar.getInventory().getItemByItemId(material.getItemId());
        if ((item == null) || (item.getCount() < material.getCount()))
        {
          activeChar.sendPacket(SystemMsg.YOU_DO_NOT_HAVE_ENOUGH_MATERIALS_TO_PERFORM_THAT_ACTION, new RecipeItemMakeInfo(activeChar, recipe, 0));
          return;
        }
      }
View Full Code Here

    }
    if ((activeChar.getPrivateStoreType() != Player.STORE_PRIVATE_NONE) || activeChar.isDead())
    {
      return;
    }
    ItemInstance item = activeChar.getInventory().getItemByItemId(_itemId);
    if (item == null)
    {
      return;
    }
    if (_type)
    {
      activeChar.addAutoSoulShot(_itemId);
      activeChar.sendPacket(new ExAutoSoulShot(_itemId, true));
      activeChar.sendPacket(new SystemMessage(SystemMessage.THE_USE_OF_S1_WILL_NOW_BE_AUTOMATED).addString(item.getName()));
      IItemHandler handler = item.getTemplate().getHandler();
      handler.useItem(activeChar, item, false);
      return;
    }
    activeChar.removeAutoSoulShot(_itemId);
    activeChar.sendPacket(new ExAutoSoulShot(_itemId, false));
    activeChar.sendPacket(new SystemMessage(SystemMessage.THE_AUTOMATIC_USE_OF_S1_WILL_NOW_BE_CANCELLED).addString(item.getName()));
  }
View Full Code Here

      long adenaDeposit = 0;
      slotsleft = Config.FREIGHT_SLOTS - freight.getSize();
      int items = 0;
      for (int i = 0; i < _count; i++)
      {
        ItemInstance item = inventory.getItemByObjectId(_items[i]);
        if ((item == null) || (item.getCount() < _itemQ[i]) || !item.getTemplate().isFreightable())
        {
          _items[i] = 0;
          _itemQ[i] = 0L;
          continue;
        }
        if (!item.isStackable() || (freight.getItemByItemId(item.getItemId()) == null))
        {
          if (slotsleft <= 0)
          {
            _items[i] = 0;
            _itemQ[i] = 0L;
            continue;
          }
          slotsleft--;
        }
        if (item.getItemId() == ItemTemplate.ITEM_ID_ADENA)
        {
          adenaDeposit = _itemQ[i];
        }
        items++;
      }
      if (slotsleft <= 0)
      {
        player.sendPacket(SystemMsg.YOU_HAVE_EXCEEDED_THE_QUANTITY_THAT_CAN_BE_INPUTTED);
      }
      if (items == 0)
      {
        player.sendPacket(SystemMsg.INCORRECT_ITEM_COUNT);
        return;
      }
      long fee = SafeMath.mulAndCheck(items, _FREIGHT_FEE);
      if ((fee + adenaDeposit) > player.getAdena())
      {
        player.sendPacket(SystemMsg.YOU_LACK_THE_FUNDS_NEEDED_TO_PAY_FOR_THIS_TRANSACTION);
        return;
      }
      if (!player.reduceAdena(fee, true))
      {
        player.sendPacket(SystemMsg.YOU_DO_NOT_HAVE_ENOUGH_ADENA);
        return;
      }
      for (int i = 0; i < _count; i++)
      {
        if (_items[i] == 0)
        {
          continue;
        }
        ItemInstance item = inventory.removeItemByObjectId(_items[i], _itemQ[i]);
        Log.LogItem(player, Log.FreightDeposit, item);
        freight.addItem(item);
      }
    }
    catch (ArithmeticException ae)
View Full Code Here

      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_BABY_BUFFALO_NECKLACE);
    control.setEnchantLevel(L2Pet.IMPROVED_BABY_BUFFALO.getMinLevel());
    control.setJdbcState(JdbcEntityState.UPDATED);
    control.update();
    player.sendItemList(false);
    show("scripts/services/petevolve/yes_pet.htm", player, npc);
  }
View Full Code Here

TOP

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

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.