Jump to content
  • [REL19] Wrong HP calculation for Elite Creatures in Dungeons and Raids


    cabfever
    • Status: Completed
      Main Category: Database
      Sub-Category: Creature
      Version: 0.20(currentmasterbranch) Milestone: 21 Priority: Normal
      Implemented Version: 0.20(currentmasterbranch)

    [REL19] Wrong HP calculation for Elite Creatures in Dungeons and Raids

    The health point calculation is wrong. The correct values are in the database. But somehow they are totally wrong in the game.
    This is a game breaker for dungeons and even more... for raids, imho.

    Every dungeon/raid boss or normal creature has around 2-3k HP.
    What could the problem be here since everything was okay in 0.18.1


    User Feedback

    Recommended Comments

    It seems more, that they are all off - not only some of them. Every elite npc/boss I saw in dungeons/raids had around 2-3k HP.
    Also, I checked some Bosses and NPCs in dungeons/raids. And they all just got the default values of "creature_template_classlevelstats" in the database.

    Take Golem Lord Argelmach for example:

    Should have MinLevelHealth 13414 in the "creature_template" table.
    But he has 2227 which could be found as a default value in the "creature_template_classlevelstats" which can be found on page 4 there.

    Maybe it has something to do with: [url]https://www.getmangos.eu/community-input-needed/9765-health-system-overhaul.html[/url] ?


    Okay, I'm not into c++ but I think I could have found something.

    [code]
    if (CreatureClassLvlStats const* cCLS = sObjectMgr.GetCreatureClassLvlStats(level, cinfo->UnitClass))
    {
    // Use Creature Stats to calculate stat values

    // health
    health = cCLS->BaseHealth * cinfo->HealthMultiplier;

    // mana
    mana = cCLS->BaseMana * cinfo->ManaMultiplier;
    }
    else
    {
    // Use old style to calculate stat values
    float rellevel = maxlevel == minlevel ? 0 : (float(level - minlevel)) / (maxlevel - minlevel);

    // health
    uint32 minhealth = std::min(cinfo->MaxLevelHealth, cinfo->MinLevelHealth);
    uint32 maxhealth = std::max(cinfo->MaxLevelHealth, cinfo->MinLevelHealth);
    health = uint32(minhealth + uint32(rellevel * (maxhealth - minhealth)));

    // mana
    uint32 minmana = std::min(cinfo->MaxLevelMana, cinfo->MinLevelMana);
    uint32 maxmana = std::max(cinfo->MaxLevelMana, cinfo->MinLevelMana);
    mana = minmana + uint32(rellevel * (maxmana - minmana));
    }
    [/code]

    This is the new function of creature.cpp.
    It's calculating with health = cCLS->BaseHealth * cinfo->HealthMultiplier;
    BaseHealth could be found in "Creature_Template_Classlevelstats" which is for example 2227.
    This will get multiplied with the HealthMultiplier found in "Character_Template" which is 1.
    Now it calculates 2227 * 1 which is the exact displayed value ingame for golem lord argelmach.

    It seems, that the HealthMultiplier is wrong, or that the way the calculation is working is wrong. (cause it doesn't get to the else query).


    This bug effects ALL ELITE NPCs everywhere. :(
    (Tested again with deadmines - > Mr. Smite -> should have 3320 HP -> HAS 484 which is the exact value in "creature_template_classlevelstats" for class 1 (warrior) at lvl20).

    Is there a possibility to go back to the old calculation without switching back to 0.18.1?

    Link to comment
    Share on other sites



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use