Skip to content

Commit da0dad5

Browse files
OrderedSet86LocalIdentity
andauthored
Add Support for Ailment chance calculations and Fix Shock calculation (#628)
* Add notes for poe2 ailment threshold implementation, remove poe1 scorch * Partial progress towards ailment threshold - canDoAilment is currently unconditionally returning false - possible bug with calcAverageSourceDamage ? * Fix bugs in last commit, reorganize calc tab, temporarily remove per stack value (didn't match breakdown values) * Cleanup for PR * Remove leftover ConPrintf values * Implement @deathbeam feedback 1. Make effective DPS visible again 2. Make damage per stack visible again (renamed to "Dmg./<ailment> Stack" for clarity) * Remove rebase leftovers * Fix typo bug added in #569 * Remove ailment threshold from bleed * Fix Nightblade feedback (modname -> modName) * Fix PR part 1 Remove print statements Remove close range knockback remove output requirements for functions Fix comment typos * Fix CalcSections * Add back Impale Block * Update enemy ailment threshold values Uses game constants for values * Formatting * Shock chance calcs * Fix base Shock value * Remove unneeded comment and move to data.lua * Fix Ailment Magnitude not working correctly * Fix Ailment Threshold value on bosses * Implement Minimum Chill values * Fix Current shock for Stormweaver node * Fix breakdowns --------- Co-authored-by: LocalIdentity <localidentity2@gmail.com>
1 parent 48d679c commit da0dad5

File tree

11 files changed

+224
-195
lines changed

11 files changed

+224
-195
lines changed

src/Data/Misc.lua

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@ local data = ...
55
data.monsterEvasionTable = { 11, 14, 17, 20, 24, 27, 31, 35, 38, 42, 46, 50, 54, 59, 63, 67, 72, 76, 81, 86, 91, 96, 101, 106, 111, 117, 122, 128, 134, 140, 146, 152, 158, 165, 171, 178, 185, 191, 199, 206, 213, 221, 228, 236, 244, 252, 261, 269, 278, 286, 295, 304, 314, 323, 333, 343, 353, 363, 373, 384, 395, 406, 417, 429, 440, 452, 464, 477, 489, 502, 515, 528, 542, 556, 570, 584, 598, 613, 628, 644, 659, 675, 691, 708, 724, 742, 759, 777, 795, 813, 832, 850, 870, 889, 909, 930, 951, 972, 993, 1015, }
66
data.monsterAccuracyTable = { 51, 56, 60, 65, 70, 75, 80, 86, 91, 97, 103, 110, 116, 123, 130, 137, 145, 152, 160, 169, 177, 186, 195, 204, 214, 224, 234, 245, 256, 267, 279, 291, 304, 317, 330, 344, 358, 372, 387, 403, 419, 435, 452, 470, 488, 506, 526, 545, 566, 587, 608, 630, 653, 677, 701, 726, 752, 778, 806, 834, 863, 892, 923, 955, 987, 1020, 1055, 1090, 1126, 1164, 1202, 1242, 1283, 1324, 1368, 1412, 1457, 1504, 1552, 1602, 1653, 1705, 1759, 1814, 1871, 1930, 1990, 2052, 2115, 2180, 2247, 2316, 2387, 2460, 2535, 2612, 2690, 2772, 2855, 2941, }
77
data.monsterLifeTable = { 15, 20, 24, 28, 33, 38, 45, 52, 62, 74, 89, 106, 127, 151, 179, 211, 237, 267, 298, 332, 368, 406, 446, 488, 533, 579, 629, 680, 734, 791, 849, 911, 975, 1053, 1137, 1228, 1326, 1432, 1547, 1671, 1804, 1949, 2104, 2273, 2455, 2577, 2706, 2842, 2984, 3133, 3289, 3454, 3627, 3808, 3998, 4198, 4408, 4629, 4860, 5103, 5358, 5626, 5907, 6203, 6513, 6904, 7318, 7757, 8222, 8716, 9239, 9793, 10381, 11003, 11664, 12363, 13105, 13892, 14725, 15609, 16545, 17538, 18590, 19705, 20888, 22141, 23469, 24878, 26370, 27953, 29630, 31407, 33292, 35289, 37407, 39651, 42030, 44552, 47225, 50059, }
8-
data.monsterLifeTable2 = { 22, 28, 35, 41, 48, 55, 63, 70, 77, 85, 93, 101, 109, 118, 126, 135, 144, 153, 163, 172, 182, 192, 202, 213, 223, 234, 245, 256, 268, 280, 292, 304, 317, 330, 343, 356, 370, 383, 398, 412, 427, 442, 457, 473, 489, 505, 522, 538, 556, 573, 591, 609, 628, 647, 666, 686, 706, 727, 747, 769, 790, 812, 835, 858, 881, 905, 929, 954, 979, 1004, 1030, 1057, 1084, 1112, 1140, 1168, 1197, 1227, 1257, 1288, 1319, 1351, 1383, 1416, 1449, 1484, 1518, 1554, 1590, 1626, 1664, 1701, 1740, 1779, 1819, 1860, 1902, 1944, 1987, 2030, }
9-
data.monsterLifeTable3 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }
108
data.monsterAllyLifeTable = { 51, 79, 109, 140, 172, 207, 243, 281, 321, 362, 406, 453, 501, 552, 605, 661, 720, 781, 845, 912, 982, 1056, 1132, 1213, 1296, 1384, 1475, 1571, 1671, 1775, 1883, 1996, 2114, 2238, 2366, 2500, 2639, 2784, 2936, 3093, 3258, 3429, 3607, 3792, 3985, 4185, 4394, 4611, 4837, 5072, 5316, 5570, 5834, 6108, 6394, 6690, 6998, 7318, 7650, 7996, 8354, 8727, 9114, 9515, 9932, 10365, 10814, 11280, 11764, 12266, 12787, 13328, 13889, 14471, 15074, 15700, 16349, 17023, 17721, 18445, 19195, 19973, 20780, 21616, 22483, 23381, 24312, 25277, 26277, 27313, 28386, 29498, 30650, 31843, 33079, 34360, 35686, 37060, 38482, 39955, }
119
data.monsterDamageTable = { 9.1599998474121, 10.260000228882, 11.390000343323, 12.569999694824, 13.779999732971, 15.029999732971, 16.319999694824, 17.64999961853, 19.020000457764, 20.440000534058, 21.89999961853, 23.409999847412, 24.969999313354, 26.569999694824, 28.229999542236, 29.930000305176, 31.690000534058, 33.5, 35.369998931885, 37.290000915527, 39.270000457764, 41.310001373291, 43.409999847412, 45.569999694824, 47.799999237061, 50.090000152588, 52.450000762939, 54.880001068115, 57.369998931885, 59.939998626709, 62.590000152588, 65.309997558594, 68.099998474121, 70.980003356934, 73.940002441406, 76.980003356934, 80.110000610352, 83.319999694824, 86.629997253418, 90.019996643066, 93.51000213623, 97.099998474121, 100.79000091553, 104.56999969482, 108.45999908447, 112.45999908447, 116.56999969482, 120.7799987793, 125.12000274658, 129.55999755859, 134.13000488281, 138.82000732422, 143.63999938965, 148.58000183105, 153.66000366211, 158.86999511719, 164.21000671387, 169.69999694824, 175.33999633789, 181.11999511719, 187.05000305176, 193.13999938965, 199.38000488281, 205.78999328613, 212.36000061035, 219.11000061035, 226.0299987793, 233.11999511719, 240.39999389648, 247.86000061035, 255.52000427246, 263.36999511719, 271.42001342773, 279.67999267578, 288.14001464844, 296.82000732422, 305.7200012207, 314.83999633789, 324.19000244141, 333.7799987793, 343.60000610352, 353.67001342773, 364, 374.57998657227, 385.42001342773, 396.5299987793, 407.92001342773, 419.57998657227, 431.54000854492, 443.79000854492, 456.33999633789, 469.20001220703, 482.38000488281, 495.86999511719, 509.70001220703, 523.85998535156, 538.36999511719, 553.22998046875, 568.46002197266, 584.04998779297, }
1210
data.monsterAllyDamageTable = { 3.1600000858307, 4.210000038147, 5.3699998855591, 6.6399998664856, 8.0299997329712, 9.539999961853, 11.199999809265, 13, 14.960000038147, 17.10000038147, 19.409999847412, 21.930000305176, 24.659999847412, 27.610000610352, 30.809999465942, 34.270000457764, 38.009998321533, 42.060001373291, 46.419998168945, 51.130001068115, 56.200000762939, 61.669998168945, 67.559997558594, 73.910003662109, 80.73999786377, 88.080001831055, 95.970001220703, 104.45999908447, 113.56999969482, 123.34999847412, 133.86000061035, 145.13000488281, 157.2200012207, 170.17999267578, 184.08000183105, 198.9700012207, 214.91999816895, 232, 250.30000305176, 269.86999511719, 290.82000732422, 313.23999023438, 337.20999145508, 362.83999633789, 390.25, 419.54000854492, 450.82998657227, 484.26998901367, 519.97998046875, 558.11999511719, 598.84997558594, 642.32000732422, 688.71002197266, 738.21997070312, 791.04998779297, 847.40002441406, 907.5, 971.59002685547, 1039.9200439453, 1112.7700195312, 1190.4200439453, 1273.1800537109, 1361.3599853516, 1455.3199462891, 1555.4000244141, 1662.0200195312, 1775.5600585938, 1896.4699707031, 2025.2099609375, 2162.2700195312, 2308.1599121094, 2463.4499511719, 2628.7199707031, 2804.580078125, 2991.6999511719, 3190.7800292969, 3402.5600585938, 3627.8200683594, 3867.3999023438, 4122.1899414062, 4393.1201171875, 4681.1899414062, 4987.4501953125, 5313.0297851562, 5659.1201171875, 6026.9599609375, 6417.8999023438, 6833.33984375, 7274.7998046875, 7743.8598632812, 8242.2001953125, 8771.6103515625, 9333.990234375, 9931.33984375, 10565.790039062, 11239.599609375, 11955.150390625, 12714.969726562, 13521.759765625, 14378.349609375, }
1311
data.monsterArmourTable = { 5, 8, 11, 15, 19, 23, 27, 32, 37, 43, 49, 55, 62, 70, 78, 86, 96, 106, 116, 127, 139, 152, 166, 181, 196, 213, 231, 250, 270, 292, 315, 339, 365, 393, 422, 453, 486, 521, 559, 599, 641, 685, 733, 783, 837, 893, 953, 1017, 1084, 1156, 1231, 1311, 1396, 1486, 1581, 1682, 1788, 1901, 2020, 2146, 2279, 2420, 2569, 2726, 2893, 3068, 3254, 3451, 3658, 3877, 4108, 4353, 4611, 4883, 5171, 5475, 5795, 6133, 6490, 6867, 7264, 7684, 8126, 8593, 9085, 9604, 10151, 10728, 11336, 11978, 12654, 13367, 14119, 14911, 15745, 16625, 17552, 18528, 19557, 20641, }
14-
data.monsterAilmentThresholdTable = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 20, 40, 60, 80, 100, 120, 140, 160, 180, 200, 220, 240, 260, 280, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, }
12+
data.monsterAilmentThresholdTable = { 15, 20, 24, 28, 34, 39, 46, 54, 64, 77, 93, 112, 135, 161, 192, 228, 257, 291, 327, 366, 408, 453, 501, 551, 606, 662, 724, 787, 855, 927, 1002, 1082, 1165, 1267, 1377, 1497, 1627, 1768, 1923, 2091, 2273, 2472, 2687, 2923, 3179, 3360, 3552, 3757, 3972, 4200, 4440, 4696, 4966, 5251, 5552, 5872, 6210, 6568, 6946, 7346, 7769, 8217, 8690, 9193, 9723, 10382, 11085, 11837, 12639, 13497, 14413, 15390, 16435, 17549, 18742, 20013, 21372, 22824, 24373, 26029, 27796, 29684, 31700, 33852, 36153, 38608, 41230, 44033, 47023, 50219, 53630, 57272, 61164, 65318, 69757, 74494, 79554, 84958, 90729, 96892, }
1513

1614
-- From MinionGemLevelScaling.dat
1715
data.minionLevelTable = { 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, }

src/Data/ModCache.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ c["10% increased Life Regeneration rate"]={{[1]={flags=0,keywordFlags=0,name="Li
766766
c["10% increased Life and Mana Recovery from Flasks"]={{[1]={flags=0,keywordFlags=0,name="FlaskLifeRecovery",type="INC",value=10},[2]={flags=0,keywordFlags=0,name="FlaskManaRecovery",type="INC",value=10}},nil}
767767
c["10% increased Lightning Damage"]={{[1]={flags=0,keywordFlags=0,name="LightningDamage",type="INC",value=10}},nil}
768768
c["10% increased Lightning Exposure Effect"]={{[1]={flags=0,keywordFlags=0,name="LightningExposureEffect",type="INC",value=10}},nil}
769-
c["10% increased Magnitude of Ailments you inflict"]={{[1]={flags=0,keywordFlags=14680064,name="AilmentMagnitude",type="INC",value=10}},nil}
769+
c["10% increased Magnitude of Ailments you inflict"]={{[1]={flags=0,keywordFlags=0,name="AilmentMagnitude",type="INC",value=10}},nil}
770770
c["10% increased Magnitude of Bleeding you inflict"]={{[1]={flags=0,keywordFlags=4194304,name="AilmentMagnitude",type="INC",value=10}},nil}
771771
c["10% increased Magnitude of Chill you inflict"]={{[1]={flags=0,keywordFlags=0,name="EnemyChillMagnitude",type="INC",value=10}},nil}
772772
c["10% increased Magnitude of Ignite you inflict"]={{[1]={flags=0,keywordFlags=8388608,name="AilmentMagnitude",type="INC",value=10}},nil}
@@ -928,7 +928,7 @@ c["12% increased Freeze Buildup 12% increased chance to Shock"]={{[1]={flags=0,k
928928
c["12% increased Grenade Area of Effect"]={{[1]={[1]={skillType=169,type="SkillType"},flags=0,keywordFlags=0,name="AreaOfEffect",type="INC",value=12}},nil}
929929
c["12% increased Grenade Damage"]={{[1]={[1]={skillType=169,type="SkillType"},flags=0,keywordFlags=0,name="Damage",type="INC",value=12}},nil}
930930
c["12% increased Lightning Damage"]={{[1]={flags=0,keywordFlags=0,name="LightningDamage",type="INC",value=12}},nil}
931-
c["12% increased Magnitude of Ailments you inflict"]={{[1]={flags=0,keywordFlags=14680064,name="AilmentMagnitude",type="INC",value=12}},nil}
931+
c["12% increased Magnitude of Ailments you inflict"]={{[1]={flags=0,keywordFlags=0,name="AilmentMagnitude",type="INC",value=12}},nil}
932932
c["12% increased Magnitude of Ignite you inflict"]={{[1]={flags=0,keywordFlags=8388608,name="AilmentMagnitude",type="INC",value=12}},nil}
933933
c["12% increased Magnitude of Poison you inflict"]={{[1]={flags=0,keywordFlags=2097152,name="AilmentMagnitude",type="INC",value=12}},nil}
934934
c["12% increased Mana Regeneration Rate"]={{[1]={flags=0,keywordFlags=0,name="ManaRegen",type="INC",value=12}},nil}
@@ -1658,7 +1658,7 @@ c["30% increased Life Recovery from Flasks"]={{[1]={flags=0,keywordFlags=0,name=
16581658
c["30% increased Life Regeneration rate during Effect of any Life Flask"]={{[1]={[1]={type="Condition",var="UsingLifeFlask"},flags=0,keywordFlags=0,name="LifeRegen",type="INC",value=30}},nil}
16591659
c["30% increased Light Radius"]={{[1]={flags=0,keywordFlags=0,name="LightRadius",type="INC",value=30}},nil}
16601660
c["30% increased Lightning Exposure Effect"]={{[1]={flags=0,keywordFlags=0,name="LightningExposureEffect",type="INC",value=30}},nil}
1661-
c["30% increased Magnitude of Ailments you inflict"]={{[1]={flags=0,keywordFlags=14680064,name="AilmentMagnitude",type="INC",value=30}},nil}
1661+
c["30% increased Magnitude of Ailments you inflict"]={{[1]={flags=0,keywordFlags=0,name="AilmentMagnitude",type="INC",value=30}},nil}
16621662
c["30% increased Magnitude of Chill you inflict"]={{[1]={flags=0,keywordFlags=0,name="EnemyChillMagnitude",type="INC",value=30}},nil}
16631663
c["30% increased Magnitude of Non-Damaging Ailments you inflict"]={{[1]={flags=0,keywordFlags=0,name="EnemyShockMagnitude",type="INC",value=30},[2]={flags=0,keywordFlags=0,name="EnemyChillMagnitude",type="INC",value=30},[3]={flags=0,keywordFlags=0,name="EnemyFreezeEffect",type="INC",value=30}},nil}
16641664
c["30% increased Magnitude of Non-Damaging Ailments you inflict with Critical Hits"]={{[1]={[1]={type="Condition",var="CriticalStrike"},flags=0,keywordFlags=0,name="EnemyShockMagnitude",type="INC",value=30},[2]={[1]={type="Condition",var="CriticalStrike"},flags=0,keywordFlags=0,name="EnemyChillMagnitude",type="INC",value=30},[3]={[1]={type="Condition",var="CriticalStrike"},flags=0,keywordFlags=0,name="EnemyFreezeEffect",type="INC",value=30}},nil}
@@ -1924,7 +1924,7 @@ c["5% increased Dexterity"]={{[1]={flags=0,keywordFlags=0,name="Dex",type="INC",
19241924
c["5% increased Duration of Damaging Ailments on Enemies"]={{[1]={flags=0,keywordFlags=0,name="EnemyIgniteDuration",type="INC",value=5},[2]={flags=0,keywordFlags=0,name="EnemyBleedDuration",type="INC",value=5},[3]={flags=0,keywordFlags=0,name="EnemyPoisonDuration",type="INC",value=5}},nil}
19251925
c["5% increased Experience gain"]={{}," Experience gain "}
19261926
c["5% increased Flask Effect Duration"]={{[1]={flags=0,keywordFlags=0,name="FlaskDuration",type="INC",value=5}},nil}
1927-
c["5% increased Magnitude of Ailments you inflict"]={{[1]={flags=0,keywordFlags=14680064,name="AilmentMagnitude",type="INC",value=5}},nil}
1927+
c["5% increased Magnitude of Ailments you inflict"]={{[1]={flags=0,keywordFlags=0,name="AilmentMagnitude",type="INC",value=5}},nil}
19281928
c["5% increased Mana Cost of Skills"]={{[1]={flags=0,keywordFlags=0,name="ManaCost",type="INC",value=5}},nil}
19291929
c["5% increased Maximum Life per Socketed Rune or Soul Core"]={{[1]={[1]={type="Multiplier",var="RunesSocketedIn{SlotName}"},flags=0,keywordFlags=0,name="Life",type="INC",value=5}},nil}
19301930
c["5% increased Maximum Mana per Socketed Rune or Soul Core"]={{[1]={[1]={type="Multiplier",var="RunesSocketedIn{SlotName}"},flags=0,keywordFlags=0,name="Mana",type="INC",value=5}},nil}

src/Export/Scripts/miscdata.lua

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ out:write('-- From DefaultMonsterStats.dat\n')
2828
out:write('data.monsterEvasionTable = { '..evasion..'}\n') --This table is off by about 0.5% in some cases but is quicker than generating the value at runtime
2929
out:write('data.monsterAccuracyTable = { '..accuracy..'}\n')
3030
out:write('data.monsterLifeTable = { '..life..'}\n')
31-
out:write('data.monsterLifeTable2 = { '..altLife1..'}\n')
32-
out:write('data.monsterLifeTable3 = { '..altLife2..'}\n')
3331
out:write('data.monsterAllyLifeTable = { '..allyLife..'}\n')
3432
out:write('data.monsterDamageTable = { '..damage..'}\n')
3533
out:write('data.monsterAllyDamageTable = { '..allyDamage..'}\n')

src/Modules/CalcDefence.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1716,7 +1716,7 @@ function calcs.defence(env, actor)
17161716
output["Self"..ailment.."Duration"] = more * inc / (100 + output.DebuffExpirationRate + modDB:Sum("BASE", nil, "Self"..ailment.."DebuffExpirationRate"))
17171717
end
17181718
for _, ailment in ipairs(data.ailmentTypeList) do
1719-
output["Self"..ailment.."Effect"] = calcLib.mod(modDB, nil, "Self"..ailment.."Effect") * (modDB:Flag(nil, "Condition:"..ailment.."edSelf") and calcLib.mod(modDB, nil, "Enemy"..ailment.."Effect") or calcLib.mod(enemyDB, nil, "Enemy"..ailment.."Effect")) * 100
1719+
output["Self"..ailment.."Effect"] = calcLib.mod(modDB, nil, "Self"..ailment.."Effect") * (modDB:Flag(nil, "Condition:"..ailment.."edSelf") and calcLib.mod(modDB, nil, "Enemy"..ailment.."Magnitude", "AilmentMagnitude") or calcLib.mod(enemyDB, nil, "Enemy"..ailment.."Magnitude", "AilmentMagnitude")) * 100
17201720
end
17211721
end
17221722

0 commit comments

Comments
 (0)