# Executed before combat begins. Accepts non-harmful actions only.
actions.precombat=flask
actions.precombat+=/food
actions.precombat+=/augmentation
actions.precombat+=/arcane_intellect
actions.precombat+=/summon_arcane_familiar
# conserve_mana is the mana percentage we want to go down to during conserve. It needs to leave enough room to worst case scenario spam AB only during AP.
actions.precombat+=/variable,name=conserve_mana,op=set,value=10
actions.precombat+=/snapshot_stats
actions.precombat+=/mirror_image
actions.precombat+=/potion
actions.precombat+=/evocation
# Executed every time the actor is available.
# Interrupt the boss when possible.
actions=counterspell,if=target.debuff.casting.react
actions+=/time_warp,if=time=0&buff.bloodlust.down
# Start a burn phase when important cooldowns are available. Start with 4 arcane charges, unless there's a good reason not to. (charged up)
actions+=/call_action_list,name=burn,if=burn_phase|target.time_to_die<variable.average_burn_length|(cooldown.arcane_power.remains=0&(buff.arcane_charge.stack=buff.arcane_charge.max_stack|(talent.charged_up.enabled&cooldown.charged_up.remains=0)))
actions+=/call_action_list,name=conserve,if=!burn_phase
actions+=/call_action_list,name=movement
# Increment our burn phase counter. Whenever we enter the `burn` actions without being in a burn phase, it means that we are about to start one.
actions.burn=variable,name=total_burns,op=add,value=1,if=!burn_phase
actions.burn+=/start_burn_phase,if=!burn_phase
# End the burn phase when we just evocated.
actions.burn+=/stop_burn_phase,if=burn_phase&mana.pct<=variable.conserve_mana&target.time_to_die>variable.average_burn_length&burn_phase_duration>0
actions.burn+=/evocation
actions.burn+=/mirror_image
actions.burn+=/charged_up,if=buff.arcane_charge.stack<=1&(!set_bonus.tier20_2pc|cooldown.presence_of_mind.remains>5)
actions.burn+=/nether_tempest,if=(refreshable|!ticking)&buff.arcane_charge.stack=buff.arcane_charge.max_stack&buff.rune_of_power.down&buff.arcane_power.down
actions.burn+=/lights_judgment,if=buff.arcane_power.down
actions.burn+=/rune_of_power,if=!buff.arcane_power.up&(mana.pct>=50|cooldown.arcane_power.remains=0)&(buff.arcane_charge.stack=buff.arcane_charge.max_stack)
actions.burn+=/arcane_power
actions.burn+=/use_items,if=buff.arcane_power.up|target.time_to_die<cooldown.arcane_power.remains
actions.burn+=/blood_fury
actions.burn+=/berserking
actions.burn+=/fireblood
actions.burn+=/ancestral_call
actions.burn+=/presence_of_mind,if=buff.rune_of_power.remains<=buff.presence_of_mind.max_stack*action.arcane_blast.execute_time|buff.arcane_power.remains<=buff.presence_of_mind.max_stack*action.arcane_blast.execute_time
actions.burn+=/potion,if=buff.arcane_power.up&(buff.berserking.up|buff.blood_fury.up|!(race.troll|race.orc))
actions.burn+=/arcane_orb,if=buff.arcane_charge.stack=0|(active_enemies<3|(active_enemies<2&talent.resonance.enabled))
actions.burn+=/arcane_barrage,if=(active_enemies>=3|(active_enemies>=2&talent.resonance.enabled))&(buff.arcane_charge.stack=buff.arcane_charge.max_stack)
actions.burn+=/arcane_explosion,if=active_enemies>=3|(active_enemies>=2&talent.resonance.enabled)
# Ignore Arcane Missiles during Arcane Power, aside from some very specific exceptions, like not having Overpowered talented & running 3x Arcane Pummeling.
actions.burn+=/arcane_missiles,if=buff.clearcasting.react&active_enemies<3&(talent.amplification.enabled|(!talent.overpowered.enabled&azerite.arcane_pummeling.rank>=2)|buff.arcane_power.down),chain=1
actions.burn+=/arcane_blast
# Now that we're done burning, we can update the average_burn_length with the length of this burn.
actions.burn+=/variable,name=average_burn_length,op=set,value=(variable.average_burn_length*variable.total_burns-variable.average_burn_length+(burn_phase_duration))%variable.total_burns
#actions.burn+=/evocation,interrupt_if=mana.pct>=85,interrupt_immediate=1
# For the rare occasion where we go oom before evocation is back up. (Usually because we get very bad rng so the burn is cut very short)
actions.burn+=/arcane_barrage
actions.conserve=mirror_image
actions.conserve+=/charged_up,if=buff.arcane_charge.stack=0
actions.conserve+=/presence_of_mind,if=set_bonus.tier20_2pc&buff.arcane_charge.stack=0
actions.conserve+=/nether_tempest,if=(refreshable|!ticking)&buff.arcane_charge.stack=buff.arcane_charge.max_stack&buff.rune_of_power.down&buff.arcane_power.down
actions.conserve+=/arcane_orb,if=buff.arcane_charge.stack<=2&(cooldown.arcane_power.remains>10|active_enemies<=2)
# Arcane Blast shifts up in priority when running rule of threes.
actions.conserve+=/arcane_blast,if=buff.rule_of_threes.up&buff.arcane_charge.stack>3
actions.conserve+=/rune_of_power,if=buff.arcane_charge.stack=buff.arcane_charge.max_stack&(full_recharge_time<=execute_time|recharge_time<=cooldown.arcane_power.remains|target.time_to_die<=cooldown.arcane_power.remains)
actions.conserve+=/arcane_missiles,if=mana.pct<=95&buff.clearcasting.react,chain=1
# During conserve, we still just want to continue not dropping charges as long as possible.So keep 'burning' as long as possible (aka conserve_mana threshhold) and then swap to a 4x AB->Abarr conserve rotation. This is mana neutral for RoT, mana negative with arcane familiar. If we do not have 4 AC, we can dip slightly lower to get a 4th AC.
actions.conserve+=/arcane_barrage,if=((buff.arcane_charge.stack=buff.arcane_charge.max_stack)&mana.pct<=variable.conserve_mana|(talent.arcane_orb.enabled&cooldown.arcane_orb.remains<=gcd&cooldown.arcane_power.remains>10))|mana.pct<=(variable.conserve_mana-10)
# Supernova is barely worth casting, which is why it is so far down, only just above AB.
actions.conserve+=/supernova,if=mana.pct<=95
# Keep 'burning' in aoe situations until conserve_mana pct. After that only cast AE with 3 Arcane charges, since it's almost equal mana cost to a 3 stack AB anyway. At that point AoE rotation will be AB x3 -> AE -> Abarr
actions.conserve+=/arcane_explosion,if=active_enemies>=3&(mana.pct>=variable.conserve_mana|buff.arcane_charge.stack=3)
actions.conserve+=/arcane_blast
actions.conserve+=/arcane_barrage
actions.movement=shimmer,if=movement.distance>=10
actions.movement+=/blink,if=movement.distance>=10
actions.movement+=/presence_of_mind
actions.movement+=/arcane_missiles
actions.movement+=/arcane_orb
actions.movement+=/supernova
head=,id=160719,bonus_id=4822/1477/4786,reforge=3,azerite_powers=167/459
neck=,id=158075,bonus_id=4936/4929/4930/1508,reforge=11,azerite_level=19
shoulder=,id=159232,bonus_id=4819/1512/4786,reforge=23,azerite_powers=167/22
back=,id=159293,gem_id=154126,bonus_id=4780/4802/1522/4783,reforge=16
chest=,id=159257,bonus_id=4819/1512/4786,reforge=23,azerite_powers=167/30
wrist=,id=158348,bonus_id=4779/1517/4783,reforge=23
hands=,id=157968,enchant_id=5937,bonus_id=4803/1532/4783,reforge=27
waist=,id=159239,bonus_id=4779/1512/4786,reforge=23
legs=,id=159277,bonus_id=4780/1522/4783,reforge=16
feet=,id=158351,bonus_id=4780/1517/4786,reforge=16
finger1=,id=158160,enchant_id=5938,bonus_id=4803/1537/4784,reforge=25
finger2=,id=158161,enchant_id=5938,bonus_id=4803/1527/4783,reforge=27
trinket1=,id=161472,gem_id=153709,bonus_id=5119/1808/1492/4786,reforge=3
trinket2=,id=160651,bonus_id=4799/1492/4786,reforge=5
main_hand=,id=158321,enchant_id=5949,bonus_id=4779/1517/4783,reforge=23
off_hand=,id=159667,bonus_id=4779/1512/4786,reforge=23