Game formulas

## Damage calculations

* Critical damage = Total damage \* (2 + Crit damage bonus)
* Damage inflicted = Total damage \* (1 - ( Enemy def - def penetration) )
* Total average damage = Min damage + [( max damage - min damage )\*balance]

## Stats calculation

* Health = raw level value + (102\*con) + items bonus + HXP bonus
* Acc = raw weapon value + (raw weapon bonus\*0.0131\*Agi) + items bonus
* Crit rate = raw weapon value + ([1.5 if one handed and +2 if 2 handed] \* luck) + items bonus
* Str damage bonus = base weapon damage \* 1.01 \* str \* items bonus
* Attack speed = Base attack speed \* (1 + items bonus)

## DPS

* Weapon DPS = Total average damage \* attack speed
* Weapon real DPS = Total average damage \* attack speed \* acc \* (1+crit rate)
* Average DPS = (Weapon DPS)\*(ennemy def - penetration)\*(acc - ennemy eva)\*(1+ crit rate - crit res)

## Whole formula :

for an unupgraded weapon :

* a = min weapon damage
* b = min damage bonus
* c = damage bonus
* d = strength
* e = max weapon damage
* f = max weapon gamage bonus
* g = balance
* h = crit rate
* i = crit bonus dmg
* j = acc (max formula value = 100% = 1)
* k = atk spd
* m= weapon level
* tier = 4 if purple 3.5 if blue 3 if yellow 2.5 if grey

`Average DPS = **[**({e*[1+(f+c)]}-{a*[1+(b+c)]})* g + {a*[1+(b+c)]}**]** * (1 + h + i) * j * k * [1 + (d * [1/(50+tier*m)])]`

**What we can see about this formula :**

* 1 strength adds 2%dmg to the total of the damage (including the buffs) for an UNUPGRADED weapon. the higher the weapon upgrade gets, the lower this% becomes.
* 1% crit adds 1% damage to the total damage. Because luck gives between 1.5 to 2.1 crit/point, luck is more interesting than str
* lacking 1% acc will reduce the total DPS of 1%. Its impact is on the DPS and not on the total damage, so if you have 50% crit and 50% acc VS 0% crit and 100% acc for 100 damage points, you will deal 50% of (100+50) damage point = 75 damage points VS 100% of (100+0) damage point = 100 !
* Attack speed also impacts directly on the DPS and not on the total damage, but its impact is less important than accuracy because items give a %of attack speed bonus. So if you have an item that adds +4.8 (in fact +5.8) % attack speed, it will be a direct damage boost of 5.8%. This means that a +12 str necklace will give a better bonus than a +7.6(8.6) attack speed necklace. and that depending of your weapon upgrade a +6.8%(7.8) attack speed necklace will be more interesting than a +8 str necklace. (if weapon is purple lvl 15 or more attack speed is more interesting)
* Balance impact depends of the gap between min and max dmg, but in any case, it is a boost that applies only on the difference between min and max damage, so this is always good to take, but the other boosts are better because they apply on total damage.

In conclusion, we know that it is important to get 100% acc and 100% crit (because crit rate is cheap) so the remaining points will usually go in str on classic builds. This means that an accessory that gives luck or agi will in fact give a str stats bonus, because whatever happens, we have to get 100 luck and 100 crit.

On con build this way of considering luck and agi is a bit different : instead of str it is a con bonus.