Skip to content

Keep the skill attack rate in dual-wield IAS breakpoints (Double Swing, Dragon Tail with two claws) - #101

Open
errolgr wants to merge 1 commit into
Project-Diablo-2:mainfrom
errolgr:fix/stats-breakpoints
Open

errolgr wants to merge 1 commit into
Project-Diablo-2:mainfrom
errolgr:fix/stats-breakpoints

Conversation

@errolgr

@errolgr errolgr commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Summary

In the advanced stats panel, the IAS (Frames): line ignores the skill's own attack rate when both hands hold a weapon. That makes Double Swing (always) and Dragon Tail with two claws show wrong breakpoints. This keeps the skill's attack rate in the dual-wield path.

Problem

GetIASBreakpointString adds a skill's attack rate modifier (nAttackRateBonus) to STAT_ATTACKRATE: Double Swing +50 (Skills.txt Param5), Dragon Tail -20 (Param4). When both hands hold weapons, the dual-wield block that applies PD2's faster-weapon rule recomputes the acceleration from the stat alone:

int nBaseIAS = D2COMMON_GetUnitStat(pUnit, STAT_ATTACKRATE, 0);
nAnimAcceleration = nBaseIAS + nMinAccrIAS;
nMinAnimAcceleration = nBaseIAS;

so the modifier is dropped:

  • Double Swing needs two weapons, so it always showed Frenzy's breakpoints. Two Hand Axes, 0 IAS: 24 frames shown, 14 actual.
  • Dragon Tail with two claws ignored the -20 penalty. Two Katars, 0 IAS: 11 frames shown, 14 actual. With one claw it was already correct.

Changes

File Change
BH/Drawing/Stats/StatsDisplay.cpp Dual-wield block: use STAT_ATTACKRATE + nAttackRateBonus, like the single-weapon paths
  • One line. Only skills with a non-zero nAttackRateBonus (Double Swing, Dragon Tail) used with two weapons change; every other line is unchanged.

Testing

Against published tables: the expected values come from a model checked against the PD2 wiki Breakpoints page. Dragon Tail row: 14 of 15 cells match exactly. The wiki lists TAS 0 for 16 frames, but the animation reaches 16 frames at -3. Double Swing and Frenzy: the whole sequence equals the wiki's hit 1 + hit 2 - 1 at every TAS from -20 to 200.

In game (PD2 Season 13 client, single player): Barbarian with two Hand Axes, and Assassin with one and with two Katars, at 0 and 30 IAS.

Result
Before (current BH) Double Swing 2/2 wrong (Frenzy's numbers), Dragon Tail with two claws 2/2 wrong; controls correct
After (this PR) all 14 lines correct: 4 fixed + 10 unchanged controls (Dragon Tail with one claw, Frenzy, two-claw attack with and without Burst of Speed, Fanaticism)
Case Before After
Double Swing, two Hand Axes, 0 IAS 0 (24) / 3 / 6 / 9 / 14 / 19 / 24 / 32 / 40 / 54 / 70 / 92 / 125 / 180 / 292 / 638 0 (14) / 3 / 13 / 27 / 50 / 89
Dragon Tail, two Katars, 0 IAS 0 (11) / 10 / 26 / 50 / 95 0 (14) / 4 / 11 / 23 / 39 / 63 / 102 / 187
Dragon Tail, one Katar, 0 IAS (unchanged) 0 (14) / 4 / 11 / 23 / 39 / 63 / 102 / 187 same

The clang-cl build and in-game parity gate (10/10 PD2 and 10/10 vanilla launches) pass. The other in-game scenarios are unchanged.

Screenshots

Double Swing, two Hand Axes, 30 IAS

Before After
before after

Dragon Tail, two Katars, 30 IAS

Before After
before after
Full before/after table and checked reports that are not bugs

Full evidence (every case, oracle values, provenance, and the reports that turned out not to be BH bugs: single-claw IAS, speed auras/buffs, Cloak of Shadows, the nCurrentFrames TODO, right-click-skill-only): https://github.com/errolgr/BH/blob/evidence/stats-breakpoints/PR-EVIDENCE.md

GetIASBreakpointString adds a skill's own attack rate to STAT_ATTACKRATE
(Double Swing +50 from Param5, Dragon Tail -20 from Param4), but the
dual-wield block that applies PD2's faster-weapon rule recomputes the
acceleration from STAT_ATTACKRATE alone and drops it. Double Swing needs
two weapons, so its line always showed Frenzy's speed; Dragon Tail with
two claws ignored the -20 penalty. Add nAttackRateBonus there as the
single-weapon paths do.
@errolgr
errolgr marked this pull request as ready for review October 5, 2026 01:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant