fix(Core/Spells): Fire CAST proc before HIT/FINISH for instant spells#25647
Open
blinkysc wants to merge 2 commits intoazerothcore:masterfrom
Open
fix(Core/Spells): Fire CAST proc before HIT/FINISH for instant spells#25647blinkysc wants to merge 2 commits intoazerothcore:masterfrom
blinkysc wants to merge 2 commits intoazerothcore:masterfrom
Conversation
Instant spells fired CAST procs after handle_immediate, so an aura applied during HIT (e.g. Arcane Potency from a mid-AoE Clearcasting) was consumed by the same cast's trailing CAST proc. Cherry-picked from TrinityCore commit 1de6f59ffc. Co-authored-by: Shauren <shauren.trinity@gmail.com>
Its three modifiers (DURATION, ACTIVATION_TIME, COST) are applied inside handle_immediate, after CAST fires. Consumption on FINISH catches them once m_appliedMods is fully populated.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes Proposed:
This PR proposes changes to:
For instant spells, HIT and FINISH happen inside
handle_immediate(), so CAST procs were firing last - the actual order wasHIT -> FINISH -> CAST. An aura applied during HIT (e.g. Arcane Potency from a Clearcasting that procs mid-AoE on Arcane Explosion) was then consumed by the same cast's trailing CAST proc, never benefiting the player.This moves the CAST proc block to before the immediate/delayed branch in
Spell::_cast()so the spec-correct orderCAST -> HIT -> FINISHis restored.m_appliedModsis already populated byHandleLaunchPhase(viaApplyModToSpellandSpellDoneCritChance), soPROC_ATTR_REQ_SPELLMOD-based consumption (Hot Streak, Brain Freeze, Arcane Potency, etc.) still drops charges correctly.Missile Barrage (44401) is the one outlier: its three modifiers (
SPELLMOD_DURATIONeffect 0,SPELLMOD_ACTIVATION_TIMEeffect 1,SPELLMOD_COSTeffect 2) are all applied insidehandle_immediate(channel start and periodic-aura setup), so consumption on CAST would fail. The accompanying SQL update moves itsSpellPhaseMaskfrom CAST (1) to FINISH (4) so the charge drops oncem_appliedModsis fully populated.I audited every other
spell_procrow withSpellPhaseMask = CASTandAttributesMask & PROC_ATTR_REQ_SPELLMOD(12043, 12536, 16166, 16246, 16870, 17116, 17941, 18708, 34936, 47383, 48108, 53817, 54274/76/77, 57529/31, 57761, 71162/65) - all useSPELLMOD_CASTING_TIME,SPELLMOD_COST,SPELLMOD_GLOBAL_COOLDOWN,SPELLMOD_DAMAGE, orSPELLMOD_CRITICAL_CHANCE, all of which are applied either inSpell::prepare()or inHandleLaunchPhase(i.e. before the new CAST proc location). Missile Barrage is the only entry that needed a phase change.AI-assisted Pull Requests
Important
While the use of AI tools when preparing pull requests is not prohibited, contributors must clearly disclose when such tools have been used and specify the model involved.
Contributors are also expected to fully understand the changes they are submitting and must be able to explain and justify those changes when requested by maintainers.
Issues Addressed:
SOURCE:
The changes have been validated through:
1de6f59ffcby Shauren (credited as co-author). The commit is in TCmasterbut has not yet been cherry-picked to TC's3.3.5branch.Tests Performed:
This PR has been:
How to Test the Changes:
Full regression checklist
A complete list of every CAST-phase
spell_procentry (78 rows: class talents, set bonuses, trinkets, encounter procs) is available here for testers to work through:https://gist.github.com/blinkysc/5e6c0db909734dfc795e167eaa8cfabb
Known Issues and TODO List:
spell_linked_spell, would ideally consume at channel start.