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: [TUTORIAL] Creating a shell of a class!  (Read 36949 times)

XxXGenesisXxX

  • Contributors
  • Model Change Addict
  • *****
  • Posts: 204
    • View Profile
[TUTORIAL] Creating a shell of a class!
« on: May 24, 2012, 09:09:32 pm »
By XxXGenesisXxX

Introduction


Firstly this is not gonna be a noob friendly guide. It will still be fairly easy to understand for the most part, but going further into every detail will take far too long with far too many images. I'm sorry if this impedes anyone, but if you need any help or have questions feel free to reply on here or inbox me and I'll do my best to help you out.

However keep in mind; this is a guide not a walk-through. Creating a custom class from scratch has so many variables it is impossible to cater to every aspect and angle. So in this guide (especially the C++ section) it will be heavily based on a magic using Necromancer class. When it comes to the C++ area, to branch out further than what I have done, you are going to need to know how to figure things out yourself within the core. Others can help, but if you can't figure things out on your own as well, you are going to have a never ending supply of questions.

What do I mean by a basic shell?


Well basically I won't be writing how to add skills, spells, talents, starting locations etc. This may seems bland or lacking but you will have a fully functioning class by the end of this guide. And the things I just mentioned (adding spells/skills etc...) will be no different to adding it to an existing class after this guide.

Few Notes


  • In this guide I am gonna be using the term "For Simplicities Sake" a bit. So instead I'm just gonna use the abbreviation FSS.
  • I have been awake for over 24 hours while being out all day. So pretty buggered while writing this xD
  • Always back up anything before you edit it. Even simple edits. One thing wrong can be very frustrating to fix.
  • Always save your work before closing. Obvious but easily forgotten.
  • This was done in ArcEmu, you will have to adapt yourself for other cores, however good luck unless you really know what you're doing xD
  • Their is a huge client side bug, that from what I have read in questions on forums (nor have I found an answer to) is a bug that when you open up your character pane. If your stats are shown it will crash WoW. So I'll be posting a macro at the end of this guide you can use on your characters to stop them showing stats while still being able to access equipment screen. If anyone knows how to fix this or even an idea on how to fix please let me know.

Step 1. DBCs


If you've done it before, you'll notice these steps are a lot like creating your own race. So having done that previously is probably going to make this part a lot easier.

First off you need to open up your "ChrClasses.dbc" and clone one of the rows. FSS I suggest copying one that has the closest similarities to your new class. For me? I'll be making a Necromancer and the way I'm designing it, it will be closest to a Mage. Yes a Mage, not a Warlock.

ChrClasses.dbc


For reference: http://www.wowdev.wiki/index.php?title=ChrClasses.dbc
The columns:
  • 0: This is our Class ID, we'll need to change this to the next number up, so in my case 12.
  • 1: Leave this.
  • 2: This is our powertype our class will use. 0 = Mana, 1 = Rage, 2 = Focus, 3 = Energy, 4 = Happiness, 6 = Runes. FSS, I suggest using either, mana, rage or energy. I won't be covering into detail in this guide a bot them. I'll be using 0 for mana.
  • 3: This is our pet type, if you want to summon demons like warlock you CAN choose to set it as demon, but honestly, you can make demon like creatures with it set as pet. So again, FSS just go with pet.
  • 4: The name of our class, for this we need to go down to Strings on the left hand tab and add a new string. This is the displayed one, so use correct punctuation in this, it isn't code dependent. I'll be naming my string "Necromancer". Once you've added it you'll get it down the bottom with a number next to it. Go back to column 4 in the Table section and type in that number.
  • 5 - 54: :Leave them alone.
  • 55: This is our code dependent name. This is what is gonna be called upon a lot. We need to make a new string. Only this time, it needs to all be in capitals. Also if you have a space in your class name like "Death Knight", you'll need to ignore the space and just type "DEATHKNIGHT". So just do the same as you did for column 4, but capitals and no spaces. So for me; "NECROMANCER".
  • 56: FSS leave this alone or just copy the one closest to your class.
  • 57: I'm not 100% sure on this one, too many inconsistencies, if you feel like experimenting try some different ones out, otherwise stick to the closest to your class.
  • 58: Leave this.
  • 59: This is for different expansions. 0 = Classic, 1 = TBC, 2 = WotLK.

Now you can save and close "ChrClasses.dbc".

CharBaseInfo.dbc


Next we need to open up "CharBaseInfo.dbc". This one is very simple. All we need to do is clone as many rows as race/class combinations as needed. For me, I am only gonna have a Human Necromancer and an Undead Necromancer. So I need to clone 2.

For reference: http://www.wowdev.wiki/index.php?title=CharBaseInfo.dbc
The columns:
  • 0: Race ID. So for me I want 1 (Human) for my first cloned ID and 5 (Undead) for my other.
  • 1: Class ID. All of these should be your new classes ID. Mine was 12, so I need to put in 12 for all of it.
Easy. You can save and close "CharBaseInfo.dbc" now.

TalentTab.dbc


Open up "TalentTab.dbc"

Clone 3 times.

For reference:  http://www.wowdev.wiki/index.php?title=TalentTab.dbc
The columns:
  • 0: These are the ID's. FSS change these to 450, 451 and 452.
  • 1: The names of your talent trees. I'll be using the old school Diablo 2 Necromancer trees. Curses, Poison and Bones, Summoning. you are going to have to make new name strings for each of these again.
  • 2-17: Leave them alone.
  • 18: This is your spell icon ID. I'm just gonna be using the ones I copy for now (warlock ones). If you want to get specific ones, go onto WoWhead, pick a spell with the icon you want. Go into "Spell.dbc". In the first column find the ID of the spell you were looking at, then go across to column 133 and that's your icon ID.
  • 19: Set all to 2047.
  • 20: This is classes, however it's in bits not the standard ID. If your class was ID number 12, than you will need to type in 2048 for each of them.
  • 21: Leave as 0.
  • 22: This is the orderindex. Which ever you want to be first in the list of the 3 talent tree tabs is set to 0, then the middle is set to 1, the the last is set to 2.
  • 23: This is the background image. I'm just leaving mine as default copied one. If you can find the file path, go ahead and make your own, if not just use one you like the background of. You can type your own path in without an image file being present, your will just get the basic background with the color like a quest background.

Once that's done, save and close.

After all that, you are free to pack your MPQ archive.

Step 2. Character Create Screen


Again this is practically the same steps as creating a new race.
Time for client side xml/lua editing. You'll need to use this first in order to remove xml/lua checks from your "wow.exe".
http://modcraft.io/viewtopic.php?f=59&t=883

However for those who have done this before I will move onto the files.

In our InterfaceGlueXML folder, we need to open up:

GlueStrings.lua


In this file we need to hit ctrl+f and search for this

Code: [Select]
CLASS_INFO_WARRIOR4 = "- Uses rage as a resource.";
Now underneath the we need to add these lines (replacing NECROMANCER with your class name in capitals. Then change each description)

Code: [Select]
CLASS_INFO_NECROMANCER0 = "- Role: Damage";
CLASS_INFO_NECROMANCER1 = "- Light Armor (Cloth)";
CLASS_INFO_NECROMANCER2 = "- Can call forth skeletons of different combat abilities.";
CLASS_INFO_NECROMANCER3 = "- Can afflict curses to weaken opponents.";
CLASS_INFO_NECROMANCER4 = "- Uses mana as a resource.";

Now it should look like this

Code: [Select]
CLASS_INFO_WARRIOR0 = "- Role: Tank, Damage";
CLASS_INFO_WARRIOR1 = "- Heavy Armor (Mail / Plate and Shield)";
CLASS_INFO_WARRIOR2 = "- Deals damage with melee weapons.";
CLASS_INFO_WARRIOR3 = "- Has 3 fighting stances with different benefits.";
CLASS_INFO_WARRIOR4 = "- Uses rage as a resource.";
CLASS_INFO_NECROMANCER0 = "- Role: Damage";
CLASS_INFO_NECROMANCER1 = "- Light Armor (Cloth)";
CLASS_INFO_NECROMANCER2 = "- Can call forth skeletons of different combat abilites.";
CLASS_INFO_NECROMANCER3 = "- Can afflict curses to weaken opponents.";
CLASS_INFO_NECROMANCER4 = "- Uses mana as a resource.";

^^^ This is the dot point description you get in the right hand pane in character create screen.

Now hit ctrl+f again and search for

Code: [Select]
tanking warriors desire Stamina as well.";
Now just below that we'll be adding this (again replacing and adjusting to your own class name and descriptions)

Code: [Select]
CLASS_NECROMANCER = "Necromancers are powerful spell casters thought upon by many to be of great evil. These thoughts come from the belief that summoning the dead to fight under controllers will, is a heinously unnatural disrespect towards the dead.";
CLASS_NECROMANCER_FEMALE = "Necromancers are powerful spell casters thought upon by many to be of great evil. These thoughts come from the belief that summoning the dead to fight under controllers will, is a heinously unnatural disrespect towards the dead.";

So now it should look like this

Code: [Select]
CLASS_WARRIOR = "Warriors are plate-wearing fighters who strive for perfection in armed combat. As warriors deal or take damage, they generate rage, which is used to power their special attacks.|n|nWarriors can choose to focus on a two-handed weapon, dual-wielding or using a sword and shield. Warriors have several abilities that let them move quickly around the battlefield. Their primary stat is Strength, though tanking warriors desire Stamina as well.";
CLASS_WARRIOR_FEMALE = "Warriors are plate-wearing fighters who strive for perfection in armed combat. As warriors deal or take damage, they generate rage, which is used to power their special attacks.|n|nWarriors can choose to focus on a two-handed weapon, dual-wielding or using a sword and shield. Warriors have several abilities that let them move quickly around the battlefield. Their primary stat is Strength, though tanking warriors desire Stamina as well.";
CLASS_NECROMANCER = "Necromancers are powerful spell casters thought upon by many to be of great evil. These thoughts come from the belief that summoning the dead to fight under controllers will, is a heinously unnatural disrespect towards the dead.";
CLASS_NECROMANCER_FEMALE = "Necromancers are powerful spell casters thought upon by many to be of great evil. These thoughts come from the belief that summoning the dead to fight under controllers will, is a heinously unnatural disrespect towards the dead.";

^^^ This is the full class description in the right hand character create pane.

Now we can save and close "GlueStrings.lua".

CharacterCreate.lua


Next up we have "CharacterCreate.lua". But before we edit this file we are gonna want to add our class icon to the images. Otherwise we are gonna be looking at a blank image.

So open up your MPQ editor, I'll be using MyWarCraftStudio. Now open up "locale-enUS.MPQ".
Then go to; Interface -> GLUES -> CHARACTERCREATE -> "UI-CHARACTERCREATE-CLASSES.BLP". And now extract this to your desktop.

Ok, so now we need to convert it from a ".blp" to a ".png". To do this we'll be using BLP converter made by PatrickCyr.
http://modcraft.io/viewtopic.php?f=59&t=801

To convert it, all we need to do is simply drag and drop our ".blp" image onto the "BLPConverter.exe" and wait. Shouldn't take long at all. Tada a PNG file!

Now to edit the PNG. Open the image up into your favorite image editor. I'm gonna be awesomely unique and very rare to find........... Adobe Photoshop....... :O

When you open it you'll see exactly how it fits in. All you need to do is copy one of the current ones (for the frame), move it next to DK icon and under the priest icon, then place a new image inside the frame. This will be your class icon. Here's mine if you are too lazy to do it...


Once you've created it, delete your old .blp from the desktop and drop your new png onto the "BLPConverter.exe". Now we need to add this one back to where we found it. So open up your MPQ file again, go to the same path, Interface -> GLUES -> CHARACTERCREATE -> "UI-CHARACTERCREATE-CLASSES.BLP". Only this time delete the current "UI-CHARACTERCREATE-CLASSES.BLP". Now right click on the CHARACTERCREATE folder and choose import. Now import your new "UI-CHARACTER-CLASSES.BLP". Pack your MPQ again and save and close.

Time to go back to the "CharacterCreate.lua", time to edit it.

At the very top change
Code: [Select]
MAX_CLASSES_PER_RACE = 10;to
Code: [Select]
MAX_CLASSES_PER_RACE = 11;
Again in "CharacterCreate.lua" hit ctrl+f (or just scroll down) and search for

Code: [Select]
["DEATHKNIGHT"] = {0.25, 0.49609375, 0.5, 0.75},Now underneath that we are going to need to put
Code: [Select]
["NECROMANCER"] = {0.49609375, 0.7421875, 0.5, 0.75},
^^^ This is the co-ords it searches for on the BLP image we made to show that section.

Save and Close "CharacterCreate.lua".

CharacterCreate.xml


Open up "CharacterCreate.xml".

Search for
Code: [Select]
<CheckButton name="CharacterCreateClassButton10" inherits="CharacterCreateClassButtonTemplate" id="10">
<Anchors>
<Anchor point="TOP" relativeTo="CharacterCreateClassButton5" relativePoint="BOTTOM" x="0" y="-6"/>
</Anchors>
</CheckButton>
Then add after it:
Code: [Select]
<CheckButton name="CharacterCreateClassButton11" inherits="CharacterCreateClassButtonTemplate" id="11">
<Anchors>
<Anchor point="LEFT" relativeTo="CharacterCreateClassButton5" relativePoint="RIGHT" x="6" y="0"/>
</Anchors>
</CheckButton>
^^^ This is telling our button to link on to the 5th button on the top row in class selection.

Now we still have to make them all fit onto the menu bars unlike this:



So search for this:

Code: [Select]
<Anchor point="TOP" x="-90" y="-463"/>And change it to:
Code: [Select]
<Anchor point="TOP" x="-98" y="-463"/>
Now go through all of the "CharacterCreateClassButton"'s and change the x="6" to x="0"

If done right, you should have this:



And that's it for this step for now! =D

P.S I am aware the Necromancer right hand pane icon is missing. I have been awake for over 24 hours and can't remember for the life of me where that BLP is, so I'll get to that when less tired, it's only a minor detail for now, I'm sure you'll live :P

Step 3. Fixing the client crash when checking stats bug!


Ok for all of these, we are going to be doing some cloning of columns in the gt* dbc files. It is highly advised you do this in CSVED.EXE & DBCUtil.exe and that's what my guide is going to be using.

You get CSVED from here: http://csved.sjfrancke.nl/

And DBCUtil from here: http://code.google.com/p/cntc2/downloads/detail?name=DBCUtil.rar&can=2&q=

I would to thank Khira for their original guide that helped me figure this out. However it wasn't the most straightforward on how to do it, so I thought I'd rewrite it a bit easier here. I would link the guide, but I have no idea where it is, it was in spanish and I had sent to me via someone quoting it.

So let's start! Firstly I want you to make a folder on your desktop and name it what ever the hell you want. Then go to your server and copy all the gt* .dbc files into your new folder. We are doing this just to keep it neat and as backup. Now in your new folder go ahead and delete "gtBarberShopCostBase.dbc", "gtNPCManaCostScaler.dbc" and "gtCombatRatings.dbc" as we won't be touching these.

Now that you've done that, go to where you extracted DBCUtil, go into that folder, create a shortcut to DBCUtil.exe and copy that shortcut into your desktop folder, highlight all your DBC's and and drag them over the DBCUtil and let go of your mouse button, it will begin converting them to csv.files. Once done you should have a 1 csv for each DBC. Now to clone entries. WARNING! DO NOT USE MICROSOFT EXCEL FOR THIS STEP!

First open up CSVED.exe. Now go to File->Open ... and navigate to your desktop folder and open up "gtChanceToMeleeCrit.dbc.csv".

gtChanceToMeleeCrit.dbc.csv
This has 1101 entries, that's 100 per class (including the dummy class) + 1, the plus 1 is just stating all these files are floating (don't ask, not important). Now open upen up ChrClasses.dbc in Taliss. Get the ID of the class your custom class is most like stat wise. So for me my class is like a Mage, so the ID I want is 8. So since it's ID of 8, I have to right-click on any entry in CSVED.EXE and select "Go to line". We need to go to line 702. Why 702 for ID of 8? Figure it out like this:

Code: [Select]
Obviously
8*100 = 800
But this starts at 0 not 100, so
800-100 = 700
We have to include the line that stats it's all floating, so
700+1 = 701
And finally, I have no idea why but, we need to add another 1. xD
701+1=702

Now because this program is wierd, click on the entry underneath the highlighted one, then click back on the first entry, this is just to make sure it's selected properly. Right click on the entry it sent you to, that you have highlighted, then select "Go to line" again. This time add 99 lines. So for me I need 801. Now shift click on that entry. All lines between here and there should be highlighted. Right-Click on one and select "Copy Selected Records". Then scroll to the bottom of the page.

Click the very last entry, then right click and select "Add Record", type in any number, we will be deleting this anyway, it's just to keep everything in line, this is a flaw in the program. It has an option to paste below cursor, point but it doesn't always work like that, and we don't want to push the last line to the bottom and throw off the stat calc. Once you've typed in any number, hit Ready. I typed in 999999 so I can tell which it is.

Now select your added line, right-click and select "Paste records below cursor pos". Now find that entry you added and delete it. Look up the top and it should say 1201 recors. If so, you've done this correctly. If not close without saving and try again. If it does say 1201, go to file and select Save As, then save over your csv file.

Repeat these exact steps for these files:

gtChanceToSpellCrit.dbc
gtOCTRegenHP.dbc
gtOCTRegenMP.dbc
gtRegenHPPerSpt.dbc
gtRegenMPPerSpt.dbc

Now do the exact same for these files, but you only need to add 1 entry, so you should have 13 records at the end.

gtChanceToMeleeCritBase.dbc
gtChanceToSpellCritBase.dbc

Now we open up "gtOCTClassCombatRatingScalar.dbc.csv"

Gonna have to do some basic math here because instead of 100, 1 or 10 entries per class it's 32. So to find yours just do this:

Code: [Select]
ID*32, so for me
8*32=256
Plus the float file
256+1=257
And that's the answer

You should end up with the column 1 saying the number 1 below your line number, that's good, it means we can ignore the flot line now. Again click off it then back on it. We need to go down another 32 lines. So do the math and go to the line.

Code: [Select]
257+32=289
Now just do the same as all the others, copy selected records, go to bottom, add new row, paste below cursor, delete created row. Now we've done that we have to edit column 1, just simply go to the top of you copied files and continue the numbers on. So mine says 352, 256, 257, 258. I need it to say 352, 353, 354, 355 etc. Once that's done, check you have 386 records. Save As and close CSVED.exe.

Now delete all the .dbc files in the folder. Then drag and drop all your .dbc.csv files onto DBCUtil shortcut again, this time it should spit out your new working dbc's. Copy them and place them into your patch and your server, then you're done for this step!

Step 4. The Core Modifications


(ArcEmu based, not sure about Trinity or Mangos sorry).

BACK UP YOUR ENTIRE WORLD SOLUTION!!!

Ok this is where we branch far away from create a race (besides the first part) and hit the stuff that most people don't know what to do. But to be completely honest; once you learn how, it's extremely basic. Just a whole bunch of ctrl+f, copy & paste, then editing. This part is not going to be fun...

I already mentioned in my introduction, this is going to be heavily based on my necromancer class, which is an adaption of a Mage class. All these stats and everything in this C++ is the basic of the basic. It isn't going to walk you through every single step for each individual style of class. You have to figure that out on your own. However, luckily, nearly all the spots for the ctrl+f sections, have all original classes listed there. Along with relevant things you will need to adjust for your own personal class.

Please remember in the core, ctrl+f is your best friend.

I apologize if this is difficult and looks very rough, but it is not an easy guide to write.

List of files we are editing:

  • Gossip.h
  • Player.h
  • StdAfx.h
  • NPCHandler.h
  • CharacterHandler.cpp
  • Creature.cpp
  • Gossip.cpp
  • MiscHandler.cpp
  • NPCHandler.cpp
  • ObjectMgr.cpp
  • player.cpp
  • ScriptMgr.cpp
  • Stats.cpp
  • AchievementMgr.cpp
  • Level3.cpp
  • CMakeLists.txt

First up, open your world.sln

Easiest part to do, under "world" section, right click on the "Header Files" folder and click Add -> New item. Then create a new Header File and name it, your class name (normal casing no spaces), so mine would be named "Necromancer".

Ok type this into it (with same caps settings as mine. For full caps, use _ instead of spaces, for normal caps don't use spaces at all. For example DEATH_KNIGHT_H and DeathKnight):
Code: [Select]
#ifndef _NECROMANCER_H
#define _NECROMANCER_H

class Necromancer : public Player
{
public:
Necromancer(uint32 guid) : Player(guid) {}

bool IsNecromancer() { return true; }
};

#endif

Save it and done for that one.

Now do the same, but in the "Source Files" folder with a cpp item instead.

And just add this into it
Code: [Select]
#include "StdAfx.h"Save it.

Now go to "CMakeLists.txt" under the world project. You have to add both of these files into it, so it actually makes them when you build with cmake.
So ctrl+f
Code: [Select]
MovementHandler.cppChange to
Code: [Select]
MovementHandler.cpp
Necromancer.cpp
NPCHandler.cpp

Then ctrl+f
Code: [Select]
NameTables.hChange to
Code: [Select]
NameTables.h
Necromancer.h
NPCHandler.h

Save the cmakelist.

Now go to your "build" folder, so not your source but the folder after CMAKE. Go into world, you'll find both your Necromancer.h and Necromancer.cpp in there. Cut them both, go to your code folder, then the src folder, followed by arcemu-world. Paste both of the items in there. Now leave and build your project with CMAKE again.

To save time I'm just gonna type the .h or .cpp name followed by very brief description/demonstration of what to do or where to add. Just replace necromancer with your class, in same caps format as mine!

Gossip.h


ctrl+f
Code: [Select]
Mage (Match Whole Word)
Code: [Select]
MAGE,
NECROMANCER,
SHAMAN,

Player.h


ctrl+f
Code: [Select]
DRUID = 11,
Code: [Select]
WARLOCK = 9,
DRUID = 11,
NECROMANCER = 12,
MAX_PLAYER_CLASSES

ctrl+f
Code: [Select]
druid - restoration - 282
Code: [Select]
druid - balance - 283
druid - feral combat - 281
druid - restoration - 282

necromancer - curses - 450
necromancer - poison and bones - 451
necromancer - summoning - 452

*/

That part was unneccessary, but it keeps it neat and doesn't hurt.

Scroll down just a little bit to:
Code: [Select]
static const uint32 TalentTreesPerClass[DRUID + 1][3] =change to
Code: [Select]
static const uint32 TalentTreesPerClass[DRUID + 2][3] =
Then a bit further to
Code: [Select]
{ 283, 281, 282 },  // DRUIDchange to
Code: [Select]
{ 283, 281, 282 },  // DRUID
{ 450, 451, 452 },  // NECROMANCER
};

ctrl+f
Code: [Select]
virtual bool IsDruid() { return false; }
change to
Code: [Select]
virtual bool IsDruid() { return false; }
virtual bool IsNecromancer() { return false; }

StdAfx.h
ctrl+f
Code: [Select]
#include "Mage.h" change to
Code: [Select]
#include "Mage.h"
#include "Hunter.h"
#include "Shaman.h"
#include "Necromancer.h"

CharacterHandler.cpp
ctrl+f
Code: [Select]
case DRUID:
plr = new Druid(playerGuid);
break;
   
Change to

Code: [Select]
case DRUID:
plr = new Druid(playerGuid);
break;
case NECROMANCER:
plr = new Necromancer(playerGuid);
break;
   
Creature.cpp
Code: [Select]
ctrl+f static const char* classes[12] = {"None", "Warrior", "Paladin", "Hunter", "Rogue", "Priest", "Death Knight", "Shaman", "Mage", "Warlock", "None", "Druid"};
change to

Code: [Select]
static const char* classes[13] = {"None", "Warrior", "Paladin", "Hunter", "Rogue", "Priest", "Death Knight", "Shaman", "Mage", "Warlock", "None", "Druid", "Necromancer"};
Gossip.cpp
Code: [Select]
ctrl+f 81 You must have Wrath of the Lich King Expansion to access this content.
change to

Code: [Select]
81 You must have Wrath of the Lich King Expansion to access this content.
82  Deathknight
83 Necromancer
*/

^^^ Not neccessary.

ctrl+f
Code: [Select]
case ::DEATHKNIGHT:
itemname += string(Plr->GetSession()->LocalizedWorldSrv(Gossip::DEATHKNIGHT));
break;
               
Change to

Code: [Select]
case ::DEATHKNIGHT:
itemname += string(Plr->GetSession()->LocalizedWorldSrv(Gossip::DEATHKNIGHT));
break;
case ::NECROMANCER:
itemname += string(Plr->GetSession()->LocalizedWorldSrv(Gossip::NECROMANCER));
break;
            
               
MiscHandler.cpp
Code: [Select]
ctrl+f case PRIEST:  // allowing priest, warlock, mage to equip ammo will mess up wand shoot. stop it.
change to

Code: [Select]
case PRIEST:  // allowing priest, warlock, mage, necromancer to equip ammo will mess up wand shoot. stop it.
case WARLOCK:
case MAGE:
case NECROMANCER:
      
      
NPCHandler.cpp
ctrl+f
Code: [Select]
{ "Druid", 0 },
change to

Code: [Select]
{ "Druid", 0 },
{ "Necromancer", 0
   
   
ObjectMgr.cpp
ctrl+f
Code: [Select]
case DEATHKNIGHT: // Based on 55-56 more testing will be done.
if(Level < 60)TotalHealthGain += 92;
                  
change to

               
Code: [Select]
case DEATHKNIGHT: // Based on 55-56 more testing will be done.
if(Level < 60)TotalHealthGain += 92;
/*else if(Level <60) TotalHealthGain+=??;
else if(Level <70) TotalHealthGain+=??;*/
else TotalHealthGain += 92;
break;
case NECROMANCER:
if(Level < 23)TotalHealthGain += 15;
// else if(Level >60) TotalHealthGain+=Level+40;
else if(Level > 60) TotalHealthGain += Level + 190;
else TotalHealthGain += Level - 8;

if(Level < 28)TotalManaGain += Level + 23;
// else if(Level>60)TotalManaGain+=Level+26;
else if(Level > 60)TotalManaGain += Level + 115;
else TotalManaGain += 51;
break;
}
               
               
               
ctrl+f       
Code: [Select]
case DRUID:
result = new Druid(guid);
break;
         
change to

      
Code: [Select]
case DRUID:
result = new Druid(guid);
break;
case NECROMANCER:
result = new Necromancer(guid);
break;

ctrl+f    
Code: [Select]
for(uint32 Class = WARRIOR; Class <= DRUID; ++Class)
change to

   
Code: [Select]
for(uint32 Class = WARRIOR; Class <= NECROMANCER; ++Class)         

NPCHandler.h
Code: [Select]
ctrl+f #define TRAINER_TYPE_MAX 16
change to

Code: [Select]
#define TRAINER_TYPE_MAX 17         
player.cpp
Code: [Select]
ctrl+f 1.7f       // Druid
change to

   
Code: [Select]
1.7f,      // Druid
1.0f       // Necromancer
   
   
ctrl+f
Code: [Select]
if((getClass() == MAGE) || (getClass() == PRIEST) || (getClass() == WARLOCK))
change to

Code: [Select]
if((getClass() == MAGE) || (getClass() == PRIEST) || (getClass() == WARLOCK) || (getClass() == NECROMANCER))
ctrl+f
Code: [Select]
default:    //mage,priest,warlock
change to

Code: [Select]
default:    //mage,priest,warlock,necromancer
^^^ Not neccessary

ScriptMgr.cpp
ctrl+f
Code: [Select]
81 You must have Wrath of the Lich King Expansion to access this content.
change to

Code: [Select]
81 You must have Wrath of the Lich King Expansion to access this content.
82 Deathknight
83 Necromancer
*/

Stats.cpp
ctrl+f                
Code: [Select]
case STAT_SPIRIT:
{ gain = CalculateStat(level, 0.000006, 0.002031, 0.278360, -0.340077); }
                  
Change to

      
Code: [Select]
case DEATHKNIGHT:
{
switch(Stat)
{
case STAT_STRENGTH:
{ gain = CalculateStat(level, 0.000039, 0.006902, 1.080040, -1.051701); }
break;
case STAT_AGILITY:
{ gain = CalculateStat(level, 0.000022, 0.004600, 0.655333, -0.600356); }
break;
case STAT_STAMINA:
{ gain = CalculateStat(level, 0.000059, 0.004044, 1.040000, -1.488504); }
break;
case STAT_INTELLECT:
{ gain = CalculateStat(level, 0.000002, 0.001003, 0.100890, -0.076055); }
break;
case STAT_SPIRIT:
{ gain = CalculateStat(level, 0.000006, 0.002031, 0.278360, -0.340077); }
break;
}

}
break;

case NECROMANCER:
{
switch(Stat)
{
case STAT_STRENGTH:
{ gain = CalculateStat(level, 0.000002, 0.001003, 0.100890, -0.076055); }
break;
case STAT_AGILITY:
{ gain = CalculateStat(level, 0.000008, 0.001001, 0.163190, -0.064280); }
break;
case STAT_STAMINA:
{ gain = CalculateStat(level, 0.000006, 0.002031, 0.278360, -0.340077); }
break;
case STAT_INTELLECT:
{ gain = CalculateStat(level, 0.000040, 0.007416, 1.125108, -1.003045); }
break;
case STAT_SPIRIT:
{ gain = CalculateStat(level, 0.000039, 0.006981, 1.090090, -1.006070); }
break;
}
}
break;
      
         
Level3.cpp
Code: [Select]
ctrl+f static const char* classes[12] =
{"None", "Warrior", "Paladin", "Hunter", "Rogue", "Priest", "Death Knight", "Shaman", "Mage", "Warlock", "None", "Druid"};
   
Change to

Code: [Select]
static const char* classes[13] =
{"None", "Warrior", "Paladin", "Hunter", "Rogue", "Priest", "Death Knight", "Shaman", "Mage", "Warlock", "None", "Druid", "Necromancer"};


ctrl+f    
Code: [Select]
if(plr->getClass() == DRUID)
{
plr->ClearCooldownsOnLine(573, guid);
plr->ClearCooldownsOnLine(574, guid);
plr->ClearCooldownsOnLine(134, guid);
BlueSystemMessage(m_session, "Cleared all Druid cooldowns.");
return true;
}
break;
Change to

   
Code: [Select]
if(plr->getClass() == DRUID)
{
plr->ClearCooldownsOnLine(573, guid);
plr->ClearCooldownsOnLine(574, guid);
plr->ClearCooldownsOnLine(134, guid);
BlueSystemMessage(m_session, "Cleared all Druid cooldowns.");
return true;
}
if(plr->getClass() == NECROMANCER)
{
plr->ClearCooldownsOnLine(6, guid);
plr->ClearCooldownsOnLine(8, guid);
plr->ClearCooldownsOnLine(237, guid);
BlueSystemMessage(m_session, "Cleared all Necromancer cooldowns.");
return true;
}
   

ctrl+f
Code: [Select]
static uint32 spellarray[DRUID + 1][512] =
change to

Code: [Select]
static uint32 spellarray[DRUID + 2][512] =
Scroll down a bite and find

         
Code: [Select]
{ 0 }, // N/A         
Change to

         
Code: [Select]
{ 0 }, // N/A
{ 0 }, // Necromancer


         
ctrl+f
Code: [Select]
static const char* CLASS[] =
Scroll a little down to find

   
Code: [Select]
"warlock",
"invalid 10",
"druid"
   
Change to

   
Code: [Select]
"warlock",
"invalid 10",
"druid",
"necromancer"
   
AchievementMgr.cpp
ctrl+f    
Code: [Select]
case  458: // Realm First! Level 80 Rogue   
change to

      
Code: [Select]
case  458: // Realm First! Level 80 Rogue
case  480: // Realm First! Level 80 Necromancer
   
ctrl+f    
Code: [Select]
(achievement->ID == 458 && GetPlayer()->getClass() != ROGUE) ||
change to

                 
Code: [Select]
(achievement->ID == 458 && GetPlayer()->getClass() != ROGUE) ||
(achievement->ID == 480 && GetPlayer()->getClass() != NECROMANCER) ||
         
END OF SCRIPTING!!! WOOOOOOOOOOOOOOOOOOOOOOT!!!!

Now you just need to build your World Project.

Step 5. The Database


First thing to know, this is the easiest part of all! That I am sure many of you have done similar stuff before.

Open up the playercreateinfo table add a new line and fill in as the titles say. If you could do step 3 I'm pretty sure you can do step 4 by yourself. Either way here is a basic SQL file I'm using for a Human Necromancer and an Undead Necromancer. Just adjust accordingly.

Code: [Select]
INSERT INTO `playercreateinfo` VALUES (66, 1, 1, 12, 0, 12, -8946.42, -131.35, 83.63, 49, 20, 20, 20, 20, 20, 60, 0, 1000, 0, 0, 20, 3, 4, 81, '2');
INSERT INTO `playercreateinfo` VALUES (67, 5, 5, 12, 0, 85, 1676.62, 1677.2, 121.67, 57, 20, 20, 20, 20, 20, 60, 0, 1000, 0, 0, 20, 3, 4, 2, '1024');

Warning though, these classes will have no spells, no skills, no items and no talents. They are just basic shells!

Results!









Final Notes



As I said at the start, there is a big bug. If you have a look in the 3rd result image I have the stats hidden. If that is not done and the Character/Reputation/Currency/Pet/Skills pane is opened, it crashes your client. That's why I use this macro that has floated around for ages for 255 servers with druids that have the same problem.

Code: [Select]
/console PlayerStatLeftDropDown Melee
/console PlayerStatRightDropDown Spell
/reload

Simply use that, don't use any addons like "All Stats" and it will work fine. It may be an inconvenience, but I'm working on it. And any input on it would be greatly appreciated.

I'm gonna try write some guides up on custom Talents/Spells etc... To accompany this, however I'm a pretty busy lately, so not sure when I'll be able to get round to it.

Again, I apologize for how rough this guide is. It's a very difficult guide to write and touch on the right subjects. I will try and update with more info on things if I can. And any questions I'll reply to as fast as I can.

Might be a few mistakes in there, my class is working fine and my scripts are fine, however I backtracked a few times and might have written a word or two wrong in the guide version of the code as opposed to my own. If you spot anything, let me know and I'll correct it.

Thanks for taking the time read this you guys. Hope you find it helpful and more importantly, hopefully you can help custom classes expand!


Edit: Fixed an error.
« Last Edit: October 07, 2012, 03:39:40 am by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [TUTORIAL] Creating a shell of a class!
« Reply #1 on: May 25, 2012, 12:10:36 am »
I tried fixing formatting a bit, then got pissed of by the major misuse of spoiler tags and gave up. Please replace your spoilers with code tags enclosing the actual code only.

I guess, I will just remove those stupid spoiler tags entirely.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Steff

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 4551
    • View Profile
Re: [TUTORIAL] Creating a shell of a class!
« Reply #2 on: May 25, 2012, 12:21:57 pm »
YES please ;)
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
Please mark as solved if solved.
Don't ask if you could ask a question... JUST ask the Question.
You can send me also offline messages. I will answer if I get online.
Skype: project.modcraft
Discord: steff#6954

holyleen

  • Registred Member
  • Polygonshifter
  • *****
  • Posts: 54
    • View Profile
Re: [TUTORIAL] Creating a shell of a class!
« Reply #3 on: May 27, 2012, 07:18:47 am »
what ddi i do worng ?

InterfaceGlueXML/CharacterCreate.lua
Code: [Select]
MAX_RACES = 10;
MAX_CLASSES_PER_RACE = 11;

Code: [Select]
["NECROMANCER"]   = {0.49609375, 0.7421875, 0.5, 0.75},
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
So. All of time and space. Everything that ever happened or ever will. Where do you want to start?

XxXGenesisXxX

  • Contributors
  • Model Change Addict
  • *****
  • Posts: 204
    • View Profile
Re: [TUTORIAL] Creating a shell of a class!
« Reply #4 on: June 05, 2012, 02:11:35 am »
Sorry, been away for a few days.

Did you do both CharacterCreate.lua and CharacterCreate.xml before testing it?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Dreamzone

  • Registred Member
  • BLP Convertor
  • *****
  • Posts: 7
    • View Profile
Re: [TUTORIAL] Creating a shell of a class!
« Reply #5 on: June 10, 2012, 09:42:24 am »
Wooot!
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Såcrament

  • Registred Member
  • BLP Convertor
  • *****
  • Posts: 14
    • View Profile
Re: [TUTORIAL] Creating a shell of a class!
« Reply #6 on: June 30, 2012, 05:06:02 am »
Genesis: thank you for this guide. I am now closer to creating a class than I ever was before.

However; I have been faced with an annoying error:



Any help will be deeply appreciated.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
Meanwhile, at the Modcraft Shoutbox...

Ascathos

  • Moderators
  • Creator of Worlds
  • *****
  • Posts: 1129
    • View Profile
Re: [TUTORIAL] Creating a shell of a class!
« Reply #7 on: July 05, 2012, 10:48:32 pm »
Quote from: "Såcrament"
Genesis: thank you for this guide. I am now closer to creating a class than I ever was before.

However; I have been faced with an annoying error:



Any help will be deeply appreciated.
After looking into that particular .lua, I saw that it refers to the background. I'd say you didn't create (a proper) background for the class - look into that again, maybe it solves your problem.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

XxXGenesisXxX

  • Contributors
  • Model Change Addict
  • *****
  • Posts: 204
    • View Profile
Re: [TUTORIAL] Creating a shell of a class!
« Reply #8 on: July 14, 2012, 03:25:04 pm »
Quote from: "Såcrament"
Genesis: thank you for this guide. I am now closer to creating a class than I ever was before.

However; I have been faced with an annoying error:



Any help will be deeply appreciated.

Was this the first time you extracted the .lua and .xml files? Cause you could of extracted an older version of GlueParent.xml and now it's loading the out-dated one over the newest ones.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

XxXGenesisXxX

  • Contributors
  • Model Change Addict
  • *****
  • Posts: 204
    • View Profile
Re: [TUTORIAL] Creating a shell of a class!
« Reply #9 on: October 07, 2012, 03:40:26 am »
Updated: Removing the client crash bug. It's the new step 3.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Diemen

  • Registred Member
  • Race Changer
  • *****
  • Posts: 37
    • View Profile
[QUESTION] Re: [TUTORIAL] Creating a shell of a class!
« Reply #10 on: October 18, 2012, 11:52:16 pm »
I have to admit its a really nice Tut for Custom Classes !
so Rep for you :-D

But as simple as it is i can't seem to get my Class Icon shown at the Character Create Screen....
I followed every single line you wrote down.
all i have left to do is the Core part but that should't be a part of this problem.

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="LEFT" relativeTo="CharacterCreateClassButton5" relativePoint="RIGHT" x="6" y="0"/>
</Anchors>
</CheckButton>


I've changed X=6 to X=0 on Button nr 2 - 10 and tried it for button 11 aswell but without any result.
Any tips would be great ! :D

Thnx !
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

XxXGenesisXxX

  • Contributors
  • Model Change Addict
  • *****
  • Posts: 204
    • View Profile
Re: [QUESTION] Re: [TUTORIAL] Creating a shell of a class!
« Reply #11 on: October 19, 2012, 12:24:28 am »
Quote from: "Diemen"
I have to admit its a really nice Tut for Custom Classes !
so Rep for you :-D

But as simple as it is i can't seem to get my Class Icon shown at the Character Create Screen....
I followed every single line you wrote down.
all i have left to do is the Core part but that should't be a part of this problem.

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="LEFT" relativeTo="CharacterCreateClassButton5" relativePoint="RIGHT" x="6" y="0"/>
</Anchors>
</CheckButton>


I've changed X=6 to X=0 on Button nr 2 - 10 and tried it for button 11 aswell but without any result.
Any tips would be great ! :D

Thnx !

Do you mean the actual button or just the display icon?

If it's the button itself make sure you have set the max classes to 11 in the lua file and the DBC's did save (Taliis has a habbit of not saving properly).

If you just mean the actual icon, firstly make the x="6" into x="0", as I said in the guide make all the x="6" into x="0"', the one we made was no exception. If the icon still isn't showing in the button, then either the lua file icon co-ordinates are off, or your class blp file isn't working properly.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Diemen

  • Registred Member
  • Race Changer
  • *****
  • Posts: 37
    • View Profile
Re: [TUTORIAL] Creating a shell of a class!
« Reply #12 on: October 19, 2012, 12:37:06 am »
i'm sorry for being not clear , i meant the Button itself.
I Checked the DBC's and they were all Saved properly
Same for the Lua and XML , Checked the Paths and they were also fine.
Tried Your BLP and my own but still no result :-(





This could be the only part i did wrong i Guess..

#CharBaseInfo.DBC




#1 Races
1-10
13
14
16

#2 Classes
12
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

XxXGenesisXxX

  • Contributors
  • Model Change Addict
  • *****
  • Posts: 204
    • View Profile
Re: [TUTORIAL] Creating a shell of a class!
« Reply #13 on: October 19, 2012, 03:25:51 am »
Quote from: "Diemen"
i'm sorry for being not clear , i meant the Button itself.
I Checked the DBC's and they were all Saved properly
Same for the Lua and XML , Checked the Paths and they were also fine.
Tried Your BLP and my own but still no result :-(





This could be the only part i did wrong i Guess..

#CharBaseInfo.DBC




#1 Races
1-10
13
14
16

#2 Classes
12

How are you applying these to your client? Like are you doing it through an MPQ patch? Or through folders in your clients directory? If folders, are you using a hacked wow.exe, if so which one? And does your GlueXML folder come up as GlueXML.old?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Diemen

  • Registred Member
  • Race Changer
  • *****
  • Posts: 37
    • View Profile
[SOLVED] Re: [TUTORIAL] Creating a shell of a class!
« Reply #14 on: October 20, 2012, 12:32:26 am »
i'm using Mjollna's wow.exe so i can just put my Files into maps and don't need to make MPQ's
but now i get an Error when i Click [ Create New Character ]


Code: [Select]
ERROR #132 (0x85100084) Fatal Exception
Program: C:GamesWorld of Warcraft 3.3.5a (no install)World of Warcraft 3.3.5a (no install)Wow.exe
Exception: 0xC0000005 (ACCESS_VIOLATION) at 001B:004E204F
but i can't seem to find the problem.
i think its a Lua Issue..

And it seems it Does change to .old

Edit: I Cracked the Wow.exe from Mjollna With wow_unsig(12340).exe and now it doesn't change to GlueXML.old anymore but still gives an error on Character Create.


EDIT2: My Error is Fixed , i messed up some thing in CharBaseInfo.dbc
Sorry for troubling you Schlumpf, and thanks for the help Guys ;-)
« Last Edit: October 22, 2012, 12:23:16 pm by Admin »