Jump to content

Question

Posted (edited)

Hello, I'm spawning mobs from the core side, using code like: 

L2MonsterInstance mob = new L2MonsterInstance(IdFactory.getInstance().getNextId(),NpcTable.getInstance().getTemplate(21425));
					 						mob.setHeading(0);
					 						mob.setCurrentHpMp(mob.getMaxHp(), mob.getMaxMp());
					 						mob.spawnMe(x, y, z);

but after killing this mob it is not respawning, it's possible to set respawn time in this way? Or I should make script and set respawn time in onKill() method?

Edited by Meikis

2 answers to this question

Recommended Posts

  • 0
Posted

 

            L2Spawn spawn = new L2Spawn(template);
            spawn.setLocx(target.getX());
            spawn.setLocy(target.getY());
            spawn.setLocz(target.getZ());
            spawn.setHeading(activeChar.getHeading());
            spawn.setRespawnDelay(respawnTime);
  • 0
Posted
            L2Spawn spawn = new L2Spawn(template);
            spawn.setLocx(target.getX());
            spawn.setLocy(target.getY());
            spawn.setLocz(target.getZ());
            spawn.setHeading(activeChar.getHeading());
            spawn.setRespawnDelay(respawnTime);

Thanks, but I've missed in your code this part:

spawn.startRespawn();
SpawnTable.getInstance().addNewSpawn(spawn, false);
spawn.doSpawn();

Found missed part in 7s code.

Guest
This topic is now closed to further replies.


×
×
  • Create New...