32 lines
5.0 KiB
Markdown
32 lines
5.0 KiB
Markdown
# WoW Death Knight Spell Deflection
|
||
|
||
## Source and chosen behavior
|
||
|
||
Spell Deflection is the next Death Knight mechanic selected for implementation. The generated local talent node is `talent-2018`, with ranks 1–3 at spell IDs `49145`, `49495`, and `49497`. The generated rank descriptions state that the proc chance equals the Death Knight's Parry chance and that it applies to direct-damage spells. Their DBC-backed effect rows contain `effectType: 6`, `auraType: 69`, and `miscValue: 126`; the rank values are 15%, 30%, and 45%.
|
||
|
||
Aura type 69 is `SPELL_AURA_SCHOOL_ABSORB` in the 3.3.5 aura definitions, so the generated effect is a school absorb, not a generic damage-taken modifier. School mask 126 covers the non-physical schools. The helper therefore treats the effect as a one-hit partial absorb of the rank percentage after the proc roll succeeds. The generated rank rows have no recovery time or charges. The tooltip and DBC rows do not specify how fractional damage is rounded; this simulator floors the absorbed amount to whole damage points. That rounding rule is a simulator choice, not a claim about stock 3.3.5a server rounding.
|
||
|
||
The proc chance is read from the defender's current derived Parry chance at hit time. It is not a saved or fixed talent profile chance: the local description says “equal to your Parry chance,” and the 3.3.5 AzerothCore handler uses the target's current `GetUnitParryChance()` as corroborating implementation evidence. The handler also checks direct spell damage and absorbs the rank percentage of that hit. No WotLKDB fallback was needed for the implementation values or eligibility description.
|
||
|
||
## Trigger, timing, and exclusions
|
||
|
||
`combatStore.ts` applies the effect on both player and generated-companion incoming enemy spell hits. The hook runs after normal hit resolution, resistance and aura-based incoming reductions, and before Mage Frost Warding, Soul Link transfer, named shields, and health loss. It rolls once for each resolved hit, using the defender's current derived Parry chance. On success, it absorbs 15%, 30%, or 45% of the remaining hit at the learned rank. The absorbed amount is included in the incoming combat event's `absorbed` field, and the reduced damage is passed to later mitigation and absorb stages.
|
||
|
||
Only a landed enemy attack represented as a direct spell hit with a non-physical school is eligible. Physical attacks and periodic damage ticks are excluded. A zero-damage result, miss, or invalid roll cannot proc. The DBC school mask is retained in the profile and checked by the helper, so a physical-only school cannot accidentally use the absorb. School masks are derived from the incoming combat school's 3.3.5 bit (`physical` 1; `holy` 2; `fire` 4; `nature` 8; `frost` 16; `shadow` 32; `arcane` 64).
|
||
|
||
The generated local enemy attack model represents spell attacks as discrete hit events and currently has no periodic incoming damage-tick event for this hook to consume. If periodic enemy spells are added later, their event type must remain distinct from direct hits. The generic `damagePlayer(amount, school)` adapter also lacks delivery/direct-hit context, so it does not invoke this talent. The AzerothCore handler suppresses the proc while the defender is casting a non-melee spell or controlled; that extra condition is not included because it is a fork-specific script gate and has not been verified against stock TrinityCore 3.3.5 behavior. It remains a source difference to revisit if stock-server behavior is later established.
|
||
|
||
## Simulator limits and implementation status
|
||
|
||
Generated spell rows provide the school absorb amount and school mask but do not encode the dynamic “chance equals Parry” calculation as a numeric proc chance; the helper uses the tooltip's dynamic rule and live combat stats. Incoming enemy hits do not currently carry a dedicated spell direct-vs-periodic subtype, so the runtime adapter treats the model's discrete non-physical spell hit event as direct. A future periodic damage event must be marked separately before integration.
|
||
|
||
Focused helper coverage verifies the generated rank amounts, school mask, live-Parry proc chance at 0%, threshold, and 100% edges, direct-hit and physical-school exclusions, and the simulator's whole-point partial-absorb rounding. Player and generated-companion integration coverage compares baseline damage with rank 3 and verifies the logged absorb amount.
|
||
|
||
## Local references
|
||
|
||
- Generated talent node and rank rows: `src/game/wow335Talents.generated.ts` (`talent-2018`).
|
||
- Isolated profile, proc, and absorb helper: `src/game/wow335DeathKnightSpellDeflectionRuntime.ts`.
|
||
- Focused helper and combat regressions: `src/game/wow335DeathKnightSpellDeflectionRuntime.test.ts`, `src/game/wow335DeathKnightSpellDeflection.integration.test.ts`.
|
||
- 3.3.5 aura type 69 definition in the local AzerothCore reference checkout: `wow-pvt-server-backups-2/azerothcore-wotlk/src/server/game/Spells/Auras/SpellAuraDefines.h`.
|
||
- AzerothCore's corroborating Spell Deflection absorb handler: `wow-pvt-server-backups-2/azerothcore-wotlk/src/server/scripts/Spells/spell_dk.cpp`.
|