Jump to content

Question

9 answers to this question

Recommended Posts

  • 0
Posted

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.

  • 0
Posted

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.

  • 0
Posted

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.

  • 0
Posted

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"

  • 0
Posted

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 (?)
  • 0
Posted

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.

 

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