Modcraft - The community dedicated to quality WoW modding!
Wrath of the Lich King Modding => Serverside Modding => Topic started by: spiderwaseem on July 04, 2016, 05:18:19 pm
-
Hello everyone!
I've created a new class and I was wondering, how is it possible to set the class as a heroic class?
I'd like to do this for 2 reasons:
1) The class is supposed to be a Heroic Class, special.
2) I need to set a level limitation to be able to play the class.
My main goal is somehow to make this heroic class (Class ID: 12) different from the DK heroic because DK requires a level 55, while my new class will require another level 90 character in order to play or create the class.
Is this a client-side or server-side, or maybe even both?
I'm running on TrinityCore 3.3.5a. If anyone has any ideas, it's appreciated.
Thanks,
Deathorous.
-
Heroic classes are basically handled server side with client being told you shall not play. So server is your first way to go. Basically copy paste everything that dk does.
-
Client knows about stuff though to forbid creation etc.
-
A ChrClasses flag iirc, ye
-
Alright, that makes it easier to determine what to do in a way.
However, any ideas where I should be looking into the core in specific?
The only file I could think of is player.cpp.
Doing a quick search to "Heroic", I found some interesting results such as the following:
// set starting level
uint32 start_level = getClass() != CLASS_DEATH_KNIGHT
? sWorld->getIntConfig(CONFIG_START_PLAYER_LEVEL)
: sWorld->getIntConfig(CONFIG_START_HEROIC_PLAYER_LEVEL);
if (m_session->HasPermission(rbac::RBAC_PERM_USE_START_GM_LEVEL))
{
uint32 gm_level = sWorld->getIntConfig(CONFIG_START_GM_LEVEL);
if (gm_level > start_level)
start_level = gm_level;
}
SetUInt32Value(UNIT_FIELD_LEVEL, start_level);
InitRunes();
SetUInt32Value(PLAYER_FIELD_COINAGE, sWorld->getIntConfig(CONFIG_START_PLAYER_MONEY));
SetHonorPoints(sWorld->getIntConfig(CONFIG_START_HONOR_POINTS));
SetArenaPoints(sWorld->getIntConfig(CONFIG_START_ARENA_POINTS));
There's a lot more but this would be very long.
Anyhow, looking into the code above it also specifies something about Death Knights in resemblance to it being a heroic class on a starting level.
I'm not exactly sure how to do this yet, but I feel like I could be getting somewhere.
Any other files beside player.cpp you believe I should be looking into?
Thanks for the responses! :)
-
https://github.com/TrinityCore/TrinityC ... r.cpp#L479 (https://github.com/TrinityCore/TrinityCore/blob/8396dabdad65fbe86c525584e38ccfacde85f9f1/src/server/game/Handlers/CharacterHandler.cpp#L479" onclick="window.open(this.href);return false;)
-
https://github.com/TrinityCore/TrinityCore/blob/8396dabdad65fbe86c525584e38ccfacde85f9f1/src/server/game/Handlers/CharacterHandler.cpp#L479
Thank you so much! :)
-
I'm getting really close to getting what I need done.
However, for the following code (c++):
// set starting level
uint32 start_level = getClass() != CLASS_DEATH_KNIGHT
? sWorld->getIntConfig(CONFIG_START_PLAYER_LEVEL)
: sWorld->getIntConfig(CONFIG_START_HEROIC_PLAYER_LEVEL);
I could do it this way, however, I need both classes starting at different levels so I created my own configs for it, so I can't do it this way or else the other class (CLASS_DEMONHUNTER) would be using the same configs as CLASS_DEATHKNIGHT, DKs:
// set starting level
uint32 start_level = (getClass() != CLASS_DEATH_KNIGHT && getClass() != CLASS_DEMONHUNTER)
? sWorld->getIntConfig(CONFIG_START_PLAYER_LEVEL)
: sWorld->getIntConfig(CONFIG_START_HEROIC_PLAYER_LEVEL);
So I thought of copying the same code but changing the class to DH instead of DK and changing the configs it's directed to. So like this:
(http://puu.sh/pRIi2/5f82b3ef59.png)
However, I receive the following compiling error:
(http://puu.sh/pRIxB/e5e79ef543.jpg)
So, how should I be writing the code in this case?
My objective is to set DK to the following configs in code (defaults):
uint32 start_level = getClass() != CLASS_DEATH_KNIGHT
? sWorld->getIntConfig(CONFIG_START_PLAYER_LEVEL)
: sWorld->getIntConfig(CONFIG_START_HEROIC_PLAYER_LEVEL);
And then to have the Demon Hunter class (CLASS_DEMONHUNTER) with these custom configs in code:
uint32 start_level = getClass() != CLASS_DEMONHUNTER
? sWorld->getIntConfig(CONFIG_START_PLAYER_LEVEL)
: sWorld->getIntConfig(CONFIG_START_ULTRAHEROIC_PLAYER_LEVEL);
"CONFIG_START_PLAYER_LEVEL" those stay the same for CLASS_DEMONHUNTER.
"CONFIG_START_HEROIC_PLAYER_LEVEL" need to become "CONFIG_START_ULTRAHEROIC_PLAYER_LEVEL" for CLASS_DEMONHUNTER.
Thanks!
Any help is appreciated and I appreciate the help I got so far. :)
-- Quick Update:
I have a broad understanding of the error "redefinition; muliple initialization". From what I know, the error is telling me I have repeated code. Which I technically do, but how I should write the code is what I don't understand to achieve what I wrote above.
-
FIXED THE ERROR BEFORE
Turns out it was a really simple fix.
I'll post more if I run into anything else but I believe I'm almost done. :)
-
Thanks for all the help everyone.
I've gotten what I need. :)