Examples of RecipeComponent


Examples of lineage2.gameserver.templates.item.RecipeTemplate.RecipeComponent

    {
      activeChar.getInventory().writeUnlock();
    }
    activeChar.resetWaitSitTime();
    activeChar.reduceCurrentMp(recipe.getMpConsume(), null);
    RecipeComponent product = recipe.getRandomProduct();
    int itemId = product.getItemId();
    long itemsCount = product.getCount();
    int success = 0;
    if (Rnd.chance(recipe.getSuccessRate()))
    {
      ItemFunctions.addItem(activeChar, itemId, itemsCount, true);
      success = 1;
View Full Code Here

Examples of lineage2.gameserver.templates.item.RecipeTemplate.RecipeComponent

                RecipeTemplate recipe = RecipeHolder.getInstance().getRecipeByRecipeId(recipeId);
                if ((recipe == null) || (recipe.getProducts().length == 0))
                {
                  continue;
                }
                RecipeComponent product = recipe.getProducts()[0];
                ItemTemplate temp = ItemHolder.getInstance().getTemplate(product.getItemId());
                if (temp == null)
                {
                  continue;
                }
                TreeMap<Long, Item> oldItems = items.get(temp.getName());
                if (oldItems == null)
                {
                  oldItems = new TreeMap<>();
                  items.put(temp.getName(), oldItems);
                }
                Item newItem = new Item(product.getItemId(), type, mitem.getCost(), product.getCount(), 0, temp.getName(), pl.getStoredId(), pl.getName(), pl.getLoc(), itemObjId++, null);
                long key = newItem.price * 100;
                while ((key < ((newItem.price * 100) + 100)) && oldItems.containsKey(key))
                {
                  key++;
                }
View Full Code Here

Examples of lineage2.gameserver.templates.item.RecipeTemplate.RecipeComponent

          {
            if ("item".equalsIgnoreCase(e.getName()))
            {
              int item_id = Integer.parseInt(e.attributeValue("id"));
              long count = Long.parseLong(e.attributeValue("count"));
              recipe.addMaterial(new RecipeComponent(item_id, count));
            }
          }
        }
        else if ("products".equalsIgnoreCase(subElement.getName()))
        {
          for (Element e : subElement.elements())
          {
            if ("item".equalsIgnoreCase(e.getName()))
            {
              int item_id = Integer.parseInt(e.attributeValue("id"));
              long count = Long.parseLong(e.attributeValue("count"));
              int chance = Integer.parseInt(e.attributeValue("chance"));
              recipe.addProduct(new RecipeComponent(item_id, count, chance));
            }
          }
        }
        else if ("npc_fee".equalsIgnoreCase(subElement.getName()))
        {
          for (Element e : subElement.elements())
          {
            if ("item".equalsIgnoreCase(e.getName()))
            {
              int item_id = Integer.parseInt(e.attributeValue("id"));
              long count = Long.parseLong(e.attributeValue("count"));
              recipe.addNpcFee(new RecipeComponent(item_id, count));
            }
          }
        }
      }
      getHolder().addRecipe(recipe);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.