Jump to content
  • 0

[REQUEST] L2Monster return to spawn point like L2Raid


Question

Posted

Kalimera mages

 

 

Kserei kaneis ti prepei na kanw wste na girizei piso sto spawn point ena L2Monster

otan pernaei ena X distance apo to spawn point tou?

 

 

 

To pack m einai l2jfrozen last revision

to pack exei ena config alla den work ...

 

dokimasa auto to code alla tipota

 

/**
 * Return home.
 */
public void returnHome()
 {
  ThreadPoolManager.getInstance().scheduleAi(new Runnable() {
   @Override
   public void run()
   {
    L2Spawn mobSpawn = getSpawn();
    if(!isInCombat() && !isAlikeDead() && !isDead() && mobSpawn != null && !isInsideRadius(mobSpawn.getLocx(), mobSpawn.getLocy(), Config.MAX_DRIFT_RANGE, false))
    {
     teleToLocation(mobSpawn.getLocx(), mobSpawn.getLocy(), mobSpawn.getLocz(), false);
    }
    mobSpawn = null;
   }
   
  }, 1000);
 }
protected void startMaintenanceTask()
{
	ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new Runnable() {
		@Override
		public void run()
		{
			checkAndReturnToSpawn();
		}
	}, 3000, getMaintenanceInterval()+Rnd.get(5000));
}
protected void checkAndReturnToSpawn()
{
	if (isDead() || isMovementDisabled())
		return;

	final L2Spawn spawn = getSpawn();
	if (spawn == null)
		return;

	final int spawnX = spawn.getLocx();
	final int spawnY = spawn.getLocy();
	final int spawnZ = spawn.getLocz();

	if (!isInCombat() && !isMovementDisabled())
	{
		if (!isInsideRadius(spawnX, spawnY, spawnZ, Math.max(1000, 200), true, false))
			teleToLocation(spawnX, spawnY, spawnZ);
	}
}

4 answers to this question

Recommended Posts

  • 0
Posted

Bump

 

 

kaneis den vgazi akri me auto to pragma enw fenete 1 minite code @@ ekei na me akolouthane opou paw ta monster alla ti na peis monster einai auta :@

Guest
This topic is now closed to further replies.


×
×
  • Create New...