Package com.l2jfrozen.gameserver.model.spawn

Examples of com.l2jfrozen.gameserver.model.spawn.L2Spawn


    try
    {
      //L2MonsterInstance mob = new L2MonsterInstance(template1);

      L2Spawn spawn = new L2Spawn(template1);

      spawn.setLocx(target.getX() + 50);
      spawn.setLocy(target.getY() + 50);
      spawn.setLocz(target.getZ());
      spawn.setAmount(1);
      spawn.setHeading(target.getHeading());
      spawn.setRespawnDelay(1);

      SpawnTable.getInstance().addNewSpawn(spawn, false);

      spawn.init();
      spawn.getLastSpawn().getStatus().setCurrentHp(999999999);
      spawn.getLastSpawn().setName("event inscriptor");
      spawn.getLastSpawn().setTitle(L2Event.eventName);
      spawn.getLastSpawn().isEventMob = true;
      spawn.getLastSpawn().isAggressive();
      spawn.getLastSpawn().decayMe();
      spawn.getLastSpawn().spawnMe(spawn.getLastSpawn().getX(), spawn.getLastSpawn().getY(), spawn.getLastSpawn().getZ());

      spawn.getLastSpawn().broadcastPacket(new MagicSkillUser(spawn.getLastSpawn(), spawn.getLastSpawn(), 1034, 1, 1, 1));

      npcs.add(String.valueOf(spawn.getLastSpawn().getObjectId()));

      spawn = null;

    }
    catch(Exception e)
View Full Code Here


    ThreadPoolManager.getInstance().scheduleAi(new Runnable()
    {
      @Override
      public void run()
      {
        L2Spawn mobSpawn = getSpawn();
        if (!isInCombat() && !isAlikeDead() && !isDead() && mobSpawn != null && !isInsideRadius(mobSpawn.getLocx(), mobSpawn.getLocy(), Config.MAX_DRIFT_RANGE, false))
        {
          teleToLocation(mobSpawn.getLocx(), mobSpawn.getLocy(), mobSpawn.getLocz(), false);
        }
        mobSpawn = null;
      }
    }, Config.MONSTER_RETURN_DELAY * 1000);
  }
 
View Full Code Here

      Document doc = factory.newDocumentBuilder().parse(file);
     
      NamedNodeMap attrs;
      byte type, roomId;
      int mobId, x, y, z, delay, count;
      L2Spawn spawnDat;
      L2NpcTemplate template;

      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 = Byte.parseByte(attrs.getNamedItem("type").getNodeValue());

              for(Node room = area.getFirstChild(); room != null; room = room.getNextSibling())
              {
                if("room".equalsIgnoreCase(room.getNodeName()))
                {
                  attrs = room.getAttributes();
                  roomId = Byte.parseByte(attrs.getNamedItem("id").getNodeValue());

                  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 = NpcTable.getInstance().getTemplate(mobId);
                      if(template == null)
                      {
                        _log.log(Level.WARNING, "Template " + mobId + " not found!");
                      }
                      if(!_rooms.containsKey(type))
                      {
                        _log.log(Level.WARNING, "Type " + type + " not found!");
                      }
                      else if(!_rooms.get(type).containsKey(roomId))
                      {
                        _log.log(Level.WARNING, "Room " + roomId + " in Type " + type + " not found!");
                      }

                      for(int i = 0; i < count; i++)
                      {
                        DimensionalRiftRoom riftRoom = _rooms.get(type).get(roomId);
                        x = riftRoom.getRandomX();
                        y = riftRoom.getRandomY();
                        z = riftRoom.getTeleportCoords()[2];
                        riftRoom = null;

                        if(template != null && _rooms.containsKey(type) && _rooms.get(type).containsKey(roomId))
                        {
                          spawnDat = new L2Spawn(template);
                          spawnDat.setAmount(1);
                          spawnDat.setLocx(x);
                          spawnDat.setLocy(y);
                          spawnDat.setLocz(z);
                          spawnDat.setHeading(-1);
                          spawnDat.setRespawnDelay(delay);
                          SpawnTable.getInstance().addNewSpawn(spawnDat, false);
                          _rooms.get(type).get(roomId).getSpawns().add(spawnDat);
                          countGood++;
                        }
                        else
View Full Code Here

    if(obj != null && obj instanceof L2NpcInstance)
    {
      L2NpcInstance target = (L2NpcInstance) obj;
      target.deleteMe();

      L2Spawn spawn = target.getSpawn();
      if(spawn != null)
      {
        spawn.stopRespawn();

        if(RaidBossSpawnManager.getInstance().isDefined(spawn.getNpcid()) && !spawn.is_customBossInstance())
        {
          RaidBossSpawnManager.getInstance().deleteSpawn(spawn, true);
         
        }else
        {
          boolean update_db = true;
          if(GrandBossManager.getInstance().isDefined(spawn.getNpcid()) && spawn.is_customBossInstance()) //if custom grandboss instance, it's not saved on database
            update_db = false;
         
          SpawnTable.getInstance().deleteSpawn(spawn, update_db);
        }
      }
View Full Code Here

  {
    L2NpcTemplate tmpl = NpcTable.getInstance().getTemplate(_bossId);

    try
    {
      _bossSpawn = new L2Spawn(tmpl);

      _bossSpawn.setLocx(_bossX);
      _bossSpawn.setLocy(_bossY);
      _bossSpawn.setLocz(_bossZ);
      _bossSpawn.setAmount(1);
View Full Code Here

  {
    L2NpcTemplate tmpl = NpcTable.getInstance().getTemplate(_bossId);

    try
    {
      _bossSpawn = new L2Spawn(tmpl);

      _bossSpawn.setLocx(_bossX);
      _bossSpawn.setLocy(_bossY);
      _bossSpawn.setLocz(_bossZ);
      _bossSpawn.setAmount(1);
View Full Code Here

  public void notifyPlayerDead()
  {
    // Monster kill player and can by deleted
    deleteMe();

    L2Spawn spawn = getSpawn();
    if(spawn != null)
    {
      spawn.stopRespawn();
      SpawnTable.getInstance().deleteSpawn(spawn, false);
      spawn = null;
    }
  }
View Full Code Here

      {
        statement.setInt(2, 0);
      }
      ResultSet rs = statement.executeQuery();

      L2Spawn spawn1;
      L2NpcTemplate template1;

      while(rs.next())
      {
        template1 = NpcTable.getInstance().getTemplate(rs.getInt("npcId"));
        if(template1 != null)
        {
          spawn1 = new L2Spawn(template1);
          spawn1.setId(rs.getInt("id"));
          spawn1.setAmount(1);
          spawn1.setLocx(rs.getInt("x"));
          spawn1.setLocy(rs.getInt("y"));
          spawn1.setLocz(rs.getInt("z"));
          spawn1.setHeading(rs.getInt("heading"));
          spawn1.setRespawnDelay(rs.getInt("respawnDelay"));
          spawn1.setLocation(0);
          _siegeGuardSpawn.add(spawn1);
          spawn1 = null;
        }
        else
        {
View Full Code Here

          // make offset negative
          offset *= Rnd.get(50, 100);
          y += offset;
        }
        L2Spawn spawn = new L2Spawn(template);
        spawn.setHeading(heading);
        spawn.setLocx(x);
        spawn.setLocy(y);
        spawn.setLocz(z + 20);
        spawn.stopRespawn();
        result = spawn.spawnOne();
        spawn = null;

        if(despawnDelay > 0)
        {
          ThreadPoolManager.getInstance().scheduleGeneral(new DeSpawnScheduleTimerTask(result), despawnDelay);
View Full Code Here

    while(L2Event.npcs.size() > 0)
    {
      try
      {
        npc = (L2NpcInstance) L2World.getInstance().findObject(Integer.parseInt(L2Event.npcs.getFirst()));
        L2Spawn spawn = npc.getSpawn();

        if(spawn != null)
        {
          spawn.stopRespawn();
          SpawnTable.getInstance().deleteSpawn(spawn, true);
        }

        npc.deleteMe();
        L2Event.npcs.removeFirst();
View Full Code Here

TOP

Related Classes of com.l2jfrozen.gameserver.model.spawn.L2Spawn

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.