Examples of SimpleSpawner


Examples of lineage2.gameserver.model.SimpleSpawner

  {
    for (int i = 0; i < count; i++)
    {
      try
      {
        SimpleSpawner sp = new SimpleSpawner(mobId);
        sp.setLoc(Territory.getRandomLoc(territory).setH(Rnd.get(65535)));
        sp.doSpawn(true);
        sp.stopRespawn();
        _roomMobList.add(sp.getLastSpawn());
      }
      catch (Exception e)
      {
        e.printStackTrace();
      }
View Full Code Here

Examples of lineage2.gameserver.model.SimpleSpawner

   */
  private void spawnExactToRoom(int mobId, Location loc, int roomId)
  {
    try
    {
      SimpleSpawner sp = new SimpleSpawner(NpcHolder.getInstance().getTemplate(mobId));
      sp.setLoc(loc);
      sp.doSpawn(true);
      sp.stopRespawn();
      _roomMobList.add(sp.getLastSpawn());
    }
    catch (Exception e)
    {
      e.printStackTrace();
    }
View Full Code Here

Examples of lineage2.gameserver.model.SimpleSpawner

      {
        return;
      }
      try
      {
        _spawn = new SimpleSpawner(template);
      }
      catch (Exception E)
      {
        return;
      }
View Full Code Here

Examples of lineage2.gameserver.model.SimpleSpawner

      Thread.dumpStack();
      return;
    }
    for (int[] location : locations)
    {
      SimpleSpawner sp = new SimpleSpawner(template);
      sp.setLoc(new Location(location[0], location[1], location[2]));
      sp.setAmount(1);
      sp.setRespawnDelay(0);
      sp.init();
      if (list != null)
      {
        list.add(sp);
      }
    }
View Full Code Here

Examples of lineage2.gameserver.model.SimpleSpawner

    }
    if (!activeChar.getInventory().destroyItem(item, 1L))
    {
      return false;
    }
    final SimpleSpawner spawn = new SimpleSpawner(template);
    spawn.setLoc(Location.findPointToStay(activeChar, 30, 70));
    final NpcInstance npc = spawn.doSpawn(true);
    npc.setAI(new MeleonAI(npc));
    ((MeleonInstance) npc).setSpawner(activeChar);
    ThreadPoolManager.getInstance().schedule(new DeSpawnScheduleTimerTask(spawn), 180000);
    return true;
  }
View Full Code Here

Examples of lineage2.gameserver.model.SimpleSpawner

    {
      return;
    }
    for (InstantZone.SpawnInfo s : si)
    {
      SimpleSpawner c;
      switch (s.getSpawnType())
      {
        case 0:
          for (Location loc : s.getCoords())
          {
            c = new SimpleSpawner(s.getNpcId());
            c.setReflection(this);
            c.setRespawnDelay(s.getRespawnDelay(), s.getRespawnRnd());
            c.setAmount(s.getCount());
            c.setLoc(loc);
            c.doSpawn(true);
            if (s.getRespawnDelay() == 0)
            {
              c.stopRespawn();
            }
            else
            {
              c.startRespawn();
            }
            addSpawn(c);
          }
          break;
        case 1:
          c = new SimpleSpawner(s.getNpcId());
          c.setReflection(this);
          c.setRespawnDelay(s.getRespawnDelay(), s.getRespawnRnd());
          c.setAmount(1);
          c.setLoc(s.getCoords().get(Rnd.get(s.getCoords().size())));
          c.doSpawn(true);
          if (s.getRespawnDelay() == 0)
          {
            c.stopRespawn();
          }
          else
          {
            c.startRespawn();
          }
          addSpawn(c);
          break;
        case 2:
          c = new SimpleSpawner(s.getNpcId());
          c.setReflection(this);
          c.setRespawnDelay(s.getRespawnDelay(), s.getRespawnRnd());
          c.setAmount(s.getCount());
          c.setTerritory(s.getLoc());
          for (int j = 0; j < s.getCount(); j++)
          {
            c.doSpawn(true);
          }
          if (s.getRespawnDelay() == 0)
          {
            c.stopRespawn();
          }
          else
          {
            c.startRespawn();
          }
          addSpawn(c);
      }
    }
  }
View Full Code Here

Examples of lineage2.gameserver.model.SimpleSpawner

      final MeleonInstance actor = getActor();
      if (actor == null)
      {
        return;
      }
      SimpleSpawner spawn = null;
      try
      {
        spawn = new SimpleSpawner(NpcHolder.getInstance().getTemplate(_npcId));
        spawn.setLoc(actor.getLoc());
        final NpcInstance npc = spawn.doSpawn(true);
        npc.setAI(new MeleonAI(npc));
        ((MeleonInstance) npc).setSpawner(actor.getSpawner());
      }
      catch (Exception e)
      {
View Full Code Here

Examples of lineage2.gameserver.model.SimpleSpawner

    }
    if (!activeChar.getInventory().destroyItem(item, 1L))
    {
      return false;
    }
    final SimpleSpawner spawn = new SimpleSpawner(template);
    spawn.setLoc(activeChar.getLoc());
    final NpcInstance npc = spawn.doSpawn(false);
    npc.setTitle(activeChar.getName());
    spawn.respawnNpc(npc);
    if (itemId == 5561)
    {
      npc.setAI(new ctreeAI(npc));
    }
    ThreadPoolManager.getInstance().schedule(new DeSpawnScheduleTimerTask(spawn), (activeChar.isInPeaceZone() ? DESPAWN_TIME / 3 : DESPAWN_TIME));
View Full Code Here

Examples of lineage2.gameserver.model.SimpleSpawner

    }
    if (!activeChar.getInventory().destroyItem(item, 1L))
    {
      return false;
    }
    final SimpleSpawner spawn = new SimpleSpawner(template);
    spawn.setLoc(Location.findPointToStay(activeChar, 30, 70));
    final NpcInstance npc = spawn.doSpawn(true);
    npc.setAI(new SquashAI(npc));
    ((SquashInstance) npc).setSpawner(activeChar);
    ThreadPoolManager.getInstance().schedule(new DeSpawnScheduleTimerTask(spawn), 180000);
    return true;
  }
View Full Code Here

Examples of lineage2.gameserver.model.SimpleSpawner

      final SquashInstance actor = getActor();
      if (actor == null)
      {
        return;
      }
      SimpleSpawner spawn = null;
      try
      {
        spawn = new SimpleSpawner(NpcHolder.getInstance().getTemplate(_npcId));
        spawn.setLoc(actor.getLoc());
        final NpcInstance npc = spawn.doSpawn(true);
        npc.setAI(new SquashAI(npc));
        ((SquashInstance) npc).setSpawner(actor.getSpawner());
      }
      catch (Exception e)
      {
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.