Jump to content
  • 0

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


Question

Posted

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

8 answers to this question

Recommended Posts

  • 0
Posted

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

  • 0
Posted

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.

  • 0
Posted

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?

  • 0
Posted

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

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..