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 lineage2.gameserver.model.SimpleSpawner.doSpawn()

          SimpleSpawner sp = new SimpleSpawner(template);
          sp.setLocx(element[0]);
          sp.setLocy(element[1]);
          sp.setLocz(element[2]);
          sp.setHeading(element[3]);
          NpcInstance npc = sp.doSpawn(true);
          npc.setName("Arena 1");
          npc.setTitle("TvT Event");
          _spawns.add(npc);
        }
      }
    View Full Code Here

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

          SimpleSpawner sp = new SimpleSpawner(template);
          sp.setLocx(element[0]);
          sp.setLocy(element[1]);
          sp.setLocz(element[2]);
          sp.setHeading(element[3]);
          NpcInstance npc = sp.doSpawn(true);
          npc.setName("Arena 3");
          npc.setTitle("TvT Event");
          _spawns.add(npc);
        }
      }
    View Full Code Here

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

        {
          final SimpleSpawner sp = new SimpleSpawner(NpcHolder.getInstance().getTemplate(eliteMillipede));
          sp.setLoc(Location.findPointToStay(actor, 100, 120));
          for (int i = 0; i == 2; i++)
          {
            NpcInstance npc = sp.doSpawn(true);
            npc.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, actor.getAggroList().getMostHated(), Rnd.get(1, 100));
          }
          _eliteSpawned = true;
        }
        super.thinkAttack();
    View Full Code Here

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

            try
            {
              SimpleSpawner sp = new SimpleSpawner(NpcHolder.getInstance().getTemplate(18493));
              sp.setLoc(Location.findPointToStay(actor, 150, 250));
              sp.setReflection(actor.getReflection());
              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(mobId);
            sp.setLoc(Territory.getRandomLoc(territory).setH(Rnd.get(65535)));
            sp.doSpawn(true);
            sp.stopRespawn();
            _roomMobList.add(sp.getLastSpawn());
          }
          catch (Exception e)
          {
    View Full Code Here

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

      {
        try
        {
          SimpleSpawner sp = new SimpleSpawner(NpcHolder.getInstance().getTemplate(mobId));
          sp.setLoc(loc);
          sp.doSpawn(true);
          sp.stopRespawn();
          _roomMobList.add(sp.getLastSpawn());
        }
        catch (Exception e)
        {
    View Full Code Here

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

        {
          return false;
        }
        final SimpleSpawner spawn = new SimpleSpawner(template);
        spawn.setLoc(Location.findPointToStay(activeChar, 30, 70));
        final NpcInstance npc = spawn.doSpawn(true);
        npc.setAI(new MeleonAI(npc));
        ((MeleonInstance) npc).setSpawner(activeChar);
        ThreadPoolManager.getInstance().schedule(new DeSpawnScheduleTimerTask(spawn), 180000);
        return true;
      }
    View Full Code Here

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

                c = new SimpleSpawner(s.getNpcId());
                c.setReflection(this);
                c.setRespawnDelay(s.getRespawnDelay(), s.getRespawnRnd());
                c.setAmount(s.getCount());
                c.setLoc(loc);
                c.doSpawn(true);
                if (s.getRespawnDelay() == 0)
                {
                  c.stopRespawn();
                }
                else
    View Full Code Here

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

              c = new SimpleSpawner(s.getNpcId());
              c.setReflection(this);
              c.setRespawnDelay(s.getRespawnDelay(), s.getRespawnRnd());
              c.setAmount(1);
              c.setLoc(s.getCoords().get(Rnd.get(s.getCoords().size())));
              c.doSpawn(true);
              if (s.getRespawnDelay() == 0)
              {
                c.stopRespawn();
              }
              else
    View Full Code Here

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

              c.setRespawnDelay(s.getRespawnDelay(), s.getRespawnRnd());
              c.setAmount(s.getCount());
              c.setTerritory(s.getLoc());
              for (int j = 0; j < s.getCount(); j++)
              {
                c.doSpawn(true);
              }
              if (s.getRespawnDelay() == 0)
              {
                c.stopRespawn();
              }
    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.