100 lines
5.7 KiB
Markdown
100 lines
5.7 KiB
Markdown
# Disarm weapon contribution audit — 2026-10-05
|
||
|
||
This pass adds reusable character-side projections for item-dependent auras,
|
||
spell-selected weapon channels, and temporary weapon damage under the
|
||
source-backed Ascension/Epoch Disarm tags. The helpers are in
|
||
`src/game/enemyDisarmRuntime.ts`; the checks are in
|
||
`src/game/enemyDisarmRuntime.test.ts`.
|
||
|
||
## Core behavior verified
|
||
|
||
In the read-only historical AzerothCore tree, `SpellAuraEffects.cpp` maps Aura
|
||
67/254/278 to main-hand/off-hand/ranged flags. Applying Disarm recalculates the
|
||
player's item-dependent auras and weapon damage while retaining equipped item
|
||
stats. Removing Disarm clears the flag and recalculates the affected channel's
|
||
weapon auras. Creature spells use `Spell::CheckItems` to reject damage-class
|
||
melee/ranged spells whose selected attack type is unavailable.
|
||
|
||
`Player::HasItemFitToSpellRequirements` searches other usable equipped items
|
||
for a class/subclass/inventory-mask match. Passive item-requirement auras are
|
||
removed when Disarm leaves no matching usable weapon. The core keeps an active
|
||
nonpassive aura spell through the specific aura-cast exception. Separately,
|
||
`UpdateWeaponDependentAuras` recalculates weapon-aura contributions per attack
|
||
type, and `CheckAttackFitToAuraRequirement` tests the item in that channel.
|
||
|
||
`Spell` selects main-hand for a melee damage-class spell by default and
|
||
off-hand when AttributesEx3 `0x01000000` is set. A ranged damage-class spell
|
||
uses ranged when the core classifies it as a ranged-weapon spell; that decision
|
||
uses AttributesEx `USES_RANGED_SLOT` (`0x00000002`), the ranged weapon subclass
|
||
mask, or a Hunter-family exception. Other ranged damage-class spells use the
|
||
main-hand attack type. The player item check does not impose a blanket gate on
|
||
all physical damage-class casts.
|
||
|
||
The source was read from:
|
||
|
||
- `../wow-pvt-server-backups-2/azerothcore-wotlk/src/server/game/Spells/Auras/SpellAuraEffects.cpp`
|
||
- `../wow-pvt-server-backups-2/azerothcore-wotlk/src/server/game/Entities/Player/Player.cpp`
|
||
- `../wow-pvt-server-backups-2/azerothcore-wotlk/src/server/game/Spells/Spell.cpp`
|
||
- `../wow-pvt-server-backups-2/azerothcore-wotlk/src/server/game/Spells/SpellInfo.cpp`
|
||
- `../wow-pvt-server-backups-2/azerothcore-wotlk/src/server/shared/SharedDefines.h`
|
||
- `../wow-pvt-server-backups-2/azerothcore-wotlk/src/server/game/Entities/Item/ItemTemplate.h`
|
||
|
||
## Helper contracts
|
||
|
||
`enemyDisarmItemDependentAuraSuppressionIds` returns source-caster-owned
|
||
passive aura instance IDs whose matching equipped weapon slots are all
|
||
disabled. It preserves nonpassive aura spells and the stored aura state, so a
|
||
caller can build an effective combat aura view that restores the passive
|
||
contribution automatically when Disarm expires.
|
||
|
||
`enemyDisarmAurasForWeaponChannel` creates the attack-type-specific aura view.
|
||
It keeps an item-requirement aura contribution only when the selected usable
|
||
weapon matches the aura requirement, and suppresses it while that channel is
|
||
disarmed. This allows an enabled matching off-hand contribution to remain
|
||
available while the main-hand calculation uses the unarmed profile.
|
||
|
||
`enemyDisarmAbilityWeaponChannel` mirrors the source spell attack-type choice.
|
||
`enemyDisarmAdjustedAbilityWeapon` returns the 1–2 damage, 2-second unarmed
|
||
main-hand profile, no weapon for disabled off-hand/ranged channels, or the
|
||
unchanged weapon for other channels. Feral main-hand weapon stats remain
|
||
unchanged. `enemyDisarmBlocksNpcWeaponAbility` exposes the NPC-only selected
|
||
damage-class channel gate separately from player ability requirement checks.
|
||
|
||
## Integration boundary and limits
|
||
|
||
The party runtime uses `effectiveActorAuras` for global passive suppression and
|
||
channel-specific weapon-aura views. Party ability casts retain the player-style
|
||
equipped-item requirement gate, and generic amount calculations receive the
|
||
member's active Disarm channel set so source-selected weapon contribution can
|
||
be adjusted without rejecting unrelated physical casts. Party main-hand autos
|
||
use the source 1–2 / 2-second WoW punch; the dual-wield integration case confirms
|
||
an enabled off-hand still contributes. The party auto path also asks the native
|
||
Runewaker helper for a verified unarmed main-hand profile and cadence, while
|
||
ranged autos retain their existing channel behavior. Periodic party effects
|
||
are applied through `CombatStore.applyTimedActorEffect`; its native snapshot
|
||
path checks the source actor's active main-hand channel before passing the
|
||
verified profile into the native periodic calculator.
|
||
|
||
Generated party characters use the player's class item-requirement rules. The
|
||
hostile creature `Spell::CheckItems` channel gate remains available as a
|
||
separate helper and is not imposed on party class builds. The centralized
|
||
combat store owns the player and party passive-aura projection and generic
|
||
ability weapon contribution. The simulator still cannot infer item durability
|
||
or equipment eligibility missing from its resolved loadout.
|
||
|
||
Native Runewaker unarmed main-hand damage is implemented only when the active
|
||
five training profile is source-verifiable. Its sidecar does not model
|
||
`Main_DMG_Per`, `DMG_AllWeapon`, `DMG_Unarmed`, `AtkSpeed`, `Main_ATKSpeed_Per`,
|
||
`AttackSpeed_AllWeapon`, or `AttackSpeed_Unarmed`; those rate channels remain an
|
||
explicit neutral-rate boundary. Unsupported profiles keep their existing
|
||
fallback behavior rather than borrowing the WoW punch profile.
|
||
|
||
## Focused validation
|
||
|
||
`npx vitest run src/game/enemyWeaponDebuffs.test.ts
|
||
src/game/enemyDisarmRuntime.test.ts
|
||
src/game/enemyDisarmRuntime.integration.test.ts
|
||
src/game/romNativeDisarm.test.ts` passes: 4 files, 21 tests. The party integration
|
||
tests cover player and companion cast handling, an enabled party off-hand, native
|
||
main-hand damage/cadence, and the existing ranged Scout channel behavior.
|