Package lineage2.gameserver.model

Examples of lineage2.gameserver.model.SimpleSpawner


      final NpcInstance actor = getActor();
      for (int i = 0; i < SPAWN_COUNT; i++)
      {
        try
        {
          SimpleSpawner sp = new SimpleSpawner(TANTA_LIZARDMAN_SCOUT);
          // @SuppressWarnings("unused")
          // int radius = (((i % 2) == 0) ? -1 : 1) * 16000;
          sp.setLoc(actor.getLoc());
          NpcInstance npc = sp.doSpawn(true);
          npc.setHeading(PositionUtils.calculateHeadingFrom(npc, attacker));
          npc.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, attacker, 1000);
        }
        catch (Exception e)
        {
View Full Code Here


      default:
        break;
    }
    try
    {
      SimpleSpawner sp = new SimpleSpawner(epidostospawn);
      sp.setLoc(spawnLoc);
      sp.doSpawn(true);
      sp.stopRespawn();
      _bossSpawned = true;
    }
    catch (Exception e)
    {
      e.printStackTrace();
View Full Code Here

    {
      spore.deleteMe();
    }
    try
    {
      SimpleSpawner sp = new SimpleSpawner(teleCube);
      sp.setLoc(spawnLoc);
      sp.doSpawn(true);
      sp.stopRespawn();
      Functions.npcShout(sp.getLastSpawn(), "Teleportation to Beleth Throne Room is available for 2 minutes");
    }
    catch (Exception e)
    {
      e.printStackTrace();
    }
View Full Code Here

  {
    for (int i = 0; i < count; i++)
    {
      try
      {
        SimpleSpawner sp = new SimpleSpawner(mobId);
        sp.setLoc(Territory.getRandomLoc(territory).setH(Rnd.get(65535)));
        sp.setRespawnDelay(respawnDelay, 30);
        sp.setAmount(1);
        sp.doSpawn(true);
        sp.startRespawn();
      }
      catch (Exception e)
      {
        e.printStackTrace();
      }
View Full Code Here

      _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

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

    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

      _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

      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

   */
  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

TOP

Related Classes of lineage2.gameserver.model.SimpleSpawner

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.