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()

                  spawnDat.setTerritory(hbsi.getSpawnTerritory());
                }
                spawnDat.setReflection(ReflectionManager.DEFAULT);
                spawnDat.setRespawnDelay(hbsi.getRespawn(), hbsi.getRespawnRnd());
                spawnDat.setRespawnTime(0);
                spawnDat.doSpawn(true);
                spawnDat.getLastSpawn().addListener(_deathListener);
                spawnDat.startRespawn();
                _spawnList.add(spawnDat);
              }
            }
    View Full Code Here

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

      @Override
      protected void onEvtDead(Creature killer)
      {
        final SimpleSpawner sp = new SimpleSpawner(NpcHolder.getInstance().getTemplate(teredorLarva));
        sp.setLoc(Location.findPointToStay(actor, 100, 120));
        sp.doSpawn(true);
        super.onEvtDead(killer);
      }
     
      /**
       * @author Mobius
    View Full Code Here

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

        SimpleSpawner sp = new SimpleSpawner(NpcHolder.getInstance().getTemplate(npcId));
        sp.setLoc(randomOffset > 0 ? Location.findPointToStay(loc, 0, randomOffset, getGeoIndex()) : loc);
        sp.setReflection(this);
        sp.setAmount(1);
        sp.setRespawnDelay(respawnDelay);
        sp.doSpawn(true);
        sp.startRespawn();
        return sp.getLastSpawn();
      }
     
      /**
     
    View Full Code Here

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

              {
                sp.startRespawn();
              }
              for (int i = 0; i < sp.getAmount(); i++)
              {
                sp.doSpawn(true);
              }
            }
            DelusionChamber.this.addSpawnWithoutRespawn(getManagerId(), riftRoom.getTeleportCoords(), 0);
          }
        }, 10000);
    View Full Code Here

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

      {
        final SimpleSpawner sp = new SimpleSpawner(npcId);
        sp.setLocx(loc.x);
        sp.setLocy(loc.y);
        sp.setLocz(loc.z);
        final NpcInstance npc = sp.doSpawn(true);
        npc.setHeading(PositionUtils.calculateHeadingFrom(npc, killer));
        npc.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, killer, 1000);
      }
    }
    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 2");
          npc.setTitle("TvT Event");
          _spawns.add(npc);
        }
      }
    View Full Code Here

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

              spawn.setLocy(_arenaCoordinates[_arena][5] + Rnd.get(-400, 400));
              spawn.setLocz(_zCoord);
              spawn.setAmount(1);
              spawn.setHeading(1);
              spawn.setRespawnDelay(1);
              BlockInstance blockInstance = (BlockInstance) spawn.doSpawn(true);
              blockInstance.setRed((random % 2) == 0);
              _spawns.add(spawn);
              random++;
            }
          }
    View Full Code Here

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

              girlSpawn.setLocy(_arenaCoordinates[_arena][5] + Rnd.get(-400, 400));
              girlSpawn.setLocz(_zCoord);
              girlSpawn.setAmount(1);
              girlSpawn.setHeading(1);
              girlSpawn.setRespawnDelay(1);
              girlSpawn.doSpawn(true);
              girlSpawn.init();
              _girlNpc = girlSpawn.getLastSpawn();
              ThreadPoolManager.getInstance().schedule(new RunnableImpl()
              {
                @Override
    View Full Code Here

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

        }
        SimpleSpawner sp = new SimpleSpawner(template);
        sp.setLoc(spawnPoint);
        sp.setAmount(1);
        sp.setRespawnDelay(0);
        _snowman = sp.doSpawn(true);
        if (_snowman == null)
        {
          return;
        }
        template = NpcHolder.getInstance().getTemplate(THOMAS_ID);
    View Full Code Here

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

        Location pos = Location.findPointToStay(_snowman, 100, 120);
        sp = new SimpleSpawner(template);
        sp.setLoc(pos);
        sp.setAmount(1);
        sp.setRespawnDelay(0);
        _thomas = sp.doSpawn(true);
        if (_thomas == null)
        {
          return;
        }
        _snowmanState = SnowmanState.CAPTURED;
    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.