This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Menu

Author Topic: [SOLVED] Error creating a new class  (Read 3125 times)

mathex

  • Registred Member
  • GM Isle Explorer
  • *****
  • Posts: 24
    • View Profile
[SOLVED] Error creating a new class
« 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
viewtopic.php?f=26&t=3838

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:
« Last Edit: August 09, 2013, 07:22:09 pm by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [QUESTION] Error creating a new class
« Reply #1 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.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

mathex

  • Registred Member
  • GM Isle Explorer
  • *****
  • Posts: 24
    • View Profile
Re: [QUESTION] Error creating a new class
« Reply #2 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
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [QUESTION] Error creating a new class
« Reply #3 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.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

mathex

  • Registred Member
  • GM Isle Explorer
  • *****
  • Posts: 24
    • View Profile
Re: [QUESTION] Error creating a new class
« Reply #4 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:


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! :-)
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Ascathos

  • Moderators
  • Creator of Worlds
  • *****
  • Posts: 1129
    • View Profile
Re: [QUESTION] Error creating a new class
« Reply #5 on: August 08, 2013, 06:45:43 pm »
I dare say that your playercreateinfo_* is incomplete. ChrBaseInfo shouldn't be the only problem.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

mathex

  • Registred Member
  • GM Isle Explorer
  • *****
  • Posts: 24
    • View Profile
Re: [QUESTION] Error creating a new class
« Reply #6 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.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Ascathos

  • Moderators
  • Creator of Worlds
  • *****
  • Posts: 1129
    • View Profile
Re: [QUESTION] Error creating a new class
« Reply #7 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.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »