Level Correction Function and pDIF

New Capping Method of Attack/Defense Ratio
Prior to August 2007, capping of damage multipliers was applied after level corretion and pDIF calculation. This allowed Level Correction to be overridden by high enough Attack values, and obviously was not the developer's intention.

After the August 2007 update, the ratio of an attacker's Attack versus the defender's Defense, Ratio, is now capped at 2.2 for the purposes of damage calculation. Level correction is then applied to find cRatio, upon which the multipliers to find pDIF work. This entails that Level Correction will always have an effect on damage output.

pDIF can now vary freely above its original values, and will only be capped in the case of a Critical Hit at 3.15. The highest non-critical pDIF possible is now approximately 2.77 after both randomizations (2.2 * 1.2 * 1.05). Maximum pDIF will now drop off as the target's level increases.

The Level Correction function
The Level Correction function modifies your (ranged) attack / monster defense ratio before it is used in the calculation of pDIF.
 * As an extreme example, an attacker with 600 attack against a target with 200 defense has a melee attack/defense Ratio of 3.0. This Ratio will be capped to 2.2, meaning only 440 attack is actually required to maximize Melee pDIF output against this target, regardless of its level.
 * ''If the target is a higher level than the attacking player, then a level corrected ratio is needed before calculating pDIF.
 * This is not, however, applied in reverse if the player is the higher level being attacked.
 * When fighting EM monsters or lower, level correction is always zero, meaning no 'bonus' is applied for attacking lower level targets.

After Ratio is capped at 2.2, or for any lower value:
 * Melee cRatio = Ratio - 0.050 x level difference

Using the capped 2.2 Ratio from before, against a level 81 target, your melee cRatio is then (2.2 - 0.05*5) = 1.95.

Level correction is also applied to Ranged Attacks, but no Ratio cap has been determined:
 * Ranged cRatio = Ratio - 0.025 x level difference

pDIF
The pDIF calculation takes your (level corrected) Attack and Defense ratio, cRatio, and outputs a randomized multiplier of base damage in different scalings based on the tier of cRatio achieved, per the charts below, and an additional static 5% randomizer.


 * The functions detailed in the chart below specifically output an intermediate value that is then multiplied by a static 0.95-1.05 randomizer to prevent high values from outputting the same damage successively.


 * pDIF is thus given by cRatio * (Scaling randomization for damage variance, chart below) * (Static randomization of 0.95-1.05)


 * pDIF is then final multiplier to base damage to find damage dealt.


 * One Handers, Two Handers and Ranged pDIF scaling multipliers have different formulas:

1-Handers
See Discussion Page.


 * max pDIF has the following formulas:
 * {| border="0" cellpadding="2" cellspacing="2"

! Ratio Range ! BGCOLOR="#FFEFD5" align="left"|Function Value
 * - style="background:#ffdead;" align="left"
 * - style="background:#ffdead;" align="left"
 * 0 &le; cRatio &lt; 0.5
 * BGCOLOR="#FFEFD5" align="left"|fMax(cRatio) = 0.4 + 1.2 x cRatio
 * - style="background:#ffdead;" align="left"
 * 0.5 &le; cRatio &le; 5/6
 * BGCOLOR="#FFEFD5" align="left"|fMax(cRatio) = 1
 * - style="background:#ffdead;" align="left"
 * 5/6 &lt; cRatio &le; 1.99
 * BGCOLOR="#FFEFD5" align="left" |fMax(cRatio) = 1.2 x cRatio
 * - style="background:#ffdead;" align="left"
 * 2 (capped)
 * BGCOLOR="#FFEFD5" align="left" |fMax(cRatio) = 1.2 x cRatio + 0.05 (Proven)
 * }


 * and Min pDIF has the following formulas:
 * {| border="0" cellpadding="2" cellspacing="2"

! Ratio Range ! BGCOLOR="#FFEFD5" align="left"|Function Value if fMin &lt; 0 &rarr; fMin = 0
 * - style="background:#ffdead;" align="left"
 * - style="background:#ffdead;" align="left"
 * 0 &le; cRatio &lt; 1.25
 * BGCOLOR="#FFEFD5" align="left"|fMin(cRatio) = -0.5 + 1.2 x cRatio
 * - style="background:#ffdead;" align="left"
 * 1.25 &le; cRatio &le; 1.5
 * BGCOLOR="#FFEFD5" align="left"|fMin(cRatio) = 1
 * - style="background:#ffdead;" align="left"
 * 1.5 &lt; cRatio &le; 1.99
 * BGCOLOR="#FFEFD5" align="left" |fMin(cRatio) = -0.8 + 1.2 x cRatio
 * - style="background:#ffdead;" align="left"
 * 2 (capped)
 * BGCOLOR="#FFEFD5" align="left" |fMin(cRatio) = 1.2 x cRatio - 0.82 (Proven)
 * }

2-Handers

 * max pDIF has the following formulas:
 * {| border="0" cellpadding="2" cellspacing="2"

! Ratio Range ! BGCOLOR="#FFEFD5" align="left"|Function Value
 * - style="background:#ffdead;" align="left"
 * - style="background:#ffdead;" align="left"
 * 0 &le; cRatio &lt; 0.5
 * BGCOLOR="#FFEFD5" align="left"|fMax(cRatio) = 0.4 + 1.2 x cRatio
 * - style="background:#ffdead;" align="left"
 * 0.5 &le; cRatio &le; 5/6
 * BGCOLOR="#FFEFD5" align="left"|fMax(cRatio) = 1
 * - style="background:#ffdead;" align="left"
 * 5/6 &lt; cRatio &le; 2
 * BGCOLOR="#FFEFD5" align="left" |fMax(cRatio) = 1.2 x cRatio
 * }


 * and Min pDIF has the following formulas:
 * {| border="0" cellpadding="2" cellspacing="2"

! Ratio Range ! BGCOLOR="#FFEFD5" align="left"|Function Value if fMin &lt; 0 &rarr; fMin = 0
 * - style="background:#ffdead;" align="left"
 * - style="background:#ffdead;" align="left"
 * 0 &le; cRatio &lt; 1.25
 * BGCOLOR="#FFEFD5" align="left"|fMin(cRatio) = -0.5 + 1.2 x cRatio
 * - style="background:#ffdead;" align="left"
 * 1.25 &le; cRatio &le; 1.5
 * BGCOLOR="#FFEFD5" align="left"|fMin(cRatio) = 1
 * - style="background:#ffdead;" align="left"
 * 1.5 &lt; cRatio &le; 2
 * BGCOLOR="#FFEFD5" align="left" |fMin(cRatio) = -0.8 + 1.2 x cRatio
 * }

Ranged Attack

 * {| border="0" cellpadding="2" cellspacing="2"

! Ratio Range ! BGCOLOR="#FFEFD5" align="left"|Function Value
 * - style="background:#ffdead;" align="left"
 * - style="background:#ffdead;" align="left"
 * 0 &le; cRatio &lt; 0.9
 * BGCOLOR="#FFEFD5" align="left"|fMax(cRatio) = 10/9 x cRatio
 * - style="background:#ffdead;" align="left"
 * 0.9 &le; cRatio &le; 1.1
 * BGCOLOR="#FFEFD5" align="left"|fMax(cRatio) = 1
 * - style="background:#ffdead;" align="left"
 * 1.1 &lt; cRatio &le; 3.0
 * BGCOLOR="#FFEFD5" align="left" |fMax(cRatio) = cRatio
 * }


 * {| border="0" cellpadding="2" cellspacing="2"

! Ratio Range ! BGCOLOR="#FFEFD5" align="left"|Function Value
 * - style="background:#ffdead;" align="left"
 * - style="background:#ffdead;" align="left"
 * 0 &le; cRatio &lt; 0.9
 * BGCOLOR="#FFEFD5" align="left"|fMin(cRatio) = cRatio
 * - style="background:#ffdead;" align="left"
 * 0.9 &le; cRatio &le; 1.1
 * BGCOLOR="#FFEFD5" align="left"|fMin(cRatio) = 1
 * - style="background:#ffdead;" align="left"
 * 1.1 &lt; cRatio &le; 3.0
 * BGCOLOR="#FFEFD5" align="left" |fMin(cRatio) = -3/19 + 20/19 x cRatio
 * }
 * When cRatio exceeds 3.0, cRatio is 3.0 (capped for ranged)


 * Rules for ranged Critical Hit
 * Ranged critical hit always multiplies your pDIF by 1.25
 * Example:
 * When your pDIF is 3.0 and you score a critical hit, your pDIF will be 3.75