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 net.sf.l2j.gameserver.model.L2Spawn.doSpawn()

                    // 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);
                }
                catch (Exception e)
    View Full Code Here

    Examples of net.sf.l2j.gameserver.model.L2Spawn.doSpawn()

                        // 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)
                            festivalMob.setOfferingBonus(2);
    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.