# Character Attack Formulas

(Difference between revisions)
 Revision as of 18:06, 2 October 2009 (edit) (→An analysis - adding rules of thumb, suggested by Grobblewobble)← Previous diff Current revision (18:45, 2 October 2009) (edit) (undo) (→Critical Hit/Backstab Formula - more tweaks) Line 50: Line 50: ((((LN((GLvl / 999) + 1) * 100) * LN(CritMod + 1)) / 3) - (LN((MonLvl / 999) + 1)) * 100))/2 + Ln(ItemDropLevel+1) * Ln(10) ((((LN((GLvl / 999) + 1) * 100) * LN(CritMod + 1)) / 3) - (LN((MonLvl / 999) + 1)) * 100))/2 + Ln(ItemDropLevel+1) * Ln(10) - Minimum 1% (if the character has any critical hit ability) or whatever the weapon's crit % is (see below) + Minimum 1% (if the character has any critical hit ability) or whatever the weapon's crit % is (see below)
Maximum 50% (although 33.1% is the highest that can be achieved in-game) Maximum 50% (although 33.1% is the highest that can be achieved in-game) Line 58: Line 58: ((((LN((GLvl / 999) + 1) * 100) * LN(BSMod + 1)) / 3) - (LN((MonLvl / 999) + 1)) * 100))/2 + Ln(ItemDropLevel+1) * Ln(100) ((((LN((GLvl / 999) + 1) * 100) * LN(BSMod + 1)) / 3) - (LN((MonLvl / 999) + 1)) * 100))/2 + Ln(ItemDropLevel+1) * Ln(100) - Minimum 2% (if the character has any backstab ability) or whatever the weapon's backstab % is (see below) + Minimum 2% (if the character has any backstab ability) or whatever the weapon's backstab % is (see below)
- Maximum 75% (39.4% is the maximum that can be achieved in-game) + Maximum 75% (although 39.4% is the maximum that can be achieved in-game) BSMod = Value found in Help File, i.e, Thief = 9, Ninja = 2 BSMod = Value found in Help File, i.e, Thief = 9, Ninja = 2 Line 81: Line 81: * +2.2% for warrior/thief 60 * +2.2% for warrior/thief 60 - A rough rule of thumb is to divide GLvl by 28; this gives a pretty good approximation up to about level 400. + A rough rule of thumb is to divide GLvl by 28; this gives
a pretty good approximation up to about level 400. - For other guilds, the 38.38 figure above should be replaced by LN(CritMod + 1 or BSMod + 1) * 16.667. For instance, for a guild ability of 5 (Scavenger's backstab or Ninja's crit), the figures would be: + For other guilds, the 38.38 figure above should be replaced by LN(CritMod + 1 or BSMod + 1) * 16.667. For instance, for a guild ability of 5 (Scavenger's backstab or Ninja's crit), the figures would be 78% that of Warrior or Thief: * +20.7% for level 999 * +20.7% for level 999 Line 90: Line 90: * +3.4% level 120 * +3.4% level 120 * +1.7% level 60 * +1.7% level 60 + + For a guild ability of 4, the numbers will be 70% that of Warrior or Thief; for guild ability 3, 60%; ability 2, 48%; ability 1, 30%. ==== Portion subtracted by monster ability ==== ==== Portion subtracted by monster ability ==== Line 101: Line 103: * -2.4% for level 50 * -2.4% for level 50 - A rough rule of thumb is to divide monster GLvl by 22; this works quite well for all but a handful of extremely high-level monsters. + A rough rule of thumb is to divide monster GLvl by 22; this works quite

## Damage Formula

The formula has been well tested and seems to be extremely close, barring possible issues with different rounding algorithms.

GLvl = Guild Level with best fighting ability, should be the same as the one in "Guild" Tab
FightingMod = Value found in Help File / 10, i.e., Warrior = 1.2, Nomad = 0.7
Size = Range [0 to 5] or Very Small, Small, Normal, Big, Very Big, Huge
Ln stands for natural logarithm.
Rnd is a number ranging from 0 to 0.999.. (not 1, this is important because it produces different top values).

This is the Damage Modifier, a bit more complex than I expected really
1: DamMod = 0.6 + (((Ln(100 + GLvl) / 1.75) - 2.3) * FightingMod^2 / 2)
2: * WeaponModifier
3: + 5 if Critical Hit, Chance see below
4: + 2 if Backstab, Chance see below
5: / 2 if Monster is invisible and character can't see invisible
6: +0.1/-0.1 per size bigger/smaller than monster
7: if DamMod is > 1, then DamMod = DamMod - ln(DamMod)^2
Value 0.1 to 7ish (Lv 999 Human Warrior with a Mod 2.6 Weapon, severing a Tiny monster)

Let's get the Strength Modifier, it's actually 2 parts, and requires a new Strength Value (called BSV here)
BSV = Int(Strength - (LN(Strength) * ((LN(Strength) - 2,4) * 2,25))) + 1
StrMod1 = Int((Rnd * ((BSV + 10) / 2)) + ((BSV + 10) / 4)) / 10
StrMod2 = BSV/30
Str 1 to 40 -> Value [0.3-0.8 * 0.06667] to [1-2.9 * 1] Note, this value is the 2 StrMods combined

And last part of formula, Level Modifier.
LvlMod = (Ln(GLvl + 5) + 1) / Ln(1.2)
Lvl 1 to 999 -> Value 15.31228 to 43.39447

Base Damage = LvlMod * StrMod1 * StrMod2 * DamMod
Final Damage = Base - Rnd[1 to (Def-Atk)/8] or very close to this
Defense bug lurks though, so it's just:
Final Damage = Base + Rnd[1 to Atk/8]

## Chance to Hit Formula

Chance to Hit Formula in percent, range [1 to 97]
if Atk = 0 and Def = 0: 50
if Atk > Def: 0.5 + 0.5 * (Atk - Def) / Atk
if Atk < Def: 0.5 - 0.5 * (Def - Atk) / Def
Since Monster Defense passed to this formula is 0, you should always have 97% chance to hit.

## Critical Hit/Backstab Formula

Chance of scoring a critical hit or backstab:

Crit

((((LN((GLvl / 999) + 1) * 100) * LN(CritMod + 1)) / 3) - (LN((MonLvl / 999) + 1)) * 100))/2 + Ln(ItemDropLevel+1) * Ln(10)

Minimum 1% (if the character has any critical hit ability) or whatever the weapon's crit % is (see below)
Maximum 50% (although 33.1% is the highest that can be achieved in-game)

CritMod = Value found in Help File, i.e., Warrior = 9, Seeker = 3

Backstab

((((LN((GLvl / 999) + 1) * 100) * LN(BSMod + 1)) / 3) - (LN((MonLvl / 999) + 1)) * 100))/2 + Ln(ItemDropLevel+1) * Ln(100)

Minimum 2% (if the character has any backstab ability) or whatever the weapon's backstab % is (see below)
Maximum 75% (although 39.4% is the maximum that can be achieved in-game)

BSMod = Value found in Help File, i.e, Thief = 9, Ninja = 2

### An analysis

A simplified way of looking at the formula is:

LN(1 + (GLvl / 999)) * 38.38 (assuming Warrior or Thief)
- LN(1 + (MonLvl / 999)) * 50
+ LN(ItemLevelDrop + 1) * [2.30 if crit or 4.61 if backstab]

#### Portion from guild ability

The contribution from guild ability alone is:

• +26.6% for warrior/thief 999 for crit/backstab, respectively
• +15.6% for warrior/thief 500
• +8.6% for warrior/thief 250
• +4.4% for warrior/thief 120
• +2.2% for warrior/thief 60
```A rough rule of thumb is to divide GLvl by 28; this gives a pretty good approximation up to about level 400.
```

For other guilds, the 38.38 figure above should be replaced by LN(CritMod + 1 or BSMod + 1) * 16.667. For instance, for a guild ability of 5 (Scavenger's backstab or Ninja's crit), the figures would be 78% that of Warrior or Thief:

• +20.7% for level 999
• +12.1% level 500
• +6.7% level 250
• +3.4% level 120
• +1.7% level 60

For a guild ability of 4, the numbers will be 70% that of Warrior or Thief; for guild ability 3, 60%; ability 2, 48%; ability 1, 30%.

#### Portion subtracted by monster ability

The amount subtracted by various monsters is:

• -34.7% for level 999 (you-know-who)
• -15.0% for level 350 (the highest you'll normally see on level 15)
• -9.1% for level 200 (semi-common for level 15 monsters)
• -4.8% for level 100 (pretty common for levels 10-15)
• -2.4% for level 50
```A rough rule of thumb is to divide monster GLvl by 22; this works quite well for all but a handful of extremely high-level monsters.
```

#### Portion from weapon ability

The amount added by various weapons is:

Critical Hit
Backstab

The percentage chance of a crit or backstab will never be lower than the chance given by the weapon alone, regardless of the level of the monster faced. In most cases, this means any guild crit or backstab ability you have will be overshadowed by your weapon's crit or backstab ability until you get to about guild level 200, especially when factoring in the effect of monster "defense". However, if your guild has crit ability and your weapon has backstab ability, or vice-versa, your guild ability will help to increase your chances of achieving a "sever" (crit+backstab).