Skip to content

Commit

Permalink
Fix weapons with 0 DPS doing infinite style damage
Browse files Browse the repository at this point in the history
Weapons below 1.5 DPS do zero style damage instead
  • Loading branch information
NetDwarf committed Oct 23, 2022
1 parent b32adf6 commit 8e764f5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions GameServer/styles/StyleProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);

Expand Down

0 comments on commit 8e764f5

Please sign in to comment.