# DEF

## Some rough understanding of DEF / MDEF and RES / MRES

**Defense** is the total physical defense that is factored upon physical damage, which is generally based on ATK as whole or partially. However, there are exceptions.

The descriptions used here refer to Hard and Soft DEF. These names are used for clarity. The vast majority of players do not use these terms in general conversation, and instead refer Armor Def (hard) and VIT Def (soft). Hard DEF works as a relative reduction, whereas Soft DEF is a subtractive reduction.

^{wd->damage = wd.damage * (2000+status_get_lv(src)*6 + def1) / (2000+status_get_lv(target)*6 + 7 * def1) - max(vit_def,0);}

**Magic Defense** works the same way in this server, using the same formula.

^{ad.damage = ad.damage * (1000 + status_get_lv(src) * 6 + mdef) / (1000 + status_get_lv(target) * 6 + 7 * mdef) - max(mdef2, 0);}

wd.damage is physical damage received

ad.damage is magical damage received

def1 refers to Hard DEF

vit_def refers to Soft DEF

mdef refers to Hard MDEF

mdef2 refers to Soft MDEF

status_get_lv(src) refers to Monster Level

status_get_lv(target) refers to Player Level + Mastery Level

Now before you get confused, let me explain this as simple as and as accurate as possible.

The damage you take, are processed by monster level and your hard defense divided by your level and hard defense, then these are substracted by your total Soft Defense/Mdefense

It means the higher monster level is, the more damage you take. Simple.

### 4th Job Update

Current 4th Job Update added traits that increases specific status, I will be discussing RES/MRES and what they do to original DEF/MDEF calculation

**Physical Resistance (RES)**

Before calculating physical defense, it reduces normal physical damage taken by %. (up to 75%)

**Magic Resistance (MRES)**

Before calculating the magic defense, it reduces the normal magic damage received by %. (up to 75%)

With formula of

^{ad.damage = ad.damage * (5000 + mres) / (5000 + 10 * mres);}

^{wd.damage = wd.damage * (5000 + res) / (5000 + 10 * res);}

RES/MRES has a cap of 615 in original RO (50% reduction) and has a cap of 2500 in ROTFR (75%)

To explain how it works..

You have a damage taken.

This damage taken, processed by RES/MRES calculation, reducing it up to 75%.

This **damage taken after RES/MRES**, further reduced by DEF/MDEF.

This damage taken processed by these two formulas, can be REDUCED **multiplicatively** by unique addons, cards, deflect mechanics, elemental resistance, etc...

Extra note, monsters get some **RES/MRES pierce based on their level** and if they outlevel you, they get more.. the calculation for this is

^{if (src->type != BL_PC) { mres -= max(status_get_lv(src) - status_get_lv(target), 0); mres -= status_get_lv(src) / 20; }}

example, level 10.000 monster has 500RES/MRES pierce.

Lets talk about monster in a shortest way possible..

Bosses, can have RES/MRES **in The Spire of Infinity** and **all rift monsters** gain a small amount as well (both blue and red rift monsters)**.**

Monster themselves, have their own def.. **Their Level divided by 2 roughly.** The maximum damage taken by players can be reduced up to 90%, they take full damage if you ignore the def completely

**Spire of Infinity** has flat % damage reduction which should work multiplicatively.

This behaves much like what I’ve explained up there, but simpler, lets look at example : Spire MVP has Maximum RES, Maximum DEF, and 60% damage reduction

^{Damage * (RES/MRES) * (DEF/MDEF) * (Modifier)}

^{Damage * 0.25 * 0.1 * 0.4 returns value around Damage * 0.015, around 1.5% damage taken}

Having RES/MRES ignore and full DEF/MDEF ignore is very important.

## Summary

-Player damage taken is a combined **Multiplicative and Substractive** calculation.

-Monster damage taken is a simple **Multiplicative** calculation.

-Every unique addon in ROTFR is simply multiplicative calculations, with some exceptions like Double Damage, calculated in the end of damage you do.

-What do we want? Better outcomes for sure, lets look at the example figure here. This is the part where we want some stats better than others.

*Example 1*

We took 10.000 damage

We have 75% MRES, 50% MDEF, and 1000 Soft MDEF

Imagine a situation where we only have simple **Multiplicative** calculation. Turn soft MDEF into 50% reduction instead, and we use the formula..

^{10.000 * 0.25 * 0.5 * 0.5 = 625 damage taken}

Now we use the combined **Multiplicative and Substractive** calculation. Which is..

^{(ad.damage * (5000 + mres)/(5000 + 10 * mres)) * (1000 + status_get_lv(src) * 6 + mdef) / (1000 + status_get_lv(target) * 6 + 7 * mdef) - max(mdef2, 0);}

Well, lets simplify it using our example stats.

^{(10.000 * 0.25) = 2500 Damage taken after MRES process}

^{(2500 * (0.5)) – 1000 = 125 Damage taken after base calculation and reduced by 1000 Soft MDEF}

### End notes :

RES/MRES being calculated first, helps soft DEF reduces it further than you’d usually expect. RES/MRES has a higher impact the more you have it, which means RES/MRES takes priority a bit more than other status, I’d say something along like this

RES/MRES = Hard DEF/MDEF > Unique Addons > Soft DEF/MDEF

Note : This doesn’t meant soft def is bad, but it only works better if you have other status prioritized/combined. Trivia; in the original RO, 50% RES/MRES makes little difference and seemingly almost works like standard multiplicative calculation, don’t know why they made it overly complex.

Other things that hasn’t mentioned..

-Rift Invasions MVP and Raid MVP has a “shield” that acts as a multiplicative defense addon.

-Trouvere/Troubadour, Shadow Cross, Cardinal are the only class with RES/MRES Ignore%

-MVPs MAX_PAIN skill ignores reflected damage reduction, bug?

-Reflected Damage are the damage taken after all the process

-DEF/MDEF has a negative value calculation which is currently disabled/no way to get it.

-Fractured Equipment are lacking in RES/MRES department.

_{these informations are subject to change and may not be entirely accurate}

sources :

https://irowiki.org/wiki/DEF#Soft_DEF