rogue="T22_Rogue_Subtlety"
source=default
spec=subtlety
level=120
race=night_elf
timeofday=day
role=attack
position=back
talents=1320031

# Default consumables
potion=battle_potion_of_agility
flask=currents
food=bountiful_captains_feast
augmentation=battle_scarred

# 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+=/augmentation
actions.precombat+=/food
# Snapshot raid buffed stats before combat begins and pre-potting is done.
actions.precombat+=/snapshot_stats
actions.precombat+=/stealth
actions.precombat+=/marked_for_death,precombat_seconds=15
actions.precombat+=/shadow_blades,precombat_seconds=1
actions.precombat+=/potion

# Executed every time the actor is available.
# Restealth if possible (no vulnerable enemies in combat)
actions=stealth
# Check CDs at first
actions+=/call_action_list,name=cds
# Run fully switches to the Stealthed Rotation (by doing so, it forces pooling if nothing is available).
actions+=/run_action_list,name=stealthed,if=stealthed.all
# Apply Nightblade at 2+ CP during the first 10 seconds, after that 4+ CP if it expires within the next GCD or is not up
actions+=/nightblade,if=target.time_to_die>6&remains<gcd.max&combo_points>=4-(time<10)*2
# Only change rotation if we have priority_rotation set and multiple targets up.
actions+=/variable,name=use_priority_rotation,value=priority_rotation&spell_targets.shuriken_storm>=2
# Priority Rotation? Let's give a crap about energy for the stealth CDs (builder still respect it). Yup, it can be that simple.
actions+=/call_action_list,name=stealth_cds,if=variable.use_priority_rotation
# Used to define when to use stealth CDs or builders
actions+=/variable,name=stealth_threshold,value=25+talent.vigor.enabled*35+talent.master_of_shadows.enabled*25+talent.shadow_focus.enabled*20+talent.alacrity.enabled*10+15*(spell_targets.shuriken_storm>=3)
# Consider using a Stealth CD when reaching the energy threshold
actions+=/call_action_list,name=stealth_cds,if=energy.deficit<=variable.stealth_threshold
# Finish at 4+ without DS, 5+ with DS (outside stealth)
actions+=/call_action_list,name=finish,if=combo_points.deficit<=1|target.time_to_die<=1&combo_points>=3
# With DS also finish at 4+ against exactly 4 targets (outside stealth)
actions+=/call_action_list,name=finish,if=spell_targets.shuriken_storm=4&combo_points>=4
# Use a builder when reaching the energy threshold
actions+=/call_action_list,name=build,if=energy.deficit<=variable.stealth_threshold
# Lowest priority in all of the APL because it causes a GCD
actions+=/arcane_torrent,if=energy.deficit>=15+energy.regen
actions+=/arcane_pulse
actions+=/lights_judgment

# Builders
actions.build=shuriken_storm,if=spell_targets>=2
actions.build+=/gloomblade
actions.build+=/backstab

# Cooldowns
actions.cds=potion,if=buff.bloodlust.react|buff.symbols_of_death.up&(buff.shadow_blades.up|cooldown.shadow_blades.remains<=10)
# Falling back to default item usage: Use with Symbols of Death.
actions.cds+=/use_item,name=galecallers_boon,if=buff.symbols_of_death.up|target.time_to_die<20
actions.cds+=/blood_fury,if=buff.symbols_of_death.up
actions.cds+=/berserking,if=buff.symbols_of_death.up
actions.cds+=/fireblood,if=buff.symbols_of_death.up
actions.cds+=/ancestral_call,if=buff.symbols_of_death.up
# Use Dance off-gcd before the first Shuriken Storm from Tornado comes in.
actions.cds+=/shadow_dance,use_off_gcd=1,if=!buff.shadow_dance.up&buff.shuriken_tornado.up&buff.shuriken_tornado.remains<=3.5
# (Unless already up because we took Shadow Focus) use Symbols off-gcd before the first Shuriken Storm from Tornado comes in.
actions.cds+=/symbols_of_death,use_off_gcd=1,if=buff.shuriken_tornado.up&buff.shuriken_tornado.remains<=3.5
# Use Symbols on cooldown (after first Nightblade) unless we are going to pop Tornado and do not have Shadow Focus.
actions.cds+=/symbols_of_death,if=dot.nightblade.ticking&(!talent.shuriken_tornado.enabled|talent.shadow_focus.enabled|spell_targets.shuriken_storm<3|!cooldown.shuriken_tornado.up)
# If adds are up, snipe the one with lowest TTD. Use when dying faster than CP deficit or not stealthed without any CP.
actions.cds+=/marked_for_death,target_if=min:target.time_to_die,if=raid_event.adds.up&(target.time_to_die<combo_points.deficit|!stealthed.all&combo_points.deficit>=cp_max_spend)
# If no adds will die within the next 30s, use MfD on boss without any CP and no stealth.
actions.cds+=/marked_for_death,if=raid_event.adds.in>30-raid_event.adds.duration&!stealthed.all&combo_points.deficit>=cp_max_spend
actions.cds+=/shadow_blades,if=combo_points.deficit>=2+stealthed.all
# At 3+ without Shadow Focus use Tornado with SoD and Dance ready. We will pop those before the first storm comes in.
actions.cds+=/shuriken_tornado,if=spell_targets>=3&!talent.shadow_focus.enabled&dot.nightblade.ticking&!stealthed.all&cooldown.symbols_of_death.up&cooldown.shadow_dance.charges>=1
# At 3+ with Shadow Focus use Tornado with SoD already up.
actions.cds+=/shuriken_tornado,if=spell_targets>=3&talent.shadow_focus.enabled&dot.nightblade.ticking&buff.symbols_of_death.up
actions.cds+=/shadow_dance,if=!buff.shadow_dance.up&target.time_to_die<=5+talent.subterfuge.enabled&!raid_event.adds.up

# Finishers
# Eviscerate highest priority at 2+ targets with Shadow Focus (5+ with Secret Technique in addition) and Night's Vengeance up.
actions.finish=eviscerate,if=talent.shadow_focus.enabled&buff.nights_vengeance.up&spell_targets.shuriken_storm>=2+3*talent.secret_technique.enabled
# Keep up Nightblade if it is about to run out. Do not use NB during Dance, if talented into Dark Shadow.
actions.finish+=/nightblade,if=(!talent.dark_shadow.enabled|!buff.shadow_dance.up)&target.time_to_die-remains>6&remains<tick_time*2
# Multidotting outside Dance on targets that will live for the duration of Nightblade, refresh during pandemic. Multidot as long as 2+ targets do not have Nightblade up with Replicating Shadows (unless you have Night's Vengeance too).
actions.finish+=/nightblade,cycle_targets=1,if=!variable.use_priority_rotation&spell_targets.shuriken_storm>=2&(azerite.nights_vengeance.enabled|!azerite.replicating_shadows.enabled|spell_targets.shuriken_storm-active_dot.nightblade>=2)&!buff.shadow_dance.up&target.time_to_die>=(5+(2*combo_points))&refreshable
# Refresh Nightblade early if it will expire during Symbols. Do that refresh if SoD gets ready in the next 5s.
actions.finish+=/nightblade,if=remains<cooldown.symbols_of_death.remains+10&cooldown.symbols_of_death.remains<=5&target.time_to_die-remains>cooldown.symbols_of_death.remains+5
# Secret Technique during Symbols. With Dark Shadow only during Shadow Dance (until threshold in next line).
actions.finish+=/secret_technique,if=buff.symbols_of_death.up&(!talent.dark_shadow.enabled|buff.shadow_dance.up)
# With enough targets always use SecTec on CD.
actions.finish+=/secret_technique,if=spell_targets.shuriken_storm>=2+talent.dark_shadow.enabled+talent.nightstalker.enabled
actions.finish+=/eviscerate

# Stealth Cooldowns
# Helper Variable
actions.stealth_cds=variable,name=shd_threshold,value=cooldown.shadow_dance.charges_fractional>=1.75
# Vanish unless we are about to cap on Dance charges. Only when Find Weakness is about to run out.
actions.stealth_cds+=/vanish,if=!variable.shd_threshold&combo_points.deficit>1&debuff.find_weakness.remains<1
# Pool for Shadowmeld + Shadowstrike unless we are about to cap on Dance charges. Only when Find Weakness is about to run out.
actions.stealth_cds+=/pool_resource,for_next=1,extra_amount=40
actions.stealth_cds+=/shadowmeld,if=energy>=40&energy.deficit>=10&!variable.shd_threshold&combo_points.deficit>1&debuff.find_weakness.remains<1
# CP requirement: Dance at low CP by default.
actions.stealth_cds+=/variable,name=shd_combo_points,value=combo_points.deficit>=4
# CP requirement: Dance only before finishers if we have amp talents and priority rotation.
actions.stealth_cds+=/variable,name=shd_combo_points,value=combo_points.deficit<=1+2*azerite.the_first_dance.enabled,if=variable.use_priority_rotation&(talent.nightstalker.enabled|talent.dark_shadow.enabled)
# With Dark Shadow only Dance when Nightblade will stay up. Use during Symbols or above threshold.
actions.stealth_cds+=/shadow_dance,if=variable.shd_combo_points&(!talent.dark_shadow.enabled|dot.nightblade.remains>=5+talent.subterfuge.enabled)&(variable.shd_threshold|buff.symbols_of_death.remains>=1.2|spell_targets.shuriken_storm>=4&cooldown.symbols_of_death.remains>10)
# Burn remaining Dances before the target dies if SoD won't be ready in time.
actions.stealth_cds+=/shadow_dance,if=variable.shd_combo_points&target.time_to_die<cooldown.symbols_of_death.remains&!raid_event.adds.up

# Stealthed Rotation
# If Stealth/vanish are up, use Shadowstrike to benefit from the passive bonus and Find Weakness, even if we are at max CP (from the precombat MfD).
actions.stealthed=shadowstrike,if=(talent.find_weakness.enabled|spell_targets.shuriken_storm<3)&(buff.stealth.up|buff.vanish.up)
# Finish at 4+ CP without DS, 5+ with DS, and 6 with DS after Vanish or The First Dance and no Dark Shadow + no Subterfuge
actions.stealthed+=/call_action_list,name=finish,if=combo_points.deficit<=1-(talent.deeper_stratagem.enabled&(buff.vanish.up|azerite.the_first_dance.enabled&!talent.dark_shadow.enabled&!talent.subterfuge.enabled&spell_targets.shuriken_storm<3))
# At 2 targets with Secret Technique keep up Find Weakness by cycling Shadowstrike.
actions.stealthed+=/shadowstrike,cycle_targets=1,if=talent.secret_technique.enabled&talent.find_weakness.enabled&debuff.find_weakness.remains<1&spell_targets.shuriken_storm=2&target.time_to_die-remains>6
# Without Deeper Stratagem and 3 Ranks of Blade in the Shadows it is worth using Shadowstrike on 3 targets.
actions.stealthed+=/shadowstrike,if=!talent.deeper_stratagem.enabled&azerite.blade_in_the_shadows.rank=3&spell_targets.shuriken_storm=3
# For priority rotation, use Shadowstrike over Storm 1) with WM against up to 4 targets, 2) if FW is running off (on any amount of targets), or 3) to maximize SoD extension with Inevitability on 3 targets (4 with BitS).
actions.stealthed+=/shadowstrike,if=variable.use_priority_rotation&(talent.find_weakness.enabled&debuff.find_weakness.remains<1|talent.weaponmaster.enabled&spell_targets.shuriken_storm<=4|azerite.inevitability.enabled&buff.symbols_of_death.up&spell_targets.shuriken_storm<=3+azerite.blade_in_the_shadows.enabled)
actions.stealthed+=/shuriken_storm,if=spell_targets>=3
actions.stealthed+=/shadowstrike

head=hood_of_pestilent_ichor,id=160623,bonus_id=4824/1507/4775,azerite_powers=483/31/13
neck=heart_of_azeroth,id=158075,bonus_id=4929/4930/4936/1536,azerite_level=33
shoulders=usurpers_bloodcaked_spaulders,id=160620,bonus_id=4824/1507/4775,azerite_powers=414/22/13
back=cloak_of_rippling_whispers,id=160642,bonus_id=4800/1507
chest=jerkin_of_the_aberrant_chimera,id=160619,bonus_id=4824/1507/4775,azerite_powers=413/31/13
wrists=wristwraps_of_coursing_miasma,id=160621,bonus_id=4800/1507
hands=gloves_of_descending_madness,id=160618,bonus_id=4800/1507
waist=replicated_chitin_cord,id=160717,bonus_id=4800/1507
legs=pathogenic_legwraps,id=160625,bonus_id=4800/1507
feet=quarantine_protocol_treads,id=160624,bonus_id=4800/1507
finger1=ring_of_the_infinite_void,id=160647,bonus_id=4800/1507,enchant=pact_of_critical_strike
finger2=rotscour_ring,id=160645,bonus_id=4800/1507,enchant=pact_of_critical_strike
trinket1=harlans_loaded_dice,id=155881,bonus_id=1542/4779
trinket2=galecallers_boon,id=159614,bonus_id=1542/4779
main_hand=latticework_scalpel,id=160683,bonus_id=4800/1507,enchant=deadly_navigation
off_hand=latticework_scalpel,id=160683,bonus_id=4800/1507,enchant=versatile_navigation

# Gear Summary
# gear_ilvl=384.31
# gear_agility=4303
# gear_stamina=7205
# gear_crit_rating=1254
# gear_haste_rating=917
# gear_mastery_rating=582
# gear_versatility_rating=249
# gear_armor=1911
