fix Boss avoidance value (#452)#453
Conversation
The avoidance is the sum of the chances to be missed by, to block, to parry or to dodge an attack from the enemy. Each of these possibilities receives a -0.2 % penalty for every level of the attacker above the player's level. The code currently takes the level difference in consideration only for the misses. This results in the "Avoidance (Lvl +3)" displayed value to be incorrect, being shown at -0.6 % compared to same-level avoidance, while the difference should be -2.4 %. Fix this by adding an enemyLevel parameter to the GetDodgeChance, GetParryChance and GetBlockChance methods and using it to properly take the level difference into account in the returned values.
| -- In theory we should compare the player's base defense skill with | ||
| -- the attacker's weapon skill. Unfortunately there's no API function | ||
| -- to retrieve the former. The following formula leads to the same | ||
| -- results except when the player just gained a level and his/her | ||
| -- defense skill did not catch up yet. |
There was a problem hiding this comment.
Why doesn't Data:GetDefenseValue() suffice here? We use it for enemy miss chance as well 🤔
There was a problem hiding this comment.
Unfortunately Data:GetDefenseValue() is based on UnitDefense() which takes talents into account. Specifically when testing on my level 70 paladin, this function returns 370 and not 350, because of talent Anticipation 5/5. However the parry chance penalty that should be applied must be computed by comparing the player's base Defense (without gear nor talents) with the attacker's base weapon skill.
I looked for an API function which would return the base Defense value, without talent modifiers, but could not find any. If you know of a way to obtain this value, please let me know.
The avoidance is the sum of the chances to be missed by, to block, to parry or to dodge an attack from the enemy. Each of these possibilities receives a -0.2 % penalty for every level of the attacker above the player's level.
The code currently takes the level difference in consideration only for the misses. This results in the "Avoidance (Lvl +3)" displayed value to be incorrect, being shown at -0.6 % compared to same-level avoidance, while the difference should be -2.4 %.
Fix this by adding an enemyLevel parameter to the GetDodgeChance, GetParryChance and GetBlockChance methods and using it to properly take the level difference into account in the returned values.