mage="T21_Mage_Arcane"
spec=arcane
level=110
race=troll
role=spell
position=back
talents=2023031
artifact=4:0:0:0:0:72:4:73:1:74:4:75:4:77:4:78:1:79:4:80:1:81:4:82:4:83:4:84:4:86:1:87:1:290:1:1169:1:1339:1:1371:1:1529:4:1530:1:1531:1:1532:24:1639:1
crucible=1739:1780:81/1739:1780:82/1739:1780:81

# Default consumables
potion=deadly_grace
flask=whispered_pact
food=lemon_herb_filet
augmentation=defiled

# This default action priority list is automatically created based on your character.
# It is a attempt to provide you with a action list that is both simple and practicable,
# while resulting in a meaningful and good simulation. It may not result in the absolutely highest possible dps.
# Feel free to edit, adapt and improve it to your own needs.
# SimulationCraft is always looking for updates and improvements to the default action lists.

# Executed before combat begins. Accepts non-harmful actions only.
actions.precombat=flask
actions.precombat+=/food
actions.precombat+=/augmentation
actions.precombat+=/summon_arcane_familiar
actions.precombat+=/snapshot_stats
actions.precombat+=/mirror_image
actions.precombat+=/potion
actions.precombat+=/arcane_blast

# Executed every time the actor is available.
# Interrupt the boss when possible.
actions=counterspell,if=target.debuff.casting.react
# 3 different lust usages to support Shard: on pull; during Arcane Power (with potion, preferably); end of fight.
actions+=/time_warp,if=buff.bloodlust.down&(time=0|(buff.arcane_power.up&(buff.potion.up|!action.potion.usable))|target.time_to_die<=buff.bloodlust.duration)
# Set variables used throughout the APL.
actions+=/call_action_list,name=variables
# AoE scenarios will delay our Presence of Mind cooldown because we'll be using Arcane Explosion instead of Arcane Blast, so we cancel the aura immediately.
actions+=/cancel_buff,name=presence_of_mind,if=active_enemies>1&set_bonus.tier20_2pc
# Build Arcane Charges before doing anything else. Burn phase has some specific actions for building Arcane Charges, so we avoid entering this list if currently burning.
actions+=/call_action_list,name=build,if=buff.arcane_charge.stack<buff.arcane_charge.max_stack&!burn_phase
# Enter burn actions if we're ready to burn, or already burning.
actions+=/call_action_list,name=burn,if=(buff.arcane_charge.stack=buff.arcane_charge.max_stack&variable.time_until_burn=0)|burn_phase
# Fallback to conserve rotation.
actions+=/call_action_list,name=conserve

actions.build=arcane_orb
# Use Arcane Missiles at max stacks to avoid munching a proc. Alternatively, we can cast at 3 stacks of Arcane Charge to conserve mana.
actions.build+=/arcane_missiles,if=active_enemies<3&(variable.arcane_missiles_procs=buff.arcane_missiles.max_stack|(variable.arcane_missiles_procs&mana.pct<=50&buff.arcane_charge.stack=3)),chain=1
actions.build+=/arcane_explosion,if=active_enemies>1
actions.build+=/arcane_blast

# 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
# The burn_phase variable is a flag indicating whether or not we are in a burn phase. It is set to 1 (True) with start_burn_phase, and 0 (False) with stop_burn_phase.
actions.burn+=/start_burn_phase,if=!burn_phase
# Evocation is the end of our burn phase, but we check available charges in case of Gravity Spiral. The final burn_phase_duration check is to prevent an infinite loop in SimC.
actions.burn+=/stop_burn_phase,if=prev_gcd.1.evocation&cooldown.evocation.charges=0&burn_phase_duration>0
# Use during pandemic refresh window or if the dot is missing.
actions.burn+=/nether_tempest,if=refreshable|!ticking
actions.burn+=/mark_of_aluneth
actions.burn+=/mirror_image
actions.burn+=/lights_judgment,if=buff.arcane_power.down
# Prevents using RoP at super low mana.
actions.burn+=/rune_of_power,if=mana.pct>30|(buff.arcane_power.up|cooldown.arcane_power.up)
actions.burn+=/arcane_power
actions.burn+=/blood_fury
actions.burn+=/berserking
actions.burn+=/arcane_torrent
# For Troll/Orc, it's best to sync potion with their racial buffs.
actions.burn+=/potion,if=buff.arcane_power.up&(buff.berserking.up|buff.blood_fury.up|!(race.troll|race.orc))
# Pops any on-use items, e.g., Tarnished Sentinel Medallion.
actions.burn+=/use_items,if=buff.arcane_power.up|target.time_to_die<cooldown.arcane_power.remains
# With 2pt20 or Charged Up we are able to extend the damage buff from 2pt21.
actions.burn+=/arcane_barrage,if=set_bonus.tier21_2pc&((set_bonus.tier20_2pc&cooldown.presence_of_mind.up)|(talent.charged_up.enabled&cooldown.charged_up.up))&buff.arcane_charge.stack=buff.arcane_charge.max_stack&buff.expanding_mind.down
# With T20, use PoM at start of RoP/AP for damage buff. Without T20, use PoM at end of RoP/AP to cram in two final Arcane Blasts. Includes a mana condition to prevent using PoM at super low mana.
actions.burn+=/presence_of_mind,if=((mana.pct>30|buff.arcane_power.up)&set_bonus.tier20_2pc)|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
# Use Charged Up to regain Arcane Charges after dumping to refresh 2pt21 buff.
actions.burn+=/charged_up,if=buff.arcane_charge.stack<buff.arcane_charge.max_stack
actions.burn+=/arcane_orb
# Arcane Barrage has a good chance of launching an Arcane Orb at max Arcane Charge stacks.
actions.burn+=/arcane_barrage,if=active_enemies>4&equipped.mantle_of_the_first_kirin_tor&buff.arcane_charge.stack=buff.arcane_charge.max_stack
# Arcane Missiles are good, but not when there's multiple targets up.
actions.burn+=/arcane_missiles,if=variable.arcane_missiles_procs=buff.arcane_missiles.max_stack&active_enemies<3,chain=1
# Get PoM back on cooldown as soon as possible.
actions.burn+=/arcane_blast,if=buff.presence_of_mind.up
actions.burn+=/arcane_explosion,if=active_enemies>1
actions.burn+=/arcane_missiles,if=variable.arcane_missiles_procs>1,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
# That last tick of Evocation is a waste; it's better for us to get back to casting.
actions.burn+=/evocation,interrupt_if=ticks=2|mana.pct>=85,interrupt_immediate=1

actions.conserve=mirror_image,if=variable.time_until_burn>recharge_time|variable.time_until_burn>target.time_to_die
actions.conserve+=/mark_of_aluneth,if=mana.pct<85
actions.conserve+=/strict_sequence,name=miniburn,if=talent.rune_of_power.enabled&set_bonus.tier20_4pc&variable.time_until_burn>30:rune_of_power:arcane_barrage:presence_of_mind
# Use if we're about to cap on stacks, or we just used MoA.
actions.conserve+=/rune_of_power,if=full_recharge_time<=execute_time|prev_gcd.1.mark_of_aluneth
# We want Charged Up for our burn phase to refresh 2pt21 buff, but if we have time to let it recharge we can use it during conserve.
actions.conserve+=/strict_sequence,name=abarr_cu_combo,if=talent.charged_up.enabled&cooldown.charged_up.recharge_time<variable.time_until_burn:arcane_barrage:charged_up
# Arcane Missiles are good, but not when there's multiple targets up.
actions.conserve+=/arcane_missiles,if=variable.arcane_missiles_procs=buff.arcane_missiles.max_stack&active_enemies<3,chain=1
actions.conserve+=/supernova
# Use during pandemic refresh window or if the dot is missing.
actions.conserve+=/nether_tempest,if=refreshable|!ticking
# AoE until about 70% mana. We can go a little further with kilt, down to 60% mana.
actions.conserve+=/arcane_explosion,if=active_enemies>1&(mana.pct>=70-(10*equipped.mystic_kilt_of_the_rune_master))
# Use Arcane Blast if we have the mana for it or a proc from legendary wrists. With the Kilt we can cast freely.
actions.conserve+=/arcane_blast,if=mana.pct>=90|buff.rhonins_assaulting_armwraps.up|(buff.rune_of_power.remains>=cast_time&equipped.mystic_kilt_of_the_rune_master)
actions.conserve+=/arcane_missiles,if=variable.arcane_missiles_procs,chain=1
actions.conserve+=/arcane_barrage
# The following two lines are here in case Arcane Barrage is on cooldown.
actions.conserve+=/arcane_explosion,if=active_enemies>1
actions.conserve+=/arcane_blast

# Track the number of Arcane Missiles procs that we have.
actions.variables=variable,name=arcane_missiles_procs,op=set,value=buff.arcane_missiles.react
# Burn condition #1: Arcane Power has to be available.
actions.variables+=/variable,name=time_until_burn,op=set,value=cooldown.arcane_power.remains
# Burn condition #2: Evocation should be up by the time we finish burning. We use the custom variable average_burn_length to help estimate when Evocation will be available.
actions.variables+=/variable,name=time_until_burn,op=max,value=cooldown.evocation.remains-variable.average_burn_length
# Burn condition #3: 2pt20 grants a damage boost with Presence of Mind usage, so we definitely want to stack that with AP.
actions.variables+=/variable,name=time_until_burn,op=max,value=cooldown.presence_of_mind.remains,if=set_bonus.tier20_2pc
# Burn condition #4: We need an RoP charge if we've actually taken the talent. Check usable_in to see when we'll be able to cast, and ignore the line if we didn't take the talent.
actions.variables+=/variable,name=time_until_burn,op=max,value=action.rune_of_power.usable_in,if=talent.rune_of_power.enabled
# Burn condition #5: Charged Up allows the 2pt21 buff to be extended during our burn phase.
actions.variables+=/variable,name=time_until_burn,op=max,value=cooldown.charged_up.remains,if=talent.charged_up.enabled&set_bonus.tier21_2pc
# Boss is gonna die soon. All the above conditions don't really matter. We're just gonna burn our mana until combat ends.
actions.variables+=/variable,name=time_until_burn,op=reset,if=target.time_to_die<variable.average_burn_length

head=runebound_collar,id=152138,bonus_id=3612/1502
neck=chain_of_the_unmaker,id=152283,bonus_id=3612/1502,enchant=mark_of_the_hidden_satyr
shoulders=runebound_mantle,id=152141,bonus_id=3612/1502
back=drape_of_the_arcane_tempest,id=147145,bonus_id=3563/1512,enchant=binding_of_intellect
chest=runebound_tunic,id=152140,bonus_id=3612/1502
wrists=blooddrenched_bindings,id=151954,bonus_id=3612/1502
hands=gloves_of_the_arcane_tempest,id=147146,bonus_id=3563/1512
waist=cord_of_blossoming_petals,id=151952,bonus_id=3612/1502
legs=runebound_leggings,id=152139,bonus_id=3612/1502
feet=lady_dacidions_silk_slippers,id=151945,bonus_id=3612/1502
finger1=soul_of_the_archmage,id=151642,bonus_id=3630,gem_id=151585,enchant=binding_of_versatility
finger2=shard_of_the_exodar,id=132410,bonus_id=3630,gem_id=151585,enchant=binding_of_versatility
trinket1=tarnished_sentinel_medallion,id=147017,bonus_id=3563/1512
trinket2=amanthuls_vision,id=154172,bonus_id=4213
main_hand=aluneth,id=127857,gem_id=155846/155850/155846,relic_id=3612:1512/3612:1512/3612:1512

# Gear Summary
# gear_ilvl=965.27
# gear_stamina=59745
# gear_intellect=61267
# gear_crit_rating=12755
# gear_haste_rating=11973
# gear_mastery_rating=8207
# gear_versatility_rating=6685
# gear_armor=2364
# set_bonus=tier20_2pc=1
# set_bonus=tier21_2pc=1
# set_bonus=tier21_4pc=1
