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: [QUESTION] Enabling New Races in TrinityCore  (Read 2908 times)

mferrill

  • Registred Member
  • Race Changer
  • *****
  • Posts: 36
    • View Profile
[QUESTION] Enabling New Races in TrinityCore
« on: February 26, 2013, 02:42:03 pm »
I'm trying to figure out how to enable a few new races in Trinity.

I've edited Player.cpp

Code: [Select]
 
    switch (race)
    {
        case RACE_HUMAN:    SetTaximaskNode(2);  break;     // Human
        case RACE_ORC:      SetTaximaskNode(23); break;     // Orc
        case RACE_DWARF:    SetTaximaskNode(6);  break;     // Dwarf
        case RACE_NIGHTELF: SetTaximaskNode(26);
                            SetTaximaskNode(27); break;     // Night Elf
        case RACE_UNDEAD_PLAYER: SetTaximaskNode(11); break;// Undead
        case RACE_TAUREN:   SetTaximaskNode(22); break;     // Tauren
        case RACE_GNOME:    SetTaximaskNode(6);  break;     // Gnome
        case RACE_TROLL:    SetTaximaskNode(23); break;     // Troll
        case RACE_GOBLIN:   SetTaximaskNode(23); break;      // Naga
        case RACE_BLOODELF: SetTaximaskNode(82); break;     // Blood Elf
        case RACE_DRAENEI:  SetTaximaskNode(94); break;     // Draenei
        case RACE_NAGA:     SetTaximaskNode(2);  break;     // Troll
        case RACE_BROKEN:   SetTaximaskNode(94); break;     // Broken
        case RACE_VRYKUL:   SetTaximaskNode(2);  break;     // vrykul
    }

Edited SharedDefines.h

 
enum Races
{
    RACE_NONE           = 0,
    RACE_HUMAN          = 1,
    RACE_ORC            = 2,
    RACE_DWARF          = 3,
    RACE_NIGHTELF       = 4,
    RACE_UNDEAD_PLAYER  = 5,
    RACE_TAUREN         = 6,
    RACE_GNOME          = 7,
    RACE_TROLL          = 8,
    RACE_GOBLIN         = 9,
    RACE_BLOODELF       = 10,
    RACE_DRAENEI        = 11,
    RACE_NAGA           = 13,
    RACE_BROKEN         = 14,
    RACE_VRYKUL         = 16
};

// max+1 for player race
#define MAX_RACES         17

#define RACEMASK_ALL_PLAYABLE
    ((1<<(RACE_HUMAN-1))   |(1<<(RACE_ORC-1))          |(1<<(RACE_DWARF-1))   |
    (1<<(RACE_NIGHTELF-1))|(1<<(RACE_UNDEAD_PLAYER-1))|(1<<(RACE_TAUREN-1))  |
    (1<<(RACE_GNOME-1))   |(1<<(RACE_TROLL-1))        |(1<<(RACE_BLOODELF-1))|
    (1<<(RACE_DRAENEI-1)) |(1<<(RACE_NAGA-1)) |(1<<(RACE_BROKEN-1)) |(1<<(RACE_VRYKUL-1)) |(1<<(RACE_GOBLIN-1)))

#define RACEMASK_ALLIANCE
    ((1<<(RACE_HUMAN-1)) | (1<<(RACE_DWARF-1))   | (1<<(RACE_NIGHTELF-1)) |
    (1<<(RACE_GNOME-1))  | (1<<(RACE_DRAENEI-1)) | (1<<(RACE_NAGA-1)) | (1<<(RACE_BROKEN-1)))

#define RACEMASK_HORDE RACEMASK_ALL_PLAYABLE & ~RACEMASK_ALLIANCE


I added in stats for them in DB for them in...

Playercreateinfo
Playercreateinfo_action
Playercreateinfo_item
Playercreateinfo_spell
Playercreateinfo_spell_custom
player_classlevelstats
Player_levelstats
player_xp_for_level


I'm not sure what else needs done.  I thought that was it, but I"m still getting an error on character creation that the class/race is not valid...

DBC files are edited, patched, and placed in Server's DBC folder as well..

Error I"m getting is...

 Player::Create: Possible hacking-attempt: Account 1 tried creating a character named 'Goblintest' with an invalid race/class pair (9/1) - refusing to do so.


Anyone know if there is any other core file in Trinity that needs changed?? Or what might be wrong.  I've triple checked my dbc files for the patch, I"m pretty sure they're correct and not the issue.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Ascathos

  • Moderators
  • Creator of Worlds
  • *****
  • Posts: 1129
    • View Profile
Re: [QUESTION] Enabling New Races in TrinityCore
« Reply #1 on: February 26, 2013, 03:19:46 pm »
How do you have 17 races with one missing and having 16 named ? 14 is missing.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

mferrill

  • Registred Member
  • Race Changer
  • *****
  • Posts: 36
    • View Profile
Re: [QUESTION] Enabling New Races in TrinityCore
« Reply #2 on: February 26, 2013, 03:44:10 pm »
Quote from: "Ascathos"
How do you have 17 races with one missing and having 16 named ? 14 is missing.

Broken = 14 - it's actually FEL_ORC = 12 that isn't on the list, and changing from 17 Max to 15, did nothing.
Although, your right it was a mistake on my part, and should be 15. (I think)

And I could have set it up like this.... but it seemed...messy and unorganized

// Race value is index in ChrRaces.dbc
enum Races
{
    RACE_NONE               = 0,
    RACE_HUMAN              = 1,
    RACE_ORC                = 2,
    RACE_DWARF              = 3,
    RACE_NIGHTELF           = 4,
    RACE_UNDEAD_PLAYER      = 5,
    RACE_TAUREN             = 6,
    RACE_GNOME              = 7,
    RACE_TROLL              = 8,
    RACE_GOBLIN             = 9,
    RACE_BLOODELF           = 10,
    RACE_DRAENEI            = 11
    //RACE_FEL_ORC            = 12,
     RACE_NAGA               = 13,
    RACE_BROKEN             = 14,
    //RACE_SKELETON           = 15,
    RACE_VRYKUL             = 16,
    //RACE_TUSKARR            = 17,
    //RACE_FOREST_TROLL       = 18,
    //RACE_TAUNKA             = 19,
    //RACE_NORTHREND_SKELETON = 20,
    //RACE_ICE_TROLL          = 21
};

Appreciate you taking the time to read, and respond.  Unfortunately, I"m still stuck in the same spot.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

XxXGenesisXxX

  • Contributors
  • Model Change Addict
  • *****
  • Posts: 204
    • View Profile
Re: [QUESTION] Enabling New Races in TrinityCore
« Reply #3 on: February 26, 2013, 09:58:54 pm »
RACE_DRAENEI = 11

Has no comma at the end, the list will, stop reading, surprised it even compiled. Also, that error you are getting has always come from a database mismatch for me. Check the playercreateinfo table again to make sure.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

mferrill

  • Registred Member
  • Race Changer
  • *****
  • Posts: 36
    • View Profile
Re: [QUESTION] Enabling New Races in TrinityCore
« Reply #4 on: February 26, 2013, 11:03:27 pm »
Quote from: "XxXGenesisXxX"
RACE_DRAENEI = 11

Has no comma at the end, the list will, stop reading, surprised it even compiled. Also, that error you are getting has always come from a database mismatch for me. Check the playercreateinfo table again to make sure.


Thanks for the reply!

I'm actually using ...

enum Races
{
RACE_NONE = 0,
RACE_HUMAN = 1,
RACE_ORC = 2,
RACE_DWARF = 3,
RACE_NIGHTELF = 4,
RACE_UNDEAD_PLAYER = 5,
RACE_TAUREN = 6,
RACE_GNOME = 7,
RACE_TROLL = 8,
RACE_GOBLIN = 9,
RACE_BLOODELF = 10,
RACE_DRAENEI = 11,
RACE_NAGA = 13,
RACE_BROKEN = 14,
RACE_VRYKUL = 16
};

// max+1 for player race
#define MAX_RACES 17

I decided to keep the MAX_RACES 17 - Looking at Cata SharedDefines, that seems right....
I Think I"ll have to rebuild my entire PlayerCreateInfo table again.  I had All race all class enabled before...I think that's where things went wrong! :D

Any other thoughts on the matter, or suggestion are always welcome. Thanks again for the help!
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

mferrill

  • Registred Member
  • Race Changer
  • *****
  • Posts: 36
    • View Profile
Re: [QUESTION] Enabling New Races in TrinityCore
« Reply #5 on: February 27, 2013, 05:42:44 am »
[attachment=0:1k1kehfw]Capture.PNG[/attachment:1k1kehfw]Solved.

You were right. it was a mistake in playercreateinfo table.  Simple mistake that I overlooked cause my brain turned to mush staring at the pc all day :D  SQL I wrote for it had a typo, non-existent map. Threw everything off.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »