wowlab_engine_content/hooks/enhancement_shaman/
guardians.rs1use wowlab_engine_combat::GuardianOps as _;
2use wowlab_engine_combat::AuraOps as _;
3use wowlab_engine_combat::{GuardianAbility, GuardianEvent, GuardianSpec, HookCtx};
4
5use crate::generated::specs::enhancement_shaman::AURA_MAELSTROM_WEAPON;
6
7use super::config::enhancement_config;
8
9const FERAL_SPIRIT_DURATION_MS: u32 = 8_000;
10const FERAL_SPIRIT_SWING_MS: u32 = 1_500;
11
12fn feral_spirit_action(
13 ctx: &mut HookCtx<'_>,
14 _event: GuardianEvent,
15) {
16 ctx.apply_aura(AURA_MAELSTROM_WEAPON.raw());
17}
18
19pub(super) fn summon_feral_spirit(ctx: &mut HookCtx<'_>, tag: u32, buff: u8) {
20 if !enhancement_config(ctx).feral_spirit {
21 return;
22 }
23
24 ctx.apply_aura(buff);
25 let _ = ctx.summon_guardian(
26 GuardianSpec::new_inheriting_owner(tag, FERAL_SPIRIT_DURATION_MS).ability(
27 GuardianAbility::new(FERAL_SPIRIT_SWING_MS, feral_spirit_action)
28 .first_action_delay(FERAL_SPIRIT_SWING_MS),
29 ),
30 );
31}