Examples of SimpleSpawner


Examples of lineage2.gameserver.model.SimpleSpawner

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

Examples of lineage2.gameserver.model.SimpleSpawner

    if (!Config.SERVICES_PARNASSUS_ENABLED)
    {
      return;
    }
    ReflectionManager.PARNASSUS.setCoreLoc(new Location(149384, 171896, -952));
    SimpleSpawner spawn = new SimpleSpawner(30086);
    spawn.setLocx(149960);
    spawn.setLocy(174136);
    spawn.setLocz(-920);
    spawn.setAmount(1);
    spawn.setHeading(32768);
    spawn.setRespawnDelay(5);
    spawn.setReflection(ReflectionManager.PARNASSUS);
    spawn.init();
    _spawns.add(spawn);
    spawn = new SimpleSpawner(30839);
    spawn.setLocx(149368);
    spawn.setLocy(174264);
    spawn.setLocz(-896);
    spawn.setAmount(1);
    spawn.setHeading(49152);
    spawn.setRespawnDelay(5);
    spawn.setReflection(ReflectionManager.PARNASSUS);
    spawn.init();
    _spawns.add(spawn);
    spawn = new SimpleSpawner(13129);
    spawn.setLocx(149368);
    spawn.setLocy(172568);
    spawn.setLocz(-952);
    spawn.setAmount(1);
    spawn.setHeading(49152);
    spawn.setRespawnDelay(5);
    spawn.setReflection(ReflectionManager.PARNASSUS);
    spawn.init();
    _spawns.add(spawn);
    spawn = new SimpleSpawner(31860);
    spawn.setLocx(148904);
    spawn.setLocy(173656);
    spawn.setLocz(-952);
    spawn.setAmount(1);
    spawn.setHeading(49152);
    spawn.setRespawnDelay(5);
    spawn.setReflection(ReflectionManager.PARNASSUS);
    spawn.init();
    _spawns.add(spawn);
    spawn = new SimpleSpawner(30300);
    spawn.setLocx(148760);
    spawn.setLocy(174136);
    spawn.setLocz(-920);
    spawn.setAmount(1);
    spawn.setHeading(0);
    spawn.setRespawnDelay(5);
    spawn.setReflection(ReflectionManager.PARNASSUS);
    spawn.init();
    _spawns.add(spawn);
    spawn = new SimpleSpawner(32320);
    spawn.setLocx(149368);
    spawn.setLocy(173064);
    spawn.setLocz(-952);
    spawn.setAmount(1);
    spawn.setHeading(16384);
    spawn.setRespawnDelay(5);
    spawn.setReflection(ReflectionManager.PARNASSUS);
    spawn.init();
    _spawns.add(spawn);
    _zoneListener = new ZoneListener();
    _zone.addListener(_zoneListener);
    _zone.setReflection(ReflectionManager.PARNASSUS);
    _zone.setActive(true);
View Full Code Here

Examples of lineage2.gameserver.model.SimpleSpawner

      _mobsNotSpawned = false;
      for (int i = 0; i < MOBS_COUNT; i++)
      {
        try
        {
          SimpleSpawner sp = new SimpleSpawner(NpcHolder.getInstance().getTemplate(MOBS));
          sp.setLoc(Location.findPointToStay(actor, 100, 120));
          NpcInstance npc = sp.doSpawn(true);
          if (caster.isPet() || caster.isServitor())
          {
            npc.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, caster, Rnd.get(2, 100));
          }
          npc.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, caster.getPlayer(), Rnd.get(1, 100));
View Full Code Here

Examples of lineage2.gameserver.model.SimpleSpawner

      Document doc = factory.newDocumentBuilder().parse(file);
      NamedNodeMap attrs;
      int type;
      int roomId;
      int mobId, delay, count;
      SimpleSpawner spawnDat;
      NpcTemplate template;
      Location tele = new Location();
      int xMin = 0, xMax = 0, yMin = 0, yMax = 0, zMin = 0, zMax = 0;
      boolean isBossRoom;
      for (Node rift = doc.getFirstChild(); rift != null; rift = rift.getNextSibling())
      {
        if ("rift".equalsIgnoreCase(rift.getNodeName()))
        {
          for (Node area = rift.getFirstChild(); area != null; area = area.getNextSibling())
          {
            if ("area".equalsIgnoreCase(area.getNodeName()))
            {
              attrs = area.getAttributes();
              type = Integer.parseInt(attrs.getNamedItem("type").getNodeValue());
              for (Node room = area.getFirstChild(); room != null; room = room.getNextSibling())
              {
                if ("room".equalsIgnoreCase(room.getNodeName()))
                {
                  attrs = room.getAttributes();
                  roomId = Integer.parseInt(attrs.getNamedItem("id").getNodeValue());
                  Node boss = attrs.getNamedItem("isBossRoom");
                  isBossRoom = (boss != null) && Boolean.parseBoolean(boss.getNodeValue());
                  Territory territory = null;
                  for (Node coord = room.getFirstChild(); coord != null; coord = coord.getNextSibling())
                  {
                    if ("teleport".equalsIgnoreCase(coord.getNodeName()))
                    {
                      attrs = coord.getAttributes();
                      tele = Location.parseLoc(attrs.getNamedItem("loc").getNodeValue());
                    }
                    else if ("zone".equalsIgnoreCase(coord.getNodeName()))
                    {
                      attrs = coord.getAttributes();
                      xMin = Integer.parseInt(attrs.getNamedItem("xMin").getNodeValue());
                      xMax = Integer.parseInt(attrs.getNamedItem("xMax").getNodeValue());
                      yMin = Integer.parseInt(attrs.getNamedItem("yMin").getNodeValue());
                      yMax = Integer.parseInt(attrs.getNamedItem("yMax").getNodeValue());
                      zMin = Integer.parseInt(attrs.getNamedItem("zMin").getNodeValue());
                      zMax = Integer.parseInt(attrs.getNamedItem("zMax").getNodeValue());
                      territory = new Territory().add(new Rectangle(xMin, yMin, xMax, yMax).setZmin(zMin).setZmax(zMax));
                    }
                  }
                  if (territory == null)
                  {
                    _log.error("DimensionalRiftManager: invalid spawn data for room id " + roomId + "!");
                  }
                  if (!_rooms.containsKey(type))
                  {
                    _rooms.put(type, new ConcurrentHashMap<Integer, DelusionChamberRoom>());
                  }
                  _rooms.get(type).put(roomId, new DelusionChamberRoom(territory, tele, isBossRoom));
                  for (Node spawn = room.getFirstChild(); spawn != null; spawn = spawn.getNextSibling())
                  {
                    if ("spawn".equalsIgnoreCase(spawn.getNodeName()))
                    {
                      attrs = spawn.getAttributes();
                      mobId = Integer.parseInt(attrs.getNamedItem("mobId").getNodeValue());
                      delay = Integer.parseInt(attrs.getNamedItem("delay").getNodeValue());
                      count = Integer.parseInt(attrs.getNamedItem("count").getNodeValue());
                      template = NpcHolder.getInstance().getTemplate(mobId);
                      if (template == null)
                      {
                        _log.warn("Template " + mobId + " not found!");
                      }
                      if (!_rooms.containsKey(type))
                      {
                        _log.warn("Type " + type + " not found!");
                      }
                      else if (!_rooms.get(type).containsKey(roomId))
                      {
                        _log.warn("Room " + roomId + " in Type " + type + " not found!");
                      }
                      if ((template != null) && _rooms.containsKey(type) && _rooms.get(type).containsKey(roomId))
                      {
                        spawnDat = new SimpleSpawner(template);
                        spawnDat.setTerritory(territory);
                        spawnDat.setHeading(-1);
                        spawnDat.setRespawnDelay(delay);
                        spawnDat.setAmount(count);
                        _rooms.get(type).get(roomId).getSpawns().add(spawnDat);
                        countGood++;
                      }
                      else
                      {
View Full Code Here

Examples of lineage2.gameserver.model.SimpleSpawner

   */
  public void SpawnMammons()
  {
    final int firstTown = Rnd.get(MAMMON_PRIEST_POINTS.length);
    NpcTemplate template = NpcHolder.getInstance().getTemplate(MAMMON_PRIEST_ID);
    SimpleSpawner sp = new SimpleSpawner(template);
    sp.setLoc(MAMMON_PRIEST_POINTS[firstTown]);
    sp.setAmount(1);
    sp.setRespawnDelay(0);
    PriestNpc = sp.doSpawn(true);
    template = NpcHolder.getInstance().getTemplate(MAMMON_MERCHANT_ID);
    sp = new SimpleSpawner(template);
    sp.setLoc(MAMMON_MERCHANT_POINTS[firstTown]);
    sp.setAmount(1);
    sp.setRespawnDelay(0);
    MerchantNpc = sp.doSpawn(true);
    template = NpcHolder.getInstance().getTemplate(MAMMON_BLACKSMITH_ID);
    sp = new SimpleSpawner(template);
    sp.setLoc(MAMMON_BLACKSMITH_POINTS[firstTown]);
    sp.setAmount(1);
    sp.setRespawnDelay(0);
    BlacksmithNpc = sp.doSpawn(true);
  }
View Full Code Here

Examples of lineage2.gameserver.model.SimpleSpawner

    final NpcInstance actor = getActor();
    for (int i = 0; i < MOBS_COUNT; i++)
    {
      try
      {
        SimpleSpawner sp = new SimpleSpawner(NpcHolder.getInstance().getTemplate(MOB));
        sp.setLoc(Location.findPointToStay(actor, 100, 120));
        sp.setReflection(actor.getReflection());
        NpcInstance npc = sp.doSpawn(true);
        npc.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, attacker, 100);
      }
      catch (Exception e)
      {
        e.printStackTrace();
View Full Code Here

Examples of lineage2.gameserver.model.SimpleSpawner

  {
    if (checkAllDestroyed())
    {
      try
      {
        final SimpleSpawner sp = new SimpleSpawner(NpcHolder.getInstance().getTemplate(TeleportCube));
        sp.setLoc(new Location(-12527, 279714, -11622, 16384));
        sp.doSpawn(true);
        sp.stopRespawn();
        ThreadPoolManager.getInstance().schedule(new Unspawn(), 600 * 1000L);
      }
      catch (Exception e)
      {
        e.printStackTrace();
View Full Code Here

Examples of lineage2.gameserver.model.SimpleSpawner

  {
    for (Location element : locSD)
    {
      try
      {
        SimpleSpawner sp = new SimpleSpawner(NpcHolder.getInstance().getTemplate(32371));
        sp.setLoc(element);
        sp.doSpawn(true);
        if (!s)
        {
          Functions.npcShout(sp.getLastSpawn(), "Self Destruction mechanism launched: 10 minutes to explosion");
          s = true;
        }
      }
      catch (Exception e)
      {
        e.printStackTrace();
      }
    }
    for (Location element : locFTT)
    {
      try
      {
        SimpleSpawner sp = new SimpleSpawner(NpcHolder.getInstance().getTemplate(22392));
        sp.setLoc(element);
        sp.doSpawn(true);
      }
      catch (Exception e)
      {
        e.printStackTrace();
      }
    }
    try
    {
      final SimpleSpawner sp = new SimpleSpawner(NpcHolder.getInstance().getTemplate(32370));
      sp.setLoc(new Location(-11984, 272928, -9040, 23644));
      sp.doSpawn(true);
      removable_ghost = sp.getLastSpawn();
    }
    catch (Exception e)
    {
      e.printStackTrace();
    }
View Full Code Here

Examples of lineage2.gameserver.model.SimpleSpawner

    _state = new EpicBossState(BAIUM);
    _zone = ReflectionUtils.getZone("[baium_epic]");
    CharListenerList.addGlobal(this);
    try
    {
      final SimpleSpawner tempSpawn;
      _statueSpawn = new SimpleSpawner(NpcHolder.getInstance().getTemplate(BAIUM_NPC));
      _statueSpawn.setAmount(1);
      _statueSpawn.setLoc(STATUE_LOCATION);
      _statueSpawn.stopRespawn();
      tempSpawn = new SimpleSpawner(NpcHolder.getInstance().getTemplate(BAIUM));
      tempSpawn.setAmount(1);
      _monsterSpawn.put(BAIUM, tempSpawn);
    }
    catch (Exception e)
    {
      e.printStackTrace();
    }
    try
    {
      final NpcTemplate Cube = NpcHolder.getInstance().getTemplate(TELEPORT_CUBE);
      _teleportCubeSpawn = new SimpleSpawner(Cube);
      _teleportCubeSpawn.setAmount(1);
      _teleportCubeSpawn.setLoc(CUBE_LOCATION);
      _teleportCubeSpawn.setRespawnDelay(60);
    }
    catch (Exception e)
    {
      e.printStackTrace();
    }
    try
    {
      final NpcTemplate angel = NpcHolder.getInstance().getTemplate(ARCHANGEL);
      SimpleSpawner spawnDat;
      _angelSpawns.clear();
      final List<Integer> random = new ArrayList<>();
      for (int i = 0; i < 5; i++)
      {
        int r = -1;
        while ((r == -1) || random.contains(r))
        {
          r = Rnd.get(10);
        }
        random.add(r);
      }
      for (int i : random)
      {
        spawnDat = new SimpleSpawner(angel);
        spawnDat.setAmount(1);
        spawnDat.setLoc(ANGEL_LOCATION[i]);
        spawnDat.setRespawnDelay(300000);
        _angelSpawns.add(spawnDat);
      }
    }
    catch (Exception e)
    {
View Full Code Here

Examples of lineage2.gameserver.model.SimpleSpawner

   */
  public static void spawnBaium(NpcInstance NpcBaium, Player awake_by)
  {
    Dying = false;
    _npcBaium = NpcBaium;
    final SimpleSpawner baiumSpawn = _monsterSpawn.get(BAIUM);
    baiumSpawn.setLoc(_npcBaium.getLoc());
    _npcBaium.getSpawn().stopRespawn();
    _npcBaium.deleteMe();
    final BossInstance baium = (BossInstance) baiumSpawn.doSpawn(true);
    _monsters.add(baium);
    _state.setRespawnDate(getRespawnInterval());
    _state.setState(EpicBossState.State.ALIVE);
    _state.update();
    Log.add("Spawned Baium, awake by: " + awake_by, "bosses");
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.