TrinityCore 3.3.5 Spell Stats/Procs/Scaling issues menu

User Tag List

Results 1 to 2 of 2
  1. #1
    maneamehigh's Avatar Member
    Reputation
    1
    Join Date
    Dec 2024
    Posts
    4
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    TrinityCore 3.3.5 Spell Stats/Procs/Scaling issues

    Hello mates,

    I was hoping someone here might have stumbled upon this issue and can help.
    Lately i've built up a Trinity Core 3.3.5 (32k stats cap changed in the variables and compiled from the very beggining, DB change to INT, all the fun stuff) , done few edits in it, custom items, changed npcs hp and damage, etc, so it can be ready for playing with my friends.

    The issues:
    - Attack power doesnt show properly ( I have a paladin with Titan's grip and 2x 2H swords both 100k attack power and 100k spell power ) and i get like 10k attack power shown?
    -MOST frustrating, that for that much amount of spell power ( 200k~) Holy Light does normal heals, just like i would not have the items equipped.

    Damaging spells : some of them work, for example :
    -Paladin with 200k spellpower : judgement does 100k damage, and consecration does 600 dmg /proc, heals bad also
    -Priest : dots do properly scaled damage, casted spells don't scale, they do regular damage)
    -Warlock : staff equipped with 100k spell power, dots do normal damage, casted spells do scale (haunt, chaos bolt, etc, except for shadow bolt which also does 1,5k/cast)
    -Mage : nothing scales, just plain damage
    -Druid : same as mage

    Troubleshooting done so far :
    -I've tested changing spell_bonus_data scaling for example, with a 10.0 value for Holy Light for Paladin, it changed the behaviour meaning around 40k heals with no items, and when equipping 100k spell weapons, back to 6k heals.
    -Created new item with 65535 spellpower cap instead of 100k thinking it would help even if i have changed to INT for stat_value in the item_template DB, same behaviour.

    I don't want to go over repacks, as I have experience of integrating and building up projects and I want full control of scripts and rebuilding if needed, but this one is giving me headaches.

    It's difficult for me to pinpoint the issue, hoping someone has stumbled upon this and might be able to help. Sorry for the long text.
    Also, if wrong prefix of topic, please move it accordingly.

    TrinityCore 3.3.5 Spell Stats/Procs/Scaling issues
  2. #2
    maneamehigh's Avatar Member
    Reputation
    1
    Join Date
    Dec 2024
    Posts
    4
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello mates,

    Well since i've posted this wrong in the first place in the "guide" section, I figured I could also post the fix to my issue, after long nights of code debugging and tons of coffee, here it is.

    -The culprit is : CalculateSpellpowerCoefficientLevelPenalty in unit.cpp file at line 2324.

    You can open with Visual Studio ( whatever version you have ) and edit accordingly. Now, I'm not just pointing out to some no-man's-land function, the following calculations are done, you can use them, or adjust as you see fit.

    float Unit::CalculateSpellpowerCoefficientLevelPenalty(SpellInfo const* spellInfo) const
    {
    if (!spellInfo->MaxLevel || GetLevel() < spellInfo->MaxLevel)
    return 1.0f;

    return std::max(0.0f, std::min(1.0f, (22.0f + spellInfo->MaxLevel - GetLevel()) / 20.0f));
    }


    How it works :
    1. !spellInfo->MaxLevel : If the spell has no MaxLevel defined, no penalty is applied, and the function returns 1.0f (100% scaling).
    2. GetLevel() < spellInfo->MaxLevel: If the caster's level is below the spell's MaxLevel, no penalty is applied, and the function returns 1.0f.
    3. Level Penalty Calculation: When the caster's level exceeds the spell's MaxLevel, scaling is reduced based on this formula: Penalty = (22.0 + spellInfo->MaxLevel - GetLevel()) / 20.0
    If GetLevel() exceeds MaxLevel by more than 22 levels, the penalty becomes 0.0 (no scaling). Otherwise, the penalty linearly decreases from 1.0 to 0.0 as the difference increases.

    For characters at level 255, most spells are designed with a MaxLevel of 80 (or slightly higher for some). This means the penalty calculation reduces or nullifies the Spell Power contribution for these spells. Conversely, a level 80 character experiences no penalty because their level matches the MaxLevel of the spells.

    Now, some maths, since we're all into bits and bobbers, otherwise we wouldn't be here playing with code:

    float maxLevelPenalty = 1.0f - (float(GetLevel() - spellInfo->MaxLevel) / (255 - spellInfo->MaxLevel));

    Penalty Calculation explained:
    At level 80 (equal to MaxLevel), the penalty is: maxLevelPenalty = 1.0f - (0 / (255 - 80)) = 1.0f (Full scaling is applied)
    At level 100 (20 levels above MaxLevel): maxLevelPenalty = 1.0f - (20 / (255 - 80)) = 1.0f - 0.1143 ≈ 0.8857 (Only ~88.57% of scaling remains)
    At level 150 (70 levels above MaxLevel): maxLevelPenalty = 1.0f - (70 / (255 - 80)) = 1.0f - 0.4 = 0.6 (Only 60% of scaling remains)
    At level 255 (175 levels above MaxLevel): maxLevelPenalty = 1.0f - (175 / (255 - 80)) = 1.0f - 1 = 0 (No Scaling)

    -Adjustments/Fixes :
    1. Remove Penalty Entirely


    float Unit::CalculateSpellpowerCoefficientLevelPenalty(SpellInfo const* spellInfo) const
    {
    return 1.0f; // Disable level penalty entirely, returning full scaling
    }

    Tested, working, but not recommended unless you want to do a humongous stats server that's unbalanced.

    Fool proof copy-paste (lines with penalty return can be commented) :
    float Unit::CalculateSpellpowerCoefficientLevelPenalty(SpellInfo const* spellInfo) const
    {
    // if (!spellInfo->MaxLevel || GetLevel() < spellInfo->MaxLevel)
    return 1.0f;

    // return std::max(0.0f, std::min(1.0f, (22.0f + spellInfo->MaxLevel - GetLevel()) / 20.0f));
    }

    2. Scale Penalty :
    float Unit::CalculateSpellpowerCoefficientLevelPenalty(SpellInfo const* spellInfo) const
    {
    if (!spellInfo->MaxLevel || GetLevel() < spellInfo->MaxLevel)
    return 1.0f;

    //Old Blizzard Penalty
    //return std::max(0.0f, std::min(1.0f, (22.0f + spellInfo->MaxLevel - GetLevel()) / 20.0f));

    // Normalize penalty based on max level (e.g., 255)
    float maxLevelPenalty = 1.0f - (float(GetLevel() - spellInfo->MaxLevel) / (255 - spellInfo->MaxLevel));

    // Ensure the penalty doesn't drop below 50% scaling
    return std::max(0.5f, std::min(1.0f, maxLevelPenalty));
    }

    Now return std::max(0.5f, std::min(1.0f, maxLevelPenalty));

    The std::max function ensures the penalty doesn’t drop below 0.5f (50% scaling). Even at very high levels, spells will retain at least 50% of their scaling. You can adjust as you see fit, just change the first value of the f.
    Examples :
    -return std::max(0.8f, std::min(1.0f, maxLevelPenalty)); (80% scaling)
    -return std::max(0.9f, std::min(1.0f, maxLevelPenalty)); (90% scaling)

    And while you're at it and about to rebuild, if you haven't already removed the 32767 Stats for Items, go to ObjectManager.cpp, line 3021, and change
    itemTemplate.ItemStat[i].ItemStatValue = int32(fields[29 + i*2].GetInt16());
    to
    itemTemplate.ItemStat[i].ItemStatValue = int32(fields[29 + i*2].GetInt32());

    That's it, rebuild, delete cache, join your server and test thoroughly.

    Sorry for the long post, I hope this helps somebody, as I wish I would have found this sooner and well documented as it is documented by me above.

    Enjoy

Similar Threads

  1. [Spell Swap] Trauma Proc
    By nannou in forum WoW ME Questions and Requests
    Replies: 0
    Last Post: 02-21-2010, 09:12 AM
  2. [Spell Swap] Mage & Proc spell swaps
    By Shaquillle in forum World of Warcraft Model Editing
    Replies: 9
    Last Post: 03-25-2009, 05:09 PM
  3. [Spell Swap] Sword proc > Windfury proc
    By Banned in forum World of Warcraft Model Editing
    Replies: 7
    Last Post: 07-23-2008, 12:50 PM
  4. [Spell Swap]Poison Proc > Windfury Proc
    By recklesss in forum World of Warcraft Model Editing
    Replies: 18
    Last Post: 03-22-2008, 12:18 AM
  5. Question: How to edit spells/procs.
    By Messages in forum WoW ME Questions and Requests
    Replies: 0
    Last Post: 06-28-2007, 01:17 PM
All times are GMT -5. The time now is 02:38 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search