EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Development (https://www.eqemulator.org/forums/forumdisplay.php?f=590)
-   -   FYI, Dev post on dodge chance code (https://www.eqemulator.org/forums/showthread.php?t=41863)

Xanathol 04-24-2018 04:39 PM

FYI, Dev post on dodge chance code
 
Can be found here.

Quote:

Here's how your chance to dodge is calculated:

Step1 = HeroicStrikethrough(NPC)
Step2 = HeroicAgility / 25
Step3 = MIN( Step1, Step2 )
Step4 = DodgeSkill + 100
Step5 = Step4 + ( DodgeSkill * DodgeSPA ) / 100
Step6 = Step5 / 45
DodgeChance = Step6 + ( Step2 - Step3 )

Roll a random number between 1 and 100, if it's <= than DodgeChance, we successfully dodge.

DodgeSPA is the sum of SPA 174 (dodge) for AA, items, and spells (buffs).
If you have the following:

AA: Item: Myrmidon's Skill XII (21)
Item Focus: Improved Dodge VII (70)
Spell: Illusion Benefit Neza (10)

DodgeSPA = 21 + 10 + 70 = 101

You get only the maximum value between all your AAs + the highest item focus + the highest dodge % buff (they don't stack).

If we assume these values (as an example):

HeroicAgility = 1009
DodgeSkill = 520
HeroicStrikethrough(NPC) = 0

My total dodge chance is:

Step1 = 0
Step2 = 1009 / 25 = 40
Step3 = MIN( 0, 40 ) = 0
Step4 = 520 + 100 = 620
Step5 = 620 + ( 520 * 101 ) / 100 = 1145
Step6 = 1145 / 45 = 25
DodgeChance = 25 + ( 40 - 0 ) = 65

What if you fought something with more heroic strikethrough?

HeroicStrikethrough(NPC) = 20

Step1 = 20
Step2 = 1009 / 25 = 40
Step3 = MIN( 20, 40 ) = 20
Step4 = 520 + 100 = 620
Step5 = 620 + ( 520 * 101 ) / 100 = 1145
Step6 = 1145 / 45 = 25
DodgeChance = 25 + ( 40 - 20 ) = 45

What if you fought something with even more heroic strikethrough?

Step1 = 50
Step2 = 1009 / 25 = 40
Step3 = MIN( 50, 40 ) = 40
Step4 = 520 + 100 = 620
Step5 = 620 + ( 520 * 101 ) / 100 = 1145
Step6 = 1145 / 45 = 25
DodgeChance = 25 + ( 40 - 40 ) = 25

If an NPC's Heroic Strikethrough is higher than your character's Heroic Agility bonus, you are disqualified from the "bonus" you would have gotten at the end.

demonstar55 04-24-2018 04:51 PM

They posted them all ages and we've implemented it.


All times are GMT -4. The time now is 05:37 PM.

Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.