Skip to main content

wowlab_engine_content/hooks/enhancement_shaman/
guardians.rs

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