Package lineage2.commons.time.cron

Examples of lineage2.commons.time.cron.SchedulingPattern$IntArrayValueMatcher


  public void onEvtDead(Creature killer)
  {
    final NpcInstance actor = getActor();
    super.onEvtDead(killer);
    actor.deleteMe();
    ThreadPoolManager.getInstance().schedule(new RunnableImpl()
    {
      @Override
      public void runImpl()
      {
        final NpcTemplate template = NpcHolder.getInstance().getTemplate(18602);
View Full Code Here


          getZone("[soi_hos_attack_attackup_5]").setActive(false);
          spawnRoom(6);
        }
      }
      else if(self.getNpcId() == Yehan)
        ThreadPoolManager.getInstance().schedule(new RunnableImpl(){
          @Override
          public void runImpl() throws Exception
          {
            spawnRoom(7);
            setReenterTime(System.currentTimeMillis());
View Full Code Here

   * @param time String
   * @param shutdownMode int
   */
  public void schedule(String time, int shutdownMode)
  {
    SchedulingPattern cronTime;
    try
    {
      cronTime = new SchedulingPattern(time);
    }
    catch (InvalidPatternException e)
    {
      return;
    }
    int seconds = (int) ((cronTime.next(System.currentTimeMillis()) / 1000L) - (System.currentTimeMillis() / 1000L));
    schedule(seconds, shutdownMode);
  }
View Full Code Here

    for (Iterator<Element> iterator = rootElement.elementIterator(); iterator.hasNext();)
    {
      Element element = iterator.next();
      int instanceId;
      String name;
      SchedulingPattern resetReuse = new SchedulingPattern("30 6 * * *");
      int timelimit = -1;
      int timer = 60;
      int mapx = -1;
      int mapy = -1;
      boolean dispelBuffs = false;
      boolean onPartyDismiss = true;
      int mobId, respawn, respawnRnd, count, sharedReuseGroup = 0;
      int collapseIfEmpty = 0;
      int spawnType = 0;
      SpawnInfo spawnDat = null;
      int removedItemId = 0, removedItemCount = 0, giveItemId = 0, givedItemCount = 0, requiredQuestId = 0;
      int maxChannels = 20;
      boolean removedItemNecessity = false;
      boolean setReuseUponEntry = true;
      StatsSet params = new StatsSet();
      List<InstantZone.SpawnInfo> spawns = new ArrayList<>();
      IntObjectMap<InstantZone.DoorInfo> doors = Containers.emptyIntObjectMap();
      Map<String, InstantZone.ZoneInfo> zones = Collections.emptyMap();
      Map<String, InstantZone.SpawnInfo2> spawns2 = Collections.emptyMap();
      instanceId = Integer.parseInt(element.attributeValue("id"));
      name = element.attributeValue("name");
      String n = element.attributeValue("timelimit");
      if (n != null)
      {
        timelimit = Integer.parseInt(n);
      }
      n = element.attributeValue("collapseIfEmpty");
      collapseIfEmpty = Integer.parseInt(n);
      n = element.attributeValue("maxChannels");
      maxChannels = Integer.parseInt(n);
      n = element.attributeValue("dispelBuffs");
      dispelBuffs = (n != null) && Boolean.parseBoolean(n);
      int minLevel = 0, maxLevel = 0, minParty = 1, maxParty = 7;
      List<Location> teleportLocs = Collections.emptyList();
      Location ret = null;
      for (Iterator<Element> subIterator = element.elementIterator(); subIterator.hasNext();)
      {
        Element subElement = subIterator.next();
        if ("level".equalsIgnoreCase(subElement.getName()))
        {
          minLevel = Integer.parseInt(subElement.attributeValue("min"));
          maxLevel = Integer.parseInt(subElement.attributeValue("max"));
        }
        else if ("collapse".equalsIgnoreCase(subElement.getName()))
        {
          onPartyDismiss = Boolean.parseBoolean(subElement.attributeValue("on-party-dismiss"));
          timer = Integer.parseInt(subElement.attributeValue("timer"));
        }
        else if ("party".equalsIgnoreCase(subElement.getName()))
        {
          minParty = Integer.parseInt(subElement.attributeValue("min"));
          maxParty = Integer.parseInt(subElement.attributeValue("max"));
        }
        else if ("return".equalsIgnoreCase(subElement.getName()))
        {
          ret = Location.parseLoc(subElement.attributeValue("loc"));
        }
        else if ("teleport".equalsIgnoreCase(subElement.getName()))
        {
          if (teleportLocs.isEmpty())
          {
            teleportLocs = new ArrayList<>(1);
          }
          teleportLocs.add(Location.parseLoc(subElement.attributeValue("loc")));
        }
        else if ("remove".equalsIgnoreCase(subElement.getName()))
        {
          removedItemId = Integer.parseInt(subElement.attributeValue("itemId"));
          removedItemCount = Integer.parseInt(subElement.attributeValue("count"));
          removedItemNecessity = Boolean.parseBoolean(subElement.attributeValue("necessary"));
        }
        else if ("give".equalsIgnoreCase(subElement.getName()))
        {
          giveItemId = Integer.parseInt(subElement.attributeValue("itemId"));
          givedItemCount = Integer.parseInt(subElement.attributeValue("count"));
        }
        else if ("quest".equalsIgnoreCase(subElement.getName()))
        {
          requiredQuestId = Integer.parseInt(subElement.attributeValue("id"));
        }
        else if ("reuse".equalsIgnoreCase(subElement.getName()))
        {
          resetReuse = new SchedulingPattern(subElement.attributeValue("resetReuse"));
          sharedReuseGroup = Integer.parseInt(subElement.attributeValue("sharedReuseGroup"));
          setReuseUponEntry = Boolean.parseBoolean(subElement.attributeValue("setUponEntry"));
        }
        else if ("geodata".equalsIgnoreCase(subElement.getName()))
        {
View Full Code Here

   * @param pattern - cron
   */
  protected final void initSchedulingPattern(String pattern)
  {
    StartConditionInit();
    DynamicQuestController.getInstance().initSchedulingPattern(getQuestId(), new SchedulingPattern(pattern));
  }
View Full Code Here

              int instanceId = Integer.parseInt(nab.getNamedItem("id").getNodeValue());
              if (_managerInstances.containsKey(instanceId))
              {
                throw new Exception("Duplicate instanceId " + instanceId);
              }
              SchedulingPattern dateTime = new SchedulingPattern(nab.getNamedItem("schedule").getNodeValue());
              List<AuctionItem> items = new ArrayList<>();
              for (Node nc = nb.getFirstChild(); nc != null; nc = nc.getNextSibling())
              {
                if ("item".equalsIgnoreCase(nc.getNodeName()))
                {
View Full Code Here

   * @param player Player
   * @return int
   */
  public int getMinutesToNextEntrance(int id, Player player)
  {
    SchedulingPattern resetReuse = getResetReuseById(id);
    if (resetReuse == null)
    {
      return 0;
    }
    Long time = null;
    if ((getSharedReuseInstanceIds(id) != null) && !getSharedReuseInstanceIds(id).isEmpty())
    {
      List<Long> reuses = new ArrayList<>();
      for (int i : getSharedReuseInstanceIds(id))
      {
        if (player.getInstanceReuse(i) != null)
        {
          reuses.add(player.getInstanceReuse(i));
        }
      }
      if (!reuses.isEmpty())
      {
        Collections.sort(reuses);
        time = reuses.get(reuses.size() - 1);
      }
    }
    else
    {
      time = player.getInstanceReuse(id);
    }
    if (time == null)
    {
      return 0;
    }
    return (int) Math.max((resetReuse.next(time) - System.currentTimeMillis()) / 60000L, 0);
  }
View Full Code Here

  {
    _instance = this;
    _serverStarted = time();
    _listeners = new GameServerListenerList();
    new File("./log/").mkdir();
    version = new Version(GameServer.class);
    _log.info("=================================================");
    _log.info("Revision: ................ " + version.getRevisionNumber());
    _log.info("Build date: .............. " + version.getBuildDate());
    _log.info("Compiler version: ........ " + version.getBuildJdk());
    _log.info("=================================================");
View Full Code Here

    {
      synchronized (this)
      {
        if (_ai == null)
        {
          _ai = new ClonePlayerAI(this);
        }
      }
    }
    return (ClonePlayerAI) _ai;
  }
View Full Code Here

    }
    catch (Exception e)
    {
      _log.error("Unable to create ai of doorId " + _id, e);
    }
    return new DoorAI(door);
  }
View Full Code Here

TOP

Related Classes of lineage2.commons.time.cron.SchedulingPattern$IntArrayValueMatcher

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.