Changing base_class = Changing race?...

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
Rexxar
Posts: 12
Joined: Wed Mar 02, 2011 2:38 pm

Changing base_class = Changing race?...

Post by Rexxar »

L2J Revision Number: 4497
L2JDP Revision Number: 7780
_______________

So revision information aside, I have a question that's been haunting me ever since I first tried my own L2 server;


Whenever you change a characters class using GM commands, their race changes too. If you're an orc and you change into bounty hunter, you suddenly find yourself as a dwarf.

This also occurs when you change the character's class manually in the database... Your race ID is 1 (Elf) and your base_class ID is 25 (Elven mystic), you decide to change this (base_class) to 53 (Dwarven Fighter) and when you log in, you suddenly find yourself having changed into a dwarf. Once you log out this is saved permanently.


So my question is: Why does this happen? And how do I prevent it?
Is there any way to prevent the server from automatically overriding your specified race with the "default" race of the "new" class? I've gathered that it's most likely not a client-side limitations, because if it was you wouldn't be able to subclass.
I'd really, REALLY like my female elfs to stay tall and beautiful, even if they choose to become dwarven fighters and spoilers, without having to be forced to shrink down into pre-teen lolis.


Any information would be helpful!
I don't require a big detailed guide on where and what to change, perhaps just a pointer to which file controls the whole "Check if race and base_class matches, and if not, change it" business and I'd most likely be able to locate it myself.



Also please, please, PLEASE don't tell me to use the search function, I've just spent the last 30 or so minutes searching the forum to and fro all the way back to 2006, and I've found nothing relating to my question. And to be honest, I'm quite tired of reading about subclass stacking, race-track bugs and issues with kamael skills. :x
macdonald12
Posts: 89
Joined: Mon Sep 15, 2008 8:51 am

Re: Changing base_class = Changing race?...

Post by macdonald12 »

If you create a character in L2, you first select a (type of) race. That selection becomes your base class. So it's obvious that if you change the base_class in the DB or through GM-commands that you see this change reflected ingame too.

If you want to have a different race or class visually other than you your actual class, take a look at CharInfo.java

Code: Select all

             writeD(_activeChar.getRace().ordinal());            writeD(_activeChar.getAppearance().getSex()? 1 : 0);             if (_activeChar.getClassIndex() == 0)                writeD(_activeChar.getClassId().getId());            else                writeD(_activeChar.getBaseClass()); 
This piece of code handles what class you see on your screen.
Rexxar
Posts: 12
Joined: Wed Mar 02, 2011 2:38 pm

Re: Changing base_class = Changing race?...

Post by Rexxar »

Thanks a lot! Even though Charinfo.java controls how you see other characters around you, thanks to the tip I found Userinfo.java which controls how you see your own character. :)

Now however, I've encountered a trickier issue relating to display of class/race;

Lets say for example that I change:

Code: Select all

writeD(_activeChar.getRace().ordinal());
To:

Code: Select all

writeD(3);
This should technically make all characters look like Orcs (Orc = Race ID 3), right?



Sadly what happens is that all characters turns into female dwarves, which I assume is some kind of "Emergency race" or something that appears when the server tells the client to display a race (or something) that doesn't exist.

Now the weird thing is... When I change myself into an Orc class, such as Titan or Monk, I see my character as an orc. However when I for example change myself to a Spellsinger or Bounty Hunter... I turn into a female dwarf again.


Any idea as to why this is happening?

I looked through the Userinfo.java for clues, and the only thing I realized is that the server only tells the client race and class even when subclassed, which means that if an orc wants to subclass to spellsinger, the server tells the client to display an orc with the spellsinger class... and that works. But when I tell the server manually that this elf spellsinger should look like an orc... I get the "female dwarf error". Really confusing. =/
Zumba
Posts: 58
Joined: Fri Nov 12, 2010 5:01 pm

Re: Changing base_class = Changing race?...

Post by Zumba »

Rexxar wrote:Thanks a lot! Even though Charinfo.java controls how you see other characters around you, thanks to the tip I found Userinfo.java which controls how you see your own character. :)

Now however, I've encountered a trickier issue relating to display of class/race;

Lets say for example that I change:

Code: Select all

writeD(_activeChar.getRace().ordinal());
To:

Code: Select all

writeD(3);
This should technically make all characters look like Orcs (Orc = Race ID 3), right?



Sadly what happens is that all characters turns into female dwarves, which I assume is some kind of "Emergency race" or something that appears when the server tells the client to display a race (or something) that doesn't exist.

Now the weird thing is... When I change myself into an Orc class, such as Titan or Monk, I see my character as an orc. However when I for example change myself to a Spellsinger or Bounty Hunter... I turn into a female dwarf again.


Any idea as to why this is happening?

I looked through the Userinfo.java for clues, and the only thing I realized is that the server only tells the client race and class even when subclassed, which means that if an orc wants to subclass to spellsinger, the server tells the client to display an orc with the spellsinger class... and that works. But when I tell the server manually that this elf spellsinger should look like an orc... I get the "female dwarf error". Really confusing. =/
subclass and base class are 2 different things.
if you change base class = change the skin according to the class
if you change subclass = skin stays the same as the base class
and yes - female dwarf is "emergency" class
simple as that.
User avatar
TK-Master
Posts: 25
Joined: Sat Mar 12, 2011 10:44 pm

Re: Changing base_class = Changing race?...

Post by TK-Master »

uhh why is that weird for you? is it normal for you to have for example an orc with Duelist as a base class? lol of course the race will change.. what you are asking is custom and makes no sense to me personally (not to mention that you could just make a subclass?), one way or the other this is totally normal.
Post Reply