# Executed before combat begins. Accepts non-harmful actions only.
actions.precombat=summon_pet
# Snapshot raid buffed stats before combat begins.
actions.precombat+=/snapshot_stats
actions.precombat+=/use_item,name=algethar_puzzle_box
actions.precombat+=/wildfire_bomb,if=active_enemies=1

actions=retarget,target_if=max:target.health,line_cd=5,if=fight_style.dungeonroute
actions+=/auto_attack
actions+=/call_action_list,name=cds
actions+=/call_action_list,name=plst,if=active_enemies<3&talent.howl_of_the_pack_leader
actions+=/call_action_list,name=plcleave,if=active_enemies>2&talent.howl_of_the_pack_leader
actions+=/call_action_list,name=sentst,if=active_enemies<3&!talent.howl_of_the_pack_leader
actions+=/call_action_list,name=sentcleave,if=active_enemies>2&!talent.howl_of_the_pack_leader

# CDS
actions.cds=blood_fury,if=buff.takedown.up|cooldown.takedown.ready
actions.cds+=/use_item,name=voracious_heart_of_ulatek
actions.cds+=/use_item,name=font_of_venomous_rage,if=!buff.takedown.up&!cooldown.takedown.ready|fight_remains<3
actions.cds+=/use_items,check_existing=0,slots=trinket1:trinket2,if=this_trinket.has_use_damage&!this_trinket.is.font_of_venomous_rage
actions.cds+=/use_items,check_existing=0,slots=trinket1:trinket2,if=this_trinket.has_use_buff&talent.takedown&!other_trinket.has_use_buff&this_trinket.cooldown.duration>=cooldown.takedown.duration*2&this_trinket.has_buff.haste&(buff.takedown.up|cooldown.takedown.remains>this_trinket.cooldown.duration*0.45)
actions.cds+=/use_items,check_existing=0,slots=trinket1:trinket2,if=this_trinket.has_use_buff&(!talent.takedown|other_trinket.has_use_buff|this_trinket.cooldown.duration<cooldown.takedown.duration*2|!this_trinket.has_buff.haste)&(buff.takedown.up|cooldown.takedown.ready|cooldown.takedown.remains>20|!talent.takedown)
actions.cds+=/use_item,name=algethar_puzzle_box,if=cooldown.takedown.remains<5|!talent.takedown
actions.cds+=/invoke_external_buff,name=power_infusion,if=buff.takedown.up&!buff.power_infusion.up
actions.cds+=/ancestral_call,if=buff.takedown.up|cooldown.takedown.ready
actions.cds+=/fireblood,if=buff.takedown.up|cooldown.takedown.ready
actions.cds+=/berserking,if=buff.takedown.up|cooldown.takedown.ready
actions.cds+=/muzzle
actions.cds+=/potion,if=target.time_to_die<25|cooldown.takedown.ready
actions.cds+=/aspect_of_the_eagle,if=target.distance>=6

#ST - PL
actions.plst=kill_command,if=buff.tip_of_the_spear.stack<2&howl_summon.ready
actions.plst+=/kill_command,if=cooldown.takedown.remains<gcd&buff.tip_of_the_spear.stack<2&!talent.twin_fangs
actions.plst+=/takedown,if=buff.tip_of_the_spear.stack>0&!talent.twin_fangs|buff.tip_of_the_spear.stack=0&talent.twin_fangs
actions.plst+=/wildfire_bomb,if=buff.tip_of_the_spear.up&(talent.lethal_calibration&full_recharge_time<4+gcd|!talent.lethal_calibration)
actions.plst+=/boomstick,if=buff.tip_of_the_spear.up
actions.plst+=/raptor_strike,if=(buff.tip_of_the_spear.up|!buff.raptor_swipe.up)
actions.plst+=/wildfire_bomb,if=buff.tip_of_the_spear.up
actions.plst+=/kill_command,if=cooldown.takedown.remains
actions.plst+=/takedown

#ST - Sent
actions.sentst=kill_command,if=buff.tip_of_the_spear.stack=0&(cooldown.takedown.remains|!talent.twin_fangs)
actions.sentst+=/boomstick
actions.sentst+=/wildfire_bomb,if=(debuff.sentinels_mark.remains|full_recharge_time<4)
actions.sentst+=/kill_command,if=cooldown.takedown.remains<gcd&buff.tip_of_the_spear.stack<2&!talent.twin_fangs
actions.sentst+=/takedown,if=buff.tip_of_the_spear.stack>0&!talent.twin_fangs|buff.tip_of_the_spear.stack=0&talent.twin_fangs
actions.sentst+=/moonlight_chakram
actions.sentst+=/raptor_strike
actions.sentst+=/kill_command,if=cooldown.takedown.remains
actions.sentst+=/wildfire_bomb
actions.sentst+=/takedown


#AOE - PL
actions.plcleave=kill_command,if=buff.tip_of_the_spear.stack<2&(buff.howl_of_the_pack_leader_wyvern.remains|buff.howl_of_the_pack_leader_boar.remains|buff.howl_of_the_pack_leader_bear.remains)
actions.plcleave+=/kill_command,if=cooldown.takedown.remains<gcd&buff.tip_of_the_spear.stack<2&!talent.twin_fangs
actions.plcleave+=/takedown,if=buff.tip_of_the_spear.stack>0&!talent.twin_fangs|buff.tip_of_the_spear.stack=0&talent.twin_fangs
actions.plcleave+=/wildfire_bomb,if=full_recharge_time<gcd
actions.plcleave+=/boomstick,if=buff.tip_of_the_spear.up
actions.plcleave+=/wildfire_bomb,if=buff.tip_of_the_spear.up
actions.plcleave+=/raptor_strike,if=buff.tip_of_the_spear.up|!buff.raptor_swipe.up
actions.plcleave+=/kill_command,if=cooldown.takedown.remains
actions.plcleave+=/wildfire_bomb
actions.plcleave+=/takedown

#AOE - Sent
actions.sentcleave=kill_command,if=buff.tip_of_the_spear.stack=0&(cooldown.takedown.remains|!talent.twin_fangs)
actions.sentcleave+=/boomstick,if=buff.tip_of_the_spear.up
actions.sentcleave+=/wildfire_bomb,target_if=max:debuff.sentinels_mark.remains,if=buff.tip_of_the_spear.up
actions.sentcleave+=/kill_command,if=cooldown.takedown.remains<gcd&buff.tip_of_the_spear.stack<2&!talent.twin_fangs
actions.sentcleave+=/takedown,target_if=min:debuff.sentinels_mark.remains,if=buff.tip_of_the_spear.stack>0&!talent.twin_fangs|buff.tip_of_the_spear.stack=0&talent.twin_fangs
actions.sentcleave+=/moonlight_chakram,target_if=min:debuff.sentinels_mark.remains,if=buff.tip_of_the_spear.up
actions.sentcleave+=/raptor_strike,target_if=min:debuff.sentinels_mark.remains,if=buff.tip_of_the_spear.up&buff.raptor_swipe.up|!buff.raptor_swipe.up
actions.sentcleave+=/kill_command
