Skip to content

Commit

Permalink
Adjust miss rate for 1.65 compliance
Browse files Browse the repository at this point in the history
* The base miss rate for players is supposed to be 18%, but spec was taken into account during Atlas because 18% wasn't very fun. However, making spec matter means players could get about a 7% reduction in miss rate when fully spec and at high RR.
* 1.117C, added to every weapon a miss rate reduction of 5%, which was previously only applied to special weapons such as artifacts. But this is a very late patch.
* Also changed the base miss rate of NPCs from 25% to 18%. 25% was absurdly high and unsourced (18 years old code).
  • Loading branch information
bm01 committed Aug 7, 2024
1 parent 1aecec0 commit 476bfad
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions GameServer/ECS-Components/AttackComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2580,7 +2580,8 @@ public int GetMissChance(WeaponAction action, AttackData ad, AttackData lastAD,
if ((owner is GamePlayer player && player.IsSitting) || action.RangedAttackType == eRangedAttackType.Volley)
return 0;

int missChance = ad.Attacker is GamePlayer or GameSummonedPet ? 18 : 25;
// In 1.117C, every weapon was given the intrinsic 5% flat bonus special weapons (such as artifacts) had, lowering the base miss rate to 13%.
int missChance = 18;
missChance -= ad.Attacker.GetModified(eProperty.ToHitBonus);

if (owner is not GamePlayer || ad.Attacker is not GamePlayer)
Expand Down Expand Up @@ -2633,9 +2634,6 @@ public int GetMissChance(WeaponAction action, AttackData ad, AttackData lastAD,
if (lastAD != null && lastAD.AttackResult == eAttackResult.HitStyle && lastAD.Style != null)
missChance += lastAD.Style.BonusToDefense;

if (owner is GamePlayer && ad.Attacker is GamePlayer && weapon != null)
missChance -= (int) ((ad.Attacker.WeaponSpecLevel(weapon) - 1) * 0.1);

if (action.ActiveWeaponSlot == eActiveWeaponSlot.Distance)
{
DbInventoryItem ammo = ad.Attacker.rangeAttackComponent.Ammo;
Expand Down

0 comments on commit 476bfad

Please sign in to comment.