Forum > Serverside Modding
[TrinityCore 335] How To Make A Class Heroic?
<< < (2/2)
Kaev:
https://github.com/TrinityCore/TrinityC ... r.cpp#L479
spiderwaseem:
--- Quote from: "Kaev" ---https://github.com/TrinityCore/TrinityCore/blob/8396dabdad65fbe86c525584e38ccfacde85f9f1/src/server/game/Handlers/CharacterHandler.cpp#L479 --- End quote ---
Thank you so much! :)
spiderwaseem:
I'm getting really close to getting what I need done. However, for the following code (c++):
--- Code: --- // set starting level uint32 start_level = getClass() != CLASS_DEATH_KNIGHT ? sWorld->getIntConfig(CONFIG_START_PLAYER_LEVEL) : sWorld->getIntConfig(CONFIG_START_HEROIC_PLAYER_LEVEL);
--- End code ---
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:
--- Code: --- // 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);
--- End code ---
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:
However, I receive the following compiling error:
So, how should I be writing the code in this case? My objective is to set DK to the following configs in code (defaults):
--- Code: --- uint32 start_level = getClass() != CLASS_DEATH_KNIGHT ? sWorld->getIntConfig(CONFIG_START_PLAYER_LEVEL) : sWorld->getIntConfig(CONFIG_START_HEROIC_PLAYER_LEVEL);
--- End code ---
And then to have the Demon Hunter class (CLASS_DEMONHUNTER) with these custom configs in code:
--- Code: --- uint32 start_level = getClass() != CLASS_DEMONHUNTER ? sWorld->getIntConfig(CONFIG_START_PLAYER_LEVEL) : sWorld->getIntConfig(CONFIG_START_ULTRAHEROIC_PLAYER_LEVEL);
--- End code ---
"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.
spiderwaseem:
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. :)
spiderwaseem:
Thanks for all the help everyone. I've gotten what I need. :)
Navigation
[0] Message Index
[*] Previous page
|