Package lineage2.gameserver.templates.item.RecipeTemplate

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


      _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


    {
      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

                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

          {
            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

   * @param template NpcTemplate
   */
  public Kama26BossInstance(int objectId, NpcTemplate template)
  {
    super(objectId, template);
    getMinionList().addMinion(new MinionData(18556, 1));
  }
View Full Code Here

    ThreadPoolManager.getInstance().schedule(new RunnableImpl()
    {
      @Override
      public void runImpl()
      {
        final NpcTemplate template = NpcHolder.getInstance().getTemplate(18602);
        if (template != null)
        {
          final NpcInstance a = template.getNewInstance();
          a.setCurrentHpMp(a.getMaxHp(), a.getMaxMp());
          a.spawnMe(actor.getLoc());
        }
      }
    }, 10000L);
View Full Code Here

      {
        player.sendPacket(Msg.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE);
        return;
      }
    }
    final Location pos = Location.findPointToStay(x, y, z, 50, 100, player.getGeoIndex());
    if (price > 0)
    {
      player.reduceAdena(price, true);
    }
    player.teleToLocation(pos);
View Full Code Here

      player.sendPacket(SystemMessage2.removeItems(item, count));
    }
    final int x = Integer.parseInt(param[0]);
    final int y = Integer.parseInt(param[1]);
    final int z = Integer.parseInt(param[2]);
    final Location pos = Location.findPointToStay(x, y, z, 20, 70, player.getGeoIndex());
    player.teleToLocation(pos);
  }
View Full Code Here

      return;
    }
    final String var = player.getVar("DCBackCoords");
    if ((var == null) || var.isEmpty())
    {
      player.teleToLocation(new Location(43768, -48232, -800), 0);
      return;
    }
    player.teleToLocation(Location.parseLoc(var), 0);
    player.unsetVar("DCBackCoords");
  }
View Full Code Here

    }
    for (Player player : World.getAroundPlayers(actor, 200, 200))
    {
      if (player != null)
      {
        player.teleToLocation(new Location(207559, 86429, -1000));
      }
    }
    return true;
  }
View Full Code Here

TOP

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

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.