Package l2p.gameserver.model.items

Examples of l2p.gameserver.model.items.Inventory$ItemOrderComparator


    }
    else
    {
      player = playable;
    }
    Inventory inv = player.getInventory();
    if(inv == null)
    {
      return 0;
    }
    L2ItemInstance[] items = inv.getItems();
    for(L2ItemInstance item : items)
    {
      if(item.getItemId() == item_id)
      {
        count += item.getCount();
View Full Code Here


    }
    else
    {
      player = playable;
    }
    Inventory inv = player.getInventory();
    if(inv == null)
    {
      return 0;
    }
    long removed = count;
    L2ItemInstance[] items = inv.getItems();
    for(L2ItemInstance item : items)
    {
      if(item.getItemId() == item_id && count > 0)
      {
        long item_count = item.getCount();
View Full Code Here

   * @param player whose inventory is being checked
   * @return True if player equips whole set
   */
  public boolean containAll(L2Player player)
  {
    Inventory inv = player.getInventory();
    L2ItemInstance legsItem = inv.getPaperdollItem(Inventory.PAPERDOLL_LEGS);
    L2ItemInstance headItem = inv.getPaperdollItem(Inventory.PAPERDOLL_HEAD);
    L2ItemInstance glovesItem = inv.getPaperdollItem(Inventory.PAPERDOLL_GLOVES);
    L2ItemInstance feetItem = inv.getPaperdollItem(Inventory.PAPERDOLL_FEET);
    int legs = 0;
    int head = 0;
    int gloves = 0;
    int feet = 0;
    if(legsItem != null)
View Full Code Here

    return _skill;
  }

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

    // Player don't have full set
    if(!containAll(player))
    {
      return false;
    }
    Inventory inv = player.getInventory();
    L2ItemInstance chestItem = inv.getPaperdollItem(Inventory.PAPERDOLL_CHEST);
    L2ItemInstance legsItem = inv.getPaperdollItem(Inventory.PAPERDOLL_LEGS);
    L2ItemInstance headItem = inv.getPaperdollItem(Inventory.PAPERDOLL_HEAD);
    L2ItemInstance glovesItem = inv.getPaperdollItem(Inventory.PAPERDOLL_GLOVES);
    L2ItemInstance feetItem = inv.getPaperdollItem(Inventory.PAPERDOLL_FEET);
    if(chestItem.getEnchantLevel() < 6)
    {
      return false;
    }
    if(!_legs.isEmpty() && legsItem.getEnchantLevel() < 6)
View Full Code Here

      }
    }
    synchronized(player.getInventory())
    {
      L2RecipeComponent[] recipes = recipeList.getRecipes();
      Inventory inventory = player.getInventory();
      for(L2RecipeComponent recipe : recipes)
      {
        if(recipe.getQuantity() == 0)
        {
          continue;
        }
        if(Config.ALT_GAME_UNREGISTER_RECIPE && ItemTable.getInstance().getTemplate(recipe.getItemId()).getItemType() == EtcItemType.RECIPE)
        {
          L2Recipe rp = RecipeController.getInstance().getRecipeByRecipeItem(recipe.getItemId());
          if(player.hasRecipe(rp))
          {
            continue;
          }
          player.sendPacket(Msg.NOT_ENOUGH_MATERIALS, new RecipeItemMakeInfo(recipeList.getId(), player, 0));
          return;
        }
        L2ItemInstance invItem = inventory.getItemByItemId(recipe.getItemId());
        if(invItem == null || recipe.getQuantity() > invItem.getCount())
        {
          player.sendPacket(Msg.NOT_ENOUGH_MATERIALS, new RecipeItemMakeInfo(recipeList.getId(), player, 0));
          return;
        }
      }
      player.reduceCurrentMp(recipeList.getMpCost(), null);
      for(L2RecipeComponent recipe : recipes)
      {
        if(recipe.getQuantity() != 0)
        {
          L2ItemInstance invItem = inventory.getItemByItemId(recipe.getItemId());
          if(Config.ALT_GAME_UNREGISTER_RECIPE && ItemTable.getInstance().getTemplate(recipe.getItemId()).getItemType() == EtcItemType.RECIPE)
          {
            player.unregisterRecipe(RecipeController.getInstance().getRecipeByRecipeItem(recipe.getItemId()).getId());
          }
          else
          {
            inventory.destroyItem(invItem, recipe.getQuantity(), false);
            player.sendPacket(SystemMessage.removeItems(invItem.getItemId(), recipe.getQuantity()));
          }
        }
      }
    }
View Full Code Here

      return;
    }
    synchronized(employer.getInventory())
    {
      L2RecipeComponent[] recipes = recipeList.getRecipes();
      Inventory inventory = employer.getInventory();
      for(L2RecipeComponent recipe : recipes)
      {
        if(recipe.getQuantity() == 0)
        {
          continue;
        }
        L2ItemInstance invItem = inventory.getItemByItemId(recipe.getItemId());
        if(invItem == null || recipe.getQuantity() > invItem.getCount())
        {
          employer.sendPacket(Msg.NOT_ENOUGH_MATERIALS, new RecipeShopItemInfo(player.getObjectId(), recipeListId, price, success, employer));
          return;
        }
      }
      player.reduceCurrentMp(recipeList.getMpCost(), null);
      for(L2RecipeComponent recipe : recipes)
      {
        if(recipe.getQuantity() != 0)
        {
          L2ItemInstance invItem = inventory.getItemByItemId(recipe.getItemId());
          inventory.destroyItem(invItem, recipe.getQuantity(), false);
          employer.sendPacket(SystemMessage.removeItems(invItem.getItemId(), recipe.getQuantity()));
        }
      }
    }
    if(price > 0)
View Full Code Here

  {
    if(!env.character.isPlayer())
    {
      return false;
    }
    Inventory inv = ((L2Player) env.character).getInventory();
    L2ItemInstance item = inv.getPaperdollItem(_slot);
    if(item == null)
    {
      return false;
    }
    return (item.getItem().getItemMask() & _mask) != 0;
View Full Code Here

TOP

Related Classes of l2p.gameserver.model.items.Inventory$ItemOrderComparator

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.