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: [TrinityCore 335] How To Make A Class Heroic?  (Read 1899 times)

spiderwaseem

  • Registred Member
  • Wiki Incarnate
  • *****
  • Posts: 154
    • View Profile
    • http://anarchy-wow.com/
[TrinityCore 335] How To Make A Class Heroic?
« 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.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Ascathos

  • Moderators
  • Creator of Worlds
  • *****
  • Posts: 1129
    • View Profile
Re: [TrinityCore 335] How To Make A Class Heroic?
« Reply #1 on: July 04, 2016, 10:16:47 pm »
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.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [TrinityCore 335] How To Make A Class Heroic?
« Reply #2 on: July 04, 2016, 11:48:51 pm »
Client knows about stuff though to forbid creation etc.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Ascathos

  • Moderators
  • Creator of Worlds
  • *****
  • Posts: 1129
    • View Profile
Re: [TrinityCore 335] How To Make A Class Heroic?
« Reply #3 on: July 05, 2016, 12:56:21 am »
A ChrClasses flag iirc, ye
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

spiderwaseem

  • Registred Member
  • Wiki Incarnate
  • *****
  • Posts: 154
    • View Profile
    • http://anarchy-wow.com/
Re: [TrinityCore 335] How To Make A Class Heroic?
« Reply #4 on: July 05, 2016, 04:15:30 am »
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:
Code: [Select]
   // 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! :)
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Kaev

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 308
    • View Profile
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

spiderwaseem

  • Registred Member
  • Wiki Incarnate
  • *****
  • Posts: 154
    • View Profile
    • http://anarchy-wow.com/
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

spiderwaseem

  • Registred Member
  • Wiki Incarnate
  • *****
  • Posts: 154
    • View Profile
    • http://anarchy-wow.com/
Re: [TrinityCore 335] How To Make A Class Heroic?
« Reply #7 on: July 06, 2016, 03:01:24 am »
I'm getting really close to getting what I need done.
However, for the following code (c++):

Code: [Select]
   // 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:

Code: [Select]
   // 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:



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: [Select]
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:
Code: [Select]
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.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

spiderwaseem

  • Registred Member
  • Wiki Incarnate
  • *****
  • Posts: 154
    • View Profile
    • http://anarchy-wow.com/
Re: [TrinityCore 335] How To Make A Class Heroic?
« Reply #8 on: July 06, 2016, 03:42:44 am »
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. :)
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

spiderwaseem

  • Registred Member
  • Wiki Incarnate
  • *****
  • Posts: 154
    • View Profile
    • http://anarchy-wow.com/
Re: [TrinityCore 335] How To Make A Class Heroic?
« Reply #9 on: July 06, 2016, 10:53:51 pm »
Thanks for all the help everyone.
I've gotten what I need. :)
« Last Edit: January 01, 1970, 01:00:00 am by Admin »