Jump to content
  • 0

Help Core Side - Mobs Respawn Time


Meikis
 Share

Question

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
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

 

            L2Spawn spawn = new L2Spawn(template);
            spawn.setLocx(target.getX());
            spawn.setLocy(target.getY());
            spawn.setLocz(target.getZ());
            spawn.setHeading(activeChar.getHeading());
            spawn.setRespawnDelay(respawnTime);
Link to comment
Share on other sites

  • 0
            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.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share



×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock