Modcraft - The community dedicated to quality WoW modding!

Wrath of the Lich King Modding => Miscellaneous => Topic started by: mathex on August 08, 2013, 03:50:05 pm

Title: [SOLVED] Error creating a new class
Post by: mathex on August 08, 2013, 03:50:05 pm
So I've created a new class from scratch from using both of these tutorials:
viewtopic.php?f=26&t=1840 (http://modcraft.io/viewtopic.php?f=26&t=1840" onclick="window.open(this.href);return false;)
viewtopic.php?f=26&t=3838 (http://modcraft.io/viewtopic.php?f=26&t=3838" onclick="window.open(this.href);return false;)

I looked into the code and this is where it seems to crash (player.cpp line 942)
Code: [Select]
   PlayerInfo const* info = sObjectMgr->GetPlayerInfo(createInfo->Race, createInfo->Class);
    if (!info)
    {
        TC_LOG_ERROR(LOG_FILTER_PLAYER, "Player::Create: Possible hacking-attempt: Account %u tried creating a character named '%s' with an invalid race/class pair (%u/%u) - refusing to do so.",
                GetSession()->GetAccountId(), m_name.c_str(), createInfo->Race, createInfo->Class);
return false;
    }

I'm using TrinityCore.
The new class ID is 12.

And I've stumbled into a problem. After all my attempts I still get this little error:
(http://i.imgur.com/B8m1sCt.png)
Title: Re: [QUESTION] Error creating a new class
Post by: schlumpf on August 08, 2013, 04:29:24 pm
As the error and code tells you: You need to put that class and race combination in the serverside dbc and db.
Title: Re: [QUESTION] Error creating a new class
Post by: mathex on August 08, 2013, 04:35:24 pm
Quote from: "schlumpf"
As the error and code tells you: You need to put that class and race combination in the serverside dbc and db.

I already put the ChrClasses and all other files modified by me in the server's DBC folder, what I don't know is what to edit in the DB? I inserted a start location, spells and other stuff which was told in the tutorial but no more than that.

Do you have any idea?

The files which is changed is:
CharBaseInfo.dbc
CharStartOutfit.dbc
ChrClasses.dbc
gt*.dbc files
TalentTab.dbc

DB Tables modified:
player_classlevelstats
player_levelstats
playercreateinfo
playercreateinfo_spell
Title: Re: [QUESTION] Error creating a new class
Post by: schlumpf on August 08, 2013, 04:53:28 pm
CharBaseInfo is the one most likely triggering the error.
You may also want to have a look in GetPlayerInfo() of that objectMgr class.
Title: Re: [QUESTION] Error creating a new class
Post by: mathex on August 08, 2013, 05:04:07 pm
Quote from: "schlumpf"
CharBaseInfo is the one most likely triggering the error.
You may also want to have a look in GetPlayerInfo() of that objectMgr class.

Already checked the GetPlayerInfo function in the object manager. It seems to detect the max number of races and classes and if the players class or race is above that it returns null. The thing is my Class ID is 12 and the MAX_CLASSES is set to 13. So that's not really what's wrong (I assume). I'm going to try to make a new CharBaseInfo. It's very tricky to make that. But it seems to work client side? :O

Also as you see it's all good:
(http://i.imgur.com/6jnA9Sf.png)

Maybe this will help you.

List of edited files:
ItemPrototype.h (added glyphs for the class)
Player.cpp (added dodge from agility and roll rules)
Statsystem.cpp (edited a lot of stat stuff)
ObjectMgr.cpp (edited BuildPlayerLevelInfo function)
SharedDefines.h (added class to enum classesm made max classes 13, added it to the classmask_playable, added quest sorts and added a spell family for the class)

Okay I got it all working, for future references, it's about population the playercreate tables correctly. Sorry about all the fuzz. Thanks for the help! :-)
Title: Re: [QUESTION] Error creating a new class
Post by: Ascathos on August 08, 2013, 06:45:43 pm
I dare say that your playercreateinfo_* is incomplete. ChrBaseInfo shouldn't be the only problem.
Title: Re: [QUESTION] Error creating a new class
Post by: mathex on August 08, 2013, 07:46:47 pm
Quote from: "Ascathos"
I dare say that your playercreateinfo_* is incomplete. ChrBaseInfo shouldn't be the only problem.

Yep, you're correct, Sir. Check the message above :) Thank you for helping! It's much appreciated.
Title: Re: [QUESTION] Error creating a new class
Post by: Ascathos on August 09, 2013, 12:24:35 pm
Quote from: "mathex"
Quote from: "Ascathos"
I dare say that your playercreateinfo_* is incomplete. ChrBaseInfo shouldn't be the only problem.

Yep, you're correct, Sir. Check the message above :) Thank you for helping! It's much appreciated.
You are right. I didn't check the entire log for a change - apologizing.