druid="PR_Druid_Feral_Owlweave"
source=default
spec=feral
level=60
race=night_elf
timeofday=day
role=attack
position=back
talents=2313122
covenant=night_fae
soulbind=niya,grove_invigoration/taste_for_blood:4

# Default consumables
potion=spectral_agility
flask=spectral_flask_of_power
food=feast_of_gluttonous_hedonism
augmentation=veiled
temporary_enchant=main_hand:shaded_sharpening_stone

# 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.

# Feral APL can also be found at https://gist.github.com/Xanzara/6896c8996f5afce5ce115daa3a08daff

# Executed before combat begins. Accepts non-harmful actions only.
actions.precombat=flask
actions.precombat+=/food
actions.precombat+=/augmentation
# Snapshot raid buffed stats before combat begins and pre-potting is done.
actions.precombat+=/snapshot_stats
actions.precombat+=/flask
actions.precombat+=/food
actions.precombat+=/augmentation
# Snapshot raid buffed stats before combat begins and pre-potting is done.
actions.precombat+=/snapshot_stats
actions.precombat+=/variable,name=4cp_bite,value=0
# Shred = 0, Non-snapshot Rake = 1, Snapshot Rake = 2, LI = 3, Swipe = 4
actions.precombat+=/variable,name=filler,value=1
actions.precombat+=/variable,name=rip_ticks,value=7
actions.precombat+=/fleshcraft,if=(soulbind.pustule_eruption|soulbind.volatile_solvent)
actions.precombat+=/cat_form
actions.precombat+=/prowl

# Executed every time the actor is available.
actions=call_action_list,name=owlweave,if=druid.owlweave_cat
# Prowl whenever possible
actions+=/prowl
actions+=/tigers_fury,if=buff.cat_form.down
actions+=/cat_form,if=buff.cat_form.down
actions+=/auto_attack,if=!buff.prowl.up&!buff.shadowmeld.up
actions+=/variable,name=shortest_ttd,value=target.time_to_die
actions+=/cycling_variable,name=shortest_ttd,op=min,value=target.time_to_die
# One shot stealth
actions+=/run_action_list,name=stealth,if=buff.shadowmeld.up|buff.prowl.up
actions+=/skull_bash
actions+=/call_action_list,name=setup,if=!dot.rip.ticking
actions+=/call_action_list,name=cooldown
# Necrolord: Cast 3 or 4 combo point rips on single target outside of berserk or during berserk if feral frenzy is up OR apply a 5cp Rip when TF is up and will soon fall off.
actions+=/rip,if=covenant.necrolord&(!talent.bloodtalons.enabled|buff.bloodtalons.up)&spell_targets.thrash_cat=1&(combo_points>2&refreshable&druid.rip.ticks_gained_on_refresh>variable.rip_ticks&(!buff.bs_inc.up|cooldown.bs_inc.up|(buff.bs_inc.up&cooldown.feral_frenzy.up))|combo_points=5&buff.tigers_fury.up&buff.tigers_fury.remains<4&druid.rip.ticks_gained_on_refresh>5)
actions+=/run_action_list,name=finisher,if=combo_points>=(5-variable.4cp_bite)
actions+=/primal_wrath,if=druid.primal_wrath.ticks_gained_on_refresh>=20&combo_points>=2,line_cd=5
# Multi-gcd stealth
actions+=/call_action_list,name=stealth,if=buff.bs_inc.up
# The most expensive BT cycle (Thresh Shred Swipe cost 115 energy, make sure we can make that in 4 globals)
actions+=/pool_resource,if=talent.bloodtalons.enabled&buff.bloodtalons.down&(energy+3.5*energy.regen+(40*buff.clearcasting.up))<(115-23*buff.incarnation_king_of_the_jungle.up)&active_bt_triggers=0
actions+=/run_action_list,name=bloodtalons,if=talent.bloodtalons.enabled&buff.bloodtalons.down
actions+=/ferocious_bite,target_if=max:target.time_to_die,if=buff.apex_predators_craving.up
actions+=/pool_resource,for_next=1
actions+=/rake,target_if=max:druid.rake.ticks_gained_on_refresh,if=(refreshable|persistent_multiplier>dot.rake.pmultiplier)&druid.rake.ticks_gained_on_refresh>spell_targets.swipe_cat*2-2
actions+=/lunar_inspiration,target_if=max:druid.lunar_inspiration.ticks_gained_on_refresh,if=(refreshable|persistent_multiplier>dot.lunar_inspiration.pmultiplier)&druid.lunar_inspiration.ticks_gained_on_refresh>spell_targets.swipe_cat*2-2
actions+=/pool_resource,for_next=1
actions+=/thrash_cat,target_if=refreshable&druid.thrash_cat.ticks_gained_on_refresh>(4+spell_targets.thrash_cat*4)%(1+mastery_value)-conduit.taste_for_blood.enabled-covenant.necrolord&(!buff.bs_inc.up|spell_targets.thrash_cat>1)
actions+=/pool_resource,for_next=1
actions+=/brutal_slash,if=(raid_event.adds.in>(1+max_charges-charges_fractional)*recharge_time)&(spell_targets.brutal_slash*action.brutal_slash.damage%action.brutal_slash.cost)>(action.shred.damage%action.shred.cost)
actions+=/swipe_cat,if=spell_targets.swipe_cat>1+buff.bs_inc.up*2
actions+=/thrash_cat,if=spell_targets.thrash_cat>3
actions+=/shred,if=buff.clearcasting.up&(buff.sudden_ambush.down&buff.shadowmeld.down|buff.bs_inc.up)
actions+=/call_action_list,name=filler

actions.bloodtalons=rake,target_if=max:druid.rake.ticks_gained_on_refresh,if=(!ticking|(1.2*persistent_multiplier>=dot.rake.pmultiplier)|(active_bt_triggers=2&refreshable))&buff.bt_rake.down
actions.bloodtalons+=/lunar_inspiration,target_if=max:druid.lunar_inspiration.ticks_gained_on_refresh,if=refreshable&buff.bt_moonfire.down
actions.bloodtalons+=/thrash_cat,target_if=refreshable&buff.bt_thrash.down&druid.thrash_cat.ticks_gained_on_refresh>(4+spell_targets.thrash_cat*4)%(1+mastery_value)-conduit.taste_for_blood.enabled
actions.bloodtalons+=/brutal_slash,if=buff.bt_brutal_slash.down
actions.bloodtalons+=/swipe_cat,if=buff.bt_swipe.down&spell_targets.swipe_cat>1
actions.bloodtalons+=/shred,if=buff.bt_shred.down
actions.bloodtalons+=/swipe_cat,if=buff.bt_swipe.down
actions.bloodtalons+=/thrash_cat,if=buff.bt_thrash.down

actions.cooldown=adaptive_swarm,target_if=((!dot.adaptive_swarm_damage.ticking|dot.adaptive_swarm_damage.remains<2)&(dot.adaptive_swarm_damage.stack<3|!dot.adaptive_swarm_heal.stack>1)&!action.adaptive_swarm_heal.in_flight&!action.adaptive_swarm_damage.in_flight&!action.adaptive_swarm.in_flight)&target.time_to_die>5|active_enemies>2&!dot.adaptive_swarm_damage.ticking&energy<35&target.time_to_die>5
actions.cooldown+=/fleshcraft,if=(soulbind.pustule_eruption|soulbind.volatile_solvent)
# Cast Tiger's Fury before (or immediatly after) casting Feral Frenzy if Berserk is on cooldown
actions.cooldown+=/tigers_fury,sync=feral_frenzy,if=cooldown.bs_inc.up
actions.cooldown+=/feral_frenzy,target_if=max:target.time_to_die,if=combo_points<3&target.time_to_die>7&(buff.savage_roar.up|!talent.savage_roar.enabled)&(!cooldown.tigers_fury.up|cooldown.bs_inc.up)|fight_remains<8&fight_remains>2
# TODO: Need to sync with with ravenous frenzy when we run frenzyband, or atleast check if its worth it
actions.cooldown+=/berserk,if=combo_points>=3
actions.cooldown+=/incarnation,if=combo_points>=3
# Try and not waste TF energy, but also just use it for zerk and incarns
actions.cooldown+=/tigers_fury,if=energy.deficit>40|buff.bs_inc.up|(talent.predator.enabled&variable.shortest_ttd<3)
# Might be wrong to use Smeld on Rake in very very niche situations, but very rarely
actions.cooldown+=/shadowmeld,if=buff.tigers_fury.up&buff.bs_inc.down&combo_points<4&buff.sudden_ambush.down&dot.rake.pmultiplier<1.6&energy>40&druid.rake.ticks_gained_on_refresh>spell_targets.swipe_cat*2-2&target.time_to_die>5
actions.cooldown+=/berserking,if=buff.tigers_fury.up|buff.bs_inc.up
actions.cooldown+=/potion,if=buff.bs_inc.up|fight_remains<cooldown.bs_inc.remains|fight_remains<25
actions.cooldown+=/ravenous_frenzy,if=buff.bs_inc.up|fight_remains<21
# TODO: Check moonkin hotw and stuff like this, and maybe better combat remain resync
actions.cooldown+=/convoke_the_spirits,if=(dot.rip.remains>4&combo_points<5&(dot.rake.ticking|spell_targets.thrash_cat>1)&energy.deficit>=20)|fight_remains<5
# Maybe there should be more conditions on the conduit
actions.cooldown+=/kindred_spirits,if=buff.tigers_fury.up|(conduit.deep_allegiance.enabled)
# Give priority to on-use weapon
actions.cooldown+=/use_item,name=jotungeirr_destinys_call,if=equipped.jotungeirr_destinys_call
actions.cooldown+=/use_items

actions.filler=rake,target_if=max:druid.rake.ticks_gained_on_refresh,if=variable.filler=1&dot.rake.pmultiplier<=1.2*persistent_multiplier
actions.filler+=/rake,if=variable.filler=2
actions.filler+=/lunar_inspiration,if=variable.filler=3
actions.filler+=/swipe,if=variable.filler=4
actions.filler+=/shred,if=buff.sudden_ambush.down

actions.finisher=pool_resource,for_next=1
actions.finisher+=/savage_roar,if=buff.savage_roar.remains<3
actions.finisher+=/primal_wrath,if=(druid.primal_wrath.ticks_gained_on_refresh>3*(spell_targets.primal_wrath+1)&spell_targets.primal_wrath>1)|spell_targets.primal_wrath>(3+1*talent.sabertooth.enabled)
actions.finisher+=/rip,target_if=refreshable&druid.rip.ticks_gained_on_refresh>variable.rip_ticks&((buff.tigers_fury.up|!ticking)&(buff.bloodtalons.up|!talent.bloodtalons.enabled)|!talent.sabertooth.enabled)&(spell_targets.primal_wrath=1|!talent.primal_wrath.enabled)&(active_dot.rip=0|ticking&active_dot.rip=1|!runeforge.draught_of_deep_focus|!talent.sabertooth.enabled)
actions.finisher+=/savage_roar,if=buff.savage_roar.remains<(combo_points+1)*6*0.3
actions.finisher+=/ferocious_bite,max_energy=1,target_if=max:time_to_die
actions.finisher+=/ferocious_bite,target_if=max:time_to_die,if=buff.bs_inc.up&talent.soul_of_the_forest.enabled|cooldown.convoke_the_spirits.remains<1&covenant.night_fae

actions.owlweave=starsurge,if=buff.heart_of_the_wild.up
actions.owlweave+=/sunfire,line_cd=4*gcd
actions.owlweave+=/moonfire,line_cd=4*gcd,if=buff.moonkin_form.up&spell_targets.thrash_cat<2&!talent.lunar_inspiration.enabled
actions.owlweave+=/heart_of_the_wild,if=energy<30&dot.rip.remains>4.5&(cooldown.tigers_fury.remains>=6.5|runeforge.cateye_curio)&buff.clearcasting.stack<1&!buff.apex_predators_craving.up&!buff.bloodlust.up&!buff.bs_inc.up&(cooldown.convoke_the_spirits.remains>6.5|!covenant.night_fae)&(!covenant.necrolord|cooldown.adaptive_swarm.remains>=5|dot.adaptive_swarm_damage.remains>7)
actions.owlweave+=/moonkin_form,if=energy<30&dot.rip.remains>4.5&(cooldown.tigers_fury.remains>=4.5|runeforge.cateye_curio)&buff.clearcasting.stack<1&!buff.apex_predators_craving.up&!buff.bloodlust.up&(!buff.bs_inc.up|covenant.necrolord&talent.savage_roar.enabled&buff.bs_inc.remains>6)&(cooldown.convoke_the_spirits.remains>6.5|!covenant.night_fae)&(!covenant.necrolord|cooldown.adaptive_swarm.remains>=5|dot.adaptive_swarm_damage.remains>7)&target.time_to_die>7

actions.setup=lunar_inspiration,if=covenant.necrolord&spell_targets.thrash_cat<4&combo_points<5&!ticking&!buff.bs_inc.up
actions.setup+=/pool_resource,for_next=1
actions.setup+=/savage_roar,if=talent.feral_frenzy.enabled&cooldown.feral_frenzy.up&!buff.savage_roar.up&combo_points>1&dot.rake.ticking&(dot.lunar_inspiration.ticking|!talent.lunar_inspiration.enabled)
actions.setup+=/pool_resource,if=talent.bloodtalons.enabled&buff.bloodtalons.down&(energy+3.5*energy.regen+(40*buff.clearcasting.up))<(115-23*buff.incarnation_king_of_the_jungle.up)&active_bt_triggers=0
actions.setup+=/call_action_list,name=bloodtalons,if=talent.bloodtalons.enabled&buff.bloodtalons.down&(combo_points<5|spell_targets.thrash_cat=1)
actions.setup+=/call_action_list,name=cooldown
actions.setup+=/call_action_list,name=finisher,if=combo_points>3&(buff.bloodtalons.up|!talent.bloodtalons.enabled)

# Rake needs roughly 50% of its length at a minimum to surpass shreds dpe
actions.stealth=pool_resource,for_next=1
actions.stealth+=/rake,target_if=max:druid.rake.ticks_gained_on_refresh,if=(dot.rake.pmultiplier<1.5|refreshable)&druid.rake.ticks_gained_on_refresh>2|(persistent_multiplier>dot.rake.pmultiplier&buff.bs_inc.up&spell_targets.thrash_cat<3&covenant.necrolord)|buff.bs_inc.remains<1
actions.stealth+=/lunar_inspiration,if=spell_targets.thrash_cat<3&refreshable&druid.lunar_inspiration.ticks_gained_on_refresh>5&(combo_points=4|dot.lunar_inspiration.remains<5|!dot.lunar_inspiration.ticking)
# Brutal Slash is better than stealth Shred at 3 targets
actions.stealth+=/brutal_slash,if=spell_targets.brutal_slash>2
actions.stealth+=/pool_resource,for_next=1
actions.stealth+=/shred,if=combo_points<4&spell_targets.thrash_cat<5

head=hood_of_refracted_shadows,id=178817,bonus_id=6807/1498/6646
neck=trailspinner_pendant,id=178707,bonus_id=6807/1498/6646
shoulders=far_travelers_shoulderpads,id=179344,bonus_id=6807/1498/6646
back=cloak_of_enveloping_manifestations,id=178851,bonus_id=6807/1498/6646
chest=umbrahide_vest,id=172314,bonus_id=6716/7086/6647/6648/1487,enchant=eternal_skirmish
wrists=bands_of_the_undergrowth,id=178702,bonus_id=6807/1498/6646
hands=gloves_of_obscure_rituals,id=178757,bonus_id=6807/1498/6646
waist=girdle_of_shattered_dreams,id=178805,bonus_id=6807/1498/6646
legs=fearless_challengers_leggings,id=178801,bonus_id=6807/1498/6646
feet=sinsoaked_waders,id=178837,bonus_id=6807/1498/6646,enchant=eternal_agility
finger1=ring_of_perpetual_conflict,id=178872,bonus_id=6807/1498/6646,enchant=tenet_of_critical_strike
finger2=ritual_commanders_ring,id=178781,bonus_id=6807/1498,enchant=tenet_of_critical_strike
trinket1=inscrutable_quantum_device,id=179350,bonus_id=6807/1498/6646
trinket2=darkmoon_deck_voracity,id=173087
main_hand=quarterstaff_of_discordant_ethic,id=180097,bonus_id=6807/1498/6646,enchant=sinful_revelation

# Gear Summary
# gear_ilvl=185.47
# gear_agility=597
# gear_stamina=860
# gear_attack_power=20
# gear_crit_rating=783
# gear_haste_rating=70
# gear_mastery_rating=350
# gear_versatility_rating=183
# gear_armor=479
