Jump to content
  • 0

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


Slayerduck

Question

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

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

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.

Link to comment
Share on other sites

  • 0

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?

Link to comment
Share on other sites

  • 0

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.

Link to comment
Share on other sites

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