-
Notifications
You must be signed in to change notification settings - Fork 139
/
talents.go
649 lines (565 loc) · 19.7 KB
/
talents.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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
package rogue
import (
"math"
"time"
"github.com/wowsims/wotlk/sim/core"
"github.com/wowsims/wotlk/sim/core/proto"
"github.com/wowsims/wotlk/sim/core/stats"
)
func (rogue *Rogue) ApplyTalents() {
rogue.applyMurder()
rogue.applySlaughterFromTheShadows()
rogue.applySealFate()
rogue.applyWeaponSpecializations()
rogue.applyCombatPotency()
rogue.applyFocusedAttacks()
rogue.applyInitiative()
rogue.AddStat(stats.Dodge, core.DodgeRatingPerDodgeChance*2*float64(rogue.Talents.LightningReflexes))
rogue.PseudoStats.MeleeSpeedMultiplier *= []float64{1, 1.03, 1.06, 1.10}[rogue.Talents.LightningReflexes]
rogue.AddStat(stats.Parry, core.ParryRatingPerParryChance*2*float64(rogue.Talents.Deflection))
rogue.AddStat(stats.MeleeCrit, core.CritRatingPerCritChance*1*float64(rogue.Talents.Malice))
rogue.AddStat(stats.MeleeHit, core.MeleeHitRatingPerHitChance*1*float64(rogue.Talents.Precision))
rogue.AddStat(stats.SpellHit, core.SpellHitRatingPerHitChance*1*float64(rogue.Talents.Precision))
rogue.AddStat(stats.Expertise, core.ExpertisePerQuarterPercentReduction*5*float64(rogue.Talents.WeaponExpertise))
rogue.AddStat(stats.ArmorPenetration, core.ArmorPenPerPercentArmor*3*float64(rogue.Talents.SerratedBlades))
rogue.AutoAttacks.OHConfig().DamageMultiplier *= rogue.dwsMultiplier()
if rogue.Talents.Deadliness > 0 {
rogue.MultiplyStat(stats.AttackPower, 1.0+0.02*float64(rogue.Talents.Deadliness))
}
if rogue.Talents.SavageCombat > 0 {
rogue.MultiplyStat(stats.AttackPower, 1.0+0.02*float64(rogue.Talents.SavageCombat))
}
if rogue.Talents.SinisterCalling > 0 {
rogue.MultiplyStat(stats.Agility, 1.0+0.03*float64(rogue.Talents.SinisterCalling))
}
rogue.registerOverkill()
rogue.registerHungerForBlood()
rogue.registerColdBloodCD()
rogue.registerBladeFlurryCD()
rogue.registerAdrenalineRushCD()
rogue.registerKillingSpreeCD()
rogue.registerShadowstepCD()
rogue.registerShadowDanceCD()
rogue.registerMasterOfSubtletyCD()
rogue.registerPreparationCD()
rogue.registerPremeditation()
rogue.registerGhostlyStrikeSpell()
rogue.registerDirtyDeeds()
rogue.registerHonorAmongThieves()
}
// dwsMultiplier returns the offhand damage multiplier
func (rogue *Rogue) dwsMultiplier() float64 {
return 1 + 0.1*float64(rogue.Talents.DualWieldSpecialization)
}
func getRelentlessStrikesSpellID(talentPoints int32) int32 {
if talentPoints == 1 {
return 14179
}
return 58420 + talentPoints
}
func (rogue *Rogue) makeFinishingMoveEffectApplier() func(sim *core.Simulation, numPoints int32) {
ruthlessnessMetrics := rogue.NewComboPointMetrics(core.ActionID{SpellID: 14161})
relentlessStrikesMetrics := rogue.NewEnergyMetrics(core.ActionID{SpellID: getRelentlessStrikesSpellID(rogue.Talents.RelentlessStrikes)})
var mayhemMetrics *core.ResourceMetrics
if rogue.HasSetBonus(Tier10, 4) {
mayhemMetrics = rogue.NewComboPointMetrics(core.ActionID{SpellID: 70802})
}
return func(sim *core.Simulation, numPoints int32) {
if t := rogue.Talents.Ruthlessness; t > 0 {
if sim.RandomFloat("Ruthlessness") < 0.2*float64(t) {
rogue.AddComboPoints(sim, 1, ruthlessnessMetrics)
}
}
if t := rogue.Talents.RelentlessStrikes; t > 0 {
if sim.RandomFloat("RelentlessStrikes") < 0.04*float64(t*numPoints) {
rogue.AddEnergy(sim, 25, relentlessStrikesMetrics)
}
}
if mayhemMetrics != nil {
if sim.RandomFloat("Mayhem") < 0.13 {
rogue.AddComboPoints(sim, 3, mayhemMetrics)
}
}
}
}
func (rogue *Rogue) makeCostModifier() func(baseCost float64) float64 {
if rogue.HasSetBonus(Tier7, 4) {
return func(baseCost float64) float64 {
return math.RoundToEven(0.95 * baseCost)
}
}
return func(baseCost float64) float64 {
return baseCost
}
}
func (rogue *Rogue) applyMurder() {
rogue.PseudoStats.DamageDealtMultiplier *= rogue.murderMultiplier()
}
func (rogue *Rogue) murderMultiplier() float64 {
return 1.0 + 0.02*float64(rogue.Talents.Murder)
}
func (rogue *Rogue) applySlaughterFromTheShadows() {
rogue.PseudoStats.DamageDealtMultiplier *= rogue.slaughterFromTheShadowsMultiplier()
}
func (rogue *Rogue) slaughterFromTheShadowsMultiplier() float64 {
return 1.0 + 0.01*float64(rogue.Talents.SlaughterFromTheShadows)
}
func (rogue *Rogue) registerHungerForBlood() {
if !rogue.Talents.HungerForBlood {
return
}
actionID := core.ActionID{SpellID: 51662}
multiplier := 1.05
if rogue.HasMajorGlyph(proto.RogueMajorGlyph_GlyphOfHungerForBlood) {
multiplier += 0.03
}
rogue.HungerForBloodAura = rogue.RegisterAura(core.Aura{
Label: "Hunger for Blood",
ActionID: actionID,
Duration: time.Minute,
OnGain: func(aura *core.Aura, sim *core.Simulation) {
rogue.PseudoStats.DamageDealtMultiplier *= multiplier
},
OnExpire: func(aura *core.Aura, sim *core.Simulation) {
rogue.PseudoStats.DamageDealtMultiplier *= 1 / multiplier
},
})
rogue.HungerForBlood = rogue.RegisterSpell(core.SpellConfig{
ActionID: actionID,
Flags: core.SpellFlagAPL,
EnergyCost: core.EnergyCostOptions{
Cost: 15,
},
Cast: core.CastConfig{
DefaultCast: core.Cast{
GCD: time.Second,
},
},
ApplyEffects: func(sim *core.Simulation, _ *core.Unit, spell *core.Spell) {
rogue.HungerForBloodAura.Activate(sim)
},
})
}
func (rogue *Rogue) preyOnTheWeakMultiplier(_ *core.Unit) float64 {
// TODO: Use the following predicate if/when health values are modeled,
// but note that this would have to be applied dynamically in that case.
//if rogue.CurrentTarget != nil &&
//rogue.CurrentTarget.HasHealthBar() &&
//rogue.CurrentTarget.CurrentHealthPercent() < rogue.CurrentHealthPercent()
return 1 + 0.04*float64(rogue.Talents.PreyOnTheWeak)
}
func (rogue *Rogue) registerDirtyDeeds() {
if rogue.Talents.DirtyDeeds == 0 {
return
}
actionID := core.ActionID{SpellID: 14083}
rogue.RegisterResetEffect(func(sim *core.Simulation) {
sim.RegisterExecutePhaseCallback(func(sim *core.Simulation, isExecute int32) {
if isExecute == 35 {
rogue.DirtyDeedsAura.Activate(sim)
}
})
})
rogue.DirtyDeedsAura = rogue.RegisterAura(core.Aura{
Label: "Dirty Deeds",
ActionID: actionID,
Duration: core.NeverExpires,
OnGain: func(aura *core.Aura, sim *core.Simulation) {
for _, spell := range rogue.Spellbook {
if spell.Flags.Matches(SpellFlagBuilder|SpellFlagFinisher) && spell.DamageMultiplier > 0 {
spell.DamageMultiplier *= rogue.DirtyDeedsMultiplier()
}
}
},
OnExpire: func(aura *core.Aura, sim *core.Simulation) {
for _, spell := range rogue.Spellbook {
if spell.Flags.Matches(SpellFlagBuilder|SpellFlagFinisher) && spell.DamageMultiplier > 0 {
spell.DamageMultiplier /= rogue.DirtyDeedsMultiplier()
}
}
},
})
}
func (rogue *Rogue) DirtyDeedsMultiplier() float64 {
if rogue.Talents.DirtyDeeds == 0 {
return 1
}
return 1 + 0.1*float64(rogue.Talents.DirtyDeeds)
}
func (rogue *Rogue) registerColdBloodCD() {
if !rogue.Talents.ColdBlood {
return
}
actionID := core.ActionID{SpellID: 14177}
coldBloodAura := rogue.RegisterAura(core.Aura{
Label: "Cold Blood",
ActionID: actionID,
Duration: core.NeverExpires,
OnGain: func(aura *core.Aura, sim *core.Simulation) {
for _, spell := range rogue.Spellbook {
if spell.Flags.Matches(SpellFlagColdBlooded) {
spell.BonusCritRating += 100 * core.CritRatingPerCritChance
}
}
},
OnExpire: func(aura *core.Aura, sim *core.Simulation) {
for _, spell := range rogue.Spellbook {
if spell.Flags.Matches(SpellFlagColdBlooded) {
spell.BonusCritRating -= 100 * core.CritRatingPerCritChance
}
}
},
OnSpellHitDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
// for Fan of Knives and Mutilate, the offhand hit comes first and is ignored, so the aura doesn't fade too early
if spell.Flags.Matches(SpellFlagColdBlooded) && spell.ProcMask.Matches(core.ProcMaskMeleeMH) {
aura.Deactivate(sim)
}
},
})
rogue.ColdBlood = rogue.RegisterSpell(core.SpellConfig{
ActionID: actionID,
Cast: core.CastConfig{
CD: core.Cooldown{
Timer: rogue.NewTimer(),
Duration: time.Minute * 3,
},
},
ApplyEffects: func(sim *core.Simulation, _ *core.Unit, spell *core.Spell) {
coldBloodAura.Activate(sim)
},
})
rogue.AddMajorCooldown(core.MajorCooldown{
Spell: rogue.ColdBlood,
Type: core.CooldownTypeDPS,
})
}
func (rogue *Rogue) applySealFate() {
if rogue.Talents.SealFate == 0 {
return
}
procChance := 0.2 * float64(rogue.Talents.SealFate)
cpMetrics := rogue.NewComboPointMetrics(core.ActionID{SpellID: 14195})
icd := core.Cooldown{
Timer: rogue.NewTimer(),
Duration: 500 * time.Millisecond,
}
rogue.RegisterAura(core.Aura{
Label: "Seal Fate",
Duration: core.NeverExpires,
OnReset: func(aura *core.Aura, sim *core.Simulation) {
aura.Activate(sim)
},
OnSpellHitDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
if !spell.Flags.Matches(SpellFlagBuilder) {
return
}
if !result.Outcome.Matches(core.OutcomeCrit) {
return
}
if icd.IsReady(sim) && sim.Proc(procChance, "Seal Fate") {
rogue.AddComboPoints(sim, 1, cpMetrics)
icd.Use(sim)
}
},
})
}
func (rogue *Rogue) applyInitiative() {
if rogue.Talents.Initiative == 0 {
return
}
procChance := []float64{0, 0.33, 0.66, 1.0}[rogue.Talents.Initiative]
cpMetrics := rogue.NewComboPointMetrics(core.ActionID{SpellID: 13980})
rogue.RegisterAura(core.Aura{
Label: "Initiative",
Duration: core.NeverExpires,
OnReset: func(aura *core.Aura, sim *core.Simulation) {
aura.Activate(sim)
},
OnSpellHitDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
if spell == rogue.Garrote || spell == rogue.Ambush {
if result.Landed() {
if sim.Proc(procChance, "Initiative") {
rogue.AddComboPoints(sim, 1, cpMetrics)
}
}
}
},
})
}
func (rogue *Rogue) applyWeaponSpecializations() {
if hns := rogue.Talents.HackAndSlash; hns > 0 {
if mask := rogue.GetProcMaskForTypes(proto.WeaponType_WeaponTypeSword, proto.WeaponType_WeaponTypeAxe); mask != core.ProcMaskUnknown {
rogue.registerHackAndSlash(mask)
}
}
if cqc := rogue.Talents.CloseQuartersCombat; cqc > 0 {
switch rogue.GetProcMaskForTypes(proto.WeaponType_WeaponTypeDagger, proto.WeaponType_WeaponTypeFist) {
case core.ProcMaskMelee:
rogue.AddStat(stats.MeleeCrit, core.CritRatingPerCritChance*float64(cqc))
case core.ProcMaskMeleeMH:
// the default character pane displays critical strike chance for main hand only
rogue.AddStat(stats.MeleeCrit, core.CritRatingPerCritChance*float64(cqc))
rogue.OnSpellRegistered(func(spell *core.Spell) {
if spell.ProcMask.Matches(core.ProcMaskMeleeOH) {
spell.BonusCritRating -= core.CritRatingPerCritChance * float64(cqc)
}
})
case core.ProcMaskMeleeOH:
rogue.OnSpellRegistered(func(spell *core.Spell) {
if spell.ProcMask.Matches(core.ProcMaskMeleeOH) {
spell.BonusCritRating += core.CritRatingPerCritChance * float64(cqc)
}
})
}
}
if ms := rogue.Talents.MaceSpecialization; ms > 0 {
if mask := rogue.GetProcMaskForTypes(proto.WeaponType_WeaponTypeMace); mask != core.ProcMaskUnknown {
rogue.AddStat(stats.ArmorPenetration, core.ArmorPenPerPercentArmor*3*float64(ms))
}
}
}
func (rogue *Rogue) applyCombatPotency() {
if rogue.Talents.CombatPotency == 0 {
return
}
const procChance = 0.2
energyBonus := 3.0 * float64(rogue.Talents.CombatPotency)
energyMetrics := rogue.NewEnergyMetrics(core.ActionID{SpellID: 35553})
rogue.RegisterAura(core.Aura{
Label: "Combat Potency",
Duration: core.NeverExpires,
OnReset: func(aura *core.Aura, sim *core.Simulation) {
aura.Activate(sim)
},
OnSpellHitDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
// from 3.0.3 patch notes: "Combat Potency: Now only works with auto attacks"
if !result.Landed() || !spell.ProcMask.Matches(core.ProcMaskMeleeOHAuto) {
return
}
if sim.RandomFloat("Combat Potency") < procChance {
rogue.AddEnergy(sim, energyBonus, energyMetrics)
}
},
})
}
func (rogue *Rogue) applyFocusedAttacks() {
if rogue.Talents.FocusedAttacks == 0 {
return
}
procChance := []float64{0, 0.33, 0.66, 1}[rogue.Talents.FocusedAttacks]
energyMetrics := rogue.NewEnergyMetrics(core.ActionID{SpellID: 51637})
rogue.RegisterAura(core.Aura{
Label: "Focused Attacks",
Duration: core.NeverExpires,
OnReset: func(aura *core.Aura, sim *core.Simulation) {
aura.Activate(sim)
},
OnSpellHitDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
if !spell.ProcMask.Matches(core.ProcMaskMelee) || !result.DidCrit() {
return
}
// Fan of Knives OH hits do not trigger focused attacks
if spell.ProcMask.Matches(core.ProcMaskMeleeOH) && spell.IsSpellAction(FanOfKnivesSpellID) {
return
}
if sim.Proc(procChance, "Focused Attacks") {
rogue.AddEnergy(sim, 2, energyMetrics)
}
},
})
}
var BladeFlurryActionID = core.ActionID{SpellID: 13877}
var BladeFlurryHitID = core.ActionID{SpellID: 22482}
func (rogue *Rogue) registerBladeFlurryCD() {
if !rogue.Talents.BladeFlurry {
return
}
var curDmg float64
bfHit := rogue.RegisterSpell(core.SpellConfig{
ActionID: BladeFlurryHitID,
SpellSchool: core.SpellSchoolPhysical,
ProcMask: core.ProcMaskEmpty, // No proc mask, so it won't proc itself.
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagNoOnCastComplete | core.SpellFlagIgnoreAttackerModifiers,
DamageMultiplier: 1,
ThreatMultiplier: 1,
ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
spell.CalcAndDealDamage(sim, target, curDmg, spell.OutcomeAlwaysHit)
},
})
const hasteBonus = 1.2
const inverseHasteBonus = 1 / 1.2
dur := time.Second * 15
rogue.BladeFlurryAura = rogue.RegisterAura(core.Aura{
Label: "Blade Flurry",
ActionID: BladeFlurryActionID,
Duration: dur,
OnGain: func(aura *core.Aura, sim *core.Simulation) {
rogue.MultiplyMeleeSpeed(sim, hasteBonus)
},
OnExpire: func(aura *core.Aura, sim *core.Simulation) {
rogue.MultiplyMeleeSpeed(sim, inverseHasteBonus)
},
OnSpellHitDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
if sim.GetNumTargets() < 2 {
return
}
if result.Damage == 0 || !spell.ProcMask.Matches(core.ProcMaskMelee) {
return
}
// Fan of Knives off-hand hits are not cloned
if spell.IsSpellAction(FanOfKnivesSpellID) && spell.ProcMask.Matches(core.ProcMaskMeleeOH) {
return
}
// Undo armor reduction to get the raw damage value.
curDmg = result.Damage / result.ResistanceMultiplier
bfHit.Cast(sim, rogue.Env.NextTargetUnit(result.Target))
bfHit.SpellMetrics[result.Target.UnitIndex].Casts--
},
})
cooldownDur := time.Minute * 2
rogue.BladeFlurry = rogue.RegisterSpell(core.SpellConfig{
ActionID: BladeFlurryActionID,
Flags: core.SpellFlagAPL,
EnergyCost: core.EnergyCostOptions{
Cost: core.TernaryFloat64(rogue.HasMajorGlyph(proto.RogueMajorGlyph_GlyphOfBladeFlurry), 0, 25),
},
Cast: core.CastConfig{
DefaultCast: core.Cast{
GCD: time.Second,
},
IgnoreHaste: true,
CD: core.Cooldown{
Timer: rogue.NewTimer(),
Duration: cooldownDur,
},
},
ApplyEffects: func(sim *core.Simulation, _ *core.Unit, spell *core.Spell) {
rogue.BreakStealth(sim)
rogue.BladeFlurryAura.Activate(sim)
},
})
rogue.AddMajorCooldown(core.MajorCooldown{
Spell: rogue.BladeFlurry,
Type: core.CooldownTypeDPS,
Priority: core.CooldownPriorityDefault,
ShouldActivate: func(sim *core.Simulation, character *core.Character) bool {
if sim.GetRemainingDuration() > cooldownDur+dur {
// We'll have enough time to cast another BF, so use it immediately to make sure we get the 2nd one.
return true
}
// Since this is our last BF, wait until we have SND / procs up.
sndTimeRemaining := rogue.SliceAndDiceAura.RemainingDuration(sim)
// TODO: Wait for dst/mongoose procs
return sndTimeRemaining >= time.Second
},
})
}
var AdrenalineRushActionID = core.ActionID{SpellID: 13750}
func (rogue *Rogue) registerAdrenalineRushCD() {
if !rogue.Talents.AdrenalineRush {
return
}
rogue.AdrenalineRushAura = rogue.RegisterAura(core.Aura{
Label: "Adrenaline Rush",
ActionID: AdrenalineRushActionID,
Duration: core.TernaryDuration(rogue.HasMajorGlyph(proto.RogueMajorGlyph_GlyphOfAdrenalineRush), time.Second*20, time.Second*15),
OnGain: func(aura *core.Aura, sim *core.Simulation) {
rogue.ResetEnergyTick(sim)
rogue.ApplyEnergyTickMultiplier(1.0)
},
OnExpire: func(aura *core.Aura, sim *core.Simulation) {
rogue.ResetEnergyTick(sim)
rogue.ApplyEnergyTickMultiplier(-1.0)
},
})
adrenalineRushSpell := rogue.RegisterSpell(core.SpellConfig{
ActionID: AdrenalineRushActionID,
Cast: core.CastConfig{
DefaultCast: core.Cast{
GCD: time.Second,
},
IgnoreHaste: true,
CD: core.Cooldown{
Timer: rogue.NewTimer(),
Duration: time.Minute * 3,
},
},
ApplyEffects: func(sim *core.Simulation, _ *core.Unit, spell *core.Spell) {
rogue.BreakStealth(sim)
rogue.AdrenalineRushAura.Activate(sim)
},
})
rogue.AddMajorCooldown(core.MajorCooldown{
Spell: adrenalineRushSpell,
Type: core.CooldownTypeDPS,
Priority: core.CooldownPriorityBloodlust,
ShouldActivate: func(sim *core.Simulation, character *core.Character) bool {
thresh := 45.0
return rogue.CurrentEnergy() <= thresh
},
})
}
func (rogue *Rogue) registerKillingSpreeCD() {
if !rogue.Talents.KillingSpree {
return
}
rogue.registerKillingSpreeSpell()
}
func (rogue *Rogue) registerHonorAmongThieves() {
// When anyone in your group critically hits with a damage or healing spell or ability,
// you have a [33%/66%/100%] chance to gain a combo point on your current target.
// This effect cannot occur more than once per second.
if rogue.Talents.HonorAmongThieves == 0 {
return
}
procChance := []float64{0, 0.33, 0.66, 1}[rogue.Talents.HonorAmongThieves]
comboMetrics := rogue.NewComboPointMetrics(core.ActionID{SpellID: 51701})
honorAmongThievesID := core.ActionID{SpellID: 51701}
icd := core.Cooldown{
Timer: rogue.NewTimer(),
Duration: time.Second,
}
maybeProc := func(sim *core.Simulation) {
if icd.IsReady(sim) && sim.Proc(procChance, "honor of thieves") {
rogue.AddComboPoints(sim, 1, comboMetrics)
icd.Use(sim)
}
}
rogue.HonorAmongThieves = rogue.RegisterAura(core.Aura{
Label: "Honor Among Thieves",
ActionID: honorAmongThievesID,
Duration: core.NeverExpires,
OnReset: func(aura *core.Aura, sim *core.Simulation) {
aura.Activate(sim)
},
OnGain: func(_ *core.Aura, sim *core.Simulation) {
// In an ideal party, you'd probably get up to 6 ability crits/s (Rate = 600).
// Survival Hunters, Enhancement Shamans, and Assassination Rogues are particularly good.
if rogue.Options.HonorOfThievesCritRate <= 0 {
return
}
if rogue.Options.HonorOfThievesCritRate > 2000 {
rogue.Options.HonorOfThievesCritRate = 2000 // limited, so performance doesn't suffer
}
rateToDuration := float64(time.Second) * 100 / float64(rogue.Options.HonorOfThievesCritRate)
pa := &core.PendingAction{}
pa.OnAction = func(sim *core.Simulation) {
maybeProc(sim)
pa.NextActionAt = sim.CurrentTime + time.Duration(sim.RandomExpFloat("next party crit")*rateToDuration)
sim.AddPendingAction(pa)
}
pa.NextActionAt = sim.CurrentTime + time.Duration(sim.RandomExpFloat("next party crit")*rateToDuration)
sim.AddPendingAction(pa)
},
OnSpellHitDealt: func(_ *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
if result.DidCrit() && !spell.ProcMask.Matches(core.ProcMaskMeleeMHAuto|core.ProcMaskMeleeOHAuto|core.ProcMaskRangedAuto) {
maybeProc(sim)
}
},
OnPeriodicDamageDealt: func(_ *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
if result.DidCrit() {
maybeProc(sim)
}
},
})
}