# Block Formula

When a player or monster attacks, the game uses a formula to calculate if the hit is blocked or not. The formula is not readily available in-game, so this page is the only place to find it.

You may need to read carefully so that you understand what is written.

Letters and words are used to denote various parts of the formula, like this: `"X = (Player's INT)/100".`

What this means is that when you see "X" in the formula, all it means is that you take your INT, divide it by 100, and put that number where you see "X".

When you see Parenthesis ( "(" and ")" ) and brackets ( "[" and "]" ), all it means is that the stuff in parenthesis and brackets happens before the stuff outside them.

If you took any Algebra classes, simply follow the rules of operations.

## The Formula

The formula is actually two; one formula is used for Player VS Player combat, and another formula is used for Player VS Monster combat.

### Player VS Player

```
R = Random Number between 0 and 80.
```

If R is <= 5

The hit is not blocked, and the formula ends here.

If R is >= 75

The hit is blocked, 90% of the damage is reduced, and the formula ends here.

Otherwise, the formula continues.

A = (Defender's Level) / ( ( (Defender's Level) + (Attacker's Level) ) * 15)

B = ( (Defender's DEX) + (Attacker's DEX + 2) ) * ( ( (Defender's DEX) - (Attacker's DEX) ) / 800 )

If B is > 10, B = 10

C = A + B

If C is < 0, C = 0

if (Defender's Ranged Block) is > 96, then

(Defender's Ranged Block) = 96

if (Defender's Melee Block) is > 96, then

(Defender's Melee Block) = 96

If the attack is a ranged attack,

C = C + ( (Defender's Ranged Block) - (Attacker's Ranged Block Breaker) )

If the attack is a melee attack,

C = C + ( (Defender's Melee Block) - (Attacker's Melee Block Breaker) )

D = ( (Defender's DEX / 8) * (Defender's Class's blocking multiplier) ) + C

If D is < 0

D = 0

If D is > R

The hit is blocked, and 95% of the damage is reduced.

Otherwise, the hit is not blocked.

### Player VS Monster

```
R = Random number between 0 and 100
```

If R is <= 5

The hit is not blocked, and the formula ends here.

If R is >= 95

The hit is blocked, 90% of the damage is reduced, and the formula ends here.

Otherwise, the formula continues

If the attack is a ranged attack,

A = (Attacker's Ranged Block Breaker)

If the attack is a melee attack,

A = (Attacker's Melee Block Breaker)

B = ( (Get Monster's Evasion) - (Get Monster's Level) ) * 0.5

If B is > 100

B = 100

B = B - A

If B is < 0

B = 0

If B is > R

The hit is blocked, and 80% of the damage is reduced.

Otherwise, the hit is not blocked.