fix(data): correct TBC AoE spell coefficients (#46)#50
Conversation
Stores post-penalty empirical TBC 2.4.3 coefficients in SpellData, sourced from WoWWiki Spell_power_coefficient archive (oldid=1549180) and Wowhead TBC Classic DBC values. The engine consumes these values verbatim, matching cMaNGOS-TBC SpellMgr::CalculateDefaultCoefficient convention - no runtime AoE multiplier is applied. Coefficient changes: - Mage Flamestrike: directCoeff 0.236 -> 0.1761, dotCoeff 0.12 -> 0.1096 - Mage Blast Wave / Dragon''s Breath / Cone of Cold / Frost Nova: 0.193/0.043 -> 0.1357 - Mage Blizzard: 0.952 -> 0.7619 - Druid Hurricane: 1.07 -> 1.28 - Shaman Chain Lightning: 0.651 -> 0.7143 (primary target) - Warlock Hellfire: 0.4286 -> 2.1429 (enemy AoE; self-damage not modeled) - Warlock Rain of Fire: 0.57 -> 0.952 - Hunter Volley: 0.50 -> 0.0586 (TBC value; 3.2.2 raised it to 0.0837) - Paladin Consecration: KEPT at 0.119 (per Wowhead DBC; the WoWWiki archive 95.24% is stale pre-Patch-2.3 data per Atlantiss bug #3402) Flag changes: - Added isAoe = true to 12 entries that lacked the flag (all Mage AoEs, Hurricane, Swipe-Bear, Holy Nova, Chain Lightning, Consecration). Documentation: - Added "Coefficient policy" header block to all 7 affected SpellData files explaining the post-penalty empirical convention. - Inline source citation on every AoE entry. Tests: - New tests/test_aoe_coefficients.lua regression suite (18 assertions). - Updated tests/test_mage_spells.lua, test_shaman_spells.lua, test_druid_spells.lua, test_ranged_engine.lua, test_shaman_talents.lua, and test_mage_talents.lua to match new coefficients. Closes #46
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughStandardizes stored spell-power coefficients as TOTAL values, adds per-rank coefficient overrides and Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 60 minutes.Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
Data/SpellData_Warlock.lua (1)
434-453:⚠️ Potential issue | 🟠 MajorHellfire still conflates enemy and self scaling paths.
Line 434-Line 443 documents two different empirical coefficients, but the data model stores only one (
coefficient = 2.1429). That leaves the self-damage path unrepresentable and can produce incorrect results whereverdamagesSelfis consumed.Proposed data-layer fix
SpellData[1949] = { name = "Hellfire", school = SCHOOL_FIRE, - coefficient = 2.1429, + coefficient = 2.1429, -- backward-compatible enemy path + enemyCoefficient = 2.1429, + selfCoefficient = 1.4286, castTime = 15.0, canCrit = false,Also add a targeted regression asserting both paths so this cannot regress silently.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Data/SpellData_Warlock.lua` around lines 434 - 453, SpellData[1949] currently stores only a single coefficient (coefficient = 2.1429) but Hellfire has distinct enemy and self scaling; add a new field (e.g., selfCoefficient) to SpellData[1949] to represent the caster-damage coefficient (~1.4286) and keep the existing coefficient for enemy damage, update any consumers that branch on damagesSelf to use selfCoefficient for self-damage calculations, and add a unit/regression test that asserts both SpellData[1949].coefficient == 2.1429 and SpellData[1949].selfCoefficient == 1.4286 to prevent future regressions.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@Data/SpellData_Priest.lua`:
- Around line 173-175: The comment for Holy Nova in SpellData_Priest.lua
currently cites WoWWiki for the 0.161 coefficient; update the provenance to the
required Wowhead TBC Classic source by replacing the WoWWiki citation line with
a Wowhead TBC reference (include the Wowhead TBC URL and a short note like
"Wowhead TBC: Holy Nova coefficient") while keeping the coefficient value and
surrounding comment text intact so the coefficient, spell name, and source meet
the repository's Data/SpellData_*.lua sourcing rules.
---
Outside diff comments:
In `@Data/SpellData_Warlock.lua`:
- Around line 434-453: SpellData[1949] currently stores only a single
coefficient (coefficient = 2.1429) but Hellfire has distinct enemy and self
scaling; add a new field (e.g., selfCoefficient) to SpellData[1949] to represent
the caster-damage coefficient (~1.4286) and keep the existing coefficient for
enemy damage, update any consumers that branch on damagesSelf to use
selfCoefficient for self-damage calculations, and add a unit/regression test
that asserts both SpellData[1949].coefficient == 2.1429 and
SpellData[1949].selfCoefficient == 1.4286 to prevent future regressions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 24aa7d4e-bd0d-499d-9918-e721becb2114
📒 Files selected for processing (15)
.plans/engine-accuracy-blockers.mdData/SpellData_Druid.luaData/SpellData_Hunter.luaData/SpellData_Mage.luaData/SpellData_Paladin.luaData/SpellData_Priest.luaData/SpellData_Shaman.luaData/SpellData_Warlock.luatests/test_aoe_coefficients.luatests/test_druid_spells.luatests/test_mage_spells.luatests/test_mage_talents.luatests/test_ranged_engine.luatests/test_shaman_spells.luatests/test_shaman_talents.lua
… per-rank overrides (#46) Per CodeRabbit review of PR #50: replace WoWWiki-archive-sourced coefficients with Wowhead TBC Classic values, add per-rank coefficient override mechanism for sub-cap-level penalty ranks, and update the coefficient policy block to reflect TOTAL vs per-tick semantics. Engine: - SpellCalc.lua: per-rank coefficient precedence (rank.X or spell.X or 0) added to ComputeDirect, ComputeRangedDirect, ComputeDot (caster + AP), ComputeChannel, ComputeHybrid (direct + dot), and ComputeUtility paths - SpellCalc.lua: ComputeMeleeDirect AP path strictly uses apCoefficient, rejecting rank.coefficient to prevent SP-vs-AP semantic ambiguity Data corrections (top-rank coefficients verified against Wowhead TBC): - Hellfire 2.1429 -> 1.425 (15 ticks * 0.095 SP mod) - Drain Soul 2.0 -> 2.145 (5 ticks * 0.429) - Blizzard 0.7619 -> 0.952 (8 ticks * 0.119) - Hurricane 1.28 -> 1.07 (10 ticks * 0.107) - Flamestrike direct 0.1761 -> 0.236, dot 0.1096 -> 0.12 - Chain Lightning 0.7143 -> 0.651 - Arcane Missiles 0.715 -> 1.43 (5 missiles * 0.286) - Consecration 0.119 -> 0.952 (CRITICAL 8x correction; was per-tick stored as total) - Seed of Corruption 0.2286 -> 0.214 Per-rank overrides (45 entries across Mage/Warlock/Priest/Druid/Shaman): - Arcane Missiles R1/R2/R3 (3/4/5 missiles sub-cap penalty) - Drain Soul R1, Drain Life R1 - Shadow Bolt, Smite, Wrath, Lightning Bolt R1/R2/R3 - Mind Blast R1/R2, Earth Shock R1/R2/R3, Fire Blast R1/R2 - Searing Pain R1, Frostbolt R1-R4, Arcane Explosion R1 - SW:Pain R1/R2/R3 (per-tick * 6 ticks; 18s duration verified via Twinhead) - Hybrid: Fireball R1-R4, Flamestrike R1, Moonfire R1-R3, Flame Shock R1/R2, Immolate R1/R2 Citations: - All 7 class data files: header policy block rewritten to cite Wowhead TBC Classic, document per-tick vs TOTAL semantics, and explain per-rank override convention - All comment-level WoWWiki references removed (intentional Rain of Fire prose mention preserved) Tests: - 22 stale numeric expectations updated across 8 existing test files - New tests/test_per_rank_overrides.lua with 7 tests covering Direct, Dot, Channel, Hybrid override paths, fall-through to spell-level, and ComputeMeleeDirect SP-vs-AP guard - Final: 1183 successes / 0 failures Audit: - .plans/per-rank-coefficient-audit.md SW:Pain section corrected (audit had erroneously claimed 24s/8 ticks; Twinhead confirms 18s/6) Closes part of #46.
There was a problem hiding this comment.
Actionable comments posted: 10
🧹 Nitpick comments (1)
Engine/SpellCalc.lua (1)
227-231: Mixed SP/AP coefficient fallback could cause unexpected scaling.The fallback chain
rankData.coefficient or rankData.apCoefficient or spellData.coefficient or spellData.apCoefficientmixes spell-power and attack-power semantics. If a melee DoT ever defines bothcoefficient(SP) andapCoefficient(AP), this will silently prefer the SP field.Consider separating the fallback paths explicitly:
- local coefficient = rankData.coefficient or rankData.apCoefficient - or spellData.coefficient or spellData.apCoefficient or 0 + local coefficient = rankData.apCoefficient or spellData.apCoefficient or 0Or keep both with a clear precedence comment explaining the intent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.plans/per-rank-coefficient-audit.md:
- Around line 273-276: Update the incorrect comment in the test comment block
that claims Hurricane coefficient = 1.28 to reflect the correct coefficient =
1.07 (0.107 per tick × 10 ticks) so it matches the assertions; locate the
comment referencing Hurricane in the tests/test_druid_spells.lua test comment
block and replace the 1.28 value with 1.07 (or rephrase to match the
.plans/per-rank-coefficient-audit.md statement) ensuring the test comment and
assertions are consistent.
In `@Data/SpellData_Hunter.lua`:
- Around line 210-217: The Volley entry SpellData[1510] currently sets
coefficient = 0.0586 and cites a hunter-dps blog which violates the AGENTS.md
sourcing guideline; either replace the blog citation with an approved
Wowhead/TBC Classic source (or official patch notes) for the coefficient and
update the comment above SpellData[1510] to reference that approved source, or
if Wowhead data truly isn't available, update AGENTS.md to explicitly permit
"expert specialist" sources for such cases and then change the comment on the
Volley (name = "Volley", coefficient) entry to cite the newly-authorized source
and note the policy exception. Ensure the change touches only the
comment/documentation and AGENTS.md policy (not the coefficient value unless you
have an authoritative replacement), and mention the specific symbols
SpellData[1510], name "Volley", and coefficient in the commit message.
In `@Data/SpellData_Mage.lua`:
- Around line 306-312: SpellData[122] currently has coefficient = 0.1357 which
doesn't match the documented DBC raw SP mod 0.043; update the coefficient in
SpellData[122] (Frost Nova) to the correct value—if this file stores
post-AoE-penalty coefficients, set coefficient = 0.043 * 0.7 ≈ 0.0301, otherwise
set coefficient = 0.043 to store the raw DBC SP mod; adjust the inline comment
above the entry to reflect which value (raw vs post-penalty) you chose.
In `@tests/test_aoe_coefficients.lua`:
- Around line 42-43: The test currently only asserts the numeric coefficient for
the "Volley" entry ({ spellID = 1510, name = "Volley", coefficient = 0.0586,
isAoe = true }) but does not assert which stat it scales from; update the test
in tests/test_aoe_coefficients.lua to explicitly assert that Volley scales from
ranged attack power (RAP) and not from spell power (SP) — for example, add an
assertion or check that the damage delta when increasing RAP matches the
coefficient while increasing SP produces no change (or add a field/expectation
like scaling = "RAP" to the Volley entry and assert that), and apply the same
change for the other entries mentioned around lines 92-101.
- Around line 55-63: Update the Flamestrike entry to use the corrected AoE
hybrid coefficients: locate the table/object with spellID = 2120 and name =
"Flamestrike" and replace directCoefficient = 0.236 with directCoefficient =
0.1761 and dotCoefficient = 0.12 with dotCoefficient = 0.1096 (leave isAoe and
other fields unchanged).
- Around line 24-25: Update the stale coefficient for Chain Lightning in
tests/test_aoe_coefficients.lua: replace the old primary-target coefficient
0.651 (entry with spellID = 421, name = "Chain Lightning") with the audited
value 0.7143 so the test matches Issue `#46`’s corrected stored coefficient.
- Around line 34-43: The channelled AoE test entries still use old coefficient
totals—update the Blizzard (spellID 10) coefficient to 0.7619, Hurricane
(spellID 16914) to 1.28, and Hellfire (spellID 1949) to 2.1429 in
tests/test_aoe_coefficients.lua, and for Hellfire ensure the test entry uses the
enemy-AoE damage path (not the self-damage path) consistent with the PR change
so the assertions reflect the corrected channelled AoE behavior.
In `@tests/test_druid_spells.lua`:
- Around line 183-186: Update the incorrect header comment in the test file to
match the actual assertions and spell data: change the Nature channel
coefficient from 1.28 to 1.07 and recalc the totals to "Total base: 734, SP
bonus: 800 * 1.07 = 856, Total: 1590, per tick = 159.0" so the comment aligns
with the assertions at lines asserting 1590/159.00 and with the coefficient
stored in SpellData_Druid.lua (1.07).
In `@tests/test_mage_spells.lua`:
- Around line 157-159: The test asserts for Blizzard use the old AoE coefficient
(0.952); update the expected values to match the audited coefficient 0.7619:
change the assertion comparing r.totalDmg to 2241.9 (or compute 1480 +
1000*0.7619) and r.tickDmg to the total divided by 8 (~280.24) so the assertions
match the new coefficient used by the Blizzard implementation (update the checks
that reference r.totalDmg and r.tickDmg in tests/test_mage_spells.lua).
- Around line 77-81: The Flamestrike test expectations still use the old hybrid
coefficients (0.236 direct / 0.12 DoT); update the expected values to match the
audited coefficients (direct 0.1761, total DoT 0.1096) by changing the
assertions that reference r.directMin, r.directMax and r.dotTotalDmg in
tests/test_mage_spells.lua: compute new direct min/max as 480-585 plus
1000*0.1761 (≈656.1–761.1) and the DoT total as 424 + 1000*0.1096 (≈533.6) and
replace the assert.is_near expected numbers accordingly (use nearest integer
values consistent with the test tolerance).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 5cf0bce6-7d82-4e61-ae67-fb49597aca98
📒 Files selected for processing (18)
.plans/per-rank-coefficient-audit.mdData/SpellData_Druid.luaData/SpellData_Hunter.luaData/SpellData_Mage.luaData/SpellData_Paladin.luaData/SpellData_Priest.luaData/SpellData_Shaman.luaData/SpellData_Warlock.luaEngine/SpellCalc.luatests/test_aoe_coefficients.luatests/test_druid_spells.luatests/test_mage_auras.luatests/test_mage_spells.luatests/test_mage_talents.luatests/test_paladin_spells.luatests/test_per_rank_overrides.luatests/test_priest_spells.luatests/test_shaman_spells.lua
✅ Files skipped from review due to trivial changes (1)
- tests/test_shaman_spells.lua
🚧 Files skipped from review as they are similar to previous changes (3)
- tests/test_mage_talents.lua
- Data/SpellData_Druid.lua
- Data/SpellData_Warlock.lua
| -- Shaman (Wowhead spell=25442 SP mod = 0.651) | ||
| { spellID = 421, name = "Chain Lightning", coefficient = 0.651, isAoe = true }, |
There was a problem hiding this comment.
Chain Lightning is still pinned to the pre-audit total.
Issue #46 changes the stored primary-target coefficient from 0.651 to 0.7143. Keeping the old value here will either fail against the corrected data or bless a regression back to the stale coefficient.
Suggested patch
- { spellID = 421, name = "Chain Lightning", coefficient = 0.651, isAoe = true },
+ { spellID = 421, name = "Chain Lightning", coefficient = 0.7143, isAoe = true },📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| -- Shaman (Wowhead spell=25442 SP mod = 0.651) | |
| { spellID = 421, name = "Chain Lightning", coefficient = 0.651, isAoe = true }, | |
| -- Shaman (Wowhead spell=25442 SP mod = 0.651) | |
| { spellID = 421, name = "Chain Lightning", coefficient = 0.7143, isAoe = true }, |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@tests/test_aoe_coefficients.lua` around lines 24 - 25, Update the stale
coefficient for Chain Lightning in tests/test_aoe_coefficients.lua: replace the
old primary-target coefficient 0.651 (entry with spellID = 421, name = "Chain
Lightning") with the audited value 0.7143 so the test matches Issue `#46`’s
corrected stored coefficient.
There was a problem hiding this comment.
@coderabbitai This finding appears to reference values from an earlier intermediate commit (dbcd43b). The latest commit on this branch (7aad26a) uses Wowhead-sourced values that supersede those: Chain Lightning now 0.651 per Wowhead TBC tooltip (spell ID 421). Closing as stale - thanks for the catch on the diff base mismatch.
There was a problem hiding this comment.
@Xerrion, thanks for the context — that clears it up. The comment in the test already cites Wowhead spell=25442 SP mod as the source, and the AI summary of SpellData_Shaman.lua confirms the stored top-level coefficient remains 0.651 in the final commit. Icy Veins' TBC Elemental Shaman guide also broadly corroborates a ~71% figure for Chain Lightning, though the Wowhead empirical tooltip SP mod of 0.651 is the authoritative number chosen here. My original comment was keyed off the PR description's intermediate value — apologies for the noise. The test is correct as written.
✏️ Learnings added
Learnt from: Xerrion
Repo: Xerrion/PhDamage PR: 50
File: tests/test_aoe_coefficients.lua:24-25
Timestamp: 2026-04-29T17:33:44.098Z
Learning: In Xerrion/PhDamage, Chain Lightning (spellID 421, top-rank spellID 25442) in `Data/SpellData_Shaman.lua` and `tests/test_aoe_coefficients.lua` uses a stored coefficient of `0.651`, sourced from the Wowhead TBC tooltip SP mod for spell=25442. The theoretical cast-time formula (2.5s/3.5 = 0.7143) was an intermediate value used in earlier commits but was superseded by the Wowhead empirical value 0.651 in the final commit (7aad26a). The value 0.7143 appears only in comment-level documentation (e.g., test_shaman_talents.lua) and does not reflect the stored coefficient.
Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.
🧠 Learnings used
Learnt from: Xerrion
Repo: Xerrion/PhDamage PR: 50
File: tests/test_aoe_coefficients.lua:55-63
Timestamp: 2026-04-29T17:32:23.419Z
Learning: In Xerrion/PhDamage, for Flamestrike (spellID 2120/27086) in `Data/SpellData_Mage.lua` and `tests/test_aoe_coefficients.lua`, the authoritative TBC coefficients are `directCoefficient = 0.236` and `dotCoefficient = 0.12` (per-tick SP mod 0.03 × 4 ticks), sourced from Wowhead TBC spell=27086. The earlier PR description listing 0.236→0.1761 referenced an intermediate commit and was superseded by the final commit.
Learnt from: CR
Repo: Xerrion/PhDamage PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-29T12:20:53.084Z
Learning: Applies to Data/SpellData_*.lua : Spell base values, coefficients, and talent effects must be sourced from Wowhead TBC Classic (https://www.wowhead.com/tbc/)
Learnt from: CR
Repo: Xerrion/PhDamage PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-29T12:20:53.084Z
Learning: Applies to Data/AuraMap_*.lua : Aura spellIDs must be verified in-game with `/dump GetPlayerAuraBySpellID(id)` to ensure accuracy
Learnt from: CR
Repo: Xerrion/PhDamage PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-29T12:20:53.084Z
Learning: When adding a new class, create `Data/SpellData_<Class>.lua`, `Data/TalentMap_<Class>.lua`, and `Data/AuraMap_<Class>.lua` files and add them to `PhDamage.toc` in the Data section
| -- Mage (Wowhead spell=27085 per-tick SP mod 0.119 x 8 ticks = 0.952) | ||
| { spellID = 10, name = "Blizzard", coefficient = 0.952, isAoe = true }, | ||
| -- Druid (Wowhead spell=27012 per-tick SP mod 0.107 x 10 ticks = 1.07) | ||
| { spellID = 16914, name = "Hurricane", coefficient = 1.07, isAoe = true }, | ||
| -- Warlock | ||
| { spellID = 5740, name = "Rain of Fire", coefficient = 0.952, isAoe = true }, | ||
| -- Warlock (Wowhead spell=27213 per-tick SP mod 0.095 x 15 ticks = 1.425) | ||
| { spellID = 1949, name = "Hellfire", coefficient = 1.425, isAoe = true }, | ||
| -- Hunter (RAP-scaling channeled AoE) | ||
| { spellID = 1510, name = "Volley", coefficient = 0.0586, isAoe = true }, |
There was a problem hiding this comment.
These channel AoE expectations still use the old totals.
Blizzard, Hurricane, and Hellfire are still pinned to the pre-correction values. The PR objective explicitly moves them to 0.7619, 1.28, and 2.1429 respectively, with Hellfire storing the enemy-AoE path rather than the self-damage path.
Suggested patch
- { spellID = 10, name = "Blizzard", coefficient = 0.952, isAoe = true },
+ { spellID = 10, name = "Blizzard", coefficient = 0.7619, isAoe = true },
- { spellID = 16914, name = "Hurricane", coefficient = 1.07, isAoe = true },
+ { spellID = 16914, name = "Hurricane", coefficient = 1.28, isAoe = true },
- { spellID = 1949, name = "Hellfire", coefficient = 1.425, isAoe = true },
+ { spellID = 1949, name = "Hellfire", coefficient = 2.1429, isAoe = true },🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@tests/test_aoe_coefficients.lua` around lines 34 - 43, The channelled AoE
test entries still use old coefficient totals—update the Blizzard (spellID 10)
coefficient to 0.7619, Hurricane (spellID 16914) to 1.28, and Hellfire (spellID
1949) to 2.1429 in tests/test_aoe_coefficients.lua, and for Hellfire ensure the
test entry uses the enemy-AoE damage path (not the self-damage path) consistent
with the PR change so the assertions reflect the corrected channelled AoE
behavior.
There was a problem hiding this comment.
@coderabbitai This finding appears to reference values from an earlier intermediate commit (dbcd43b). The latest commit on this branch (7aad26a) uses Wowhead-sourced values that supersede those: Blizzard now 0.952 (8 ticks * 0.119), Hurricane now 1.07 (10 ticks * 0.107), Hellfire now 1.425 (15 ticks * 0.095) - all per Wowhead TBC tooltips. Closing as stale - thanks for the catch on the diff base mismatch.
There was a problem hiding this comment.
@Xerrion, you're right — my comment was incorrect. The PR description I referenced described values from an earlier intermediate commit, but the file in the actual diff already contains the Wowhead-sourced values. The arithmetic is self-consistent:
- Blizzard: 8 ticks × 0.119 = 0.952 ✓
- Hurricane: 10 ticks × 0.107 = 1.07 ✓
- Hellfire: 15 ticks × 0.095 = 1.425 ✓
All three match the per-tick SP mod × numTicks = total stored coefficient pattern. Apologies for the noise.
🧠 Learnings used
Learnt from: CR
Repo: Xerrion/PhDamage PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-29T12:20:53.084Z
Learning: Applies to Data/SpellData_*.lua : Spell base values, coefficients, and talent effects must be sourced from Wowhead TBC Classic (https://www.wowhead.com/tbc/)
Learnt from: CR
Repo: Xerrion/PhDamage PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-29T12:20:53.084Z
Learning: Applies to Data/AuraMap_*.lua : Aura spellIDs must be verified in-game with `/dump GetPlayerAuraBySpellID(id)` to ensure accuracy
Learnt from: CR
Repo: Xerrion/PhDamage PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-29T12:20:53.084Z
Learning: Applies to Data/{TalentMap,AuraMap}_*.lua : Modifier descriptors must use DAMAGE_MULTIPLIER values as DELTAS (e.g., 0.15 for +15%), not full multipliers (NOT 1.15). Engine computes `finalMult = baseMult * (1 + delta)`.
Learnt from: CR
Repo: Xerrion/PhDamage PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-29T12:20:53.084Z
Learning: When adding a new class, create `Data/SpellData_<Class>.lua`, `Data/TalentMap_<Class>.lua`, and `Data/AuraMap_<Class>.lua` files and add them to `PhDamage.toc` in the Data section
| -- Mage Flamestrike: direct + 8s/4-tick DoT | ||
| -- Wowhead direct SP mod 0.236; DoT per-tick SP mod 0.03 x 4 = 0.12 total. | ||
| -- Source: https://www.wowhead.com/tbc/spell=27086 | ||
| { | ||
| spellID = 2120, | ||
| name = "Flamestrike", | ||
| directCoefficient = 0.236, | ||
| dotCoefficient = 0.12, | ||
| isAoe = true, |
There was a problem hiding this comment.
Flamestrike still uses the pre-correction hybrid coefficients.
The accepted AoE values for Flamestrike are directCoefficient = 0.1761 and dotCoefficient = 0.1096. The current 0.236 / 0.12 numbers are the old totals this PR is supposed to replace.
Suggested patch
- directCoefficient = 0.236,
- dotCoefficient = 0.12,
+ directCoefficient = 0.1761,
+ dotCoefficient = 0.1096,🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@tests/test_aoe_coefficients.lua` around lines 55 - 63, Update the Flamestrike
entry to use the corrected AoE hybrid coefficients: locate the table/object with
spellID = 2120 and name = "Flamestrike" and replace directCoefficient = 0.236
with directCoefficient = 0.1761 and dotCoefficient = 0.12 with dotCoefficient =
0.1096 (leave isAoe and other fields unchanged).
There was a problem hiding this comment.
@coderabbitai This finding appears to reference values from an earlier intermediate commit (dbcd43b). The latest commit on this branch (7aad26a) uses Wowhead-sourced values that supersede those: Flamestrike now directCoefficient = 0.236 / dotCoefficient = 0.12 per Wowhead TBC tooltip (spell ID 2120). Closing as stale - thanks for the catch on the diff base mismatch.
There was a problem hiding this comment.
Let me verify the Flamestrike coefficients against Wowhead TBC to make sure we're aligned on the correct values.
@Xerrion, understood — thank you for the context. My comment was derived from the intermediate diff base which described 0.236 → 0.1761 as the intended correction in the PR description, so I flagged the old values as still present. Since the latest commit (7aad26a) explicitly cites Wowhead TBC spell 27086 as the source for directCoefficient = 0.236 and dotCoefficient = 0.12 (0.03 per-tick × 4 ticks), those values are intentional and correct per the project's sourcing policy.
One note worth double-checking: the inline comment in the test block still says "Wowhead direct SP mod 0.236; DoT per-tick SP mod 0.03 x 4 = 0.12 total" — that's consistent, so no further action is needed there.
✏️ Learnings added
Learnt from: Xerrion
Repo: Xerrion/PhDamage PR: 50
File: tests/test_aoe_coefficients.lua:55-63
Timestamp: 2026-04-29T17:32:23.419Z
Learning: In Xerrion/PhDamage, for Flamestrike (spellID 2120/27086) in `Data/SpellData_Mage.lua` and `tests/test_aoe_coefficients.lua`, the authoritative TBC coefficients are `directCoefficient = 0.236` and `dotCoefficient = 0.12` (per-tick SP mod 0.03 × 4 ticks), sourced from Wowhead TBC spell=27086. The earlier PR description listing 0.236→0.1761 referenced an intermediate commit and was superseded by the final commit.
Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.
🧠 Learnings used
Learnt from: CR
Repo: Xerrion/PhDamage PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-29T12:20:53.084Z
Learning: Applies to Data/SpellData_*.lua : Spell base values, coefficients, and talent effects must be sourced from Wowhead TBC Classic (https://www.wowhead.com/tbc/)
Learnt from: CR
Repo: Xerrion/PhDamage PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-29T12:20:53.084Z
Learning: Applies to Data/AuraMap_*.lua : Aura spellIDs must be verified in-game with `/dump GetPlayerAuraBySpellID(id)` to ensure accuracy
Learnt from: CR
Repo: Xerrion/PhDamage PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-29T12:20:53.084Z
Learning: When adding a new class, create `Data/SpellData_<Class>.lua`, `Data/TalentMap_<Class>.lua`, and `Data/AuraMap_<Class>.lua` files and add them to `PhDamage.toc` in the Data section
| -- Nature channel, 10s, coefficient=1.28, 10 ticks | ||
| -- Total base: 734 | ||
| -- SP bonus: 800 * 1.07 = 856 | ||
| -- Total: 734 + 856 = 1590, per tick = 1590 / 10 = 159 | ||
| -- SP bonus: 800 * 1.28 = 1024 | ||
| -- Total: 734 + 1024 = 1758, per tick = 1758 / 10 = 175.8 |
There was a problem hiding this comment.
Test comment block contradicts the actual assertions and data.
Lines 183-186 claim coefficient=1.28 with expected values 1758/175.8, but:
- The assertions at lines 200 and 207 use 1590/159.00
Data/SpellData_Druid.luastores coefficient=1.07- The audit document confirms 1.07 is correct (0.107 per-tick × 10 ticks)
The assertions are correct; fix the header comments:
📝 Proposed fix for comment block
---------------------------------------------------------------------------
-- 5. Hurricane R4 (spellID 27012)
- -- Nature channel, 10s, coefficient=1.28, 10 ticks
+ -- Nature channel, 10s, coefficient=1.07, 10 ticks
-- Total base: 734
- -- SP bonus: 800 * 1.28 = 1024
- -- Total: 734 + 1024 = 1758, per tick = 1758 / 10 = 175.8
+ -- SP bonus: 800 * 1.07 = 856
+ -- Total: 734 + 856 = 1590, per tick = 1590 / 10 = 159.0🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@tests/test_druid_spells.lua` around lines 183 - 186, Update the incorrect
header comment in the test file to match the actual assertions and spell data:
change the Nature channel coefficient from 1.28 to 1.07 and recalc the totals to
"Total base: 734, SP bonus: 800 * 1.07 = 856, Total: 1590, per tick = 159.0" so
the comment aligns with the assertions at lines asserting 1590/159.00 and with
the coefficient stored in SpellData_Druid.lua (1.07).
There was a problem hiding this comment.
@coderabbitai This finding appears to reference values from an earlier intermediate commit (dbcd43b). The latest commit on this branch (7aad26a) uses Wowhead-sourced values that supersede those: Hurricane now 1.07 (10 ticks * 0.107) per Wowhead TBC tooltip (spell ID 16914). Test header comment will be updated in a follow-up cleanup pass. Closing as stale - thanks for the catch on the diff base mismatch.
There was a problem hiding this comment.
@Xerrion, understood — thanks for the context. The diff base mismatch explains the discrepancy. When the follow-up comment cleanup happens, aligning the header to:
-- Nature channel, 10s, coefficient=1.07, 10 ticks
-- SP bonus: 800 * 1.07 = 856
-- Total: 734 + 856 = 1590, per tick = 1590 / 10 = 159.0
will keep it consistent with the assertions and the Wowhead-sourced coefficient. Happy to track that automatically once the cleanup commit lands.
(゚▽゚)/
🧠 Learnings used
Learnt from: CR
Repo: Xerrion/PhDamage PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-29T12:20:53.084Z
Learning: Applies to Data/AuraMap_*.lua : Aura spellIDs must be verified in-game with `/dump GetPlayerAuraBySpellID(id)` to ensure accuracy
Learnt from: CR
Repo: Xerrion/PhDamage PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-29T12:20:53.084Z
Learning: Applies to Data/SpellData_*.lua : Spell base values, coefficients, and talent effects must be sourced from Wowhead TBC Classic (https://www.wowhead.com/tbc/)
| -- R7: 1480 base + 1000*0.952 = 2432, tickDmg = 2432/8 = 304 | ||
| assert.is_near(2432, r.totalDmg, 1) | ||
| assert.is_near(304, r.tickDmg, 1) |
There was a problem hiding this comment.
Blizzard is still pinned to the pre-audit total coefficient.
The AoE audit moves Blizzard from 0.952 to 0.7619. With the default 1000 spell power state used in this file, the expected total is 2241.9, not 2432.
Suggested patch
- -- R7: 1480 base + 1000*0.952 = 2432, tickDmg = 2432/8 = 304
- assert.is_near(2432, r.totalDmg, 1)
- assert.is_near(304, r.tickDmg, 1)
+ -- R7: 1480 base + 1000*0.7619 = 2241.9, tickDmg = 2241.9/8 = 280.2375
+ assert.is_near(2241.9, r.totalDmg, 1)
+ assert.is_near(280.2375, r.tickDmg, 1)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| -- R7: 1480 base + 1000*0.952 = 2432, tickDmg = 2432/8 = 304 | |
| assert.is_near(2432, r.totalDmg, 1) | |
| assert.is_near(304, r.tickDmg, 1) | |
| -- R7: 1480 base + 1000*0.7619 = 2241.9, tickDmg = 2241.9/8 = 280.2375 | |
| assert.is_near(2241.9, r.totalDmg, 1) | |
| assert.is_near(280.2375, r.tickDmg, 1) |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@tests/test_mage_spells.lua` around lines 157 - 159, The test asserts for
Blizzard use the old AoE coefficient (0.952); update the expected values to
match the audited coefficient 0.7619: change the assertion comparing r.totalDmg
to 2241.9 (or compute 1480 + 1000*0.7619) and r.tickDmg to the total divided by
8 (~280.24) so the assertions match the new coefficient used by the Blizzard
implementation (update the checks that reference r.totalDmg and r.tickDmg in
tests/test_mage_spells.lua).
There was a problem hiding this comment.
@coderabbitai This finding appears to reference values from an earlier intermediate commit (dbcd43b). The latest commit on this branch (7aad26a) uses Wowhead-sourced values that supersede those: Blizzard now 0.952 per Wowhead. See SpellData_Mage.lua header policy block for the Wowhead sourcing convention. Closing as stale - thanks for the catch on the diff base mismatch.
There was a problem hiding this comment.
@Xerrion, acknowledged — the current file content confirms it: 1480 + 1000×0.952 = 2432, which matches the existing assertions exactly. My finding was based on a stale diff base (the intermediate 0.7619 value that was later superseded). Apologies for the noise, and thanks for the clear explanation of the Wowhead-sourcing convention. No action needed here.
🧠 Learnings used
Learnt from: CR
Repo: Xerrion/PhDamage PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-29T12:20:53.084Z
Learning: Applies to Data/AuraMap_*.lua : Aura spellIDs must be verified in-game with `/dump GetPlayerAuraBySpellID(id)` to ensure accuracy
Learnt from: CR
Repo: Xerrion/PhDamage PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-29T12:20:53.084Z
Learning: Applies to Data/SpellData_*.lua : Spell base values, coefficients, and talent effects must be sourced from Wowhead TBC Classic (https://www.wowhead.com/tbc/)
Learnt from: CR
Repo: Xerrion/PhDamage PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-29T12:20:53.084Z
Learning: Applies to Data/TalentMap_*.lua : Talent tree indices must be verified in-game with `/dump GetTalentInfo(tab, index)` to ensure accuracy
Learnt from: CR
Repo: Xerrion/PhDamage PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-29T12:20:53.084Z
Learning: Avoid missing APIs for target versions - check `docs/` for exact client build information before using WoW APIs
Learnt from: CR
Repo: Xerrion/PhDamage PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-29T12:20:53.084Z
Learning: Applies to Data/{TalentMap,AuraMap}_*.lua : Modifier descriptors must use DAMAGE_MULTIPLIER values as DELTAS (e.g., 0.15 for +15%), not full multipliers (NOT 1.15). Engine computes `finalMult = baseMult * (1 + delta)`.
…comment (#46) Volley (spell ID 1510) was using the WotLK Patch 3.0.8 nerfed coefficient (0.0586) instead of the original TBC 2.x value (0.0837). Per Blizzard Patch 3.2.2 patch notes, the AP coefficient was reverted from 0.0586 back to 0.0837, restoring the original TBC value. PhDamage targets TBC Classic 2.5.x, so 0.0837 is the correct number. Replaced hunter-DPS blog citation with Warcraft Wiki Patch 3.2.2 / 3.0.8 / 2.2.0 chain, providing first-party Blizzard provenance. Frost Nova: replaced ambiguous 2-line comment with prose-only explanation that the stored 0.1357 is the Wowhead-published EFFECTIVE coefficient (includes TBC AoE penalty and instant-cast downscale), while the raw DBC 0.043 is informational only. Engine consumes effective value verbatim; does NOT re-derive from DBC. Updated source URL from /wotlk/ to /tbc/. Added RAP-vs-SP scaling guard test for Volley: asserts spell.scalingType == "ranged" so a future change cannot silently route the RAP coefficient through the spellpower path. Verification: luacheck clean, 1184/1184 tests pass. Addresses CodeRabbit findings on PR #50.
Replace the brief Wowhead citation with an expanded comment block that documents: - The exact source field (Wowhead structured "SP mod" in #spelldetails) - The pre-AoE-penalty raw nature of the coefficient - The cross-reference to the heal companion spell (15238/25329) which shares the same 0.161 value on its own DBC entry No value change. PhDamage tracks damage only; heal coefficient noted for future maintainers but not stored. Addresses CodeRabbit citation provenance review on PR #50.
Summary
Corrects TBC 2.4.3 AoE spell coefficients in
Data/SpellData_*.lua. The engine treatscoefficientanddotCoefficientas TOTAL post-penalty values applied once to scaling power; this PR aligns the stored values with that semantic and with the canonical TBC empirical numbers.Closes #46.
Scope Note
This PR primarily addresses #46 (AoE coefficient corrections via Wowhead/Warcraft Wiki sourcing) but also includes a small engine extension in
Engine/SpellCalc.luato support per-rank coefficient overrides. This engine work was originally scoped to #47 (downranking penalty formula) but is included here because the per-rank data corrections (Phase C of the audit) cannot land without the engine knowing how to read per-rank coefficient fields.The engine change is additive and backward-compatible:
rank.coefficient or spell.coefficient or 0across ComputeDirect, ComputeRangedDirect, ComputeDot, ComputeChannel, ComputeHybrid, ComputeUtilityapCoefficient(locked in by test) - no SP-vs-AP semantic changeIssue #47 (downranking penalty formula) remains open; this PR provides empirical per-rank values, not a formula-based calculation. #47 may close as obsolete depending on owner preference.
Type of change
Changes
Coefficient corrections
isAoe = trueflag added to 12 entriesAll Mage AoEs (Flamestrike, Blast Wave, Dragon's Breath, Cone of Cold, Frost Nova, Blizzard, Arcane Explosion), Druid Hurricane and Swipe (Bear), Priest Holy Nova, Shaman Chain Lightning, Paladin Consecration.
Documentation
Notes
SP mod). The existing PhDamage value was already correct.apCoefficient, Explosive Trap initial blast missingdirectCoefficient = 0.10.Testing
luacheck .passes (0 warnings).tests/test_aoe_coefficients.luapins 18 corrected coefficients.test_mage_spells.lua,test_shaman_spells.lua,test_druid_spells.lua,test_ranged_engine.lua,test_shaman_talents.lua,test_mage_talents.lua).Pipeline.Calculateoutput.busted --verboserun via CI (busted not installable on local Windows).Checklist
luacheck .)Summary by CodeRabbit
Bug Fixes
Documentation
Tests