Modcraft - The community dedicated to quality WoW modding!

Wrath of the Lich King Modding => Serverside Modding => Topic started by: Ascathos on January 09, 2013, 04:19:57 pm

Title: Discourse: Creating a custom Class in Trinity Core
Post by: Ascathos on January 09, 2013, 04:19:57 pm

Introduction


In the following, I want to explain how to create a custom Class and make it work on Trinity Core. That being said, it's relatively simple in creation, but requires quite a bit of foresight, imagination and planning. This tutorial is created with a 3.3.5a Trinity Core version, that may change in the future. If this happens, it's the obligatory of the user to find solutions and post them. That being said, I am not going into details of how to do anything. That should be "common knowledge". A lot of the here shown content is a contribution of several people, namely "schlumpf (http://modcraft.io/memberlist.php?mode=viewprofile&u=59)", "XxXGenesisXxX (http://modcraft.io/memberlist.php?mode=viewprofile&u=1999)", "Khira (http://modcraft.io/memberlist.php?mode=viewprofile&u=103)", "stoneharry" (http://modcraft.io/memberlist.php?mode=viewprofile&u=435) and many others - some of which I forgot. A huge thank you to the TrinityCore staff, which helped and still helps me learn more about the world of coding beyond world of warcraft (gives me a good glimpse, though). Still, I am thankful for their contributions that enabled this.

Due the length of this topic, I shall divide the topic in several posts to make it clearer and better to look over. I'm not going in depth about indentions. Please do that yourself.

What to expect/Index


Within this discourse, I want to mention following things:

Definition


In World of Warcraft, a class defines a type and field of specialization a character obtains. Divided in different classes, each has numerous "Archetypes" to the common roleplay genre. The most common archetypes are the Warrior, the Archer, the Magician and other, "finer" ones. World of Warcraft is blurring the lines of these archetypes. For example, the Hunter has aspects of a warrior, an archer and also to a beastmaster - each representing common aspects mixed into an unique character. The Deathknight mixes magical aspects with warrior aspects, for example. Once you go finer into the definition, you quickly see that "stereotypes" are not subject to discussion here.

How could you want to create your own class ? In the end, it all comes down to what you want. Do you want your own game and remove the old ones ? Or do you feel like there is something missing that may be enormous ? The good thing about modding is the imagination. You can do whatever you want. The bad thing is how it's done, because horrible applications may be a waste of time and effort.

(Permission by Steff to post in here. Work in progress)
Title: 2. Create your own class and get it work
Post by: Ascathos on January 09, 2013, 08:29:33 pm
This part is the most complex, longest and hardest part of it all. I try to explain it as easy as I can. If you have issues reading, simply press quote in the bottom and press preview in the reply window.

Note that I am basically copying the Warrior class for the most part. You have to do most things on your own to get an understanding for them, however, I'll try my best. If something is unclear, pm me.

What you need


1. Any C++ Editor and compiler (Most cases: Microsoft Visual C++ (Everything can be used, but 2010+ is advisable)
2. Any Text/CSV editor (I prefer: Notepad++ - edits both)
3. Any DBC Editor (I prefer: DBCUtil, Tallis and MyDBCEditor for whatever is the best option in each case.)
4. Any SQL Editor (I prefer: HeidiSQL)
5. Any BLP Converter (I prefer: BLP Laboratory)
6. [Optional] Any picture edit programm (I prefer: Gimp or Photoshop)
7. Important: Check for the latest files you can find for anything. If pieces of information are missing that are listed in here, look further and find the actual one.


SQL


The most easiest part that I am even providing you. Note though that these are the stats given to the warrior, so you have to make them fitting to your own personal needs.

DBC


You need to edit the following DBCs:
[/li][/list]

Core


gameHeader Filesshareddefines.h
gameSource FilesObjectMgr.cpp
gameSource FilesPlayer.cpp
scriptsSource Filescs_misc.cpp
scriptsSource Filesspell_item.cpp

LUA (Interface)



This is the essential. To even attempt running any further, you have to understand what each change does. Thus, I shall start with the core (which is fairly the most uncommon part in this).




Changes to the Core



- - gameHeader Filesshareddefines.h - -



Code: [Select]
// Class value is index in ChrClasses.dbc
enum Classes
{
    CLASS_WARLOCK       = 9,
    //CLASS_UNK           = 10,
    CLASS_DRUID         = 11[|],
    CLASS_HERO          = 12 //I added this line[|]
};

Code: [Select]
// max+1 for player class
#define MAX_CLASSES       [|]13[|]

Code: [Select]
#define CLASSMASK_ALL_PLAYABLE
        ((1<<(CLASS_WARRIOR-1))|(1<<(CLASS_PALADIN-1))| (1<<(CLASS_HUNTER-1)) |
    (1<<(CLASS_ROGUE-1))   |(1<<(CLASS_PRIEST-1)) | (1<<(CLASS_SHAMAN-1)) |
    (1<<(CLASS_MAGE-1))    |(1<<(CLASS_WARLOCK-1))| (1<<(CLASS_DRUID-1)) |  
    (1<<(CLASS_DEATH_KNIGHT-1))| [|](1<<(CLASS_HERO-1)))[|]

   
Code: [Select]
enum SpellFamilyNames
{
SPELLFAMILY_DEATHKNIGHT = 15,
    // 16 - unused
    SPELLFAMILY_PET         = 17[|],
SPELLFAMILY_HERO = 18 //I added this line[|]
};


Each change is noted within the [|]s. Make sure to remove them when you copy it. I only paste parts of most edited parts.




- - gameSource FilesObjectMgr.cpp - -



Search for: "ObjectMgr::BuildPlayerLevelInfo"

Code: [Select]
   for (uint8 lvl = sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)-1; lvl < level; ++lvl)
    {
        switch (_class)
        {
            case CLASS_WARRIOR:
                info->stats[STAT_STRENGTH]  += (lvl > 23 ? 2: (lvl > 1  ? 1: 0));
                info->stats[STAT_STAMINA]   += (lvl > 23 ? 2: (lvl > 1  ? 1: 0));
                info->stats[STAT_AGILITY]   += (lvl > 36 ? 1: (lvl > 6 && (lvl%2) ? 1: 0));
                info->stats[STAT_INTELLECT] += (lvl > 9 && !(lvl%2) ? 1: 0);
                info->stats[STAT_SPIRIT]    += (lvl > 9 && !(lvl%2) ? 1: 0);
                break;
        [...]
            case CLASS_DRUID:
                info->stats[STAT_STRENGTH]  += (lvl > 38 ? 2: (lvl > 6 && (lvl%2) ? 1: 0));
                info->stats[STAT_STAMINA]   += (lvl > 32 ? 2: (lvl > 4 ? 1: 0));
                info->stats[STAT_AGILITY]   += (lvl > 38 ? 2: (lvl > 8 && (lvl%2) ? 1: 0));
                info->stats[STAT_INTELLECT] += (lvl > 38 ? 3: (lvl > 4 ? 1: 0));
                info->stats[STAT_SPIRIT]    += (lvl > 38 ? 3: (lvl > 5 ? 1: 0));
                [|]break;
   case CLASS_HERO:
                info->stats[STAT_STRENGTH]  += (lvl > 23 ? 2: (lvl > 1  ? 1: 0));
                info->stats[STAT_STAMINA]   += (lvl > 23 ? 2: (lvl > 1  ? 1: 0));
                info->stats[STAT_AGILITY]   += (lvl > 36 ? 1: (lvl > 6 && (lvl%2) ? 1: 0));
                info->stats[STAT_INTELLECT] += (lvl > 9 && !(lvl%2) ? 1: 0);
                info->stats[STAT_SPIRIT]    += (lvl > 9 && !(lvl%2) ? 1: 0);[|]
        }
    }
}


If we wanted to have a Class that gets high strength values right from the beginning, for example from level 1 onward none, but 4 after level 6 and only 2 points after level 46, we could do this:

Code: [Select]
   {
        switch (_class)
        {
        [...]
   case CLASS_HERO:
                info->stats[STAT_STRENGTH]  += (lvl > 6 ? 4: (lvl > 46 ? 2: 0));
        [...]
        }
    }
}


This is an explanation done by Nay, one of the current TC devs:

Quote
Code: [Select]
info->stats[STAT_STRENGTH]  += (lvl > 23 ? 2: (lvl > 1  ? 1: 0));can be written as
Code: [Select]
if (lvl > 23)    
info->stats[STAT_STRENGTH] += 2;
else if (lvl > 1)    
info->stats[STAT_STRENGTH] += 1;
else // should never happen    
info->stats[STAT_STRENGTH] += 0;
and
Code: [Select]
info->stats[STAT_AGILITY]   += (lvl > 36 ? 1: (lvl > 6 && (lvl%2) ? 1: 0));to
Code: [Select]
if (lvl > 36)    
info->stats[STAT_AGILITY] += 1;
else if (lvl > 6 && isEven(lvl)) // isEven returns true if number is divisible by 2 (0,2,4,6,8,etc)    
info->stats[STAT_AGILITY] += 1;
else    
info->stats[STAT_AGILITY] += 0;
Explanation given in TrinityCore Forum. Many thanks at this point to Nay, who took the time to explain this so well! (http://www.trinitycore.org/f/topic/7756-understanding-the-buildplayerlevelinfo-function/?p=50535)

Explanations of some conditions symbols:

- - gameSource FilesPlayer.cpp - -



Search for: "InventoryResult Player::CanRollForItemInLFG"
Go to and alter to:
       
Code: [Select]
if (_class == CLASS_WARRIOR || _class == CLASS_PALADIN || _class == CLASS_DEATH_KNIGHT[|] || _class == CLASS_HERO)[|]
Search for: "Player::GetDodgeFromAgility"
Go to and alter to:
Code: [Select]
const float dodge_base[MAX_CLASSES] =
    {
         0.024211f, // Warlock
         0.0f,      // ??
         0.056097f[|],  // Druid
0.064974f  // Hero [|]
    };


Search for: "crit_to_dodge[MAX_CLASSES]"
Code: [Select]
   const float crit_to_dodge[MAX_CLASSES] =
    {        
1.00f/1.15f,    // Mage
         0.97f/1.15f,    // Warlock (?)
         0.0f,           // ??
         2.00f/1.15f[|],     // Druid
1.75f/1.15f // Hero[|]
    };


- - scriptsSource Filescs_misc.cpp - -


Search: "std::string raceStr, ClassStr;"
Go to and alter to:

Code: [Select]
       switch (Class)
        {            
case CLASS_DRUID:
                ClassStr = "Druid";
                break;
[|]case CLASS_HERO:
ClassStr = "Hero";
break;[|]
        }



- - scriptsSource Filesspell_item.cpp - -


Search: "possibleSpells.push_back(SPELL_FLASK_OF_THE_NORTH_SP);"
Alter to:
Code: [Select]
           void HandleDummy(SpellEffIndex /*effIndex*/)
            {
                Unit* caster = GetCaster();
                std::vector<uint32> possibleSpells;
                switch (caster->getClass())
                {
                    case CLASS_WARLOCK:
                    case CLASS_MAGE:
                    case CLASS_PRIEST:
                        possibleSpells.push_back(SPELL_FLASK_OF_THE_NORTH_SP);
                        break;
   [|]case CLASS_HERO:[|] // I added this line
   case CLASS_DEATH_KNIGHT:
                    case CLASS_WARRIOR:
                        possibleSpells.push_back(SPELL_FLASK_OF_THE_NORTH_STR);
                        break;



If you did everything right, you should be able to compile. If not, go through these notes again. What are your problems ? What did you do wrong ? Ask questions if necessary, for example by pm (and I shall answer in this thread with an answer if I have one.)




Changes to the Interface



I use mordred's Login screen (http://modcraft.io/viewtopic.php?f=20&t=1652), so I base it on this. However, the procedure shouldn't be different. Edited interface files require the GlueXML Check Removed from the WoW.exe (http://modcraft.io/viewtopic.php?f=59&t=883). Mordred provides such file already, however, if you need to do it based off blizzard's actual interface, you can still do it yourself.

- - InterfaceGlueXMLCharacterCreate.lua - -



Goto and alter to:
MAX_CLASSES_PER_RACE = [|]11[|]; -- 10 blizzard classes + our custom class


Goto and alter to:
CLASS_ICON_TCOORDS = {
   ["WARRIOR"]   = {0, 0.25, 0, 0.25},
   [|]["HERO"]   = {0, 0.25, 0, 0.25}, -- Basically copied the icon from the Warrior class[|]
   -- ["EXPLAINATIONHELP"]   = {widtha, widthb, heighta, heightb}, -- This is just to help explaining in the next passage.
};


- - InterfaceGlueXMLCharacterCreate.xml - -



Search for:
Code: [Select]
<Anchor point="TOP" relativeTo="CharacterCreateClassButton5" relativePoint="BOTTOM" x="0" y="-6"/>
</Anchors>
</CheckButton>

add after:
Code: [Select]
      <CheckButton name="CharacterCreateClassButton11" inherits="CharacterCreateClassButtonTemplate" id="11">
        <Anchors>
         <Anchor point="LEFT" relativeTo="CharacterCreateClassButton10" relativePoint="RIGHT" x="6" y="0"/>
        </Anchors>
       </CheckButton>


There can be changed more in this file, for example "CharacterCreateClassButton1" to change the whole position (makes it look more clean). However, it can also mess the whole layout up; test around to find what suits your interests the best.

- - InterfaceGlueXMLGlueStrings.lua- -



Search for: "CLASS_DRUID_FEMALE"

Copy and paste the values "CLASS_WARRIOR" and "CLASS_WARRIOR_FEMALE" as a whole (CLASS_WARRIOR = "[some string];" and CLASS_WARRIOR_FEMALE = "[some string];",
place it after "CLASS_DRUID_FEMALE" and rename it to "CLASS_HERO" and "CLASS_HERO_FEMALE".
You should have this structure now:

CLASS_DRUID = "Druid_Male text";
CLASS_DRUID_FEMALE = "Druid_Female text";
CLASS_HERO = "Warrior_Male text";
CLASS_HERO_FEMALE = "Warrior_Female text";
CLASS_HUNTER = "Hunter_Male text";
CLASS_HUNTER_FEMALE = "Hunter_Female text";
[... Some classes and their description texts ...]
CLASS_WARRIOR = "Warrior_Male text";
CLASS_WARRIOR_FEMALE = "Warrior_Female text";

Of course, you can set your own description texts here, but it makes things a lot easier. This is for a description each class has in the character creation.

Repeat this procedure for CLASS_INFO_HERO0 - CLASS_INFO_HERO4 (these are the description points under the class box) in the same way. You should know have 2 additional CLASS_* and 5 (or more/less) CLASS_INFO_* strings for the character creation.


Next, look for:

Code: [Select]
HELP = "Help";
HERTZ = "Hz";

Replace it with:

Code: [Select]
HELP = "Help";
HERO_DISABLED = "HeronYou must choose a different race to be this class.";
HERTZ = "Hz";

Basically, if there is a race which should not use the new class, it displays this message instead of a blank tooltip.

- - InterfaceFrameXMLConstants.lua- -



Goto and alter to
Code: [Select]
RAID_CLASS_COLORS = {
[...]
[|]["HERO"] = { r = 0.78, g = 0.61, b = 0.43 },[|]
["WARRIOR"] = { r = 0.78, g = 0.61, b = 0.43 },
["DEATHKNIGHT"] = { r = 0.77, g = 0.12 , b = 0.23 },
};

This is, so there is a value given for the guild and who-lists. This is necessary for things to not bug out ingame. Here you can set an actual color for the class, so you can have a shiny class color in the who and guild-list.

Goto and alter to
Code: [Select]
CLASS_SORT_ORDER = {
[...]
"HUNTER",
"HERO",
};

Same for above. Required to not make it bug out.

Goto and alter to
Code: [Select]
CLASS_ICON_TCOORDS = {
["WARRIOR"] = {0, 0.25, 0, 0.25},
[|]["HERO"] = {0, 0.25, 0, 0.25},[|]
[...]
};

I guess I do not need to explain anything in this part either. The same thing we did to the charactercreate.lua for the icons, we do here now. Make sure to copy the same values.

Changes to the DBC



- - ChrClasses.dbc - -


First, it's structure: (http://pxr.dk/wowdev/wiki/index.php?title=ChrClasses.dbc)

Basically, we add an entry into this copying the warrior, change the name [1], the localization depending on your language [4 - 54], the Filename [55], the Spell Class Set [56] and maybe flags [57]. Again, customize as you want.
Title: Re: Discourse: Creating a custom Class in Trinity Core
Post by: Shruik on March 17, 2013, 12:49:47 am
Is there more to come? Do you need help with anything? As i´m too stupid to compile trinity i could "only" do research, dbc and some basic coding (only programming language i somehow handle is java) but it´s better than nothing.
Title: Re: Discourse: Creating a custom Class in Trinity Core
Post by: Ascathos on March 17, 2013, 02:42:27 pm
I'll finish it over my break in a week. Was just too lazy to do it until now.
Title: Re: Discourse: Creating a custom Class in Trinity Core
Post by: Shruik on March 17, 2013, 02:50:59 pm
Quote from: "Ascathos"
I'll finish it over my break in a week. Was just too lazy to do it until now.
okay ^^
Title: Re: Discourse: Creating a custom Class in Trinity Core
Post by: detonatorss on March 18, 2013, 12:22:41 pm
that was awsome , if you make one for mangos i try to help you
Title: Re: Discourse: Creating a custom Class in Trinity Core
Post by: Ascathos on May 27, 2016, 01:21:25 am
Moved this to Serverside Modding.

May or may not note what else has to be done at some point.
Title: Re: Discourse: Creating a custom Class in Trinity Core
Post by: Kobiesan on May 29, 2016, 12:21:17 am
I followed your guide exactly but my new class doesn't appear on the creation screen. I edited the blp to include my class' icon.

(http://i.imgur.com/8o2f313.jpg)


Here's what my mpq file looks like.

(http://i.imgur.com/uirVyeR.png)
Title: Re: Discourse: Creating a custom Class in Trinity Core
Post by: Ascathos on May 29, 2016, 12:38:43 am
Make sure you add the approperiate values into the xml and import it into interface.
Title: Re: Discourse: Creating a custom Class in Trinity Core
Post by: Kobiesan on May 29, 2016, 01:44:36 am
Quote from: "Ascathos"
Make sure you add the approperiate values into the xml and import it into interface.

I used the values that are in this guide. What lines in xml need to be changed?

Here's what I have in XML.

Code: [Select]
<CheckButton name="CharacterCreateClassButton10" inherits="CharacterCreateClassButtonTemplate" id="10">
<Anchors>
<Anchor point="TOP" relativeTo="CharacterCreateClassButton5" relativePoint="BOTTOM" x="0" y="-6"/>
</Anchors>
</CheckButton>
<CheckButton name="CharacterCreateClassButton11" inherits="CharacterCreateClassButtonTemplate" id="11">
<Anchors>
<Anchor point="TOP" relativeTo="CharacterCreateClassButton6" relativePoint="BOTTOM" x="0" y="-6"/>
</Anchors>
</CheckButton>
Title: Re: Discourse: Creating a custom Class in Trinity Core
Post by: Ascathos on May 29, 2016, 02:38:46 am
Quote from: "Kobiesan"
Quote from: "Ascathos"
Make sure you add the approperiate values into the xml and import it into interface.

I used the values that are in this guide. What lines in xml need to be changed?

Here's what I have in XML.

Code: [Select]
<CheckButton name="CharacterCreateClassButton10" inherits="CharacterCreateClassButtonTemplate" id="10">
<Anchors>
<Anchor point="TOP" relativeTo="CharacterCreateClassButton5" relativePoint="BOTTOM" x="0" y="-6"/>
</Anchors>
</CheckButton>
<CheckButton name="CharacterCreateClassButton11" inherits="CharacterCreateClassButtonTemplate" id="11">
<Anchors>
<Anchor point="TOP" relativeTo="CharacterCreateClassButton6" relativePoint="BOTTOM" x="0" y="-6"/>
</Anchors>
</CheckButton>
the .lua file also ? Try a different icon, else.
Title: Re: Discourse: Creating a custom Class in Trinity Core
Post by: Kobiesan on May 29, 2016, 02:47:41 am
Quote from: "Ascathos"
Quote from: "Kobiesan"
Quote from: "Ascathos"
Make sure you add the approperiate values into the xml and import it into interface.

I used the values that are in this guide. What lines in xml need to be changed?

Here's what I have in XML.

Code: [Select]
<CheckButton name="CharacterCreateClassButton10" inherits="CharacterCreateClassButtonTemplate" id="10">
<Anchors>
<Anchor point="TOP" relativeTo="CharacterCreateClassButton5" relativePoint="BOTTOM" x="0" y="-6"/>
</Anchors>
</CheckButton>
<CheckButton name="CharacterCreateClassButton11" inherits="CharacterCreateClassButtonTemplate" id="11">
<Anchors>
<Anchor point="TOP" relativeTo="CharacterCreateClassButton6" relativePoint="BOTTOM" x="0" y="-6"/>
</Anchors>
</CheckButton>
the .lua file also ? Try a different icon, else.

I changed in the lua what the guide said to change. The only image I changed was UI_CHARACTERCREATE-CLASSES.blp do I need to add in my actual single class icon?

If you're wondering this is what my UI_CHARACTERCREATECLASSES.blp image looks like.
(http://i.imgur.com/Q0P8Pj3.png)
Title: Re: Discourse: Creating a custom Class in Trinity Core
Post by: Grymskvll on May 29, 2016, 12:01:07 pm
Quote from: "Kobiesan"

InterfaceGluesXML
should be
InterfaceGlueXML
Title: Re: Discourse: Creating a custom Class in Trinity Core
Post by: Steff on May 29, 2016, 06:15:51 pm
And you need interface fixed wow exe....
Title: Re: Discourse: Creating a custom Class in Trinity Core
Post by: Kobiesan on May 29, 2016, 07:35:14 pm
Quote from: "Grymskvll"
Quote from: "Kobiesan"

InterfaceGluesXML
should be
InterfaceGlueXML

I went ahead and fixed it and nothing changed.


Quote from: "Steff"
And you need interface fixed wow exe....

What do you mean by that? Is that removing the glues check from WoW.exe? I used this (http://modcraft.io/viewtopic.php?f=59&t=883&hilit=gluexml) to remove it. Still nothing.
Title: Re: Discourse: Creating a custom Class in Trinity Core
Post by: Grymskvll on May 29, 2016, 07:56:53 pm
Quote from: "Kobiesan"
I went ahead and fixed it and nothing changed.

Make sure you don't have an unedited CharacterCreate.xml loading from your WowInterfaceGlueXML folder (if you have one). That's a silly snag I ran into before.

Failing that, make some easily recognizable change to the class icons blp or the xml file to make sure that the files are being loaded at all. (for example, draw anatomy on the blizzard class icons, or remove the spacing between icons in the xml by setting the x offset to 0 instead of the default 6 for each button).
Title: Re: Discourse: Creating a custom Class in Trinity Core
Post by: Kobiesan on May 29, 2016, 07:58:43 pm
Quote from: "Grymskvll"
Quote from: "Kobiesan"
I went ahead and fixed it and nothing changed.

Make sure you don't have an unedited CharacterCreate.xml loading from your WowInterfaceGlueXML folder (if you have one). That's a silly snag I ran into before.

Failing that, make some easily recognizable change to the class icons blp or the xml file to make sure that the files are being loaded at all. (for example, draw anatomy on the blizzard class icons, or remove the spacing between icons in the xml by setting the x offset to 0 instead of the default 6 for each button).

So do I need to put my lua and xml files back into my original WoW patches? I only have them in a new mpq patch atm.
Title: Re: Discourse: Creating a custom Class in Trinity Core
Post by: Grymskvll on May 29, 2016, 08:04:18 pm
Quote from: "Kobiesan"
So do I need to put my lua and xml files back into my original WoW patches? I only have them in a new mpq patch atm.

No, that's never something you should do (probably). I meant inside the actual WoW game folder, not in an archive. As for checking whether the MPQ is getting loaded, I may have jumped the gun a little with my advice. It seems the guide has you create a THIRD row of class icons, and I'm not sure how this interacts with the interface so I'll actually try to follow the guide and give an update in a moment.
Title: Re: Discourse: Creating a custom Class in Trinity Core
Post by: Grymskvll on May 29, 2016, 08:37:22 pm
Update:
All you need for the icon to show up on the char creation screen is:
-an entry in ChrClasses.DBC
-incremented MAX_CLASSES_PER_RACE and a CLASS_ICON_TCOORDS entry in CharacterCreate.lua
-a new button defined in CharacterCreate.xml

All as per the guide.

Make sure the CLASS_ICON_TCOORDS entry matches the all-caps name defined in ChrClasses.DBC (column 55 or 56, depending on whether columns start counting at 0 or 1). And make sure the MPQ isn't open in an MPQ editor when you launch the game.

You should get something like this (I used the DK icon coords for ease):
https://i.imgur.com/kRuZz3z.jpg

As you can see, there's some interface overlap because the button's position is set to below the first button of the second row, in the XML file. You can figure out where you want the button to be (and where to move other UI elements) at your leisure, or you can follow the ArcEmu guide from before regarding the button's position for an easy fix.
Title: Re: Discourse: Creating a custom Class in Trinity Core
Post by: Kobiesan on May 29, 2016, 11:16:21 pm
Quote from: "Grymskvll"
Update:
All you need for the icon to show up on the char creation screen is:
-an entry in ChrClasses.DBC
-incremented MAX_CLASSES_PER_RACE and a CLASS_ICON_TCOORDS entry in CharacterCreate.lua
-a new button defined in CharacterCreate.xml

All as per the guide.

Make sure the CLASS_ICON_TCOORDS entry matches the all-caps name defined in ChrClasses.DBC (column 55 or 56, depending on whether columns start counting at 0 or 1). And make sure the MPQ isn't open in an MPQ editor when you launch the game.

You should get something like this (I used the DK icon coords for ease):
https://i.imgur.com/kRuZz3z.jpg


As you can see, there's some interface overlap because the button's position is set to below the first button of the second row, in the XML file. You can figure out where you want the button to be (and where to move other UI elements) at your leisure, or you can follow the ArcEmu guide from before regarding the button's position for an easy fix.

My XML
Code: [Select]
<CheckButton name="CharacterCreateClassButton11" inherits="CharacterCreateClassButtonTemplate" id="11">
<Anchors>
<Anchor point="TOP" relativeTo="CharacterCreateClassButton6" relativePoint="BOTTOM" x="0" y="-6"/>
</Anchors>
</CheckButton>


My tcoords
Code: [Select]
CLASS_ICON_TCOORDS = {
["WARRIOR"] = {0, 0.25, 0, 0.25},
["CAVALIER"] = {0.5, 0.75, 0.5, 0.75},
["MAGE"] = {0.25, 0.49609375, 0, 0.25},
["ROGUE"] = {0.49609375, 0.7421875, 0, 0.25},
["DRUID"] = {0.7421875, 0.98828125, 0, 0.25},
["HUNTER"] = {0, 0.25, 0.25, 0.5},
["SHAMAN"] = {0.25, 0.49609375, 0.25, 0.5},
["PRIEST"] = {0.49609375, 0.7421875, 0.25, 0.5},
["WARLOCK"] = {0.7421875, 0.98828125, 0.25, 0.5},
["PALADIN"] = {0, 0.25, 0.5, 0.75},
["DEATHKNIGHT"] = {0.25, 0.49609375, 0.5, 0.75},
};


My max_classes_per_race line
Code: [Select]
MAX_CLASSES_PER_RACE = 11;
Did everything you said and it still isn't showing up. I feel like something is wrong with my wow.exe even though I used the program to remove the gluexml check. Do you think you could upload your WoW folder and I can use that instead?


Quote from: "Grymskvll"
Quote from: "Kobiesan"
So do I need to put my lua and xml files back into my original WoW patches? I only have them in a new mpq patch atm.

No, that's never something you should do (probably). I meant inside the actual WoW game folder, not in an archive. As for checking whether the MPQ is getting loaded, I may have jumped the gun a little with my advice. It seems the guide has you create a THIRD row of class icons, and I'm not sure how this interacts with the interface so I'll actually try to follow the guide and give an update in a moment.

So to clarify, I should put my new lua and XML files in a new patch? Which I have done. I just want clarification.
Title: Re: Discourse: Creating a custom Class in Trinity Core
Post by: Ascathos on May 30, 2016, 12:39:08 am
I checked in with kobiesan by skype. Turned out that the patch had the wrong name. However, it gave me a few pointers to add to this tutorial:


Added note about *_disabled into gluestrings.lua
Added note about circle-class.blp
Changed Icon Placement Code a bit so it works now.
Title: Re: Discourse: Creating a custom Class in Trinity Core
Post by: Kobiesan on May 30, 2016, 05:52:29 am
If I make a human with my new class the human starts with no languages not even common even though I have all Alliance races set to learn common in playercreateinfo_skills. It works on other human classes though. Same goes for other races and their respective languages.
Title: Re: Discourse: Creating a custom Class in Trinity Core
Post by: Ascathos on May 30, 2016, 08:50:59 am
Quote from: "Kobiesan"
If I make a human with my new class the human starts with no languages not even common even though I have all Alliance races set to learn common in playercreateinfo_skills. It works on other human classes though. Same goes for other races and their respective languages.
Yes, that is skilllineinfo.

Have not dived into those yet in the tutorial.
Title: Re: Discourse: Creating a custom Class in Trinity Core
Post by: reidospalas on October 27, 2016, 08:27:44 am
Can u pass me your skype please? i did all the instructions but i'm getting a lot errors in compilation :(
Title: Re: Discourse: Creating a custom Class in Trinity Core
Post by: Kaev on October 27, 2016, 11:40:27 am
Quote from: "reidospalas"
Can u pass me your skype please? i did all the instructions but i'm getting a lot errors in compilation :(

Just tell us what you exactly did and which errors do you get. Why help everyone one by one when other people could also use the same informations to fix their mistakes?
Title: Re: Discourse: Creating a custom Class in Trinity Core
Post by: reidospalas on October 27, 2016, 05:25:24 pm
Quote from: "Kaev"
Quote from: "reidospalas"
Can u pass me your skype please? i did all the instructions but i'm getting a lot errors in compilation :(

Just tell us what you exactly did and which errors do you get. Why help everyone one by one when other people could also use the same informations to fix their mistakes?

Hey thank u for the awnser, Okay i got this errors when i tried compile : http://imgur.com/a/ZC2VW (http://imgur.com/a/ZC2VW" onclick="window.open(this.href);return false;)

And i got like 100 errors when i changed the cs_misc.cpp, i removed the change and i'll try run the custom class without this file editted, I didn't touched Achiev.cpp/Dbcstore.cpp and Condition.cpp but i still gotting this errors on compilation :(
Title: Re: Discourse: Creating a custom Class in Trinity Core
Post by: Kaev on October 28, 2016, 07:17:11 am
Quote from: "reidospalas"
Quote from: "Kaev"
Quote from: "reidospalas"
Can u pass me your skype please? i did all the instructions but i'm getting a lot errors in compilation :(

Just tell us what you exactly did and which errors do you get. Why help everyone one by one when other people could also use the same informations to fix their mistakes?

Hey thank u for the awnser, Okay i got this errors when i tried compile : http://imgur.com/a/ZC2VW (http://imgur.com/a/ZC2VW" onclick="window.open(this.href);return false;)

And i got like 100 errors when i changed the cs_misc.cpp, i removed the change and i'll try run the custom class without this file editted, I didn't touched Achiev.cpp/Dbcstore.cpp and Condition.cpp but i still gotting this errors on compilation :(

Several ) and ; are missing, no idea how you deleted them, but you need to add them again.
Title: Re: Discourse: Creating a custom Class in Trinity Core
Post by: reidospalas on October 28, 2016, 06:11:35 pm
I didn't touched this files, i changed the files using files on fresh compiled and i still have this errors :(