Welcome to AC Web.
Results 1 to 12 of 12
  1. #1

    How to lock dodge?


    REGISTER! (FREE)
    Registered members see less ads
    and also gain access to other great features.
    Hello, I want to lock dodge for each class except Warrior, Druid and Paladin. My server is fun 255 and most melee classes have agility of the items (shaman and hunter for example), which gives them dodge and by this way they are able to tank bosses. I want to change that. I only want these three classes to be able to tank bosses. So, can I lock the dodge for every class to 0% no matter how much agility/dodge they have as a stat and for Warrior, Druid & Paladin to 85% again, no matter how much agility/dodge they have? If yes, how can I do that?

  2. #2


    Join Date
    Sep 2014
    Location
    nloli#6788 - I dont answer PMs
    Posts
    439
    Hey there, if you use your own compiled TrinityCore Server I can help you out. I don't know about other cores and you simply cannot do that in Repacks, as it's a change within the Server's Core.

    First of, you have a different option:
    Instead of completely blocking the chance to dodge, you can just rewrite the formula on the dodge percentage. Meaning: Instead of setting their dodge to 0%, you can instead adjust it to be a dodge chance of like 15% at 2.000.000 Agility.

    This is how you do it:
    Move to your Player.cpp
    Your Server Folder\source\src\server\game\Entities\Player\Play er.cpp

    When your core is unedited, go to line 5371
    you should see:

    float bonus_agility = GetStat(STAT_AGILITY) - base_agility;
    You can just change this to retail calculations, let's say you have 2.000.000 agility and normal at max pvp gear in 3.3.5a is 3672. Then you just do (2 000 000 / 3 672) = 544,66. Mathematically this means (2 000 000 / 544,66) = 3 672 which is a proper value in retail 3.3.5a to have about 25-30% dodge chance. This means your modifier is 544,66
    So you just change
    float bonus_agility = GetStat(STAT_AGILITY) - base_agility;
    to
    float bonus_agility = (GetStat(STAT_AGILITY) - base_agility) / Your Modifier;
    in my case
    float bonus_agility = (GetStat(STAT_AGILITY) - base_agility) / 544.66f;

    If you really want to only set certain classes to 0% dodge. Open Player.h
    Your Server Folder\source\src\server\game\Entities\Player\Play er.h

    Go to line 783 or
    float const dodge_cap[MAX_CLASSES] =
    {
    88.129021f, // Warrior
    88.129021f, // Paladin
    145.560408f, // Hunter
    145.560408f, // Rogue
    150.375940f, // Priest
    88.129021f, // DK
    145.560408f, // Shaman
    150.375940f, // Mage
    150.375940f, // Warlock
    0.0f, // ??
    116.890707f // Druid
    };
    And just set the value, of the class you'd like to disable the dodge chance, to 0.00f

    After both options, compile the core, replace the old worldserver.exe with the new one, and there you go.
    Last edited by Project2k14; 01-10-2019 at 07:24 PM.

  3. #3
    Quote Originally Posted by Project2k14 View Post
    Hey there, if you use your own compiled TrinityCore Server I can help you out. I don't know about other cores and you simply cannot do that in Repacks, as it's a change within the Server's Core.

    First of, you have a different option:
    Instead of completely blocking the chance to dodge, you can just rewrite the formula on the dodge percentage. Meaning: Instead of setting their dodge to 0%, you can instead adjust it to be a dodge chance of like 15% at 2.000.000 Agility.

    This is how you do it:
    Move to your Player.cpp
    Your Server Folder\source\src\server\game\Entities\Player\Play er.cpp

    When your core is unedited, go to line 5371
    you should see:

    float bonus_agility = GetStat(STAT_AGILITY) - base_agility;
    You can just change this to retail calculations, let's say you have 2.000.000 agility and normal at max pvp gear in 3.3.5a is 3672. Then you just do (2 000 000 / 3 672) = 544,66. Mathematically this means (2 000 000 / 544,66) = 3 672 which is a proper value in retail 3.3.5a to have about 25-30% dodge chance. This means your modifier is 544,66
    So you just change
    float bonus_agility = GetStat(STAT_AGILITY) - base_agility;
    to
    float bonus_agility = (GetStat(STAT_AGILITY) - base_agility) / Your Modifier;
    in my case
    float bonus_agility = (GetStat(STAT_AGILITY) - base_agility) / 544.66f;

    If you really want to only set certain classes to 0% dodge. Open Player.h
    Your Server Folder\source\src\server\game\Entities\Player\Play er.h

    Go to line 783 or
    float const dodge_cap[MAX_CLASSES] =
    {
    88.129021f, // Warrior
    88.129021f, // Paladin
    145.560408f, // Hunter
    145.560408f, // Rogue
    150.375940f, // Priest
    88.129021f, // DK
    145.560408f, // Shaman
    150.375940f, // Mage
    150.375940f, // Warlock
    0.0f, // ??
    116.890707f // Druid
    };
    And just set the value, of the class you'd like to disable the dodge chance, to 0.00f

    After both options, compile the core, replace the old worldserver.exe with the new one, and there you go.
    That's what I looking for. But where can I found the formula for 2.4.3?

  4. #4


    Join Date
    Sep 2014
    Location
    nloli#6788 - I dont answer PMs
    Posts
    439
    Quote Originally Posted by Kepo View Post
    That's what I looking for. But where can I found the formula for 2.4.3?
    I'm sorry I've only worked with 3.3.5a or 4.3.4, you're on your own on that one, try to find a similar file and search for key words like "dodge" or "agility"

  5. #5
    Quote Originally Posted by Project2k14 View Post
    I'm sorry I've only worked with 3.3.5a or 4.3.4, you're on your own on that one, try to find a similar file and search for key words like "dodge" or "agility"
    I am using Oregon Core which is similar to Trinity Core so don't worry. Most of the custom things are for Trinity but with a few edits, they work perfectly at 2.4.3 too. Should I calculate it by the same formula? (2 000 000 / 3 672) = 544,66?

  6. #6


    Join Date
    Sep 2014
    Location
    nloli#6788 - I dont answer PMs
    Posts
    439
    Quote Originally Posted by Kepo View Post
    I am using Oregon Core which is similar to Trinity Core so don't worry. Most of the custom things are for Trinity but with a few edits, they work perfectly at 2.4.3 too. Should I calculate it by the same formula? (2 000 000 / 3 672) = 544,66?
    Just see how much agility you have in decent gear at your server, then divide that amount by 3672

  7. #7
    Quote Originally Posted by Project2k14 View Post
    Just see how much agility you have in decent gear at your server, then divide that amount by 3672
    float Player::GetDodgeFromAgility()
    {
    // Table for base dodge values
    float dodge_base[MAX_CLASSES] = {
    0.90f, // Warrior
    0.90f, // Paladin
    0.0f, // Hunter
    0.0f, // Rogue
    0.0f, // Priest
    0.0f, // DK
    0.0f, // Shaman
    0.0f, // Mage
    0.0f, // Warlock
    0.0f, // ??
    0.90f // Druid
    };
    Shaman - http://prntscr.com/m5tw7e , http://prntscr.com/m5twh2

  8. #8


    Join Date
    Sep 2014
    Location
    nloli#6788 - I dont answer PMs
    Posts
    439
    Quote Originally Posted by Kepo View Post
    float Player::GetDodgeFromAgility()
    {
    // Table for base dodge values
    float dodge_base[MAX_CLASSES] = {
    0.90f, // Warrior
    0.90f, // Paladin
    0.0f, // Hunter
    0.0f, // Rogue
    0.0f, // Priest
    0.0f, // DK
    0.0f, // Shaman
    0.0f, // Mage
    0.0f, // Warlock
    0.0f, // ??
    0.90f // Druid
    };
    Shaman - http://prntscr.com/m5tw7e , http://prntscr.com/m5twh2
    That is the base dodge chance, not the cap ^^

  9. #9
    Oh crap... I don't have "float const dodge_cap" . Everything that I found in this forum is how to cap the dodge from statsystem.cpp but it's for every one:
    Code:
    if(value > 50)
    		value = 50;
        SetStatFloatValue(PLAYER_DODGE_PERCENTAGE, value);
    }
    Any idea how can I do it for certain classes?

  10. #10


    Join Date
    Sep 2014
    Location
    nloli#6788 - I dont answer PMs
    Posts
    439
    not sure but u could try to do
    But why do you want to disable it in the first place, and not just rework the formula?

    Again i don't know how this core works but in TC I'd use something like this
    if(plr->GetClass() == CLASS_ROGUE)
    {
    value = 0;
    }

  11. #11
    +rep it's working:

    Code:
        if (getClass() == CLASS_SHAMAN || getClass() == CLASS_ROGUE || getClass() == CLASS_HUNTER || getClass () == CLASS_MAGE || getClass () == CLASS_WARLOCK || getClass () == CLASS_PRIEST)
    	{
    	value = 0.35f;
    	}
    But what If I want to increase the cap for warrior, paladin and druid to 100% and 35% for the rest?
    Code:
        if (getClass() == CLASS_SHAMAN || getClass() == CLASS_ROGUE || getClass() == CLASS_HUNTER || getClass () == CLASS_MAGE || getClass () == CLASS_WARLOCK || getClass () == CLASS_PRIEST)
    	{
    	value = 0.35f;
    	}
    
        if (getClass() == CLASS_WARRIOR || getClass() == CLASS_PALADIN || getClass() == CLASS_DRUID)
    	{
    	value = 1.00f;
    	}
    I guess.. ??

  12. #12


    Join Date
    Sep 2014
    Location
    nloli#6788 - I dont answer PMs
    Posts
    439

    REGISTER! (FREE)
    Registered members see less ads
    and also gain access to other great features.
    Thats not a cap tho, like that it sets it to 100% always, no matter how much agility or dodge rating they have.

    If you REALLY want a cap you need to do this:
    if(value > 1){
    value = 1.00;
    }
    This means as soon as they go above 100%, set back to 100%

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •