-
Notifications
You must be signed in to change notification settings - Fork 141
/
Copy pathinferno.go
183 lines (152 loc) · 5.54 KB
/
inferno.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
package warlock
import (
"math"
"time"
"github.com/wowsims/wotlk/sim/core"
"github.com/wowsims/wotlk/sim/core/proto"
"github.com/wowsims/wotlk/sim/core/stats"
)
func (warlock *Warlock) registerInfernoSpell() {
summonInfernalAura := warlock.RegisterAura(core.Aura{
Label: "Summon Infernal",
ActionID: core.ActionID{SpellID: 1122},
Duration: time.Second * 60,
})
warlock.Inferno = warlock.RegisterSpell(core.SpellConfig{
ActionID: core.ActionID{SpellID: 1122},
SpellSchool: core.SpellSchoolFire,
ProcMask: core.ProcMaskEmpty,
Flags: core.SpellFlagAPL,
ManaCost: core.ManaCostOptions{
BaseCost: 0.8,
},
Cast: core.CastConfig{
DefaultCast: core.Cast{
CastTime: time.Millisecond * 1500,
GCD: core.GCDDefault,
},
CD: core.Cooldown{
Timer: warlock.NewTimer(),
Duration: time.Second * time.Duration(600),
},
},
DamageMultiplier: 1,
ThreatMultiplier: 1,
CritMultiplier: warlock.SpellCritMultiplier(1, 0),
ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
// TODO: add fire spell damage
baseDmg := (200 + 1*spell.SpellPower()) * sim.Encounter.AOECapMultiplier()
for _, aoeTarget := range sim.Encounter.TargetUnits {
spell.CalcAndDealDamage(sim, aoeTarget, baseDmg, spell.OutcomeMagicHitAndCrit)
}
if warlock.Pet != nil {
warlock.Pet.Disable(sim)
}
warlock.Infernal.EnableWithTimeout(sim, warlock.Infernal, time.Second*60)
// fake aura to show duration
summonInfernalAura.Activate(sim)
},
})
}
type InfernalPet struct {
core.Pet
owner *Warlock
immolationAura *core.Spell
}
func (warlock *Warlock) NewInfernal() *InfernalPet {
statInheritance := func(ownerStats stats.Stats) stats.Stats {
ownerHitChance := math.Floor(ownerStats[stats.SpellHit] / core.SpellHitRatingPerHitChance)
// TODO: account for fire spell damage
return stats.Stats{
stats.Stamina: ownerStats[stats.Stamina] * 0.75,
stats.Intellect: ownerStats[stats.Intellect] * 0.3,
stats.Armor: ownerStats[stats.Armor] * 0.35,
stats.AttackPower: ownerStats[stats.SpellPower] * 0.57,
stats.SpellPower: ownerStats[stats.SpellPower] * 0.15,
stats.SpellPenetration: ownerStats[stats.SpellPenetration],
stats.MeleeHit: ownerHitChance * core.MeleeHitRatingPerHitChance,
stats.SpellHit: ownerHitChance * core.SpellHitRatingPerHitChance,
stats.Expertise: (ownerStats[stats.SpellHit] / core.SpellHitRatingPerHitChance) *
PetExpertiseScale * core.ExpertisePerQuarterPercentReduction,
}
}
infernal := &InfernalPet{
Pet: core.NewPet("Infernal", &warlock.Character, stats.Stats{
stats.Strength: 331,
stats.Agility: 113,
stats.Stamina: 361,
stats.Intellect: 65,
stats.Spirit: 109,
stats.Mana: 0,
stats.MeleeCrit: 3.192 * core.CritRatingPerCritChance,
}, statInheritance, false, false),
owner: warlock,
}
infernal.AddStatDependency(stats.Strength, stats.AttackPower, 2)
infernal.AddStat(stats.AttackPower, -20)
// infernal is classified as a warrior class, so we assume it gets the
// same agi crit coefficient
infernal.AddStatDependency(stats.Agility, stats.MeleeCrit, core.CritRatingPerCritChance*1/62.5)
// command doesn't apply to infernal
if warlock.Race == proto.Race_RaceOrc {
infernal.PseudoStats.DamageDealtMultiplier /= 1.05
}
infernal.EnableAutoAttacks(infernal, core.AutoAttackOptions{
MainHand: core.Weapon{
BaseDamageMin: 330,
BaseDamageMax: 494.9,
SwingSpeed: 2,
CritMultiplier: 2,
},
AutoSwingMelee: true,
})
infernal.AutoAttacks.MHConfig().DamageMultiplier *= 3.2
core.ApplyPetConsumeEffects(&infernal.Character, warlock.Consumes)
warlock.AddPet(infernal)
return infernal
}
func (infernal *InfernalPet) GetPet() *core.Pet {
return &infernal.Pet
}
func (infernal *InfernalPet) Initialize() {
felarmor_coef := core.TernaryFloat64(infernal.owner.Options.Armor == proto.Warlock_Options_FelArmor,
0.3*(1+float64(infernal.owner.Talents.DemonicAegis)*0.1), 0)
infernal.immolationAura = infernal.RegisterSpell(core.SpellConfig{
ActionID: core.ActionID{SpellID: 20153},
SpellSchool: core.SpellSchoolFire,
ProcMask: core.ProcMaskEmpty,
DamageMultiplier: 1,
ThreatMultiplier: 1,
Dot: core.DotConfig{
IsAOE: true,
Aura: core.Aura{
Label: "Immolation",
ActionID: core.ActionID{SpellID: 19483},
},
NumberOfTicks: 31,
TickLength: time.Second * 2,
AffectedByCastSpeed: false,
OnTick: func(sim *core.Simulation, target *core.Unit, dot *core.Dot) {
// TODO: use highest SP amount of all schools
// base formula is 25 + (lvl-50)*0.5 * Warlock_SP*0.2
// note this scales with the warlocks SP, NOT with the pets
// we remove all the spirit based sp since immolation aura doesn't benefit from it, see
// JamminL/wotlk-classic-bugs#329
coef := core.TernaryFloat64(infernal.owner.GlyphOfLifeTapAura.IsActive(), 0.2, 0) + felarmor_coef
warlockSP := infernal.owner.Unit.GetStat(stats.SpellPower) - infernal.owner.Unit.GetStat(stats.Spirit)*coef
baseDmg := (40 + warlockSP*0.2) * sim.Encounter.AOECapMultiplier()
for _, aoeTarget := range sim.Encounter.TargetUnits {
dot.Spell.CalcAndDealDamage(sim, aoeTarget, baseDmg, dot.Spell.OutcomeMagicHit)
}
},
},
ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
spell.AOEDot().Apply(sim)
},
})
}
func (infernal *InfernalPet) Reset(_ *core.Simulation) {
}
func (infernal *InfernalPet) ExecuteCustomRotation(sim *core.Simulation) {
infernal.immolationAura.Cast(sim, nil)
}