Package com.l2jfrozen.gameserver.model.spawn

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


      L2NpcTemplate witchTemplate = NpcTable.getInstance().getTemplate(_witchSpawn._npcId);

      // Spawn the festival witch for this arena
      try
      {
        L2Spawn npcSpawn = new L2Spawn(witchTemplate);

        npcSpawn.setLocx(_witchSpawn._x);
        npcSpawn.setLocy(_witchSpawn._y);
        npcSpawn.setLocz(_witchSpawn._z);
        npcSpawn.setHeading(_witchSpawn._heading);
        npcSpawn.setAmount(1);
        npcSpawn.setRespawnDelay(1);

        // Needed as doSpawn() is required to be called also for the NpcInstance it returns.
        npcSpawn.startRespawn();

        SpawnTable.getInstance().addNewSpawn(npcSpawn, false);
        _witchInst = npcSpawn.doSpawn();

        if(Config.DEBUG)
        {
          _log.fine("SevenSignsFestival: Spawned the Festival Witch " + npcSpawn.getNpcid() + " at " + _witchSpawn._x + " " + _witchSpawn._y + " " + _witchSpawn._z);
        }

        npcSpawn = null;
      }
      catch(Exception e)
View Full Code Here


        L2NpcTemplate npcTemplate = NpcTable.getInstance().getTemplate(currSpawn._npcId);

        try
        {
          L2Spawn npcSpawn = new L2Spawn(npcTemplate);

          npcSpawn.setLocx(currSpawn._x);
          npcSpawn.setLocy(currSpawn._y);
          npcSpawn.setLocz(currSpawn._z);
          npcSpawn.setHeading(Rnd.nextInt(65536));
          npcSpawn.setAmount(1);
          npcSpawn.setRespawnDelay(respawnDelay);

          // Needed as doSpawn() is required to be called also for the NpcInstance it returns.
          npcSpawn.startRespawn();

          SpawnTable.getInstance().addNewSpawn(npcSpawn, false);
          L2FestivalMonsterInstance festivalMob = (L2FestivalMonsterInstance) npcSpawn.doSpawn();

          // Set the offering bonus to 2x or 5x the amount per kill,
          // if this spawn is part of an increased challenge or is a festival chest.
          if(spawnType == 1)
          {
View Full Code Here

      return;
    }
   
    try
    {
      L2Spawn spawn = new L2Spawn(template1);
      if(Config.SAVE_GMSPAWN_ON_CUSTOM)
        spawn.setCustom(true);
      spawn.setLocx(target.getX());
      spawn.setLocy(target.getY());
      spawn.setLocz(target.getZ());
      spawn.setAmount(mobCount);
      spawn.setHeading(activeChar.getHeading());
      spawn.setRespawnDelay(respawnTime);
     
      if(RaidBossSpawnManager.getInstance().isDefined(spawn.getNpcid()) || GrandBossManager.getInstance().isDefined(spawn.getNpcid()))
      {
        activeChar.sendMessage("Another instance of " + template1.name + " already present into database:");
        activeChar.sendMessage("It will be spawned but not saved on Database");
        activeChar.sendMessage("After server restart or raid dead, the spawned npc will desappear");
        permanent=false;
        spawn.set_customBossInstance(true); //for raids, this value is used in order to segnalate to not save respawn time - status for custom instance

      }
      //else
      //{
        if(RaidBossSpawnManager.getInstance().getValidTemplate(spawn.getNpcid()) != null)
        {
          RaidBossSpawnManager.getInstance().addNewSpawn(spawn, 0, template1.getStatsSet().getDouble("baseHpMax"), template1.getStatsSet().getDouble("baseMpMax"), permanent);
        }
        else
        {
          SpawnTable.getInstance().addNewSpawn(spawn, permanent);
        }

        spawn.init();

        if(!permanent)
        {
          spawn.stopRespawn();
        }

        activeChar.sendMessage("Created " + template1.name + " on " + target.getObjectId());
      //}
View Full Code Here

    if(template1 == null)
      return;

    try
    {
      L2Spawn spawn = new L2Spawn(template1);
      spawn.setId(IdFactory.getInstance().getNextId());
      spawn.setLocx(activeChar.getX());
      spawn.setLocy(activeChar.getY());
      spawn.setLocz(activeChar.getZ());
      _gourd = (L2GourdInstance) spawn.spawnOne();
      L2World.getInstance().storeObject(_gourd);
      _gourd.setOwner(activeChar.getName());
      activeChar.destroyItem("Consume", item.getObjectId(), 1, null, false);
      SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2);
      sm.addString("Created " + template1.name + " at x: " + spawn.getLocx() + " y: " + spawn.getLocy() + " z: " + spawn.getLocz());
      activeChar.sendPacket(sm);
      sm = null;
    }
    catch(Exception e)
    {
View Full Code Here

        int bossId = Integer.parseInt(command.substring(12).trim());
        switch(RaidBossSpawnManager.getInstance().getRaidBossStatusId(bossId))
        {
          case ALIVE:
          case DEAD:
            L2Spawn spawn = RaidBossSpawnManager.getInstance().getSpawns().get(bossId);
            player.sendPacket(new RadarControl(0, 1, spawn.getLocx(), spawn.getLocy(), spawn.getLocz()));
            spawn = null;
            break;
          case UNDEFINED:
            player.sendMessage("This Boss isn't in game - notify L2JFrozen Datapack Dev Team");
            break;
View Full Code Here

    // Setting spawn data of Dummy camera marker.
    _cameraMarkerSpawn.clear();
    try
    {
      L2NpcTemplate template1 = NpcTable.getInstance().getTemplate(13014); // Dummy npc
      L2Spawn tempSpawn;

      // Dummy camera marker.
      tempSpawn = new L2Spawn(template1);
      tempSpawn.setLocx(-16397);
      tempSpawn.setLocy(-55200);
      tempSpawn.setLocz(-10449);
      tempSpawn.setHeading(16384);
      tempSpawn.setAmount(1);
      tempSpawn.setRespawnDelay(60000);
      SpawnTable.getInstance().addNewSpawn(tempSpawn, false);
      _cameraMarkerSpawn.put(1, tempSpawn);

      tempSpawn = new L2Spawn(template1);
      tempSpawn.setLocx(-16397);
      tempSpawn.setLocy(-55200);
      tempSpawn.setLocz(-10051);
      tempSpawn.setHeading(16384);
      tempSpawn.setAmount(1);
      tempSpawn.setRespawnDelay(60000);
      SpawnTable.getInstance().addNewSpawn(tempSpawn, false);
      _cameraMarkerSpawn.put(2, tempSpawn);

      tempSpawn = new L2Spawn(template1);
      tempSpawn.setLocx(-16397);
      tempSpawn.setLocy(-55200);
      tempSpawn.setLocz(-9741);
      tempSpawn.setHeading(16384);
      tempSpawn.setAmount(1);
      tempSpawn.setRespawnDelay(60000);
      SpawnTable.getInstance().addNewSpawn(tempSpawn, false);
      _cameraMarkerSpawn.put(3, tempSpawn);

      tempSpawn = new L2Spawn(template1);
      tempSpawn.setLocx(-16397);
      tempSpawn.setLocy(-55200);
      tempSpawn.setLocz(-9394);
      tempSpawn.setHeading(16384);
      tempSpawn.setAmount(1);
      tempSpawn.setRespawnDelay(60000);
      SpawnTable.getInstance().addNewSpawn(tempSpawn, false);
      _cameraMarkerSpawn.put(4, tempSpawn);

      tempSpawn = new L2Spawn(template1);
      tempSpawn.setLocx(-16397);
      tempSpawn.setLocy(-55197);
      tempSpawn.setLocz(-8739);
      tempSpawn.setHeading(16384);
      tempSpawn.setAmount(1);
      tempSpawn.setRespawnDelay(60000);
      SpawnTable.getInstance().addNewSpawn(tempSpawn, false);
      _cameraMarkerSpawn.put(5, tempSpawn);
    }
    catch(Exception e)
    {
View Full Code Here

      PreparedStatement statement = con.prepareStatement("SELECT id, count, npc_templateid, locx, locy, locz, heading, respawn_delay FROM vanhalter_spawnlist Where npc_templateid between ? and ? ORDER BY id");
      statement.setInt(1, 22175);
      statement.setInt(2, 22176);
      ResultSet rset = statement.executeQuery();

      L2Spawn spawnDat;
      L2NpcTemplate template1;

      while(rset.next())
      {
        template1 = NpcTable.getInstance().getTemplate(rset.getInt("npc_templateid"));
        if(template1 != null)
        {
          spawnDat = new L2Spawn(template1);
          spawnDat.setAmount(rset.getInt("count"));
          spawnDat.setLocx(rset.getInt("locx"));
          spawnDat.setLocy(rset.getInt("locy"));
          spawnDat.setLocz(rset.getInt("locz"));
          spawnDat.setHeading(rset.getInt("heading"));
          spawnDat.setRespawnDelay(rset.getInt("respawn_delay"));
          SpawnTable.getInstance().addNewSpawn(spawnDat, false);
          _royalGuardSpawn.add(spawnDat);
        }
        else
        {
View Full Code Here

      PreparedStatement statement = con.prepareStatement("SELECT id, count, npc_templateid, locx, locy, locz, heading, respawn_delay FROM vanhalter_spawnlist Where npc_templateid between ? and ? ORDER BY id");
      statement.setInt(1, 32058);
      statement.setInt(2, 32068);
      ResultSet rset = statement.executeQuery();

      L2Spawn spawnDat;
      L2NpcTemplate template1;

      while(rset.next())
      {
        template1 = NpcTable.getInstance().getTemplate(rset.getInt("npc_templateid"));
        if(template1 != null)
        {
          spawnDat = new L2Spawn(template1);
          spawnDat.setAmount(rset.getInt("count"));
          spawnDat.setLocx(rset.getInt("locx"));
          spawnDat.setLocy(rset.getInt("locy"));
          spawnDat.setLocz(rset.getInt("locz"));
          spawnDat.setHeading(rset.getInt("heading"));
          spawnDat.setRespawnDelay(rset.getInt("respawn_delay"));
          SpawnTable.getInstance().addNewSpawn(spawnDat, false);
          _triolRevelationSpawn.add(spawnDat);
        }
        else
        {
View Full Code Here

      con = L2DatabaseFactory.getInstance().getConnection(false);
      PreparedStatement statement = con.prepareStatement("SELECT id, count, npc_templateid, locx, locy, locz, heading, respawn_delay FROM vanhalter_spawnlist Where npc_templateid = ? ORDER BY id");
      statement.setInt(1, 22188);
      ResultSet rset = statement.executeQuery();

      L2Spawn spawnDat;
      L2NpcTemplate template1;

      while(rset.next())
      {
        template1 = NpcTable.getInstance().getTemplate(rset.getInt("npc_templateid"));
        if(template1 != null)
        {
          spawnDat = new L2Spawn(template1);
          spawnDat.setAmount(rset.getInt("count"));
          spawnDat.setLocx(rset.getInt("locx"));
          spawnDat.setLocy(rset.getInt("locy"));
          spawnDat.setLocz(rset.getInt("locz"));
          spawnDat.setHeading(rset.getInt("heading"));
          spawnDat.setRespawnDelay(rset.getInt("respawn_delay"));
          SpawnTable.getInstance().addNewSpawn(spawnDat, false);
          _royalGuardCaptainSpawn.add(spawnDat);
        }
        else
        {
View Full Code Here

      con = L2DatabaseFactory.getInstance().getConnection(false);
      PreparedStatement statement = con.prepareStatement("SELECT id, count, npc_templateid, locx, locy, locz, heading, respawn_delay FROM vanhalter_spawnlist Where npc_templateid = ? ORDER BY id");
      statement.setInt(1, 22191);
      ResultSet rset = statement.executeQuery();

      L2Spawn spawnDat;
      L2NpcTemplate template1;

      while(rset.next())
      {
        template1 = NpcTable.getInstance().getTemplate(rset.getInt("npc_templateid"));
        if(template1 != null)
        {
          spawnDat = new L2Spawn(template1);
          spawnDat.setAmount(rset.getInt("count"));
          spawnDat.setLocx(rset.getInt("locx"));
          spawnDat.setLocy(rset.getInt("locy"));
          spawnDat.setLocz(rset.getInt("locz"));
          spawnDat.setHeading(rset.getInt("heading"));
          spawnDat.setRespawnDelay(rset.getInt("respawn_delay"));
          SpawnTable.getInstance().addNewSpawn(spawnDat, false);
          _royalGuardHelperSpawn.add(spawnDat);
        }
        else
        {
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.