Skip to content

'To Town' (After death) - Question (Random Spawnpoints)

Featured Replies

Hello,

 

I've made my PVP Zone Mithril Coal Mines. So, now when someones dies.. and he clicks on "To Town" he gets spawned into the nearest town.

 

I want to change that, that he spawns at random spawnpoints in the pvp zone, how do i do that?

 

Core: L2jFrozen

Add a check inside RequestRestartPoint.java, if the player is inside your custom zone, revive and teleport him to your custom point and 'return;'.

or just put spam location inside your zone!!!

Guess needs something like this in requestrestartpoint.java

 

if (activeChar.isInsideZone(L2Character.ZONE_UNUSED) && activeChar.isDead())
		{
			activeChar.doRevive();
			activeChar.teleToLocation(0, 0, 0);
			activeChar.sendMessage("You have been teleported ....");
			return;
		}

 

Or even try this code in Die.java

 

if (_activeChar.isInsideZone(L2Character.ZONE_UNUSED))
	{
		_activeChar.doRevive();
		_activeChar.teleToLocation(0, 0, 0);
		return;
	}

 

Otherwise,we can add a check in zone's file.

  • Author

Guess needs something like this in requestrestartpoint.java

 

if (activeChar.isInsideZone(L2Character.ZONE_UNUSED) && activeChar.isDead())
		{
			activeChar.doRevive();
			activeChar.teleToLocation(0, 0, 0);
			activeChar.sendMessage("You have been teleported ....");
			return;
		}

 

Or even try this code in Die.java

 

if (_activeChar.isInsideZone(L2Character.ZONE_UNUSED))
	{
		_activeChar.doRevive();
		_activeChar.teleToLocation(0, 0, 0);
		return;
	}

 

Otherwise,we can add a check in zone's file.

 

And how the fuck know the core that i am in the zone lately :P?

sorry,what do you want to say cause i didnt  understand you?

Oh god, because inside your zone.java should be something like

 

@Override
protected void onEnter(L2Character character)
{
	if (getCastle() != null)
	{
		character.setInsideZone(ZoneId.CASTLE, true);
	}
}

@Override
protected void onExit(L2Character character)
{
	if (getCastle() != null)
	{
		character.setInsideZone(ZoneId.CASTLE, false);
	}
}

 

then when u check with something like

if(activeChar.isInsideZone(L2Character.ZoneId.CASTLE))

"the server knows" you are inside... and will execute the lines inside the if.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.