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 spawn = null;
          try
          {
            spawn = new SimpleSpawner(NpcHolder.getInstance().getTemplate(_npcId));
            spawn.setLoc(actor.getLoc());
            final NpcInstance npc = spawn.doSpawn(true);
            npc.setAI(new MeleonAI(npc));
            ((MeleonInstance) npc).setSpawner(actor.getSpawner());
          }
          catch (Exception e)
          {
    View Full Code Here

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

        {
          return false;
        }
        final SimpleSpawner spawn = new SimpleSpawner(template);
        spawn.setLoc(activeChar.getLoc());
        final NpcInstance npc = spawn.doSpawn(false);
        npc.setTitle(activeChar.getName());
        spawn.respawnNpc(npc);
        if (itemId == 5561)
        {
          npc.setAI(new ctreeAI(npc));
    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 SquashAI(npc));
        ((SquashInstance) npc).setSpawner(activeChar);
        ThreadPoolManager.getInstance().schedule(new DeSpawnScheduleTimerTask(spawn), 180000);
        return true;
      }
    View Full Code Here

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

          SimpleSpawner spawn = null;
          try
          {
            spawn = new SimpleSpawner(NpcHolder.getInstance().getTemplate(_npcId));
            spawn.setLoc(actor.getLoc());
            final NpcInstance npc = spawn.doSpawn(true);
            npc.setAI(new SquashAI(npc));
            ((SquashInstance) npc).setSpawner(actor.getSpawner());
          }
          catch (Exception e)
          {
    View Full Code Here

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

        try
        {
          final SimpleSpawner sp = new SimpleSpawner(NpcHolder.getInstance().getTemplate(MOB));
          sp.setLoc(Location.findPointToStay(actor, 100, 120));
          sp.setReflection(actor.getReflection());
          final NpcInstance npc = sp.doSpawn(true);
          npc.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, attacker, 100);
        }
        catch (Exception e)
        {
          e.printStackTrace();
    View Full Code Here

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

          }
          try
          {
            final SimpleSpawner sp = new SimpleSpawner(NpcHolder.getInstance().getTemplate(DarkShamanVarangka));
            sp.setLoc(Location.findPointToStay(actor, 400, 420));
            final NpcInstance npc = sp.doSpawn(true);
            if (attacker.isPet() || attacker.isServitor())
            {
              npc.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, attacker, Rnd.get(2, 100));
            }
            npc.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, attacker.getPlayer(), Rnd.get(1, 100));
    View Full Code Here

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

          {
            try
            {
              SimpleSpawner sp = new SimpleSpawner(NpcHolder.getInstance().getTemplate(22702));
              sp.setLoc(Location.findPointToStay(actor, 150, 160));
              NpcInstance npc = sp.doSpawn(true);
              if (attacker.isPet() || attacker.isServitor())
              {
                npc.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, attacker, Rnd.get(2, 100));
              }
              npc.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, attacker.getPlayer(), Rnd.get(1, 100));
    View Full Code Here

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

          {
            pos = Location.findPointToStay(144298, 154420, -11854, 300, 320, actor.getGeoIndex());
            SimpleSpawner sp = new SimpleSpawner(NpcHolder.getInstance().getTemplate(Tears_Copy));
            sp.setLoc(pos);
            sp.setReflection(actor.getReflection());
            NpcInstance copy = sp.doSpawn(true);
            spawns.add(copy);
            hated = actor.getAggroList().getRandomHated();
            if (hated != null)
            {
              copy.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, hated, Rnd.get(1, 100));
    View Full Code Here

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

            {
              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

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

        }
        try
        {
          SimpleSpawner sp = new SimpleSpawner(epidostospawn);
          sp.setLoc(spawnLoc);
          sp.doSpawn(true);
          sp.stopRespawn();
          _bossSpawned = true;
        }
        catch (Exception e)
        {
    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.