Package net.sf.l2j.gameserver.handler

Examples of net.sf.l2j.gameserver.handler.IItemHandler


                    sendPacket(il);
                    return;
                }
        else
        {
          IItemHandler handler = ItemHandler.getInstance().getItemHandler(item.getItemId());

          if (handler == null)
                        _log.warning("No item handler registered for item ID " + item.getItemId() + ".");
          else
                        handler.useItem(activeChar, item);
        }
      }
//    }
  }
View Full Code Here


      {
        feed(activeChar, pet, item);
      }
    }

      IItemHandler handler = ItemHandler.getInstance().getItemHandler(item.getItemId());

      if (handler != null)
    {
      useItem(pet, item, activeChar);
    }
View Full Code Here

      pet.updateEffectIcons(true);
    }
    else
    {
      //_log.finest("item not equipable id:"+ item.getItemId());
        IItemHandler handler = ItemHandler.getInstance().getItemHandler(item.getItemId());

        if (handler == null)
            _log.warning("no itemhandler registered for itemId:" + item.getItemId());
        else
            handler.useItem(pet, item);
    }
  }
View Full Code Here

      if (ItemTable.getInstance().createDummyItem(itemId).getItemType() == L2EtcItemType.HERB) // If item is herb dont add it to iv :]
      {
        if (!isCastingNow())
        {
          L2ItemInstance herb = new L2ItemInstance(_charId, itemId);
          IItemHandler handler = ItemHandler.getInstance().getItemHandler(herb.getItemId());
          if (handler == null)
          {
            _log.warning("No item handler registered for Herb - item ID " + herb.getItemId() + ".");
          }
          else
          {
            handler.useItem(this, herb);
            if (_herbstask >= 100)
            {
              _herbstask -= 100;
            }
          }
View Full Code Here

    }
   
    // Auto use herbs - pick up
    if (target.getItemType() == L2EtcItemType.HERB)
    {
      IItemHandler handler = ItemHandler.getInstance().getItemHandler(target.getItemId());
      if (handler == null)
      {
        _log.fine("No item handler registered for item ID " + target.getItemId() + ".");
      }
      else
      {
        handler.useItem(this, target);
      }
      ItemTable.getInstance().destroyItem("Consume", target, this, null);
    }
    // Cursed Weapons are not distributed
    else if (CursedWeaponsManager.getInstance().isCursed(target.getItemId()))
View Full Code Here

   * @param summon the summon
   */
  public void rechargeAutoSoulShot(boolean physical, boolean magic, boolean summon)
  {
    L2ItemInstance item;
    IItemHandler handler;
   
    if ((_activeSoulShots == null) || (_activeSoulShots.size() == 0))
    {
      return;
    }
   
    for (int itemId : _activeSoulShots.values())
    {
      item = getInventory().getItemByItemId(itemId);
     
      if (item != null)
      {
        if (magic)
        {
          if (!summon)
          {
            if ((itemId == 2509) || (itemId == 2510) || (itemId == 2511) || (itemId == 2512) || (itemId == 2513) || (itemId == 2514) || (itemId == 3947) || (itemId == 3948) || (itemId == 3949) || (itemId == 3950) || (itemId == 3951) || (itemId == 3952) || (itemId == 5790))
            {
              handler = ItemHandler.getInstance().getItemHandler(itemId);
             
              if (handler != null)
              {
                handler.useItem(this, item);
              }
            }
          }
          else
          {
            if ((itemId == 6646) || (itemId == 6647))
            {
              handler = ItemHandler.getInstance().getItemHandler(itemId);
             
              if (handler != null)
              {
                handler.useItem(this, item);
              }
            }
          }
        }
       
        if (physical)
        {
          if (!summon)
          {
            if ((itemId == 1463) || (itemId == 1464) || (itemId == 1465) || (itemId == 1466) || (itemId == 1467) || (itemId == 1835) || (itemId == 5789 /*
                                                                                   * || itemId == 6535 || itemId == 6536 || itemId == 6537 || itemId == 6538 || itemId == 6539 || itemId == 6540
                                                                                   */))
            {
              handler = ItemHandler.getInstance().getItemHandler(itemId);
             
              if (handler != null)
              {
                handler.useItem(this, item);
              }
            }
          }
          else
          {
            if (itemId == 6645)
            {
              handler = ItemHandler.getInstance().getItemHandler(itemId);
             
              if (handler != null)
              {
                handler.useItem(this, item);
              }
            }
          }
        }
      }
View Full Code Here

TOP

Related Classes of net.sf.l2j.gameserver.handler.IItemHandler

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.