From 8e764f50115215855b1400a788b4a1436badf624 Mon Sep 17 00:00:00 2001 From: NetDwarf Date: Sat, 22 Oct 2022 12:31:42 +0200 Subject: [PATCH] Fix weapons with 0 DPS doing infinite style damage Weapons below 1.5 DPS do zero style damage instead --- GameServer/styles/StyleProcessor.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/GameServer/styles/StyleProcessor.cs b/GameServer/styles/StyleProcessor.cs index 7a25407998..74f4f5189c 100644 --- a/GameServer/styles/StyleProcessor.cs +++ b/GameServer/styles/StyleProcessor.cs @@ -407,7 +407,9 @@ public static bool ExecuteStyle(GameLiving living, AttackData attackData, Invent //Growth * Style Spec * Effective Speed / Unstyled Damage Cap bool staticGrowth = attackData.Style.StealthRequirement; //static growth is not a function of (effective) weapon speed - double absorbRatio = attackData.Damage / living.UnstyledDamageCap(weapon); //scaling factor for style damage + double absorbRatio = 0; + if (weapon.DPS_AF >= 15) absorbRatio = attackData.Damage / living.UnstyledDamageCap(weapon); + double effectiveWeaponSpeed = living.AttackSpeed(weapon) * 0.001; double styleGrowth = Math.Max(0,attackData.Style.GrowthOffset + attackData.Style.GrowthRate * living.GetModifiedSpecLevel(attackData.Style.Spec)); double styleDamageBonus = living.GetModified(eProperty.StyleDamage) * 0.01 - 1; @@ -420,8 +422,7 @@ public static bool ExecuteStyle(GameLiving living, AttackData attackData, Invent } attackData.StyleDamage = (int)(absorbRatio * styleGrowth * ServerProperties.Properties.CS_OPENING_EFFECTIVENESS); } - else - attackData.StyleDamage = (int)(absorbRatio * styleGrowth * effectiveWeaponSpeed); + else attackData.StyleDamage = (int)(absorbRatio * styleGrowth * effectiveWeaponSpeed); attackData.StyleDamage += (int)(attackData.Damage * styleDamageBonus);