Skip to content

Only 3 races

Featured Replies

How can i make only 3 races available ( like orc, elf and human ) ? And is there client modding too ?

I think the character creation process is only done client side. What happens when you hit create is all of the selected properties are sent to the server in a packet.

 

There is a static function in L2PcInstance called create, which creates a character. One of the paramters is L2PcTemplate template. You can look at public final Race race; and see what the character picked. If the race isn't whichever one you want you can block the character from being created.

I guess you can "block" character creation if race != range, but about how to "cleanup" the selection, you have to play with client.

  • Author

i want to "cleanup" the selections, any ideas where it can be ?

This is a client side issue, this has nothing to do with the server.

For you to make the modification you want you'd need access to the client source code. You should ask these dudes down here for help:

http://maxcheaters.com/forum/index.php?board=68.0

 

But what I honestly think is that it isn't possible to modify this. The only thing you can do is block it via the server.

enterworld.

if(activeChar.getRace() != Race.XXX)
		{
			//code
                                return;
		}

 

you can do it only via this way,but still I dont know how you can totally remove their selection(dwarf example),and I rly doubt if that can be achieved.

the only way that you can do a such thing,or semi one,is what i posted above.

enterworld.

if(activeChar.getRace() != Race.XXX)
		{
			//code
                                return;
		}

 

you can do it only via this way,but still I dont know how you can totally remove their selection(dwarf example),and I rly doubt if that can be achieved.

the only way that you can do a such thing,or semi one,is what i posted above.

 

EnterWorld is executed after the creation of the character (if im not wrong), so its not a rly good way to block it, the best one is to find the packet received with data of the new char and send some action failed pack ( even the one that say that the name is already in use)

 

Btw Franky gratz for "Posts: 3.500"

EnterWorld is executed after the creation of the character (if im not wrong), so its not a rly good way to block it, the best one is to find the packet received with data of the new char and send some action failed pack ( even the one that say that the name is already in use)

 

Btw Franky gratz for "Posts: 3.500"

yes i know.

I explained before that its not a good way to do it,because they will be able to select the race and only when they are logging in the game they will be kicked/ban or whatever he wants.I dont think that there is a way to totally remove their selection,but even if that's possible for sure it needs client edit too.

Btw Franky gratz for "Posts: 3.500"

thanks (?)

If you want to get rid of all the characters that aren't these races already, just run a DELETE query on your database where rows match the ID's you don't want to have in your world.

 

Then where you should put the check is in:

	public static L2PcInstance create(int objectId, L2PcTemplate template, String accountName,
                                  String name, byte hairStyle, byte hairColor, byte face, boolean sex)
{
	// Create a new L2PcInstance with an account name
	PcAppearance app = new PcAppearance(face, hairColor, hairStyle, sex);
	L2PcInstance player = new L2PcInstance(objectId, template, accountName, app);

	// Set the name of the L2PcInstance
	player.setName(name);

	// Set the base class ID to that of the actual class ID.
	player.setBaseClass(player.getClassId());

	if (Config.ALT_GAME_NEW_CHAR_ALWAYS_IS_NEWBIE)
		player.setNewbie(true);

	// Add the player in the characters table of the database
	boolean ok = player.createDb();

	if (!ok)
		return null;

	return player;
}

 

Which is called whent he player wants to create a character. You can just return null if they're using a race you don't want them to use.

 

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.