Jump to content
  • 0

Calculatemeleedamage() formula not accurate ?


Marshall Burrell

Question

Hey,

I have been told by various people that have been testing content on the mangos zero core that the melee damage seems extremely low. Yes we tested everything with maxed out skills for that weapon type and the outcome is still the same. Does anyone know why the melee damage is lower than what it should be? Players with t2 and bwl gear are doing around the same amount of damage as what a fully decked out player with t3 and naxx weapons is doing on the mangos zero core.

I tried applying my own fix but that ended up buffing all damage abilities rather than just melee damage. I don't fully understand the CalculateMeleeDamage() formula, so if anyone could give me some tips I would greatly appreciate it. Even just a buff for all melee damage would be nice. EXAMPLE: damage = damage + damage * 0.25;

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

Hello Marshall,

For this, you really need to understand the whole mechanic, back in Vanilla, about hit calculation and melee damage. I'm not saying that you're right or wrong but we need to figure out the whole scenario.

CalculateMeleeDamage is one part of that flow, then you need to apply reduction due to buff and armors. Are you within the damage range indicated in the character sheet  because Melee Damage are not gonna be like critical strike @3k, event full decked T3. Check if you can find back that video of the gnome war who had Kel Thuzad's 2h mace, I think his crit doesn't go higher than 2k.

Tal'.

Link to comment
Share on other sites

Yeah, the problem is that it's easier being said than done :)

Mangos wants to be as much as possible Vanilla-like, so to update such essential computation, we need to know what was the formula used for each steps. Increasing the damages of 10% blindly will result in increasing all kind of melee damage.

We need sources & facts about how it was working (movies are one, formulas are others, websites are anothers, ..) to implement it more accurately.

Tal',

Link to comment
Share on other sites

It is indeed the case, formula is spread all over the place because you have so many constraints from every part, like you can see in the actual method.

A dummy way to do it is to increase the end-result of 10% in case of a melee attack but that wouldn't be wise.

We need the complete scenario, through researches or so, to properly implement it, if you are volunteer to do such researches, that could be a big help !

 

Tal'

Link to comment
Share on other sites

Maybe the armor is lowering the damage by too much? Hitting a level 60 creature with 0 armor vs 1000 armor the damage difference is too great.

I found this formula for CalcArmorReducedDamage():

uint32 Unit::CalcArmorReducedDamage(Unit* pVictim, const uint32 damage)
{
    uint32 newdamage = 0;
    float armor = (float)pVictim->GetArmor();

    // Ignore enemy armor by SPELL_AURA_MOD_TARGET_RESISTANCE aura
    armor += GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_TARGET_RESISTANCE, SPELL_SCHOOL_MASK_NORMAL);

    if (armor < 0.0f)
        armor = 0.0f;

    float levelModifier = (float)getLevel();
    if (levelModifier > 59)
        levelModifier = levelModifier + (4.5f * (levelModifier - 59));

    float tmpvalue = 0.1f * armor / (8.5f * levelModifier + 40);
    tmpvalue = tmpvalue / (1.0f + tmpvalue);

    if (tmpvalue < 0.0f)
        tmpvalue = 0.0f;
    if (tmpvalue > 0.75f)
        tmpvalue = 0.75f;

    newdamage = uint32(damage - (damage * tmpvalue));

    return (newdamage > 1) ? newdamage : 1;
}

Stock Mangos Zero Formula:

uint32 Unit::CalcArmorReducedDamage(Unit* pVictim, const uint32 damage)
{
    uint32 newdamage = 0;
    float armor = (float)pVictim->GetArmor();

    // Ignore enemy armor by SPELL_AURA_MOD_TARGET_RESISTANCE aura
    armor += GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_TARGET_RESISTANCE, SPELL_SCHOOL_MASK_NORMAL);

    if (armor < 0.0f)
        { armor = 0.0f; }

    float levelModifier = (float)getLevel();

    float tmpvalue = 0.1f * armor / (8.5f * levelModifier + 40);
    tmpvalue = tmpvalue / (1.0f + tmpvalue);

    if (tmpvalue < 0.0f)
        { tmpvalue = 0.0f; }
    if (tmpvalue > 0.75f)
        { tmpvalue = 0.75f; }

    newdamage = uint32(damage - (damage * tmpvalue));

    return (newdamage > 1) ? newdamage : 1;
}

 

Thoughts?

I did the calculation: If you do 1000 direct damage to a level 60 creature with 4000 armor the actual damage that you would do is 595 (actually 595.241183910953 Rounded down) Maybe it is right? not sure.

I guess its actually possible that some of the creatures in dungeons have incorrect armor values :F?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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