Azarael wrote:Code: Select all
private static void CheckArmorReduction(Unit caster, Unit target, AbilityDamageInfo damageInfo, bool toPrecalc)
{
float damageTypeResistance;
float secondaryStat = caster.StsInterface.GetTotalStat(Stats.WeaponSkill);
float pen = Math.Min(1f, secondaryStat / (7.5f * caster.EffectiveLevel + 50f) * 0.25f + caster.StsInterface.GetBonusStat(Stats.ArmorPenetration) * 0.01f);
float penRes = target.StsInterface.GetBonusStat(Stats.ArmorPenetrationReduction) * 0.01f;
if (penRes > pen)
pen = 0;
else pen -= penRes;
int originalResistance = target.StsInterface.GetTotalStat(Stats.Armor) - damageInfo.GetArmorPenetrationForLevel(caster.EffectiveLevel);
if (originalResistance <= 0)
damageTypeResistance = 0;
else
{
damageTypeResistance = originalResistance / (caster.EffectiveLevel * 44f) * 0.4f;
damageTypeResistance *= 1f - pen;
damageTypeResistance *= 1f - damageInfo.ArmorResistPenFactor;
if (damageTypeResistance > 0.75f) //puts in hard cap for physical mitigation of 75%
damageTypeResistance = 0.75f;
}
if (toPrecalc)
{
damageInfo.PrecalcMitigation += (ushort)(damageInfo.PrecalcDamage * damageTypeResistance);
damageInfo.PrecalcDamage -= (ushort)(damageInfo.PrecalcDamage * damageTypeResistance);
}
else
{
damageInfo.Mitigation += (ushort)(damageInfo.Damage * damageTypeResistance);
damageInfo.Damage -= (ushort)(damageInfo.Damage * damageTypeResistance);
}
}
And yes, this is a separate function called by autoattack, ability damage, DoTs, whatever. There is only one place where this penetration is handled.
Is this value the same for all physical damage? As in the same formula for AA, ability, and dots? Just from some easy testing it gets a bit wonky. On the same mob I can use AA / Blunderbuss / Gunblast, and get very different mitigation values with the same WS.
For example,
AA 125 (60 mitigated) for a total of 185 which is about ~32.3%
BB 344 (118 mitigated) for a total of 462 which is about ~25.6%
GB 721 (335 mitigated) for a total of 1056 which is about ~31.8%
On the same mob, with the same WS, what do we see such variation between mitigation values?
Right now my head math tells me that 40 WS is about 1.2-1.3% damage increase, which seems constant on all melee abilities I have tested so far. But ranged abilities get funky.