-
Notifications
You must be signed in to change notification settings - Fork 126
/
Havoc.lua
executable file
·517 lines (488 loc) · 31.9 KB
/
Havoc.lua
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
--- ============================ HEADER ============================
--- ======= LOCALIZE =======
-- Addon
local addonName, addonTable = ...
-- HeroDBC
local DBC = HeroDBC.DBC
-- HeroLib
local HL = HeroLib
local Cache = HeroCache
local Unit = HL.Unit
local Player = Unit.Player
local Target = Unit.Target
local Pet = Unit.Pet
local Spell = HL.Spell
local Item = HL.Item
-- HeroRotation
local HR = HeroRotation
local AoEON = HR.AoEON
local CDsON = HR.CDsON
local Cast = HR.Cast
local CastSuggested = HR.CastSuggested
-- lua
--- ============================ CONTENT ===========================
--- ======= APL LOCALS =======
-- luacheck: max_line_length 9999
-- Define S/I for spell and item arrays
local S = Spell.DemonHunter.Havoc
local I = Item.DemonHunter.Havoc
-- Create table to exclude above trinkets from On Use function
local OnUseExcludes = {
I.RingofCollapsingFutures:ID(),
I.WrapsofElectrostaticPotential:ID(),
}
-- Trinket Item Objects
local equip = Player:GetEquipment()
local trinket1 = Item(0)
local trinket2 = Item(0)
if equip[13] then
trinket1 = Item(equip[13])
end
if equip[14] then
trinket2 = Item(equip[14])
end
-- Player Covenant
-- 0: none, 1: Kyrian, 2: Venthyr, 3: Night Fae, 4: Necrolord
local CovenantID = Player:CovenantID()
-- Rotation Var
local Enemies8y, Enemies20y
local EnemiesCount8, EnemiesCount20
local DarkglareEquipped = Player:HasLegendaryEquipped(20)
local ChaosTheoryEquipped = Player:HasLegendaryEquipped(23)
local BurningWoundEquipped = Player:HasLegendaryEquipped(25)
local AgonyGazeEquipped = Player:HasLegendaryEquipped(236) or (CovenantID == 2 and Player:HasUnity())
-- GUI Settings
local Everyone = HR.Commons.Everyone
local Settings = {
General = HR.GUISettings.General,
Commons = HR.GUISettings.APL.DemonHunter.Commons,
Havoc = HR.GUISettings.APL.DemonHunter.Havoc
}
-- Interrupts List
local StunInterrupts = {
{S.FelEruption, "Cast Fel Eruption (Interrupt)", function () return true; end},
{S.ChaosNova, "Cast Chaos Nova (Interrupt)", function () return true; end},
}
-- Variables
local VarPoolingForMeta = false
local VarBladeDance = false
local VarPoolingForBladeDance = false
local VarPoolingForEyeBeam = false
local VarWaitingForEssenceBreak = false
local VarWaitingForMomentum = false
local VarWaitingForAgonyGaze = false
local VarTrinketSyncSlot = 0
local VarUseEyeBeamFuryCondition = false
local BossFightRemains = 11111
local FightRemains = 11111
-- Update CovenantID if we change Covenants
HL:RegisterForEvent(function()
CovenantID = Player:CovenantID()
end, "COVENANT_CHOSEN")
HL:RegisterForEvent(function()
VarPoolingForMeta = false
VarBladeDance = false
VarPoolingForBladeDance = false
VarPoolingForEyeBeam = false
VarWaitingForEssenceBreak = false
VarWaitingForMomentum = false
VarWaitingForAgonyGaze = false
BossFightRemains = 11111
FightRemains = 11111
end, "PLAYER_REGEN_ENABLED")
HL:RegisterForEvent(function()
equip = Player:GetEquipment()
trinket1 = Item(0)
trinket2 = Item(0)
if equip[13] then
trinket1 = Item(equip[13])
end
if equip[14] then
trinket2 = Item(equip[14])
end
DarkglareEquipped = Player:HasLegendaryEquipped(20)
ChaosTheoryEquipped = Player:HasLegendaryEquipped(23)
BurningWoundEquipped = Player:HasLegendaryEquipped(25)
AgonyGazeEquipped = Player:HasLegendaryEquipped(236) or (CovenantID == 2 and Player:HasUnity())
end, "PLAYER_EQUIPMENT_CHANGED")
local function num(val)
if val then return 1 else return 0 end
end
local function bool(val)
return val ~= 0
end
local function IsInMeleeRange(range)
if S.Felblade:TimeSinceLastCast() <= Player:GCD() then
return true
elseif S.VengefulRetreat:TimeSinceLastCast() < 1.0 then
return false
end
return range and Target:IsInMeleeRange(range) or Target:IsInMeleeRange(5)
end
local function ConserveFelRush()
return (not Settings.Havoc.ConserveFelRush) or S.FelRush:Charges() == 2
end
local function EvalutateTargetIfFilterDemonsBite202(TargetUnit)
return TargetUnit:DebuffRemains(S.BurningWoundDebuff)
end
local function EvaluateTargetIfDemonsBite204(TargetUnit)
return (BurningWoundEquipped and TargetUnit:DebuffRemains(S.BurningWoundDebuff) < 4)
end
local function EvalutateTargetIfFilterDemonsBite206(TargetUnit)
return TargetUnit:DebuffRemains(S.BurningWoundDebuff)
end
local function EvaluateTargetIfDemonsBite208(TargetUnit)
return (BurningWoundEquipped and TargetUnit:DebuffRemains(S.BurningWoundDebuff) < 4)
end
local function Precombat()
-- flask
-- augmentation
-- food
-- snapshot_stats
VarTrinketSyncSlot = 0
-- variable,name=trinket_sync_slot,value=1,if=trinket.1.has_stat.any_dps&(!trinket.2.has_stat.any_dps|trinket.1.cooldown.duration>=trinket.2.cooldown.duration)
if (trinket1:TrinketHasStatAnyDps() and ((not trinket2:TrinketHasStatAnyDps()) or trinket1:Cooldown() >= trinket2:Cooldown())) then
VarTrinketSyncSlot = 1
end
-- variable,name=trinket_sync_slot,value=2,if=trinket.2.has_stat.any_dps&(!trinket.1.has_stat.any_dps|trinket.2.cooldown.duration>trinket.1.cooldown.duration)
if (trinket2:TrinketHasStatAnyDps() and ((not trinket1:TrinketHasStatAnyDps()) or trinket2:Cooldown() >= trinket1:Cooldown())) then
VarTrinketSyncSlot = 2
end
-- variable,name=use_eye_beam_fury_condition,value=talent.blind_fury.enabled&(runeforge.darkglare_medallion|talent.demon_blades.enabled&!runeforge.agony_gaze)
VarUseEyeBeamFuryCondition = (S.BlindFury:IsAvailable() and (DarkglareEquipped or S.DemonBlades:IsAvailable() and not AgonyGazeEquipped))
-- arcane_torrent
if S.ArcaneTorrent:IsCastable() and CDsON() then
if Cast(S.ArcaneTorrent, Settings.Commons.OffGCDasOffGCD.Racials, nil, not Target:IsInRange(8)) then return "arcane_torrent precombat 1"; end
end
-- fleshcraft,if=soulbind.pustule_eruption|soulbind.volatile_solvent
if S.Fleshcraft:IsCastable() and (S.PustuleEruption:SoulbindEnabled() or S.VolatileSolvent:SoulbindEnabled()) then
if Cast(S.Fleshcraft, nil, Settings.Commons.DisplayStyle.Covenant) then return "fleshcraft precombat 1.5"; end
end
-- Manually added: Fel Rush if out of range
if (not Target:IsInMeleeRange(5)) and S.FelRush:IsCastable() then
if Cast(S.FelRush, nil, nil, not Target:IsInRange(15)) then return "fel_rush precombat 2"; end
end
-- Manually added: Demon's Bite/Demon Blades if in melee range
if Target:IsInMeleeRange(5) and (S.DemonsBite:IsCastable() or S.DemonBlades:IsAvailable()) then
if Cast(S.DemonsBite, nil, nil, not Target:IsInMeleeRange(5)) then return "demons_bite or demon_blades precombat 4"; end
end
end
local function Cooldown()
-- metamorphosis,if=!talent.demonic.enabled&(cooldown.eye_beam.remains>20|fight_remains<25)
if S.Metamorphosis:IsCastable() and ((not S.Demonic:IsAvailable()) and (S.EyeBeam:CooldownRemains() > 20 or FightRemains < 25)) then
if Cast(S.Metamorphosis, nil, Settings.Commons.DisplayStyle.Metamorphosis, not Target:IsInRange(40)) then return "metamorphosis cooldown 2"; end
end
-- metamorphosis,if=talent.demonic.enabled&(cooldown.eye_beam.remains>20&(!variable.blade_dance|cooldown.blade_dance.remains>gcd.max)|fight_remains<25)
if S.Metamorphosis:IsCastable() and (S.Demonic:IsAvailable() and (S.EyeBeam:CooldownRemains() > 20 and ((not VarBladeDance) or S.BladeDance:CooldownRemains() > Player:GCD() + 0.5) or FightRemains < 25)) then
if Cast(S.Metamorphosis, nil, Settings.Commons.DisplayStyle.Metamorphosis, not Target:IsInRange(40)) then return "metamorphosis cooldown 4"; end
end
-- potion,if=buff.metamorphosis.remains>25|fight_remains<60
if I.PotionofPhantomFire:IsReady() and Settings.Commons.Enabled.Potions and (Player:BuffRemains(S.MetamorphosisBuff) > 25 or FightRemains < 60) then
if Cast(I.PotionofPhantomFire, nil, Settings.Commons.DisplayStyle.Potions) then return "potion cooldown 6"; end
end
if Settings.Commons.Enabled.Trinkets then
-- use_item,name=wraps_of_electrostatic_potential
if I.WrapsofElectrostaticPotential:IsEquippedAndReady() then
if Cast(I.WrapsofElectrostaticPotential, nil, Settings.Commons.DisplayStyle.Items) then return "wraps_of_electrostatic_potential cooldown 8"; end
end
-- use_item,name=ring_of_collapsing_futures,if=buff.temptation.down|fight_remains<30
if I.RingofCollapsingFutures:IsEquippedAndReady() and (Player:BuffDown(S.TemptationBuff) or FightRemains < 30) then
if Cast(I.RingofCollapsingFutures, nil, Settings.Commons.DisplayStyle.Items) then return "ring_of_collapsing_futures cooldown 10"; end
end
-- use_item,name=cache_of_acquired_treasures,if=buff.acquired_axe.up&((active_enemies=desired_targets&raid_event.adds.in>60|active_enemies>desired_targets)&(active_enemies<3|cooldown.eye_beam.remains<20)|fight_remains<25)
if I.CacheofAcquiredTreasures:IsEquippedAndReady() and (Player:BuffUp(S.AcquiredAxeBuff) and ((EnemiesCount8 >= 1) and (EnemiesCount8 < 3 or S.EyeBeam:CooldownRemains() < 20) or FightRemains < 25)) then
if Cast(I.CacheofAcquiredTreasures, nil, Settings.Commons.DisplayStyle.Trinkets) then return "cache_of_acquired_treasures cooldown 12"; end
end
-- use_items,slots=trinket1,if=variable.trinket_sync_slot=1&(buff.metamorphosis.up|(!talent.demonic.enabled&cooldown.metamorphosis.remains>(fight_remains>?trinket.1.cooldown.duration%2))|fight_remains<=20)|(variable.trinket_sync_slot=2&!trinket.2.cooldown.ready)|!variable.trinket_sync_slot
local Trinket1ToUse = Player:GetUseableTrinkets(OnUseExcludes, 13)
if Trinket1ToUse and (VarTrinketSyncSlot == 1 and (Player:BuffUp(S.MetamorphosisBuff) or ((not S.Demonic:IsAvailable()) and S.Metamorphosis:CooldownRemains() > ((FightRemains > trinket1:Cooldown() / 2) and FightRemains or trinket1:Cooldown() / 2)) or FightRemains <= 20) or (VarTrinketSyncSlot == 2 and not trinket2:IsReady()) or VarTrinketSyncSlot == 0) then
if Cast(Trinket1ToUse, nil, Settings.Commons.DisplayStyle.Trinkets) then return "trinket1 cooldown 14"; end
end
-- use_items,slots=trinket2,if=variable.trinket_sync_slot=2&(buff.metamorphosis.up|(!talent.demonic.enabled&cooldown.metamorphosis.remains>(fight_remains>?trinket.2.cooldown.duration%2))|fight_remains<=20)|(variable.trinket_sync_slot=1&!trinket.1.cooldown.ready)|!variable.trinket_sync_slot
local Trinket2ToUse = Player:GetUseableTrinkets(OnUseExcludes, 14)
if Trinket2ToUse and (VarTrinketSyncSlot == 2 and (Player:BuffUp(S.MetamorphosisBuff) or ((not S.Demonic:IsAvailable()) and S.Metamorphosis:CooldownRemains() > ((FightRemains > trinket2:Cooldown() / 2) and FightRemains or trinket2:Cooldown() / 2)) or FightRemains <= 20) or (VarTrinketSyncSlot == 1 and not trinket1:IsReady()) or VarTrinketSyncSlot == 0) then
if Cast(Trinket2ToUse, nil, Settings.Commons.DisplayStyle.Trinkets) then return "trinket2 cooldown 16"; end
end
end
-- sinful_brand,if=!dot.sinful_brand.ticking&(!runeforge.agony_gaze|(cooldown.eye_beam.remains<=gcd&fury>=30))&(!cooldown.metamorphosis.up|active_enemies=1)
if S.SinfulBrand:IsCastable() and (Target:DebuffDown(S.SinfulBrandDebuff) and ((not AgonyGazeEquipped) or (S.EyeBeam:CooldownRemains() <= Player:GCD() and Player:Fury() >= 30)) and (S.Metamorphosis:CooldownDown() or EnemiesCount8 == 1)) then
if Cast(S.SinfulBrand, nil, Settings.Commons.DisplayStyle.Covenant, not Target:IsSpellInRange(S.SinfulBrand)) then return "sinful_brand cooldown 18"; end
end
-- the_hunt,if=!talent.demonic.enabled&!variable.waiting_for_momentum&!variable.pooling_for_meta|buff.furious_gaze.up
if S.TheHunt:IsCastable() and ((not S.Demonic:IsAvailable()) and (not VarWaitingForMomentum) and (not VarPoolingForMeta) or Player:BuffUp(S.FuriousGazeBuff)) then
if Cast(S.TheHunt, nil, Settings.Commons.DisplayStyle.Covenant, not Target:IsSpellInRange(S.TheHunt)) then return "the_hunt cooldown 20"; end
end
-- elysian_decree,if=(active_enemies>desired_targets|raid_event.adds.in>30)
if S.ElysianDecree:IsCastable() and (EnemiesCount8 > 0) then
if Cast(S.ElysianDecree, nil, Settings.Commons.DisplayStyle.Covenant, not Target:IsInRange(30)) then return "elysian_decree cooldown 22"; end
end
-- fleshcraft,if=soulbind.volatile_solvent&!buff.volatile_solvent_humanoid.up,interrupt_immediate=1,interrupt_global=1,interrupt_if=soulbind.volatile_solvent
if S.Fleshcraft:IsCastable() and (S.VolatileSolvent:SoulbindEnabled() and Player:BuffDown(S.VolatileSolventHumanBuff)) then
if Cast(S.Fleshcraft, nil, Settings.Commons.DisplayStyle.Covenant) then return "fleshcraft cooldown 24"; end
end
end
local function Demonic()
-- eye_beam,if=runeforge.agony_gaze&(active_enemies>desired_targets|raid_event.adds.in>25-talent.cycle_of_hatred*10)&dot.sinful_brand.ticking&dot.sinful_brand.remains<=gcd
if S.EyeBeam:IsReady() and (AgonyGazeEquipped and EnemiesCount8 > 1 and Target:DebuffUp(S.SinfulBrandDebuff) and Target:DebuffRemains(S.SinfulBrandDebuff) <= Player:GCD()) then
if Cast(S.EyeBeam, Settings.Havoc.GCDasOffGCD.EyeBeam, nil, not Target:IsInRange(20)) then return "eye_beam demonic 1"; end
end
-- fel_rush,if=talent.unbound_chaos.enabled&buff.unbound_chaos.up&(charges=2|(raid_event.movement.in>10&raid_event.adds.in>10))
if S.FelRush:IsCastable() and (S.UnboundChaos:IsAvailable() and Player:BuffUp(S.UnboundChaosBuff) and S.FelRush:Charges() == 2) then
if Cast(S.FelRush, nil, Settings.Commons.DisplayStyle.FelRush) then return "fel_rush demonic 2"; end
end
-- death_sweep,if=variable.blade_dance
if S.DeathSweep:IsReady() and (VarBladeDance) then
if Cast(S.DeathSweep, nil, nil, not IsInMeleeRange(8)) then return "death_sweep demonic 4"; end
end
-- glaive_tempest,if=active_enemies>desired_targets|raid_event.adds.in>10
if S.GlaiveTempest:IsReady() and (EnemiesCount8 > 0) then
if Cast(S.GlaiveTempest, Settings.Havoc.GCDasOffGCD.GlaiveTempest, nil, not Target:IsInMeleeRange(8)) then return "glaive_tempest demonic 6"; end
end
-- throw_glaive,if=conduit.serrated_glaive.enabled&cooldown.eye_beam.remains<6&!buff.metamorphosis.up&!debuff.exposed_wound.up
if S.ThrowGlaive:IsCastable() and (S.SerratedGlaive:ConduitEnabled() and S.EyeBeam:CooldownRemains() < 6 and Player:BuffDown(S.MetamorphosisBuff) and Target:DebuffDown(S.ExposedWoundDebuff)) then
if Cast(S.ThrowGlaive, Settings.Havoc.GCDasOffGCD.ThrowGlaive, nil, not Target:IsSpellInRange(S.ThrowGlaive)) then return "throw_glaive demonic 8"; end
end
-- eye_beam,if=active_enemies>desired_targets|raid_event.adds.in>25-talent.cycle_of_hatred*10&(!variable.use_eye_beam_fury_condition|spell_targets>1|fury<70)&!variable.waiting_for_agony_gaze
if S.EyeBeam:IsReady() and (EnemiesCount8 > 0 and ((not VarUseEyeBeamFuryCondition) or EnemiesCount8 > 1 or Player:Fury() < 70) and not VarWaitingForAgonyGaze) then
if Cast(S.EyeBeam, Settings.Havoc.GCDasOffGCD.EyeBeam, nil, not Target:IsInRange(20)) then return "eye_beam demonic 10"; end
end
-- blade_dance,if=variable.blade_dance&!cooldown.metamorphosis.ready&(cooldown.eye_beam.remains>5|(raid_event.adds.in>cooldown&raid_event.adds.in<25))
if S.BladeDance:IsReady() and (VarBladeDance and (not S.Metamorphosis:CooldownUp()) and S.EyeBeam:CooldownRemains() > 5) then
if Cast(S.BladeDance, nil, nil, not IsInMeleeRange(8)) then return "blade_dance demonic 12"; end
end
-- immolation_aura,if=!buff.immolation_aura.up
if S.ImmolationAura:IsCastable() and (Player:BuffDown(S.ImmolationAuraBuff)) then
if Cast(S.ImmolationAura, Settings.Havoc.GCDasOffGCD.ImmolationAura, nil, not IsInMeleeRange(8)) then return "immolation_aura demonic 14"; end
end
-- annihilation,if=!variable.pooling_for_blade_dance
if S.Annihilation:IsReady() and (not VarPoolingForBladeDance) then
if Cast(S.Annihilation, nil, nil, not Target:IsSpellInRange(S.Annihilation)) then return "annihilation demonic 16"; end
end
-- felblade,if=fury.deficit>=40
if S.Felblade:IsCastable() and (Player:FuryDeficit() >= 40) then
if Cast(S.Felblade, nil, nil, not Target:IsSpellInRange(S.Felblade)) then return "felblade demonic 18"; end
end
-- essence_break
if S.EssenceBreak:IsCastable() then
if Cast(S.EssenceBreak, nil, nil, not IsInMeleeRange(10)) then return "essence_break demonic 20"; end
end
-- chaos_strike,if=!variable.pooling_for_blade_dance&!variable.pooling_for_eye_beam
if S.ChaosStrike:IsReady() and ((not VarPoolingForBladeDance) and (not VarPoolingForEyeBeam)) then
if Cast(S.ChaosStrike, nil, nil, not Target:IsSpellInRange(S.ChaosStrike)) then return "chaos_strike demonic 22"; end
end
-- fel_rush,if=talent.demon_blades.enabled&!cooldown.eye_beam.ready&(charges=2|(raid_event.movement.in>10&raid_event.adds.in>10))
if S.FelRush:IsCastable() and (S.DemonBlades:IsAvailable() and (not S.EyeBeam:CooldownUp()) and ConserveFelRush()) then
if Cast(S.FelRush, nil, Settings.Commons.DisplayStyle.FelRush) then return "fel_rush demonic 24"; end
end
-- demons_bite,target_if=min:debuff.burning_wound.remains,if=runeforge.burning_wound&debuff.burning_wound.remains<4
if S.DemonsBite:IsCastable() then
if Everyone.CastTargetIf(S.DemonsBite, Enemies8y, "min", EvalutateTargetIfFilterDemonsBite206, EvaluateTargetIfDemonsBite208, not Target:IsSpellInRange(S.DemonsBite)) then return "demons_bite demonic 26"; end
end
-- fel_rush,if=!talent.demon_blades.enabled&spell_targets>1&(charges=2|(raid_event.movement.in>10&raid_event.adds.in>10))
if S.FelRush:IsCastable() and ((not S.DemonBlades:IsAvailable()) and EnemiesCount8 > 1 and (S.FelRush:Charges() == 2)) then
if Cast(S.FelRush, nil, Settings.Commons.DisplayStyle.FelRush) then return "fel_rush demonic 28"; end
end
-- demons_bite
if S.DemonsBite:IsCastable() then
if Cast(S.DemonsBite, nil, nil, not Target:IsSpellInRange(S.DemonsBite)) then return "demons_bite demonic 30"; end
end
-- throw_glaive,if=buff.out_of_range.up
if S.ThrowGlaive:IsCastable() and (not IsInMeleeRange()) then
if Cast(S.ThrowGlaive, Settings.Havoc.GCDasOffGCD.ThrowGlaive, nil, not Target:IsSpellInRange(S.ThrowGlaive)) then return "throw_glaive demonic 32"; end
end
-- fel_rush,if=movement.distance>15|buff.out_of_range.up
if S.FelRush:IsCastable() and ((not IsInMeleeRange()) and ConserveFelRush()) then
if Cast(S.FelRush, nil, Settings.Commons.DisplayStyle.FelRush) then return "fel_rush demonic 34"; end
end
-- vengeful_retreat,if=movement.distance>15
if S.VengefulRetreat:IsCastable() and (not IsInMeleeRange()) then
if Cast(S.VengefulRetreat, Settings.Havoc.OffGCDasOffGCD.VengefulRetreat) then return "vengeful_retreat demonic 36"; end
end
-- throw_glaive,if=talent.demon_blades.enabled
if S.ThrowGlaive:IsCastable() and (S.DemonBlades:IsAvailable()) then
if Cast(S.ThrowGlaive, Settings.Havoc.GCDasOffGCD.ThrowGlaive, nil, not Target:IsSpellInRange(S.ThrowGlaive)) then return "throw_glaive demonic 38"; end
end
end
local function Normal()
-- eye_beam,if=runeforge.agony_gaze&(active_enemies>desired_targets|raid_event.adds.in>15)&dot.sinful_brand.ticking&dot.sinful_brand.remains<=gcd
if S.EyeBeam:IsReady() and (AgonyGazeEquipped and EnemiesCount8 > 1 and Target:DebuffUp(S.SinfulBrandDebuff) and Target:DebuffRemains(S.SinfulBrandDebuff) <= Player:GCD()) then
if Cast(S.EyeBeam, Settings.Havoc.GCDasOffGCD.EyeBeam, nil, not Target:IsInRange(20)) then return "eye_beam normal 1"; end
end
-- vengeful_retreat,if=talent.momentum.enabled&buff.prepared.down&time>1
if S.VengefulRetreat:IsCastable() and (S.Momentum:IsAvailable() and Player:BuffDown(S.PreparedBuff) and HL.CombatTime() > 1) then
if Cast(S.VengefulRetreat, Settings.Havoc.OffGCDasOffGCD.VengefulRetreat) then return "vengeful_retreat normal 2"; end
end
-- fel_rush,if=(buff.unbound_chaos.up|variable.waiting_for_momentum&(!talent.unbound_chaos.enabled|!cooldown.immolation_aura.ready))&(charges=2|(raid_event.movement.in>10&raid_event.adds.in>10))
if S.FelRush:IsCastable() and ((Player:BuffUp(S.UnboundChaosBuff) or VarWaitingForMomentum and ((not S.UnboundChaos:IsAvailable()) or not S.ImmolationAura:CooldownUp())) and ConserveFelRush()) then
if Cast(S.FelRush, nil, Settings.Commons.DisplayStyle.FelRush) then return "fel_rush normal 4"; end
end
-- fel_barrage,if=active_enemies>desired_targets|raid_event.adds.in>30
if S.FelBarrage:IsCastable() and (EnemiesCount8 > 1) then
if Cast(S.FelBarrage, nil, nil, not IsInMeleeRange(8)) then return "fel_barrage normal 6"; end
end
-- death_sweep,if=variable.blade_dance
if S.DeathSweep:IsReady() and (VarBladeDance) then
if Cast(S.DeathSweep, nil, nil, not IsInMeleeRange(8)) then return "death_sweep normal 8"; end
end
-- immolation_aura,if=!buff.immolation_aura.up
if S.ImmolationAura:IsCastable() and (Player:BuffDown(S.ImmolationAuraBuff)) then
if Cast(S.ImmolationAura, Settings.Havoc.GCDasOffGCD.ImmolationAura, nil, not IsInMeleeRange(8)) then return "immolation_aura normal 10"; end
end
-- glaive_tempest,if=!variable.waiting_for_momentum&(active_enemies>desired_targets|raid_event.adds.in>10)
if S.GlaiveTempest:IsReady() and ((not VarWaitingForMomentum) and EnemiesCount8 > 0) then
if Cast(S.GlaiveTempest, Settings.Havoc.GCDasOffGCD.GlaiveTempest) then return "glaive_tempest normal 12"; end
end
-- throw_glaive,if=conduit.serrated_glaive.enabled&cooldown.eye_beam.remains<6&!buff.metamorphosis.up&!debuff.exposed_wound.up
if S.ThrowGlaive:IsCastable() and (S.SerratedGlaive:ConduitEnabled() and S.EyeBeam:CooldownRemains() < 6 and Player:BuffDown(S.MetamorphosisBuff) and Target:DebuffDown(S.ExposedWoundDebuff)) then
if Cast(S.ThrowGlaive, Settings.Havoc.GCDasOffGCD.ThrowGlaive, nil, not Target:IsSpellInRange(S.ThrowGlaive)) then return "throw_glaive normal 14"; end
end
-- eye_beam,if=!variable.waiting_for_momentum&(active_enemies>desired_targets|raid_event.adds.in>15&(!variable.use_eye_beam_fury_condition|spell_targets>1|fury<70)&!variable.waiting_for_agony_gaze)
if S.EyeBeam:IsReady() and ((not VarWaitingForMomentum) and (EnemiesCount20 > 0 and ((not VarUseEyeBeamFuryCondition) or EnemiesCount8 > 1 or Player:Fury() < 70) and not VarWaitingForAgonyGaze)) then
if Cast(S.EyeBeam, Settings.Havoc.GCDasOffGCD.EyeBeam, nil, not IsInMeleeRange(20)) then return "eye_beam normal 16"; end
end
-- blade_dance,if=variable.blade_dance
if S.BladeDance:IsReady() and (VarBladeDance) then
if Cast(S.BladeDance, nil, nil, not IsInMeleeRange(8)) then return "blade_dance normal 18"; end
end
-- felblade,if=fury.deficit>=40
if S.Felblade:IsCastable() and (Player:FuryDeficit() >= 40) then
if Cast(S.Felblade, nil, nil, not Target:IsSpellInRange(S.Felblade)) then return "felblade normal 20"; end
end
-- essence_break
if S.EssenceBreak:IsCastable() then
if Cast(S.EssenceBreak, nil, nil, not IsInMeleeRange(10)) then return "essence_break normal 22"; end
end
-- annihilation,if=(talent.demon_blades.enabled|!variable.waiting_for_momentum|fury.deficit<30|buff.metamorphosis.remains<5)&!variable.pooling_for_blade_dance
if S.Annihilation:IsReady() and ((S.DemonBlades:IsAvailable() or (not VarWaitingForMomentum) or Player:FuryDeficit() < 30 or Player:BuffRemains(S.MetamorphosisBuff) < 5) and not VarPoolingForBladeDance) then
if Cast(S.Annihilation, nil, nil, not Target:IsSpellInRange(S.Annihilation)) then return "annihilation normal 24"; end
end
-- chaos_strike,if=(talent.demon_blades.enabled|!variable.waiting_for_momentum|fury.deficit<30)&!variable.pooling_for_meta&!variable.pooling_for_blade_dance
if S.ChaosStrike:IsReady() and ((S.DemonBlades:IsAvailable() or (not VarWaitingForMomentum) or Player:FuryDeficit() < 30) and (not VarPoolingForMeta) and not VarPoolingForBladeDance) then
if Cast(S.ChaosStrike, nil, nil, not Target:IsSpellInRange(S.ChaosStrike)) then return "chaos_strike normal 26"; end
end
-- eye_beam,if=talent.blind_fury.enabled&raid_event.adds.in>cooldown&!variable.waiting_for_agony_gaze
if S.EyeBeam:IsReady() and (S.BlindFury:IsAvailable() and not VarWaitingForAgonyGaze) then
if Cast(S.EyeBeam, Settings.Havoc.GCDasOffGCD.EyeBeam, nil, not Target:IsInRange(20)) then return "eye_beam normal 28"; end
end
-- demons_bite,target_if=min:debuff.burning_wound.remains,if=runeforge.burning_wound&debuff.burning_wound.remains<4
if S.DemonsBite:IsCastable() then
if Everyone.CastTargetIf(S.DemonsBite, Enemies8y, "min", EvalutateTargetIfFilterDemonsBite202, EvaluateTargetIfDemonsBite204, not Target:IsSpellInRange(S.DemonsBite)) then return "demons_bite normal 28"; end
end
-- demons_bite
if S.DemonsBite:IsCastable() then
if Cast(S.DemonsBite, nil, nil, not Target:IsSpellInRange(S.DemonsBite)) then return "demons_bite normal 30"; end
end
-- fel_rush,if=!talent.momentum.enabled&raid_event.movement.in>charges*10&talent.demon_blades.enabled
if S.FelRush:IsCastable() and ((not S.Momentum:IsAvailable()) and S.DemonBlades:IsAvailable() and ConserveFelRush()) then
if Cast(S.FelRush, nil, Settings.Commons.DisplayStyle.FelRush) then return "fel_rush normal 32"; end
end
-- felblade,if=movement.distance>15|buff.out_of_range.up
if S.Felblade:IsCastable() and (not IsInMeleeRange()) then
if Cast(S.Felblade, nil, nil, not Target:IsSpellInRange(S.Felblade)) then return "felblade normal 34"; end
end
-- fel_rush,if=movement.distance>15|(buff.out_of_range.up&!talent.momentum.enabled)
if S.FelRush:IsCastable() and ((not IsInMeleeRange()) and (not S.Momentum:IsAvailable()) and ConserveFelRush()) then
if Cast(S.FelRush, nil, Settings.Commons.DisplayStyle.FelRush) then return "fel_rush normal 36"; end
end
-- vengeful_retreat,if=movement.distance>15
if S.VengefulRetreat:IsCastable() and (not IsInMeleeRange()) then
if Cast(S.VengefulRetreat, Settings.Havoc.OffGCDasOffGCD.VengefulRetreat) then return "vengeful_retreat normal 38"; end
end
-- throw_glaive,if=talent.demon_blades.enabled
if S.ThrowGlaive:IsCastable() and (S.DemonBlades:IsAvailable()) then
if Cast(S.ThrowGlaive, Settings.Havoc.GCDasOffGCD.ThrowGlaive, nil, not Target:IsSpellInRange(S.ThrowGlaive)) then return "throw_glaive normal 40"; end
end
end
--- ======= ACTION LISTS =======
local function APL()
if AoEON() then
Enemies8y = Player:GetEnemiesInMeleeRange(8) -- Multiple Abilities
Enemies20y = Player:GetEnemiesInMeleeRange(20) -- Eye Beam
EnemiesCount8 = #Enemies8y
EnemiesCount20 = #Enemies20y
else
EnemiesCount8 = 1
EnemiesCount20 = 1
end
if Everyone.TargetIsValid() or Player:AffectingCombat() then
-- Calculate fight_remains
BossFightRemains = HL.BossFightRemains(nil, true)
FightRemains = BossFightRemains
if FightRemains == 11111 then
FightRemains = HL.FightRemains(Enemies8y, false)
end
end
if Everyone.TargetIsValid() then
-- Precombat
if not Player:AffectingCombat() then
local ShouldReturn = Precombat(); if ShouldReturn then return ShouldReturn; end
end
-- auto_attack
-- variable,name=blade_dance,if=!runeforge.chaos_theory&!runeforge.darkglare_medallion,value=talent.first_blood.enabled|spell_targets.blade_dance1>=(3-talent.trail_of_ruin.enabled)
if ((not ChaosTheoryEquipped) and not DarkglareEquipped) then
VarBladeDance = (S.FirstBlood:IsAvailable() or EnemiesCount8 >= (3 - num(S.TrailofRuin:IsAvailable())))
end
-- variable,name=blade_dance,if=runeforge.chaos_theory,value=buff.chaos_theory.down|talent.first_blood.enabled&spell_targets.blade_dance1>=(2-talent.trail_of_ruin.enabled)|!talent.cycle_of_hatred.enabled&spell_targets.blade_dance1>=(4-talent.trail_of_ruin.enabled)
if (ChaosTheoryEquipped) then
VarBladeDance = (Player:BuffDown(S.ChaosTheoryBuff) or S.FirstBlood:IsAvailable() and EnemiesCount8 >= (2 - num(S.TrailofRuin:IsAvailable())) or (not S.CycleofHatred:IsAvailable()) and EnemiesCount8 >= (4 - num(S.TrailofRuin:IsAvailable())))
end
-- variable,name=blade_dance,if=runeforge.darkglare_medallion,value=talent.first_blood.enabled|(buff.metamorphosis.up|talent.trail_of_ruin.enabled|debuff.essence_break.up)&spell_targets.blade_dance1>=(3-talent.trail_of_ruin.enabled)|!talent.demonic.enabled&spell_targets.blade_dance1>=4
if (DarkglareEquipped) then
VarBladeDance = (S.FirstBlood:IsAvailable() or (Player:BuffUp(S.MetamorphosisBuff) or S.TrailofRuin:IsAvailable() or Target:DebuffUp(S.EssenceBreakDebuff)) and EnemiesCount8 >= (3 - num(S.TrailofRuin:IsAvailable())) or (not S.Demonic:IsAvailable()) and EnemiesCount8 >= 4)
end
-- variable,name=blade_dance,op=reset,if=talent.essence_break.enabled&cooldown.essence_break.ready
if (S.EssenceBreak:IsAvailable() and S.EssenceBreak:CooldownUp()) then
VarBladeDance = false
end
-- variable,name=blade_dance,if=runeforge.agony_gaze&talent.cycle_of_hatred,value=variable.blade_dance&active_dot.sinful_brand<2
if (AgonyGazeEquipped and S.CycleofHatred:IsAvailable()) then
VarBladeDance = VarBladeDance and S.SinfulBrandDebuff:AuraActiveCount() < 2
end
-- variable,name=pooling_for_meta,value=!talent.demonic.enabled&cooldown.metamorphosis.remains<6&fury.deficit>30
VarPoolingForMeta = (not S.Demonic:IsAvailable()) and S.Metamorphosis:CooldownRemains() < 6 and Player:FuryDeficit() > 30
-- variable,name=pooling_for_blade_dance,value=variable.blade_dance&(fury<75-talent.first_blood.enabled*20)
VarPoolingForBladeDance = VarBladeDance and Player:Fury() < 75 - num(S.FirstBlood:IsAvailable()) * 20
-- variable,name=pooling_for_eye_beam,value=talent.demonic.enabled&!talent.blind_fury.enabled&cooldown.eye_beam.remains<(gcd.max*2)&fury.deficit>20
VarPoolingForEyeBeam = S.Demonic:IsAvailable() and (not S.BlindFury:IsAvailable()) and S.EyeBeam:CooldownRemains() < (Player:GCD() * 2) and Player:FuryDeficit() > 20
-- variable,name=waiting_for_momentum,value=talent.momentum.enabled&!buff.momentum.up
VarWaitingForMomentum = S.Momentum:IsAvailable() and Player:BuffDown(S.MomentumBuff)
-- variable,name=waiting_for_agony_gaze,if=runeforge.agony_gaze,value=!dot.sinful_brand.ticking&cooldown.sinful_brand.remains<gcd.max*4&(!cooldown.metamorphosis.up|active_enemies=1)&spell_targets.eye_beam<=3
if (AgonyGazeEquipped) then
VarWaitingForAgonyGaze = Target:DebuffDown(S.SinfulBrandDebuff) and S.SinfulBrand:CooldownRemains() < Player:GCD() * 4 and (S.Metamorphosis:CooldownDown() or EnemiesCount8 == 1) and EnemiesCount20 <= 3
end
-- disrupt (and stun interrupts)
local ShouldReturn = Everyone.Interrupt(10, S.Disrupt, Settings.Commons.OffGCDasOffGCD.Disrupt, StunInterrupts); if ShouldReturn then return ShouldReturn; end
-- call_action_list,name=cooldown,if=gcd.remains=0
if CDsON() then
local ShouldReturn = Cooldown(); if ShouldReturn then return ShouldReturn; end
end
-- Manually added: Defensive Blur
if S.Blur:IsCastable() and Player:HealthPercentage() <= Settings.Havoc.BlurHealthThreshold then
if Cast(S.Blur, Settings.Havoc.OffGCDasOffGCD.Blur) then return "Blur defensives (Danger)"; end
end
-- pick_up_fragment,type=demon,if=demon_soul_fragments>0
-- pick_up_fragment,mode=nearest,if=(talent.demonic_appetite.enabled&fury.deficit>=35|runeforge.blind_faith&buff.blind_faith.up)&(!cooldown.eye_beam.ready|fury<30)
-- TODO: Can't detect when orbs actually spawn, we could possibly show a suggested icon when we DON'T want to pick up souls so people can avoid moving?
-- throw_glaive,if=buff.fel_bombardment.stack=5&(buff.immolation_aura.up|!buff.metamorphosis.up)
if S.ThrowGlaive:IsCastable() and (Player:BuffStack(S.FelBombardmentBuff) == 5 and (Player:BuffUp(S.ImmolationAuraBuff) or Player:BuffDown(S.MetamorphosisBuff))) then
if Cast(S.ThrowGlaive, Settings.Havoc.GCDasOffGCD.ThrowGlaive, nil, not Target:IsSpellInRange(S.ThrowGlaive)) then return "throw_glaive fel_bombardment"; end
end
-- run_action_list,name=demonic,if=talent.demonic.enabled
if (S.Demonic:IsAvailable()) then
local ShouldReturn = Demonic(); if ShouldReturn then return ShouldReturn; end
end
-- run_action_list,name=normal
if (true) then
local ShouldReturn = Normal(); if ShouldReturn then return ShouldReturn; end
end
-- Show pool icon if nothing else to do (should only happen when Demon Blades is used)
if (S.DemonBlades:IsAvailable()) then
if Cast(S.Pool) then return "pool demon_blades"; end
end
end
end
local function Init()
S.SinfulBrandDebuff:RegisterAuraTracking()
--HR.Print("Havoc DH rotation is currently a work in progress, but has been updated for patch 9.1.5.")
end
HR.SetAPL(577, APL, Init)