Package lineage2.gameserver.templates.item

Examples of lineage2.gameserver.templates.item.RecipeTemplate


    {
      return;
    }
    if (!Config.ALT_ALLOW_SHADOW_WEAPONS)
    {
      show(new CustomMessage("common.Disabled", player), player);
      return;
    }
    if ((player.getLevel() > 19) || (player.getClassLevel() > 1))
    {
      show("Your level is too high!", player);
View Full Code Here


    {
      return;
    }
    if (!Config.ALT_ALLOW_SHADOW_WEAPONS)
    {
      show(new CustomMessage("common.Disabled", player), player);
      return;
    }
    if ((player.getLevel() > 39) || (player.getClassLevel() > 2))
    {
      show("Your level is too high!", player);
View Full Code Here

      ThreadPoolManager.getInstance().schedule(new RestoreOfflineTraders(), 30000L);
    }
    getListeners().onStart();
    if (Config.IS_TELNET_ENABLED)
    {
      statusServer = new TelnetServer();
    }
    else
    {
      _log.info("Telnet server is currently disabled.");
    }
View Full Code Here

      _selectorThreads[i].start();
    }
    LoginServerCommunication.getInstance().start();
    if (Config.SERVICES_OFFLINE_TRADE_RESTORE_AFTER_RESTART)
    {
      ThreadPoolManager.getInstance().schedule(new RestoreOfflineTraders(), 30000L);
    }
    getListeners().onStart();
    if (Config.IS_TELNET_ENABLED)
    {
      statusServer = new TelnetServer();
View Full Code Here

    if (activeChar.isFishing())
    {
      activeChar.sendPacket(SystemMsg.YOU_CANNOT_DO_THAT_WHILE_FISHING_);
      return;
    }
    RecipeTemplate recipe = RecipeHolder.getInstance().getRecipeByRecipeId(_recipeId);
    if ((recipe == null) || (recipe.getMaterials().length == 0))
    {
      activeChar.sendPacket(SystemMsg.THE_RECIPE_IS_INCORRECT);
      return;
    }
    if (activeChar.getCurrentMp() < recipe.getMpConsume())
    {
      activeChar.sendPacket(SystemMsg.NOT_ENOUGH_MP, new RecipeItemMakeInfo(activeChar, recipe, 0));
      return;
    }
    if (!activeChar.findRecipe(_recipeId))
    {
      activeChar.sendPacket(SystemMsg.PLEASE_REGISTER_A_RECIPE, ActionFail.STATIC);
      return;
    }
    activeChar.getInventory().writeLock();
    try
    {
      RecipeComponent[] materials = recipe.getMaterials();
      for (RecipeComponent material : materials)
      {
        if (material.getCount() == 0)
        {
          continue;
        }
        if (Config.ALT_GAME_UNREGISTER_RECIPE && (ItemHolder.getInstance().getTemplate(material.getItemId()).getItemType() == EtcItemType.RECIPE))
        {
          RecipeTemplate rp = RecipeHolder.getInstance().getRecipeByRecipeItem(material.getItemId());
          if (activeChar.hasRecipe(rp))
          {
            continue;
          }
          activeChar.sendPacket(SystemMsg.YOU_DO_NOT_HAVE_ENOUGH_MATERIALS_TO_PERFORM_THAT_ACTION, new RecipeItemMakeInfo(activeChar, recipe, 0));
View Full Code Here

    Player activeChar = getClient().getActiveChar();
    if (activeChar == null)
    {
      return;
    }
    RecipeTemplate recipeList = RecipeHolder.getInstance().getRecipeByRecipeId(_id);
    if (recipeList == null)
    {
      activeChar.sendActionFailed();
      return;
    }
View Full Code Here

                continue;
              }
              for (ManufactureItem mitem : createList)
              {
                int recipeId = mitem.getRecipeId();
                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;
                }
View Full Code Here

        {
          title = "-";
        }
        for (ManufactureItem mi : cl)
        {
          RecipeTemplate rec = RecipeHolder.getInstance().getRecipeByRecipeId(mi.getRecipeId() - 1);
          if (rec == null)
          {
            continue;
          }
          ItemTemplate item = ItemHolder.getInstance().getTemplate(rec.getItemId());
          if (item == null)
          {
            continue;
          }
          String stpl = tpl.replace("%item_name%", item.getName());
View Full Code Here

          }
          else if ((type == 2) && (cl != null))
          {
            for (ManufactureItem mi : cl)
            {
              RecipeTemplate recipe = RecipeHolder.getInstance().getRecipeByRecipeId(mi.getRecipeId() - 1);
              if (recipe != null)
              {
                ItemTemplate item = ItemHolder.getInstance().getTemplate(recipe.getItemId());
                if ((item != null) && (item.getName() != null) && item.getName().toLowerCase().contains(search))
                {
                  s_list.add(seller);
                  break;
                }
View Full Code Here

      final int level = Integer.parseInt(element.attributeValue("level"));
      final int mpConsume = element.attributeValue("mp_consume") == null ? 0 : Integer.parseInt(element.attributeValue("mp_consume"));
      final int successRate = Integer.parseInt(element.attributeValue("success_rate"));
      final int itemId = Integer.parseInt(element.attributeValue("item_id"));
      final boolean isDwarven = element.attributeValue("is_dwarven") == null ? false : Boolean.parseBoolean(element.attributeValue("is_dwarven"));
      RecipeTemplate recipe = new RecipeTemplate(id, level, mpConsume, successRate, itemId, isDwarven);
      for (Iterator<Element> subIterator = element.elementIterator(); subIterator.hasNext();)
      {
        Element subElement = subIterator.next();
        if ("materials".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.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

Related Classes of lineage2.gameserver.templates.item.RecipeTemplate

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.