Examples of doSpawn()

  • l2p.gameserver.model.L2Spawn.doSpawn()
  • lineage2.gameserver.model.SimpleSpawner.doSpawn()
    Method doSpawn. @param spawn boolean @return NpcInstance
  • net.sf.l2j.gameserver.model.L2Spawn.doSpawn()
    Create the L2NpcInstance, add it to the world and launch its OnSpawn action.

    Concept :

    L2NpcInstance can be spawned either in a random position into a location area (if Lox=0 and Locy=0), either at an exact position. The heading of the L2NpcInstance can be a random heading if not defined (value= -1) or an exact heading (ex : merchant...).

    Actions for an random spawn into location area : (if Locx=0 and Locy=0)

  • Get L2NpcInstance Init parameters and its generate an Identifier
  • Call the constructor of the L2NpcInstance
  • Calculate the random position in the location area (if Locx=0 and Locy=0) or get its exact position from the L2Spawn
  • Set the position of the L2NpcInstance
  • Set the HP and MP of the L2NpcInstance to the max
  • Set the heading of the L2NpcInstance (random heading if not defined : value=-1)
  • Link the L2NpcInstance to this L2Spawn
  • Init other values of the L2NpcInstance (ex : from its L2CharTemplate for INT, STR, DEX...) and add it in the world
  • Launch the action OnSpawn fo the L2NpcInstance


  • Increase the current number of L2NpcInstance managed by this L2Spawn


  • @return

    Examples of l2p.gameserver.model.L2Spawn.doSpawn()

              Location oldPos = SPAWN_POINTS[i];
              L2Spawn s = new L2Spawn(NpcTable.getTemplate(LEMATANS_FOLLOWER));
              Location newPos = GeoEngine.findPointToStay(oldPos.x, oldPos.y, oldPos.z, 0, 0, actor.getReflection().getGeoIndex());
              s.setReflection(actor.getReflection().getId());
              s.setLoc(newPos);
              s.doSpawn(true);
            }
          }
          catch (Exception e)
          {
            e.printStackTrace();
    View Full Code Here

    Examples of lineage2.gameserver.model.SimpleSpawner.doSpawn()

          final SimpleSpawner sp = new SimpleSpawner(_nextId);
          sp.setLocx(_actor.getX());
          sp.setLocy(_actor.getY());
          sp.setLocz(_actor.getZ());
          sp.setReflection(_actor.getReflection());
          final NpcInstance npc = sp.doSpawn(true);
          npc.setHeading(PositionUtils.calculateHeadingFrom(npc, _player));
          npc.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, _player, 1000);
        }
      }
     
    View Full Code Here

    Examples of lineage2.gameserver.model.SimpleSpawner.doSpawn()

              SimpleSpawner spawn = new SimpleSpawner(npcId);
              spawn.setTerritory(zone.getTerritory());
              spawn.setAmount(1);
              spawn.setReflection(player.getReflection());
              spawn.stopRespawn();
              NpcInstance mob = spawn.doSpawn(true);
              if (mob != null)
              {
                ThreadPoolManager.getInstance().schedule(new UnSpawnTask(spawn), despawn * 1000L);
                if (mob.isAggressive() && attackOnSpawn)
                {
    View Full Code Here

    Examples of lineage2.gameserver.model.SimpleSpawner.doSpawn()

        {
          try
          {
            final SimpleSpawner sp = new SimpleSpawner(NpcHolder.getInstance().getTemplate(MysteriousAgent));
            sp.setLoc(new Location(-11984, 278880, -13599, -4472));
            sp.doSpawn(true);
            sp.stopRespawn();
            ThreadPoolManager.getInstance().schedule(new Unspawn(), 600 * 1000L);
          }
          catch (Exception e)
          {
    View Full Code Here

    Examples of lineage2.gameserver.model.SimpleSpawner.doSpawn()

              try
              {
                actor.getLoc();
                SimpleSpawner sp = new SimpleSpawner(NpcHolder.getInstance().getTemplate(element));
                sp.setLoc(Location.findPointToStay(actor, 150, 350));
                sp.doSpawn(true);
                sp.stopRespawn();
              }
              catch (Exception e)
              {
                e.printStackTrace();
    View Full Code Here

    Examples of lineage2.gameserver.model.SimpleSpawner.doSpawn()

              try
              {
                actor.getLoc();
                SimpleSpawner sp = new SimpleSpawner(NpcHolder.getInstance().getTemplate(element));
                sp.setLoc(Location.findPointToStay(actor, 150, 350));
                sp.doSpawn(true);
                sp.stopRespawn();
              }
              catch (Exception e)
              {
                e.printStackTrace();
    View Full Code Here

    Examples of lineage2.gameserver.model.SimpleSpawner.doSpawn()

          try
          {
            actor.getLoc();
            final SimpleSpawner sp = new SimpleSpawner(NpcHolder.getInstance().getTemplate(DarionsFaithfulServants[Rnd.get(DarionsFaithfulServants.length - 1)]));
            sp.setLoc(Location.findPointToStay(actor, 150, 350));
            sp.doSpawn(true);
            sp.stopRespawn();
          }
          catch (Exception e)
          {
            e.printStackTrace();
    View Full Code Here

    Examples of lineage2.gameserver.model.SimpleSpawner.doSpawn()

        {
          try
          {
            SimpleSpawner sp = new SimpleSpawner(NpcHolder.getInstance().getTemplate(22422));
            sp.setLoc(Location.findPointToStay(actor, 150, 550));
            sp.doSpawn(true);
            sp.stopRespawn();
          }
          catch (Exception e)
          {
            e.printStackTrace();
    View Full Code Here

    Examples of lineage2.gameserver.model.SimpleSpawner.doSpawn()

          try
          {
            SimpleSpawner sp = new SimpleSpawner(NpcHolder.getInstance().getTemplate(run[0]));
            sp.setLoc(guard_spawn_loc);
            sp.setReflection(actor.getReflection());
            NpcInstance guard = sp.doSpawn(true);
            Location runLoc = new Location(run[1], run[2], run[3]);
            guard.setRunning();
            DefaultAI ai = (DefaultAI) guard.getAI();
            ai.addTaskMove(runLoc, true);
            ai.setGlobalAggro(0);
    View Full Code Here

    Examples of lineage2.gameserver.model.SimpleSpawner.doSpawn()

        {
          try
          {
            SimpleSpawner sp = new SimpleSpawner(NpcHolder.getInstance().getTemplate(Rnd.get(25614, 25615)));
            sp.setLoc(Location.findPointToStay(actor, 400, 900));
            sp.doSpawn(true);
            sp.stopRespawn();
          }
          catch (Exception e)
          {
            e.printStackTrace();
    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.