Skip to content

[Help] Character restriction

Featured Replies

Hello folks then .. :-[

 

I need help with my AIOs since restrict them from leaving towns is hard

so I would know how to use a punishment for such

 

In L2TownZone.java this

protected void onExit(L2Character character)
{
	// TODO: there should be no exit if there was possibly no enter
	if (_isPeaceZone)
		character.setInsideZone(L2Character.ZONE_PEACE, false);

	character.setInsideZone(L2Character.ZONE_TOWN, false);

if (character instanceof L2PcInstance)

{	
		if (((L2PcInstance)character).isDonator() && getTownId() == 7)

		{
			((L2PcInstance)character).sendMessage("AIOs can't leave town. You are now back.");
            ((L2PcInstance)character).teleToLocation(MapRegionTable.TeleportWhereType.Town);
		}
		else if (((L2PcInstance)character).isDonator() && getTownId() == 8)
		{
			((L2PcInstance)character).sendMessage("AIOs can't leave town. You are now back.");
            ((L2PcInstance)character).teleToLocation(MapRegionTable.TeleportWhereType.Town);
		}
		else
			((L2PcInstance)character).sendMessage("You have entered a non-restricted area.");
			 		}

  }		

 

 

It works, but the restriction also applies when it goes to Town to Town .. here's how to limit access only to towns with ID 1-13!?

thx

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.