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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...