Package com.l2jfrozen.gameserver.model

Examples of com.l2jfrozen.gameserver.model.Inventory$StatsListener


  @Override
  public boolean testImpl(Env env)
  {
    if(!(env.player instanceof L2PcInstance))
      return false;
    Inventory inv = ((L2PcInstance) env.player).getInventory();
    L2ItemInstance item = inv.getPaperdollItem(_slot);
    if(item == null)
      return false;
    return (item.getItem().getItemMask() & _mask) != 0;
  }
View Full Code Here


  @Override
  public boolean testImpl(Env env)
  {
    if(!(env.player instanceof L2PcInstance))
      return false;
    Inventory inv = ((L2PcInstance) env.player).getInventory();
    L2ItemInstance item = inv.getPaperdollItem(_slot);
    if(item == null)
      return _itemId == 0;
    return item.getItemId() == _itemId && item.getEnchantLevel() >= _enchantLevel;
  }
View Full Code Here

  @Override
  public boolean testImpl(Env env)
  {
    if (!(env.player instanceof L2PcInstance))
      return false;
    Inventory inv = ((L2PcInstance) env.player).getInventory();
   
    //If ConditionUsingItemType is one between Light, Heavy or Magic
    if (_armor)
    {
      //Get the itemMask of the weared chest (if exists)
      L2ItemInstance chest = inv.getPaperdollItem(Inventory.PAPERDOLL_CHEST);
      if (chest == null)
        return false;
      int chestMask = chest.getItem().getItemMask();
     
      //If chest armor is different from the condition one return false
      if ((_mask & chestMask) == 0)
        return false;
     
      //So from here, chest armor matches conditions
     
      int chestBodyPart = chest.getItem().getBodyPart();
      //return True if chest armor is a Full Armor
      if (chestBodyPart == L2Item.SLOT_FULL_ARMOR)
        return true;
     
      L2ItemInstance legs = inv.getPaperdollItem(Inventory.PAPERDOLL_LEGS);
      if (legs == null)
        return false;
      int legMask = legs.getItem().getItemMask();
      //return true if legs armor matches too
      return (_mask & legMask) != 0;
    }
    return (_mask & inv.getWearedMask()) != 0;
  }
View Full Code Here

    }

    private List<TempItem> listItems(boolean remove)
    {
      L2RecipeInstance[] recipes = _recipeList.getRecipes();
      Inventory inv = _target.getInventory();
      List<TempItem> materials = new FastList<TempItem>();

      for(L2RecipeInstance recipe : recipes)
      {
        int quantity = _recipeList.isConsumable() ? (int) (recipe.getQuantity() * Config.RATE_CONSUMABLE_COST) : recipe.getQuantity();

        if(quantity > 0)
        {
          L2ItemInstance item = inv.getItemByItemId(recipe.getItemId());

          // check materials
          if(item == null || item.getCount() < quantity)
          {
            _target.sendMessage("You dont have the right elements for making this item" + (_recipeList.isConsumable() && Config.RATE_CONSUMABLE_COST != 1 ? ".\nDue to server rates you need " + Config.RATE_CONSUMABLE_COST + "x more material than listed in recipe" : ""));
            abort();
            return null;
          }

          // make new temporary object, just for counting puroses

          TempItem temp = new TempItem(item, quantity);
          materials.add(temp);
          temp = null;
        }
      }

      recipes = null;

      if(remove)
      {
        for(TempItem tmp : materials)
        {
          inv.destroyItemByItemId("Manufacture", tmp.getItemId(), tmp.getQuantity(), _target, _player);
        }
      }
      inv = null;

      return materials;
View Full Code Here

  @Override
  public void giveAllToOwner()
  {
    try
    {
      Inventory petInventory = getInventory();
      L2ItemInstance[] items = petInventory.getItems();
      petInventory = null;
      for(int i = 0; i < items.length; i++)
      {
        L2ItemInstance giveit = items[i];
        if(giveit.getItem().getWeight() * giveit.getCount() + getOwner().getInventory().getTotalWeight() < getOwner().getMaxLoad())
View Full Code Here

    else if(player.isMaryRequest())
    {
      // check for formalwear
      if(Config.L2JMOD_WEDDING_FORMALWEAR)
      {
        Inventory inv3 = player.getInventory();
        L2ItemInstance item3 = inv3.getPaperdollItem(10);
        if(item3 == null)
        {
          player.setIsWearingFormalWear(false);
        }
        else
        {
          String strItem = Integer.toString(item3.getItemId());
          String frmWear = Integer.toString(6408);
          player.sendMessage(strItem);
          if(strItem.equals(frmWear))
          {
            player.setIsWearingFormalWear(true);
          }
          else
          {
            player.setIsWearingFormalWear(false);
          }
          strItem = null;
          frmWear = null;
        }
        inv3 = null;
        item3 = null;
      }

      if(Config.L2JMOD_WEDDING_FORMALWEAR && !player.isWearingFormalWear())
      {
        filename = "data/html/mods/Wedding_noformal.htm";
        sendHtmlMessage(player, filename, replace);
        return;
      }

      filename = "data/html/mods/Wedding_ask.htm";
      player.setMaryRequest(false);
      ptarget.setMaryRequest(false);
      replace = ptarget.getName();
      sendHtmlMessage(player, filename, replace);
      return;
    }
    else if(command.startsWith("AskWedding"))
    {
      // check for formalwear
      if(Config.L2JMOD_WEDDING_FORMALWEAR)
      {
        Inventory inv3 = player.getInventory();
        L2ItemInstance item3 = inv3.getPaperdollItem(10);

        if(null == item3)
        {
          player.setIsWearingFormalWear(false);
        }
View Full Code Here

TOP

Related Classes of com.l2jfrozen.gameserver.model.Inventory$StatsListener

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.