-
Notifications
You must be signed in to change notification settings - Fork 32
/
kill_command.go
76 lines (64 loc) · 1.95 KB
/
kill_command.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package hunter
import (
"time"
"github.com/wowsims/sod/sim/core"
"github.com/wowsims/sod/sim/core/proto"
)
func (hunter *Hunter) registerKillCommand() {
if hunter.pet == nil || !hunter.HasRune(proto.HunterRune_RuneLegsKillCommand) {
return
}
actionID := core.ActionID{SpellID: 409379}
hasCatlikeReflexes := hunter.HasRune(proto.HunterRune_RuneHelmCatlikeReflexes)
cooldownModifier := 1.0
if hasCatlikeReflexes {
cooldownModifier *= 0.5
}
// For tracking in timeline
hunterAura := hunter.RegisterAura(core.Aura{
Label: "Kill Command",
ActionID: actionID,
Duration: time.Second * 30,
MaxStacks: 3,
})
hunter.pet.killCommandAura = hunter.pet.RegisterAura(core.Aura{
Label: "Kill Command",
ActionID: actionID,
Duration: time.Second * 30,
MaxStacks: 3,
OnSpellHitDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
// TODO: Make it only work on Claw/Bite after pet abilities refactor
if spell.ProcMask.Matches(core.ProcMaskMeleeSpecial | core.ProcMaskSpellDamage) {
aura.RemoveStack(sim)
hunterAura.RemoveStack(sim)
}
},
})
hunter.KillCommand = hunter.RegisterSpell(core.SpellConfig{
ActionID: actionID,
SpellSchool: core.SpellSchoolPhysical,
Flags: core.SpellFlagNoOnCastComplete,
ManaCost: core.ManaCostOptions{
BaseCost: 0.015,
},
Cast: core.CastConfig{
CD: core.Cooldown{
Timer: hunter.NewTimer(),
Duration: time.Second * time.Duration(60*cooldownModifier),
},
},
ExtraCastCondition: func(sim *core.Simulation, target *core.Unit) bool {
return hunter.pet.IsEnabled()
},
ApplyEffects: func(sim *core.Simulation, _ *core.Unit, _ *core.Spell) {
hunter.pet.killCommandAura.Activate(sim)
hunter.pet.killCommandAura.SetStacks(sim, 3)
hunterAura.Activate(sim)
hunterAura.SetStacks(sim, 3)
},
})
hunter.AddMajorCooldown(core.MajorCooldown{
Spell: hunter.KillCommand,
Type: core.CooldownTypeDPS,
})
}