Examples of SimpleSpawner


Examples of lineage2.gameserver.model.SimpleSpawner

   * @param respawnDelay int
   * @return NpcInstance
   */
  public NpcInstance addSpawnWithRespawn(int npcId, Location loc, int randomOffset, int respawnDelay)
  {
    SimpleSpawner sp = new SimpleSpawner(NpcHolder.getInstance().getTemplate(npcId));
    sp.setLoc(randomOffset > 0 ? Location.findPointToStay(loc, 0, randomOffset, getGeoIndex()) : loc);
    sp.setReflection(this);
    sp.setAmount(1);
    sp.setRespawnDelay(respawnDelay);
    sp.doSpawn(true);
    sp.startRespawn();
    return sp.getLastSpawn();
  }
View Full Code Here

Examples of lineage2.gameserver.model.SimpleSpawner

      @Override
      public void runImpl()
      {
        for (SimpleSpawner s : riftRoom.getSpawns())
        {
          SimpleSpawner sp = s.clone();
          sp.setReflection(DelusionChamber.this);
          addSpawn(sp);
          if (!isBossRoom)
          {
            sp.startRespawn();
          }
          for (int i = 0; i < sp.getAmount(); i++)
          {
            sp.doSpawn(true);
          }
        }
        DelusionChamber.this.addSpawnWithoutRespawn(getManagerId(), riftRoom.getTeleportCoords(), 0);
      }
    }, 10000);
View Full Code Here

Examples of lineage2.gameserver.model.SimpleSpawner

   * @param killer Creature
   * @param loc Location
   */
  static void spawnNextMob(int npcId, Creature killer, Location loc)
  {
    final SimpleSpawner sp = new SimpleSpawner(npcId);
    sp.setLocx(loc.x);
    sp.setLocy(loc.y);
    sp.setLocz(loc.z);
    final NpcInstance npc = sp.doSpawn(true);
    npc.setHeading(PositionUtils.calculateHeadingFrom(npc, killer));
    npc.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, killer, 1000);
  }
View Full Code Here

Examples of lineage2.gameserver.model.SimpleSpawner

      }
    };
    final NpcTemplate template = NpcHolder.getInstance().getTemplate(31391);
    for (int[] element : EVENT_MANAGERS)
    {
      SimpleSpawner sp = new SimpleSpawner(template);
      sp.setLocx(element[0]);
      sp.setLocy(element[1]);
      sp.setLocz(element[2]);
      sp.setHeading(element[3]);
      NpcInstance npc = sp.doSpawn(true);
      npc.setName("Arena 2");
      npc.setTitle("TvT Event");
      _spawns.add(npc);
    }
  }
View Full Code Here

Examples of lineage2.gameserver.model.SimpleSpawner

      final NpcTemplate template = NpcHolder.getInstance().getTemplate(18672);
      try
      {
        for (int i = 0; i < _numOfBoxes; i++)
        {
          SimpleSpawner spawn = new SimpleSpawner(template);
          spawn.setLocx(_arenaCoordinates[_arena][4] + Rnd.get(-400, 400));
          spawn.setLocy(_arenaCoordinates[_arena][5] + Rnd.get(-400, 400));
          spawn.setLocz(_zCoord);
          spawn.setAmount(1);
          spawn.setHeading(1);
          spawn.setRespawnDelay(1);
          BlockInstance blockInstance = (BlockInstance) spawn.doSpawn(true);
          blockInstance.setRed((random % 2) == 0);
          _spawns.add(spawn);
          random++;
        }
      }
      catch (Exception e)
      {
        e.printStackTrace();
      }
      if ((_round == 1) || (_round == 2))
      {
        NpcTemplate girl = NpcHolder.getInstance().getTemplate(18676);
        try
        {
          final SimpleSpawner girlSpawn = new SimpleSpawner(girl);
          girlSpawn.setLocx(_arenaCoordinates[_arena][4] + Rnd.get(-400, 400));
          girlSpawn.setLocy(_arenaCoordinates[_arena][5] + Rnd.get(-400, 400));
          girlSpawn.setLocz(_zCoord);
          girlSpawn.setAmount(1);
          girlSpawn.setHeading(1);
          girlSpawn.setRespawnDelay(1);
          girlSpawn.doSpawn(true);
          girlSpawn.init();
          _girlNpc = girlSpawn.getLastSpawn();
          ThreadPoolManager.getInstance().schedule(new RunnableImpl()
          {
            @Override
            public void runImpl()
            {
View Full Code Here

Examples of lineage2.gameserver.model.SimpleSpawner

    {
      System.out.println("WARNING! events.SavingSnowman.captureSnowman template is null for npc: " + SNOWMAN_ID);
      Thread.dumpStack();
      return;
    }
    SimpleSpawner sp = new SimpleSpawner(template);
    sp.setLoc(spawnPoint);
    sp.setAmount(1);
    sp.setRespawnDelay(0);
    _snowman = sp.doSpawn(true);
    if (_snowman == null)
    {
      return;
    }
    template = NpcHolder.getInstance().getTemplate(THOMAS_ID);
    if (template == null)
    {
      System.out.println("WARNING! events.SavingSnowman.captureSnowman template is null for npc: " + THOMAS_ID);
      Thread.dumpStack();
      return;
    }
    Location pos = Location.findPointToStay(_snowman, 100, 120);
    sp = new SimpleSpawner(template);
    sp.setLoc(pos);
    sp.setAmount(1);
    sp.setRespawnDelay(0);
    _thomas = sp.doSpawn(true);
    if (_thomas == null)
    {
      return;
    }
    _snowmanState = SnowmanState.CAPTURED;
View Full Code Here

Examples of lineage2.gameserver.model.SimpleSpawner

      }
    };
    final NpcTemplate template = NpcHolder.getInstance().getTemplate(31390);
    for (int[] element : EVENT_MANAGERS)
    {
      SimpleSpawner sp = new SimpleSpawner(template);
      sp.setLocx(element[0]);
      sp.setLocy(element[1]);
      sp.setLocz(element[2]);
      sp.setHeading(element[3]);
      NpcInstance npc = sp.doSpawn(true);
      npc.setName("Arena 1");
      npc.setTitle("TvT Event");
      _spawns.add(npc);
    }
  }
View Full Code Here

Examples of lineage2.gameserver.model.SimpleSpawner

      }
    };
    final NpcTemplate template = NpcHolder.getInstance().getTemplate(31392);
    for (int[] element : EVENT_MANAGERS)
    {
      SimpleSpawner sp = new SimpleSpawner(template);
      sp.setLocx(element[0]);
      sp.setLocy(element[1]);
      sp.setLocz(element[2]);
      sp.setHeading(element[3]);
      NpcInstance npc = sp.doSpawn(true);
      npc.setName("Arena 3");
      npc.setTitle("TvT Event");
      _spawns.add(npc);
    }
  }
View Full Code Here

Examples of lineage2.gameserver.model.SimpleSpawner

      teredorEggs = r.getAllByNpcId(teredorLairEgg, true);
      ThreadPoolManager.getInstance().scheduleAtFixedDelay(new EggSpawnTask(r), 1000, delayEggTask * 1000);
    }
    if (!_eliteSpawned)
    {
      final SimpleSpawner sp = new SimpleSpawner(NpcHolder.getInstance().getTemplate(eliteMillipede));
      sp.setLoc(Location.findPointToStay(actor, 100, 120));
      for (int i = 0; i == 2; i++)
      {
        NpcInstance npc = sp.doSpawn(true);
        npc.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, actor.getAggroList().getMostHated(), Rnd.get(1, 100));
      }
      _eliteSpawned = true;
    }
    super.thinkAttack();
View Full Code Here

Examples of lineage2.gameserver.model.SimpleSpawner

    {
      for (int i = 0; i < 4; i++)
      {
        try
        {
          SimpleSpawner sp = new SimpleSpawner(NpcHolder.getInstance().getTemplate(18493));
          sp.setLoc(Location.findPointToStay(actor, 150, 250));
          sp.setReflection(actor.getReflection());
          sp.doSpawn(true);
          sp.stopRespawn();
        }
        catch (Exception e)
        {
          e.printStackTrace();
        }
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.