You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

218 lines
38 KiB

## Balance Druid
## April 28, 2022
## Changes:
## - Added Solar Beam.
## - Changed target_if cases to cycle_targets.
## - Removed unnecessary variables (i.e., prev_starsurge -> prev.starsurge).
## - Avoid precasting Wrath if it's the wrong Eclipse.
## - Make Convoke the Spirits a little more flexible (if you hadn't hit it simultaneously with BOAT + Celestial Alignment, it'd skip).
## - Make most 'fight_remains' scenarios apply to boss fights only.
## - Treat Tome of Blah Blah Blah as a special trinket.
## - Opener (i.e., Wrath, Wrath, Starfire) made more resilient to earlier combat-start.
## - Fix Kindred Empowerment check for CD usage.
## - Remove druid.no_cds checks.
## Annotated Balance APL can be found at https://balance-simc.github.io/Balance-SimC/md.html?file=balance.txt
actions.precombat=kindred_spirits
# The variable is set to 0 with no stat on use trinkets, 1 when the first one is on use, 2 if the second is and 3 if both are
actions.precombat+=/variable,name=on_use_trinket,value=0
actions.precombat+=/variable,name=on_use_trinket,op=add,value=1,if=trinket.1.has_use_buff&trinket.1.cooldown.duration&!trinket.1.is.tome_of_monstrous_constructions
actions.precombat+=/variable,name=on_use_trinket,op=add,value=2,if=trinket.2.has_use_buff&trinket.2.cooldown.duration&!trinket.2.is.tome_of_monstrous_constructions
# These trinkets are not automatically detected as on use stat trinkets. Set variable to 4 as they also need special handling.
actions.precombat+=/variable,name=on_use_trinket,op=add,value=4,if=equipped.inscrutable_quantum_device|equipped.empyreal_ordnance|equipped.soulletting_ruby
# Sets the Starsurge cost for later calculations (for example when to start dumping before Frenzy falls off)
actions.precombat+=/variable,name=ss_cost,value=30*(1-0.15*set_bonus.tier28_4pc)
actions.precombat+=/variable,name=sf_cost,value=50*(1-0.15*set_bonus.tier28_4pc)
# Sets at which amount of AsP Convoke should be used: 40 without Celestial Spirits and 30 with.
actions.precombat+=/variable,name=convoke_asp,value=30+10*runeforge.celestial_spirits
actions.precombat+=/moonkin_form
actions.precombat+=/wrath,line_cd=10,if=(eclipse.lunar_next|eclipse.in_solar|eclipse.in_both|eclipse.any_next)
# Precast 2 Wrath and a Starsurge on ST with Night Fae and BoAT or Starfire otherwise
actions.opener+=/wrath,if=(eclipse.lunar_next|eclipse.in_solar|eclipse.in_both|eclipse.any_next)&prev.1.wrath&!prev.2.wrath
actions.opener+=/starfire,line_cd=5,if=((!runeforge.balance_of_all_things|!covenant.night_fae|!spell_targets.starfall=1|!talent.natures_balance.enabled)|(eclipse.solar_next|eclipse.in_lunar|eclipse.in_both|eclipse.any_next))&!set_bonus.tier28_2pc
actions.opener+=/starsurge,line_cd=5,if=(runeforge.balance_of_all_things&covenant.night_fae&spell_targets.starfall=1)&!set_bonus.tier28_2pc
## Executed every time the actor is available.
actions=solar_beam
actions+=/call_action_list,name=opener,strict=1,if=time<(2*action.wrath.cast_time+action.starfire.cast_time)
# Sets AoE on 3+ without drift and with Starlord and 2+ otherwise
actions+=/variable,name=is_aoe,value=spell_targets.starfall>1&(!talent.starlord.enabled|talent.stellar_drift.enabled)|spell_targets.starfall>2
# Sets cleave when Starfire can hit 2+ targets which is relevant for the Eclipse to be preferred and which filler to cast
actions+=/variable,name=is_cleave,value=spell_targets.starfire>1
# Variable that checks if you are in a gcd to avoid the situation where a trinket etc is used in between casts
actions+=/variable,name=in_gcd,value=prev_gcd.1.moonfire|prev_gcd.1.sunfire|prev_gcd.1.starsurge|prev_gcd.1.starfall|prev_gcd.1.fury_of_elune|prev.ravenous_frenzy|buff.ca_inc.remains=buff.ca_inc.duration|variable.is_aoe
# Use Berserking at the end of Frenzy when haste is above 60%, after Convoke with BoaT and otherwise with CA/Inc
actions+=/berserking,if=((!covenant.night_fae|!cooldown.convoke_the_spirits.up|!runeforge.balance_of_all_things)&buff.ca_inc.remains>15&!covenant.venthyr|covenant.venthyr&buff.ca_inc.up&buff.ravenous_frenzy.up&(buff.ravenous_frenzy.remains<=12-4*runeforge.sinful_hysteria|buff.ca_inc.remains<11|1%spell_haste<(1.9-talent.stellar_flare.enabled*0.1-druid.delay_berserking*0.3)))&variable.in_gcd
# Pot with a CA/Inc that isn't a Pulsar proc or when the fight is about to end
actions+=/potion,if=(buff.ca_inc.remains>15&(!runeforge.sinful_hysteria|buff.ravenous_frenzy.remains<19&buff.ravenous_frenzy.up)|boss&fight_remains<25)&variable.in_gcd
# Calculates whether using Convoke now will allow you to still cast the same amount of Convoke+CA/Inc casts
actions+=/variable,name=convoke_desync,value=ceil((fight_remains-15-cooldown.ca_inc.remains)%180)>ceil((fight_remains-15-cooldown.convoke_the_spirits.remains)%180)&!raid_event.adds.exists&(!cooldown.ca_inc.ready|!cooldown.convoke_the_spirits.ready)|cooldown.ca_inc.remains>interpolated_fight_remains|runeforge.celestial_spirits&cooldown.ca_inc.remains>30|cooldown.convoke_the_spirits.remains>interpolated_fight_remains-10|!covenant.night_fae
# Used to delay the usage of CA/Inc when using double on use and prevent usage when an add event is about to die
actions+=/variable,name=cd_condition,value=(target.time_to_die>15|raid_event.adds.in>50)&((equipped.empyreal_ordnance&(!covenant.venthyr|cooldown.empyreal_ordnance.remains<167+(5*runeforge.sinful_hysteria))&!cooldown.empyreal_ordnance.ready)|equipped.soulletting_ruby&(!covenant.night_fae|cooldown.soulletting_ruby_345801.remains<114)|(cooldown.berserking.ready|!race.troll|covenant.night_fae)&(!talent.fury_of_elune.enabled|covenant.venthyr&cooldown.fury_of_elune.remains<11+5*runeforge.sinful_hysteria|!covenant.venthyr&cooldown.fury_of_elune.remains<buff.ca_inc.duration+12*runeforge.primordial_arcanic_pulsar-12)&(equipped.inscrutable_quantum_device&cooldown.inscrutable_quantum_device.remains<5)|((equipped.shadowed_orb_of_torment&cooldown.tormented_insight_355321.remains)|((variable.on_use_trinket=1|variable.on_use_trinket=3)&(trinket.1.ready_cooldown|trinket.1.cooldown.remains>interpolated_fight_remains-10)|variable.on_use_trinket=2&(trinket.2.ready_cooldown|trinket.2.cooldown.remains>interpolated_fight_remains-10)|variable.on_use_trinket=0)))
# Variable used to delay any trinkets and cds when waiting for an Euphoria proc
actions+=/variable,name=thrill_seeker_wait,value=!soulbind.thrill_seeker.enabled|fight_remains>200|boss&fight_remains<25+(40-buff.thrill_seeker.stack*2)|buff.thrill_seeker.stack>38-(runeforge.sinful_hysteria*2)
# Use Empyreal Ordnance 20secs before a CA/Inc use or so that it will line up with the end of Frenzy
actions+=/use_item,name=empyreal_ordnance,if=cooldown.ca_inc.remains<20&cooldown.convoke_the_spirits.remains<20&(variable.thrill_seeker_wait|buff.thrill_seeker.stack>30+(runeforge.sinful_hysteria*3))&variable.in_gcd|boss&fight_remains<37
# Use Soulleting Ruby 6secs before a CA/Inc use or so that it will line up with the end of Frenzy
actions+=/use_item,name=soulletting_ruby,if=(cooldown.ca_inc.remains<6&!covenant.venthyr&!covenant.night_fae|covenant.night_fae&cooldown.convoke_the_spirits.remains<6&(variable.convoke_desync|cooldown.ca_inc.remains<6)|covenant.venthyr&(!runeforge.sinful_hysteria&cooldown.ca_inc.remains<6|buff.ravenous_frenzy.remains<10+(5*equipped.instructors_divine_bell)&buff.ravenous_frenzy.up)|boss&fight_remains<25|equipped.empyreal_ordnance&cooldown.empyreal_ordnance.remains>20)&variable.in_gcd&!equipped.inscrutable_quantum_device|cooldown.inscrutable_quantum_device.remains>20|boss&fight_remains<20
# Always use IQD with CA/Inc or at the end of Frenzy
actions+=/variable,name=iqd_condition,value=buff.ca_inc.remains>15&(!runeforge.sinful_hysteria|buff.ravenous_frenzy.remains<=15.5+(3.5*buff.bloodlust.up)+(4.5-3.5*buff.bloodlust.up)*equipped.instructors_divine_bell+4.5*(equipped.the_first_sigil&cooldown.the_first_sigil.remains<=20)&buff.ravenous_frenzy.up)|boss&fight_remains<25|equipped.empyreal_ordnance&cooldown.empyreal_ordnance.remains
actions+=/use_item,name=inscrutable_quantum_device,if=variable.iqd_condition&variable.in_gcd
# Use Shadowed Orb before CA/Inc
actions+=/use_item,name=shadowed_orb_of_torment,if=(cooldown.ca_inc.ready&!covenant.night_fae&variable.thrill_seeker_wait&(cooldown.berserking.ready|!race.troll)|covenant.night_fae&cooldown.convoke_the_spirits.ready&(variable.convoke_desync|cooldown.ca_inc.ready))&dot.sunfire.ticking&(dot.stellar_flare.ticking|!talent.stellar_flare.enabled|spell_targets.starfire>3)&dot.moonfire.ticking&(variable.is_aoe|runeforge.balance_of_all_things|astral_power>=90|variable.convoke_desync|buff.bloodlust.up)&!equipped.inscrutable_quantum_device|equipped.inscrutable_quantum_device&cooldown.inscrutable_quantum_device.remains>30&!buff.ca_inc.up|boss&fight_remains<40
# This is a rather elaborate way to make all on use stat trinkets to be lined up with CA/Inc and Convoke and use the 2nd slot on cd if both trinkets are on use stat trinkets
actions+=/use_items,slots=trinket1,if=variable.on_use_trinket!=1&!trinket.2.ready_cooldown|(variable.on_use_trinket=1|variable.on_use_trinket=3)&(covenant.venthyr&buff.ca_inc.up&(buff.ravenous_frenzy.remains+(4.5*runeforge.sinful_hysteria)<=trinket.1.buff_duration&buff.ravenous_frenzy.up|buff.ravenous_frenzy_sinful_hysteria.up)|cooldown.ca_inc.remains+15>trinket.1.cooldown.duration&(!runeforge.primordial_arcanic_pulsar|buff.ca_inc.remains>6|cooldown.ca_inc.remains-trinket.1.cooldown.duration<15)&(!covenant.venthyr|!buff.ravenous_frenzy.up&cooldown.ravenous_frenzy.remains)&(!covenant.night_fae|trinket.1.cooldown.duration>cooldown.convoke_the_spirits.remains|variable.convoke_desync&trinket.1.cooldown.duration>cooldown.ca_inc.remains)&!covenant.kyrian|covenant.night_fae&variable.convoke_desync&cooldown.convoke_the_spirits.up&!cooldown.ca_inc.up&((buff.eclipse_lunar.remains>5|buff.eclipse_solar.remains>5))|buff.kindred_empowerment_energize.up)|boss&fight_remains<20|variable.on_use_trinket=0
actions+=/use_items,slots=trinket2,if=variable.on_use_trinket!=2&!trinket.1.ready_cooldown|variable.on_use_trinket=2&(buff.ca_inc.up&covenant.venthyr&(buff.ravenous_frenzy.remains+(4.5*runeforge.sinful_hysteria)<=trinket.2.buff_duration&buff.ravenous_frenzy.up|buff.ravenous_frenzy_sinful_hysteria.up)|cooldown.ca_inc.remains+15>trinket.2.cooldown.duration&(!runeforge.primordial_arcanic_pulsar|buff.ca_inc.remains>6|cooldown.ca_inc.remains-trinket.2.cooldown.duration<15)&(!covenant.venthyr|!buff.ravenous_frenzy.up&cooldown.ravenous_frenzy.remains)&(!covenant.night_fae|trinket.2.cooldown.duration>cooldown.convoke_the_spirits.remains|variable.convoke_desync&trinket.2.cooldown.duration>cooldown.ca_inc.remains)&!covenant.kyrian&(!buff.ca_inc.up|!covenant.venthyr)|covenant.night_fae&variable.convoke_desync&cooldown.convoke_the_spirits.up&!cooldown.ca_inc.up&((buff.eclipse_lunar.remains>5|buff.eclipse_solar.remains>5)))|buff.kindred_empowerment_energize.up|boss&fight_remains<20|variable.on_use_trinket=0
# Uses all other on use items on cd
actions+=/use_items
# Either go into the st or aoe action list
actions+=/run_action_list,name=aoe,strict=1,if=variable.is_aoe
actions+=/run_action_list,name=st
# Calculates whether the Dreamcatcher buff will fall off within the next cast
actions.aoe=variable,name=dream_will_fall_off,value=runeforge.timeworn_dreambinder&(buff.timeworn_dreambinder.remains<gcd.max+0.1|buff.timeworn_dreambinder.remains<action.starfire.execute_time+0.1&(eclipse.in_lunar|eclipse.solar_next|eclipse.any_next))&buff.timeworn_dreambinder.up
# Calculates whether Starsurge is worth casting over Starfire in Lunar Eclipse
actions.aoe+=/variable,name=ignore_starsurge,value=!eclipse.in_solar&spell_targets.starfire>7-talent.soul_of_the_forest.enabled*2+eclipse.in_both&!runeforge.primordial_arcanic_pulsar&!runeforge.oneths_clear_vision
# Use Convoke when at less than 50 AsP and line up with CA/Inc
actions.aoe+=/convoke_the_spirits,if=((variable.convoke_desync&!cooldown.ca_inc.ready&!runeforge.primordial_arcanic_pulsar|buff.ca_inc.up&(!runeforge.primordial_arcanic_pulsar|runeforge.celestial_spirits|fight_remains>127|boss&fight_remains<cooldown.ca_inc.remains+10|buff.ca_inc.remains>12))&(((astral_power<=variable.convoke_asp|spell_targets.starfire>3)&(buff.eclipse_lunar.remains>10|buff.eclipse_solar.remains>10)|buff.ca_inc.remains>5&buff.ca_inc.remains<=12)&(!talent.stellar_drift|buff.starfall.remains<1.5-0.5*runeforge.celestial_spirits|buff.ca_inc.remains<buff.starfall.remains+5&buff.ca_inc.up)&(!runeforge.timeworn_dreambinder|!runeforge.celestial_spirits|buff.timeworn_dreambinder.remains>execute_time)|runeforge.balance_of_all_things)&(!runeforge.balance_of_all_things|(buff.balance_of_all_things_nature.stack=8|buff.balance_of_all_things_arcane.stack=8))|boss&fight_remains<10&!cooldown.ca_inc.ready)
# Use Sunfire in pandemic on anything that lives 14secs and less with more targets and at the end of a Solar Eclipse at 14 secs or less remaining as to not having to refresh during Lunar Eclipse
actions.aoe+=/sunfire,cycle_targets=1,if=(refreshable|buff.eclipse_solar.remains<3&eclipse.in_solar&remains<14&talent.soul_of_the_forest.enabled)&target.time_to_die>14-spell_targets+remains&(eclipse.in_any|remains<gcd.max)
# Wait a small moment after Frenzy when about to use an instant
actions.aoe+=/wait,sec=0.15-action.ravenous_frenzy.time_since,if=covenant.venthyr&prev.1.ravenous_frenzy&action.ravenous_frenzy.time_since<0.15&(!starfire.ap_check|talent.stellar_drift.enabled&cooldown.starfall.ready|buff.starfall.refreshable)
# Use Sunfire to have a global to use IQD
actions.aoe+=/sunfire,if=variable.iqd_condition&cooldown.inscrutable_quantum_device.ready&equipped.inscrutable_quantum_device&ap_check
# Keep up Starfall at all times unless using Lycaras and it is about to proc or let the special action line below handle Dreambinder on 2 targets
actions.aoe+=/starfall,if=!talent.stellar_drift.enabled&(!set_bonus.tier28_4pc|eclipse.in_any|spell_targets.starfall>3)&(buff.starfall.refreshable&(spell_targets.starfall<3|!runeforge.timeworn_dreambinder)|talent.soul_of_the_forest.enabled&buff.eclipse_solar.remains<3&eclipse.in_solar&buff.starfall.remains<7&spell_targets.starfall>=4)&(!runeforge.lycaras_fleeting_glimpse|time%%45>buff.starfall.remains+2)&target.time_to_die>5
# With Stellar Drift use on cd when refreshable but still wait for Lycaras proc and don't use before CDs. Still use before Convoke since that will proc another Starfall
actions.aoe+=/starfall,if=talent.stellar_drift.enabled&buff.starfall.refreshable&(!set_bonus.tier28_4pc|eclipse.in_any|spell_targets.starfall>3)&(!runeforge.lycaras_fleeting_glimpse|time%%45>4)&fight_remains>3
# With Dreambinder use Starfall to keep up the buff by also using Starfall on 5 seconds or less remaining
actions.aoe+=/starfall,if=runeforge.timeworn_dreambinder&spell_targets.starfall>=3&(!buff.timeworn_dreambinder.up&buff.starfall.refreshable|(variable.dream_will_fall_off&(buff.starfall.remains<3|spell_targets.starfall>2&talent.stellar_drift.enabled&buff.starfall.remains<5)))
# Calculates whether a Starsurge use will cause Starfall to fall off, and use Starsurge to keep Dreambinder stack up. 80 is the required AsP to cast Starsurge+Starfall
actions.aoe+=/variable,name=starfall_wont_fall_off,value=astral_power>80*(1-set_bonus.tier28_2pc*0.2)*(1-buff.timeworn_dreambinder.stack*0.1)-(buff.starfall.remains*3%spell_haste*!talent.stellar_drift.enabled)-(cooldown.starfall.remains*3%spell_haste*talent.stellar_drift.enabled)-(buff.fury_of_elune.remains*5)&(buff.starfall.up|cooldown.starfall.remains)
# Use Starsurge with Dreambinder to keep up the buff without losing Starfall uptime and use Starsurge on 4+ BoAT stacks until 4 targets
actions.aoe+=/starsurge,if=variable.dream_will_fall_off&variable.starfall_wont_fall_off&!variable.ignore_starsurge|(buff.balance_of_all_things_nature.stack>3|buff.balance_of_all_things_arcane.stack>3)&spell_targets.starfall<4&variable.starfall_wont_fall_off
# Use swarm so that you get max uptime by using it as late as possible on less than 3 stacks or just when 3+ stacks expire
actions.aoe+=/adaptive_swarm,cycle_targets=1,if=!ticking&!action.adaptive_swarm_damage.in_flight|dot.adaptive_swarm_damage.stack<3&dot.adaptive_swarm_damage.remains<3
# Refresh Moonfire if CA/Inc is ready, there are less than 5 targets in Lunar Eclipse with SotF, less than 10 otherwise in any Eclipse or up to 5 targets before a Lunar Eclipse. Don't refresh during Kindred Empowerment unless in Solar Eclipse
actions.aoe+=/moonfire,cycle_targets=1,if=refreshable&target.time_to_die>((14+(spell_targets.starfire*2*buff.eclipse_lunar.up))+remains)%(1+talent.twin_moons.enabled)&astral_power>variable.sf_cost-buff.starfall.remains*6&(ap_check|variable.ignore_starsurge|!eclipse.in_any)&(cooldown.ca_inc.ready&eclipse.in_any&(variable.convoke_desync|cooldown.convoke_the_spirits.ready|!covenant.night_fae)|spell_targets.starfire<((8-(buff.eclipse_lunar.up*3))*(1+talent.twin_moons.enabled))&!eclipse.solar_next&(!cooldown.ca_inc.ready)|(eclipse.in_solar|buff.eclipse_lunar.up&!talent.soul_of_the_forest.enabled)&(spell_targets.starfire<10*(1+talent.twin_moons.enabled)))&(!covenant.kyrian|!buff.kindred_empowerment_energize.up|eclipse.in_solar)&!buff.ravenous_frenzy_sinful_hysteria.up
# Use FoN on cd without capping
actions.aoe+=/force_of_nature,if=ap_check|variable.ignore_starsurge
actions.aoe+=/variable,name=cd_condition_aoe,value=(variable.cd_condition&(buff.starfall.up|talent.stellar_drift.enabled|covenant.night_fae)&dot.moonfire.ticking&(!buff.solstice.up&!buff.ca_inc.up&(!talent.fury_of_elune.enabled|buff.ca_inc.duration>cooldown.fury_of_elune.remains+8)&(!set_bonus.tier28_2pc|eclipse.in_lunar|eclipse.solar_next)&variable.thrill_seeker_wait&(!covenant.night_fae|variable.convoke_desync|cooldown.convoke_the_spirits.remains<15)&target.time_to_die>buff.ca_inc.duration*0.7)|boss&fight_remains<buff.ca_inc.duration+12*runeforge.primordial_arcanic_pulsar)
# Use Frenzy with CA/Inc
actions.aoe+=/ravenous_frenzy,if=buff.ca_inc.remains>15|buff.ca_inc.duration+12*runeforge.primordial_arcanic_pulsar<26&variable.cd_condition_aoe
# Use CA/Inc on cd unless and line it up with Convoke
actions.aoe+=/celestial_alignment,if=variable.cd_condition_aoe&(!covenant.venthyr|!runeforge.sinful_hysteria|runeforge.primordial_arcanic_pulsar|buff.ca_inc.duration>=26)|buff.ravenous_frenzy.up&buff.ravenous_frenzy.remains<15.5
actions.aoe+=/incarnation,if=variable.cd_condition_aoe
# Use Empower Bond on cd with Starfall up and save for Pulsar and CA/Inc
actions.aoe+=/empower_bond,if=(cooldown.ca_inc.remains+buff.ca_inc.duration+runeforge.primordial_arcanic_pulsar*12>cooldown.empower_bond.duration+10)|buff.ca_inc.remains>8
# Refresh flare on up to 3 targets without CA/Inc being about to expire and not overcapping
actions.aoe+=/stellar_flare,cycle_targets=1,if=refreshable&time_to_die>15&spell_targets.starfire<4&ap_check&(buff.ca_inc.remains>10|!buff.ca_inc.up)
# Use FoE if inside an Eclipse and line it up with a Pulsar proc and Adaptive Swarm
actions.aoe+=/fury_of_elune,if=eclipse.in_any&(ap_check|!runeforge.primordial_arcanic_pulsar)&(buff.primordial_arcanic_pulsar.value<250|buff.ca_inc.remains>8)&(dot.adaptive_swarm_damage.ticking|!covenant.necrolord|spell_targets>2)&(buff.ravenous_frenzy.remains<9-(4*runeforge.sinful_hysteria)&buff.ravenous_frenzy.up|!buff.ravenous_frenzy.up)&(!cooldown.ca_inc.up|buff.thrill_seeker.stack<15&fight_remains<200&fight_remains>100|!soulbind.thrill_seeker.enabled)&(soulbind.thrill_seeker.enabled|cooldown.ca_inc.remains>30)&target.time_to_die>5|boss&fight_remains<10
# Use a Starfall Oneth proc unless Starfall is already up or you are about to overcap AsP
actions.aoe+=/starfall,if=buff.oneths_perception.up&(buff.starfall.refreshable|astral_power>90)
# Dump AsP before Convoke with Starfall and then Starsurge
actions.aoe+=/starfall,if=covenant.night_fae&!talent.stellar_drift.enabled&(variable.convoke_desync|cooldown.ca_inc.up|buff.ca_inc.up)&cooldown.convoke_the_spirits.remains<gcd.max*ceil(astral_power%variable.sf_cost)&buff.starfall.remains<4
actions.aoe+=/starsurge,if=covenant.night_fae&(variable.convoke_desync|cooldown.ca_inc.up|buff.ca_inc.up)&cooldown.convoke_the_spirits.remains<5&variable.starfall_wont_fall_off&eclipse.in_any&!variable.ignore_starsurge
# Use Starsurge with an Oneth proc or if you'd overcap AsP with your next cast. Also dump AsP at the end of the Venthyr buff if Starfall wouldn't fall off or you are on 2 targets
actions.aoe+=/starsurge,if=buff.oneths_clear_vision.up|(!starfire.ap_check&!variable.ignore_starsurge|(buff.ca_inc.remains<5&buff.ca_inc.up|((buff.ca_inc.remains<gcd.max*ceil(astral_power%variable.ss_cost)&buff.ca_inc.up|buff.ravenous_frenzy_sinful_hysteria.remains<gcd.max*ceil(astral_power%variable.ss_cost)&buff.ravenous_frenzy_sinful_hysteria.up)&covenant.venthyr))&(spell_targets.starfall<3|variable.starfall_wont_fall_off))&!variable.ignore_starsurge&(!runeforge.timeworn_dreambinder|spell_targets.starfall<3)
# Use Moons in Solar Eclipse and save Full Moon for CA/Inc
actions.aoe+=/new_moon,if=(buff.eclipse_solar.remains>execute_time|(charges=2&recharge_time<5)|charges=3)&ap_check
actions.aoe+=/half_moon,if=(buff.eclipse_solar.remains>execute_time|(charges=2&recharge_time<5)|charges=3)&ap_check&(buff.ravenous_frenzy.remains<5&buff.ravenous_frenzy.up&!runeforge.sinful_hysteria|!buff.ravenous_frenzy.up)
actions.aoe+=/full_moon,if=(buff.eclipse_solar.remains>execute_time&(cooldown.ca_inc.remains>50|cooldown.convoke_the_spirits.remains>50)|(charges=2&recharge_time<5)|charges=3)&ap_check&(buff.ravenous_frenzy.remains<5&buff.ravenous_frenzy.up&!runeforge.sinful_hysteria|!buff.ravenous_frenzy.up)
# Use WoE on CD
actions.aoe+=/warrior_of_elune
# Calculates whether to use Starfire in Solar which is at 5 targets+1 for every 20% mastery or 4 Starsurge Empowerment stacks
actions.aoe+=/variable,name=starfire_in_solar,value=spell_targets.starfire>4+floor(mastery_value*100%20)+floor(buff.starsurge_empowerment_solar.stack%4)
# On 2 targets without Soul of the Forest you should fill with Wrath during Inc
actions.aoe+=/wrath,if=!buff.ravenous_frenzy.up&!buff.ravenous_frenzy_sinful_hysteria.up&!talent.soul_of_the_forest.enabled&spell_targets.starfire<3&buff.eclipse_solar.remains>execute_time&fight_remains>buff.ca_inc.remains+12*runeforge.primordial_arcanic_pulsar
# Calculates whether to Wrath during Frenzy
actions.aoe+=/variable,name=wrath_in_frenzy,value=1%spell_haste<2-(0.2*((spell_targets.starfire-1)%((spell_targets.starfire-1)%20+1))*(1+talent.soul_of_the_forest.enabled*1.5))+0.15*buff.ravenous_frenzy.remains
# Use Wrath in Solar Eclipse or if no Starfire will fit into CA/Inc anymore
actions.aoe+=/wrath,if=(eclipse.lunar_next|eclipse.any_next&variable.is_cleave)&(target.time_to_die>4|eclipse.lunar_in_2|boss&fight_remains<10)|buff.eclipse_solar.remains<action.starfire.execute_time&buff.eclipse_solar.up|eclipse.in_solar&!variable.starfire_in_solar|buff.ca_inc.remains<action.starfire.execute_time&!variable.is_cleave&buff.ca_inc.remains<execute_time&buff.ca_inc.up|buff.ravenous_frenzy.up&variable.wrath_in_frenzy|!variable.is_cleave&buff.ca_inc.remains>execute_time
# Use Starfire if in Lunar Eclipse, in Solar Eclipse on 4+ targets or to proc Solar Eclipse
actions.aoe+=/starfire
# Fallthru
actions.aoe+=/run_action_list,name=fallthru
# Starsurge for movement unless using BoAT
actions.fallthru=starsurge,if=!runeforge.balance_of_all_things.equipped
# Cast the dot with the most time to add until the max duration is hit. Sunfire remains multiplied to match moonfire duration
actions.fallthru+=/sunfire,cycle_targets=1,if=dot.moonfire.remains>remains*22%18
actions.fallthru+=/moonfire
# Use Adaptive Swarm when there is no active swarm, as late as possible on swarm with 2 or fewer stacks or on a 3+ swarm so that the new swarm arrives just after that swarm expires
actions.st=adaptive_swarm,cycle_targets=1,if=!dot.adaptive_swarm_damage.ticking&!action.adaptive_swarm_damage.in_flight&(!dot.adaptive_swarm_heal.ticking|dot.adaptive_swarm_heal.remains>5)|dot.adaptive_swarm_damage.stack<3&dot.adaptive_swarm_damage.remains<3&dot.adaptive_swarm_damage.ticking
# Uses Convoke if CA/Inc is up or you are desyncing CA/Inc with Convoke and you are below 40/30(Celestial Spirits) AsP in a 10+ sec Eclipse. Also don't let Dreambinder expire, always use in CA/Inc with Pulsar and at the start of a BoAT window.
actions.st+=/convoke_the_spirits,if=((variable.convoke_desync&!cooldown.ca_inc.ready&!runeforge.primordial_arcanic_pulsar|buff.ca_inc.up&(!runeforge.primordial_arcanic_pulsar|runeforge.celestial_spirits|fight_remains>127|boss&fight_remains<cooldown.ca_inc.remains+10|buff.ca_inc.remains>12))&((astral_power<=variable.convoke_asp&(buff.eclipse_lunar.remains>10|buff.eclipse_solar.remains>10)|buff.ca_inc.remains>5&buff.ca_inc.remains<=12)&(!runeforge.timeworn_dreambinder|!runeforge.celestial_spirits|buff.timeworn_dreambinder.remains>execute_time)|runeforge.balance_of_all_things)&(!runeforge.balance_of_all_things|(buff.balance_of_all_things_nature.stack=8|buff.balance_of_all_things_arcane.stack=8))|boss&fight_remains<10&!cooldown.ca_inc.ready)
# Use Starsurge to keep up the Dreambinder buff if it would expire before finishing the next cast or to dump before Convoke
actions.st+=/starsurge,if=runeforge.timeworn_dreambinder&(!((buff.timeworn_dreambinder.remains>action.wrath.execute_time+0.1&(eclipse.in_both|eclipse.in_solar|eclipse.lunar_next)|buff.timeworn_dreambinder.remains>action.starfire.execute_time+0.1&(eclipse.in_lunar|eclipse.solar_next|eclipse.any_next))|!buff.timeworn_dreambinder.up)|(buff.ca_inc.up|variable.convoke_desync)&cooldown.convoke_the_spirits.ready&covenant.night_fae&(buff.eclipse_lunar.remains>10|buff.eclipse_solar.remains>10))&(!covenant.kyrian|cooldown.empower_bond.remains>8)
# Dump Starsurges with Balance of All Things or to prepare for Convoke with BoAT
actions.st+=/starsurge,if=runeforge.balance_of_all_things&((buff.balance_of_all_things_nature.stack>2|buff.balance_of_all_things_arcane.stack>2)&cooldown.ca_inc.remains>7&!cooldown.convoke_the_spirits.up|(covenant.night_fae&cooldown.convoke_the_spirits.remains<10&eclipse.in_any&astral_power>20+30*cooldown.ca_inc.ready))
# Condition for all dots that makes sure they aren't refreshed when Ravenous Frenzy has less than 5 secs remaining or the Empower Bond buff is about to fall off or any Eclipse is about to expire
actions.st+=/variable,name=dot_requirements,value=(buff.ravenous_frenzy.remains>5|!buff.ravenous_frenzy.up)&!buff.ravenous_frenzy_sinful_hysteria.up&(buff.kindred_empowerment_energize.remains<gcd.max)&(buff.eclipse_solar.remains>gcd.max|buff.eclipse_lunar.remains>gcd.max|(!buff.eclipse_lunar.up|!buff.eclipse_solar.up)&!talent.solstice.enabled)
# Condition that checks if you are outside eclipse to only dot there or ignore this with Solstice
actions.st+=/variable,name=dot_outside_eclipse,value=(!buff.eclipse_solar.up&!buff.eclipse_lunar.up)&!talent.solstice.enabled&!runeforge.timeworn_dreambinder
# Dot all targets within Pandemic without overcapping+the above conditions
actions.st+=/moonfire,cycle_targets=1,if=(buff.eclipse_solar.remains>remains|buff.eclipse_lunar.remains>remains|variable.dot_outside_eclipse)&refreshable&target.time_to_die>12&ap_check&variable.dot_requirements
actions.st+=/sunfire,cycle_targets=1,if=(buff.eclipse_solar.remains>remains|buff.eclipse_lunar.remains>remains|variable.dot_outside_eclipse)&refreshable&target.time_to_die>12&ap_check&variable.dot_requirements
actions.st+=/stellar_flare,cycle_targets=1,if=(buff.eclipse_solar.remains>remains|buff.eclipse_lunar.remains>remains|variable.dot_outside_eclipse)&refreshable&target.time_to_die>16&ap_check&variable.dot_requirements
# Dot right before Frenzy if it would allow you to refresh less during Frenzy (this only happens without Sinful Hysteria)
actions.st+=/variable,name=no_hysteria_early_dot,value=covenant.venthyr&!runeforge.sinful_hysteria&!runeforge.circle_of_life_and_death&cooldown.berserking.ready&cooldown.ravenous_frenzy.ready&!buff.ca_inc.up&(astral_power>87|buff.bloodlust.up)
actions.st+=/moonfire,if=variable.no_hysteria_early_dot&remains<20
actions.st+=/sunfire,if=variable.no_hysteria_early_dot&remains<19
# Use FoN on cd without capping
actions.st+=/force_of_nature,if=ap_check
# Use Empower Bond with any long enough lasting Eclipse and try to line it up with Pulsar and CA/Inc
actions.st+=/empower_bond,if=(cooldown.ca_inc.remains+buff.ca_inc.duration+runeforge.primordial_arcanic_pulsar*12>cooldown.empower_bond.duration+10)|buff.ca_inc.remains>8
# Sets when AsP should be dumped to not overcap (Depends on Fury of Elune and the Eclipse)
actions.st+=/variable,name=asp_dump,value=astral_power>90-(2.5*buff.fury_of_elune.stack-2*eclipse.in_lunar)
# Use CA/Inc with Convoke/Kindred Spirits and don't overwrite Pulsar or when Bloodlust would expire before CA/Inc expires. Make sure to enter a Lunar Eclipse when usign T28 2pc and all CDs will become ready soon enough during the buff and dots have been sufficiently refreshed.
actions.st+=/variable,name=cd_condition_st,value=(variable.cd_condition&!buff.ca_inc.up&(!set_bonus.tier28_2pc|eclipse.in_lunar|eclipse.solar_next)&(((variable.asp_dump|covenant.night_fae|(covenant.kyrian&cooldown.empower_bond.ready)|runeforge.timeworn_dreambinder)&dot.sunfire.remains>8&dot.moonfire.remains>9&(dot.stellar_flare.remains>10|!talent.stellar_flare.enabled)&variable.thrill_seeker_wait&target.time_to_die>buff.ca_inc.duration*0.7|buff.bloodlust.up&buff.bloodlust.remains<buff.ca_inc.duration+(12*runeforge.primordial_arcanic_pulsar))|(equipped.empyreal_ordnance&cooldown.empyreal_ordnance.remains<167+(5*runeforge.sinful_hysteria)))&((!covenant.night_fae|(variable.convoke_desync|cooldown.convoke_the_spirits.remains<15)&(!runeforge.balance_of_all_things|astral_power<50&cooldown.convoke_the_spirits.ready))|fight_remains<cooldown.convoke_the_spirits.remains)|boss&fight_remains<buff.ca_inc.duration+12*runeforge.primordial_arcanic_pulsar)
# Use Frenzy with CA/Inc unless Frenzy would last longer than CA/Inc, then use before
actions.st+=/ravenous_frenzy,if=buff.ca_inc.remains>15|buff.ca_inc.duration<27+runeforge.primordial_arcanic_pulsar*12&variable.cd_condition_st
actions.st+=/celestial_alignment,if=variable.cd_condition_st&(buff.ca_inc.duration>=27+runeforge.primordial_arcanic_pulsar*12|!covenant.venthyr)|buff.ravenous_frenzy.up&buff.ravenous_frenzy.remains<9+conduit.precise_alignment.time_value+(!buff.bloodlust.up&!talent.starlord.enabled)
actions.st+=/incarnation,if=variable.cd_condition_st
# Variable used on abilities that want to be saved for CA/Inc so that they arent wasted just before them
actions.st+=/variable,name=save_for_ca_inc,value=cooldown.ca_inc.remains>10|!variable.convoke_desync&covenant.night_fae
# Uses FoE if in an Eclipse and tries to line it up with Pulsar, CA/Inc, Empower Bond and Adaptive Swarm
actions.st+=/fury_of_elune,if=eclipse.in_any&(astral_power<92-buff.fury_of_elune.stack*5|buff.ravenous_frenzy.up)&(buff.primordial_arcanic_pulsar.value<240|buff.ca_inc.remains>8)&variable.save_for_ca_inc&(!covenant.necrolord|dot.adaptive_swarm_damage.ticking)&(!covenant.venthyr|buff.ravenous_frenzy.remains<9-(4*runeforge.sinful_hysteria)&buff.ravenous_frenzy.up|!buff.ravenous_frenzy.up)&(!covenant.kyrian|cooldown.empower_bond.remains>20)&target.time_to_die>5|boss&fight_remains<10
# Wait a small moment after Frenzy if you are about to cast a spender
actions.st+=/wait,sec=0.15-action.ravenous_frenzy.time_since,if=covenant.venthyr&prev.1.ravenous_frenzy&action.ravenous_frenzy.time_since<0.15&variable.asp_dump
# Use Oneth Starfall procs if Starfall isn't up
actions.st+=/starfall,if=buff.oneths_perception.up&buff.starfall.refreshable
# Cancel Starlord if it has less than 5s remaining, you are at 90+ AsP and the current Eclipse has 5+s remaining
actions.st+=/cancel_buff,name=starlord,if=buff.starlord.remains<5&(buff.eclipse_solar.remains>5|buff.eclipse_lunar.remains>5)&astral_power>90
# Sets when Pulsar should be procced early to be able to use Convoke on cooldown (Essentially becomes true if dumping AsP now will allow you to perfectly enter Pulsar and then use Convoke)
actions.st+=/variable,name=proc_pulsar_early,value=covenant.night_fae&runeforge.primordial_arcanic_pulsar&buff.primordial_arcanic_pulsar.value+astral_power+3>=300&variable.convoke_desync&cooldown.convoke_the_spirits.remains<astral_power%30*gcd.max&eclipse.in_any&astral_power>variable.convoke_asp&cooldown.ca_inc.remains>5
# Use Starfall with Stellar Drift or t28 4pc and no Starlord, when no Starfall is up or to proc Pulsar when above 90 AsP(or the early Pulsar proc variable is true) or adpative swarm has 8+secs remaining or is in flight
actions.st+=/starfall,if=(talent.stellar_drift.enabled|set_bonus.tier28_4pc)&!talent.starlord.enabled&buff.starfall.refreshable&!runeforge.timeworn_dreambinder&(buff.primordial_arcanic_pulsar.value>=250&!buff.ca_inc.up&(variable.asp_dump|buff.kindred_empowerment_energize.up|variable.proc_pulsar_early)|(covenant.necrolord&talent.stellar_drift.enabled&(dot.adaptive_swarm_damage.remains>8|action.adaptive_swarm_damage.in_flight)))&(cooldown.ca_inc.remains>10|cooldown.convoke_the_spirits.remains>10)
# Dumps AsP before Convoke using the Convoke condition to check if Convoke is actually about to be cast
actions.st+=/starsurge,if=variable.proc_pulsar_early
# Use Moons when you are about to/are capping charges and make sure they are in an Eclipse still for HM/FM
actions.st+=/new_moon,if=ap_check&(charges=2&recharge_time<5|charges=3)
actions.st+=/half_moon,if=ap_check&(charges=2&recharge_time<5|charges=3)&(buff.eclipse_lunar.remains>execute_time|buff.eclipse_solar.remains>execute_time)
actions.st+=/full_moon,if=ap_check&(charges=2&recharge_time<5|charges=3)&(buff.eclipse_lunar.remains>execute_time|buff.eclipse_solar.remains>execute_time)
# Use Starsurge Oneth procs and dump AsP when CA/Inc, Empower Bond, the Venthyr buff is about to fall off or you'd cap AsP
actions.st+=/starsurge,if=eclipse.in_any&(buff.oneths_clear_vision.up|buff.kindred_empowerment_energize.up|buff.ca_inc.up&(!covenant.kyrian|cooldown.empower_bond.remains>5|buff.ca_inc.remains<gcd.max*floor(astral_power%variable.ss_cost))&(!covenant.venthyr|buff.ravenous_frenzy.remains<gcd.max*ceil((astral_power+40*talent.fury_of_elune.enabled)%variable.ss_cost)+3*talent.new_moon.enabled&!runeforge.sinful_hysteria&buff.ravenous_frenzy.up|buff.ravenous_frenzy_sinful_hysteria.up|(buff.ravenous_frenzy.remains<action.starfire.execute_time&spell_haste<0.4|buff.ravenous_frenzy.remains<action.wrath.execute_time|buff.primordial_arcanic_pulsar.value>=210&(astral_power>variable.ss_cost*2-5|buff.ravenous_frenzy.remains>2)&buff.ravenous_frenzy.remains<6|variable.iqd_condition&cooldown.inscrutable_quantum_device.ready&equipped.inscrutable_quantum_device)&buff.ravenous_frenzy.up|!buff.ravenous_frenzy.up&!cooldown.ravenous_frenzy.ready)|variable.asp_dump|boss&fight_remains<gcd.max*ceil(astral_power%variable.ss_cost))
# Try to make the best of Starlord by stacking it up quickly in any Eclipse but Pulsar isn't about to be procced
actions.st+=/starsurge,if=talent.starlord.enabled&!runeforge.timeworn_dreambinder&(buff.starlord.up|astral_power>90)&buff.starlord.stack<3&(buff.eclipse_solar.up|buff.eclipse_lunar.up)&buff.primordial_arcanic_pulsar.value<270&(cooldown.ca_inc.remains>10|!variable.convoke_desync&covenant.night_fae)
# Estimates how much AsP are gained per second. Only takes a snapshot for the current situation so wouldn't be accurate for larger timeframes
actions.st+=/variable,name=aspPerSec,value=eclipse.in_lunar*8%action.starfire.execute_time+!eclipse.in_lunar*(6+talent.soul_of_the_forest.enabled*3)%action.wrath.execute_time+0.45%spell_haste+0.5*talent.natures_balance.enabled
# Dump Starsurge in an Eclipse as soon as possible as long as you will end up with 80+ when entering the next Eclipse, don't let it proc Pulsar, don't overwrite an Oneth proc and pool before CA/Inc and Empower Bond
actions.st+=/starsurge,if=!runeforge.timeworn_dreambinder&(buff.primordial_arcanic_pulsar.value<270|buff.primordial_arcanic_pulsar.value<250&talent.stellar_drift.enabled)&(eclipse.in_solar&astral_power+variable.aspPerSec*buff.eclipse_solar.remains+dot.fury_of_elune.ticks_remain*2.5>80|eclipse.in_lunar&astral_power+variable.aspPerSec*buff.eclipse_lunar.remains+dot.fury_of_elune.ticks_remain*2.5>90)&!buff.oneths_perception.up&!talent.starlord.enabled&(cooldown.ca_inc.remains>7|soulbind.thrill_seeker.enabled&buff.thrill_seeker.stack<33-(runeforge.sinful_hysteria*2)&fight_remains>100&fight_remains<200)&(!covenant.kyrian|cooldown.empower_bond.remains>2)
# Use Moons in any Eclipse and save Half+Full Moon for CA/Inc and Kindred Empowerment. Also use NM and FM at the end of Frenzy and don't let Dreambinder fall off
actions.st+=/new_moon,if=ap_check&variable.save_for_ca_inc&(buff.eclipse_lunar.remains>execute_time|buff.eclipse_solar.remains>execute_time)
actions.st+=/half_moon,if=ap_check&variable.save_for_ca_inc&(buff.eclipse_lunar.remains>execute_time|buff.eclipse_solar.remains>execute_time)&(buff.ca_inc.up|buff.primordial_arcanic_pulsar.value<=210)&(!covenant.venthyr|buff.ravenous_frenzy.remains<(5-2*runeforge.sinful_hysteria)&buff.ravenous_frenzy.up|!buff.ravenous_frenzy.up)&(!runeforge.timeworn_dreambinder|execute_time<buff.timeworn_dreambinder.remains|!buff.timeworn_dreambinder.up)
actions.st+=/full_moon,if=ap_check&variable.save_for_ca_inc&(buff.eclipse_lunar.remains>execute_time|buff.eclipse_solar.remains>execute_time)&(buff.ca_inc.up|buff.primordial_arcanic_pulsar.value<=210)&(!covenant.kyrian|buff.kindred_empowerment_energize.up)&(!covenant.venthyr|buff.ravenous_frenzy.remains<5&buff.ravenous_frenzy.up&!runeforge.sinful_hysteria|!buff.ravenous_frenzy.up)&(!runeforge.timeworn_dreambinder|execute_time<buff.timeworn_dreambinder.remains|!buff.timeworn_dreambinder.up)
# Use WoE on cd
actions.st+=/warrior_of_elune
# Use Starfire to proc Solar Eclipse, CA/Inc has less time than a Wrath execute left or only Lunar Eclipse is up. With T28 2pc enter a Solar Eclipse if Pulsar still has less than 210 stacks and CA/Inc and Convoke have more than 17s CD remaining. Use above 250% haste during Frenzy and 222% haste without Frenzy
actions.st+=/starfire,if=eclipse.in_lunar&!buff.ravenous_frenzy.up|eclipse.solar_next|(eclipse.any_next|buff.ca_inc.remains<action.wrath.execute_time&buff.ca_inc.up)&(!set_bonus.tier28_2pc|runeforge.primordial_arcanic_pulsar&buff.primordial_arcanic_pulsar.value<210&cooldown.ca_inc.remains>17&(!covenant.night_fae|cooldown.convoke_the_spirits.remains>17)&(!race.troll|cooldown.berserking.remains>17))|eclipse.in_any&(buff.warrior_of_elune.up|spell_haste<0.45&(!covenant.venthyr|!buff.ravenous_frenzy.up)|covenant.venthyr&spell_haste<0.4)
# Use Wrath otherwise which is in Solar Eclipse, CA/Inc or to proc Lunar Eclipse
actions.st+=/wrath
# Fallthru
actions.st+=/run_action_list,name=fallthru