Leafkiller's MoP Feral/Guardian Ovale Script

Face-rippin fun.

Moderator: Forum Administrators

Jeshu
Revered
Posts: 244
Joined: Tue Dec 14, 2010 5:34 pm

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Post by Jeshu » Thu Oct 30, 2014 11:19 am

Regarding future development of a "Leafkiller" feral script -- the Ovale default feral script is generated from the Tier 16 Mythic BiS profile and the Leafkiller script has always had a few more tweaks to increase damage over that. Looking over the old script, it seems a common theme was to check if a certain buff was going to expire soon and to reapply DoTs prior to that happening, and this logic was replicated for each of the common trinket or proc buffs. Nowadays, DoT snapshotting is gone except for the damage multiplier snapshots from Tiger's Fury, Savage Roar, and Bloodtalons. Is that kind of buff-expiration check still necessary?

If it is, I was wondering if perhaps it would be enough to have a script condition that returned the minimum remaining time on a list of buffs, e.g., BuffMinimumRemaining(tigers_fury_buff savage_roar_buff) would return the earlier of the time remaining on either of the two buffs. Or do you think you would need more information than that?

ShmooDude
Exalted
Posts: 1080
Joined: Tue Feb 08, 2011 5:51 pm

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Post by ShmooDude » Thu Oct 30, 2014 4:51 pm

Jeshu wrote:Regarding future development of a "Leafkiller" feral script -- the Ovale default feral script is generated from the Tier 16 Mythic BiS profile and the Leafkiller script has always had a few more tweaks to increase damage over that. Looking over the old script, it seems a common theme was to check if a certain buff was going to expire soon and to reapply DoTs prior to that happening, and this logic was replicated for each of the common trinket or proc buffs. Nowadays, DoT snapshotting is gone except for the damage multiplier snapshots from Tiger's Fury, Savage Roar, and Bloodtalons. Is that kind of buff-expiration check still necessary?

If it is, I was wondering if perhaps it would be enough to have a script condition that returned the minimum remaining time on a list of buffs, e.g., BuffMinimumRemaining(tigers_fury_buff savage_roar_buff) would return the earlier of the time remaining on either of the two buffs. Or do you think you would need more information than that?
I'm not even sure we'd need that necessarily. Most of the code was dedicating to dynamically adjusting the ratios when a buff was going to fall off before we'd have the energy and/or gcd to apply that bleed to prevent the sudden shifting of the icon from rake to shred (or rip to FB) and accidentally applying a lesser bleed. This problem is almost non existent now as 1) aura lag is mostly gone and only affected by latency and a minimal computation time on the server and 2) The only buff that really does that anymore is Tiger's Fury since we always refresh savage roar at <3 seconds remaining at the latest so it should always be up and almost always rake will be the first ability used after using it, thus not risking it falling off when we're trying to get a better snapshot. Even in an edge case where that is the case, I'm not sure its actually worth doing anything specific for as the damage loss for that kind of mistake is no where near where it was before (example: I messed up and overwrote my rake on the pull of iron juggernaut once and lost 2 million damage!).

The other option is ovale could easily handle this internally now. All the code was doing is if a snapshot buff was expiring and you weren't going to have enough energy or gcd to use a bleed anyhow, to take that snapshot buff out of the ratio (now persistent multiplier as simcraft calls it). The only buff that you'd even need to do this for would be Tiger's Fury as BT buff is extremely long duration and Savage Roar is always going to be used before its that dangerously close to expiring. You then check the energy requirement vs rake if cp < 5 or rip if cp = 5, though the 2 piece would cause weirdness with it since its non-natural energy regen, so might be something to simply reconsider for next tier and not bother this time around (or have it as an "option"). Either way I don't see a need for a BuffMinimumRemaining() function.

User avatar
Fieran
Posts: 20
Joined: Sun Nov 16, 2014 2:30 pm

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Post by Fieran » Sun Nov 16, 2014 2:44 pm

Hey, has anyone got a script that sorts out the Claws of Shirvallah?

It thinks I'm not in cat form and keeps trying to tell me that I should shift into cat when I don't even have that spell due to claws overtaking it.

Dropzone
Posts: 22
Joined: Wed Jul 06, 2011 7:39 am

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Post by Dropzone » Mon Dec 08, 2014 10:17 pm

  • so it looks like Ovale has been updated for 6.0.3 about 89 mins ago
Image

Aperature
Posts: 13
Joined: Thu Oct 09, 2014 10:31 pm

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Post by Aperature » Mon Dec 15, 2014 4:16 pm

Anyone else still getting "flickering" issues with Ovale? I have Ovale up on screen, but off to the side because it is so distracting. I also miss the older format from the leafkiller script. As a result I also have up the addon "Claw" - which does not have any flickering issues AND is had the next ability box (predictive action).

Anyone ever take a shot at adopting feral scripts to Hekili addon (primarily Shaman addon). The idea was floated around shortly before WoD launch. It is a cool addon.

Skim - US. Blackhand.

User avatar
Tinderhoof
Exalted
Posts: 2234
Joined: Mon May 24, 2010 10:21 pm

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Post by Tinderhoof » Mon Dec 15, 2014 4:54 pm

The flickering is a known issue. The script is pretty much taken wholesale from SimC and is not specifically optimized for Cat alone. It has the other 3 specs scripts in there too.

RareBeast
Honored
Posts: 157
Joined: Thu Jun 30, 2011 4:05 am

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Post by RareBeast » Tue Dec 16, 2014 11:46 am

An option to tick to get the script to keep thrash up would be useful with all the multi target fights around at the moment.

Jeshu
Revered
Posts: 244
Joined: Tue Dec 14, 2010 5:34 pm

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Post by Jeshu » Tue Dec 16, 2014 4:28 pm

RareBeast wrote:An option to tick to get the script to keep thrash up would be useful with all the multi target fights around at the moment.
The SimC feral profile already tries to keep Thrash up as long as there is more than one target. Is the Ovale script not that way? Admittedly, this is currently difficult to test on the target dummies because Ovale doesn't consider the target dummies as enemies (this does need to get fixed eventually).

Jeshu
Revered
Posts: 244
Joined: Tue Dec 14, 2010 5:34 pm

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Post by Jeshu » Tue Dec 16, 2014 4:35 pm

Aperature wrote:I also miss the older format from the leafkiller script. As a result I also have up the addon "Claw" - which does not have any flickering issues AND is had the next ability box (predictive action).
I'm not sure exactly what the old layout was in the Leafkiller script, but in the default Ovale script, you can untoggle the AOE checkbox and it will show a "predictive" rotation in place of the AOE icon. This predictive rotation is the same as the normal rotation, minus any fillers.

ShmooDude
Exalted
Posts: 1080
Joined: Tue Feb 08, 2011 5:51 pm

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Post by ShmooDude » Wed Dec 17, 2014 8:08 am

Jeshu wrote:
RareBeast wrote:An option to tick to get the script to keep thrash up would be useful with all the multi target fights around at the moment.
The SimC feral profile already tries to keep Thrash up as long as there is more than one target. Is the Ovale script not that way? Admittedly, this is currently difficult to test on the target dummies because Ovale doesn't consider the target dummies as enemies (this does need to get fixed eventually).
Yah, works fine if you have the aoe script on.



TBH, I've been pretty lazy about updating the leafkillers script because the base one works so well.

Dropzone
Posts: 22
Joined: Wed Jul 06, 2011 7:39 am

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Post by Dropzone » Wed Dec 17, 2014 8:33 am

I have been looking and wanting a new updated script for ovals ... But no joy so I have been using Weakaura temporarily till a new script is available.
Image

Jeshu
Revered
Posts: 244
Joined: Tue Dec 14, 2010 5:34 pm

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Post by Jeshu » Wed Dec 17, 2014 4:35 pm

Dropzone wrote:I have been looking and wanting a new updated script for ovals ... But no joy so I have been using Weakaura temporarily till a new script is available.
What exactly are you looking for that the default script is not sufficient? If you can give me some details, then I can at least take a look at what can be improved in the default script.

The default script is entirely based off of the SimulationCraft feral APL which was crafted and tested by the folks here at TFD (aggixx, ShmooDude, Twitchy and many others). It has a base layout of four icons: [shortcd][main][predict/aoe][cd], and the third icon can be toggled between showing the predictive rotation or the AoE rotation by toggling the AoE checkbox option. If you switch to Guardian specialization, the script keeps the same base layout of four icons and shows the tanking rotation instead.

Terias
Honored
Posts: 144
Joined: Sun May 29, 2011 2:58 am

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Post by Terias » Thu Dec 18, 2014 6:38 am

Interrupt suggestions shouldn't be in the cd window and there should be an option to toggle them off completely.

Having to toggle between predictive and aoe seems flawed since most fights are a mix of single target and aoe, (brackenspore, tectus, twin ogron, koragh, imperator) - ideally you'd be able to see both or neither.

Also, though I don't really use it there, I've noticed in pvp it just recommends you rake your target forever - does pvp rake have a different spell id or something?

User avatar
Zyb
Posts: 11
Joined: Thu Dec 04, 2014 2:48 pm

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Post by Zyb » Thu Dec 18, 2014 2:14 pm

Anyone using this that might want to share a log? I've tested it with a dummy, Ovale and Claw as well, and if I followed the addon's instructions without keeping an eye on dots and SR by myself, I would end up losing uptime on SR, Rake or Rip when told to FB. Anyone else noticed this?

ShmooDude
Exalted
Posts: 1080
Joined: Tue Feb 08, 2011 5:51 pm

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Post by ShmooDude » Thu Dec 18, 2014 5:43 pm

Zyb wrote:Anyone using this that might want to share a log? I've tested it with a dummy, Ovale and Claw as well, and if I followed the addon's instructions without keeping an eye on dots and SR by myself, I would end up losing uptime on SR, Rake or Rip when told to FB. Anyone else noticed this?
You shouldn't ever be losing time on SR because you FB. Rip yes, Rake maybe a little, but FB is strong enough to warrant this now.

Daias
Posts: 7
Joined: Wed Dec 03, 2014 5:21 pm

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Post by Daias » Thu Dec 18, 2014 5:59 pm

Terias wrote:Having to toggle between predictive and aoe seems flawed since most fights are a mix of single target and aoe, (brackenspore, tectus, twin ogron, koragh, imperator) - ideally you'd be able to see both or neither.
This is what I'd like also.

Leafkiller
Exalted
Posts: 1180
Joined: Fri Jun 04, 2010 4:28 am

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Post by Leafkiller » Thu Dec 18, 2014 7:54 pm

Not surprisingly, I prefer the boxes as I had them setup in the script (I am not sure if that changed in the 2 years I stopped playing). Looking at the simc script, the only concern I have about copying that directly are the places where something is about to fall off. Specifically, losing a blood talons healing touch with a 1.5 second cleanup time window, and possibly 3 seconds for losing a savage roar.

I typically added about a second to those timers when I translated from a sim script to an Ovale script because there are a lot more distractions. Even making the changes in simc is pretty trivial. Changing the SR cleanup to 4 seconds was less than the dps error on a run I just tried and changing the healing touch cleanup to 2.5 seconds is about a third of a percent dps loss, while in actual play, both of these changes will likely be dps ups.

I notice there is no collision/resyncing code anymore to refresh SR early if it will expire close to Rip. Is that now a dps loss?

Another thing I have noticed with the rotation is it sometimes has you cast TF immediately followed by HT. I have seen it in game and you can also see it in the simc sample sequence (look for PK). There are several ways to try to improve on that, although there is the risk of the code asking for multiple rakes in a row - HT, rake, TF, rake.

@Jeshu

How would you feel about putting the icon code into a separate file from the rotation functions? Also, would you consider making it easy to override a couple of the values without having to replicate the code? (basically make it easy to add a second to the SR and HT cleanup times) Then the Leafkiller script would be much simpler to write and maintain since it could share most of the rotation code and automatically receive any rotation improvements when you resync with simc. The focus then would be on the icon layout and what goes into each icon so the UI could be easily tailored to different tastes.

User avatar
Zyb
Posts: 11
Joined: Thu Dec 04, 2014 2:48 pm

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Post by Zyb » Thu Dec 18, 2014 8:18 pm

ShmooDude wrote:
Zyb wrote:Anyone using this that might want to share a log? I've tested it with a dummy, Ovale and Claw as well, and if I followed the addon's instructions without keeping an eye on dots and SR by myself, I would end up losing uptime on SR, Rake or Rip when told to FB. Anyone else noticed this?
You shouldn't ever be losing time on SR because you FB. Rip yes, Rake maybe a little, but FB is strong enough to warrant this now.
I know, that's why I'm wondering if it's just me due to gear or somebody else noticed this. IF and only IF I blindly follow the rotation done by the addon, it will eventually tell me to FB when in my amateur opinion, should've pooled to refresh SR.

ShmooDude
Exalted
Posts: 1080
Joined: Tue Feb 08, 2011 5:51 pm

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Post by ShmooDude » Fri Dec 19, 2014 6:19 am

Zyb wrote:
ShmooDude wrote:
Zyb wrote:Anyone using this that might want to share a log? I've tested it with a dummy, Ovale and Claw as well, and if I followed the addon's instructions without keeping an eye on dots and SR by myself, I would end up losing uptime on SR, Rake or Rip when told to FB. Anyone else noticed this?
You shouldn't ever be losing time on SR because you FB. Rip yes, Rake maybe a little, but FB is strong enough to warrant this now.
I know, that's why I'm wondering if it's just me due to gear or somebody else noticed this. IF and only IF I blindly follow the rotation done by the addon, it will eventually tell me to FB when in my amateur opinion, should've pooled to refresh SR.
I mostly follow the addon and SR never drops off unless I have significant downtime from DPSing at a bad time in the rotation. Are you pooling your energy to near max before you FB? The addon asks you to do that (except in execute range/berserk) but it might not be immediately clear. That could be your problem, but due to the way its setup I never have issues with SR uptime from following it. Rake/Rip yea, but never SR

mineko
Honored
Posts: 52
Joined: Sun Oct 03, 2010 12:13 pm

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Post by mineko » Sat Dec 20, 2014 4:34 pm

I just came back to the game after being away since around the ToES patch. The consensus seems to be that the default Ovale script is as good as it gets, but I rather liked the simplicity of the Leafkiller script. I liked that the short and long cooldowns were shown in the main attack indicator when the optimal time to use them was up. Is there a way to do that with the default script?

Also, a huge thank you to everyone who works on Ovale. You're beautiful people.

ShmooDude
Exalted
Posts: 1080
Joined: Tue Feb 08, 2011 5:51 pm

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Post by ShmooDude » Mon Dec 22, 2014 4:20 pm

Beta script; use at your own risk:
Spoiler: show

Code: Select all

# Ovale druid script based on SimulationCraft.

Include(ovale_common)
Include(ovale_druid_spells)

AddCheckBox(opt_potion_agility ItemName(draenic_agility_potion) default)

AddFunction UsePotionAgility
{
    if CheckBoxOn(opt_potion_agility) and target.Classification(worldboss) Item(draenic_agility_potion usable=1)
}

AddFunction GetInMeleeRange
{
    if Stance(druid_bear_form) and not target.InRange(mangle) or { Stance(druid_cat_form) or Stance(druid_claws_of_shirvallah) } and not target.InRange(shred)
    {
        if target.InRange(wild_charge) Spell(wild_charge)
        Texture(misc_arrowlup help=L(not_in_melee_range))
    }
}

AddFunction UseItemActions
{
    Item(HandSlot usable=1)
    Item(Trinket0Slot usable=1)
    Item(Trinket1Slot usable=1)
}

AddFunction InterruptActions
{
    if not target.IsFriend() and target.IsInterruptible()
    {
        if target.InRange(skull_bash) Spell(skull_bash)
        if not target.Classification(worldboss)
        {
            if target.InRange(mighty_bash) Spell(mighty_bash)
            Spell(typhoon)
            if target.InRange(maim) Spell(maim)
            Spell(war_stomp)
        }
    }
}

###
### Feral
###
# Based on SimulationCraft profile "Druid_Feral_T17M".
#    class=druid
#    spec=feral
#    talents=3002002
#    glyphs=savage_roar

# ActionList: FeralDefaultActions --> main, predict, shortcd, cd

AddFunction FeralDefaultActions
{
    #cat_form
    Spell(cat_form)
    #rake,if=buff.prowl.up|buff.shadowmeld.up
    if BuffPresent(prowl_buff) or BuffPresent(shadowmeld_buff) Spell(rake)
    #auto_attack
    #ferocious_bite,cycle_targets=1,if=dot.rip.ticking&dot.rip.remains<3&target.health.pct<25
    if target.DebuffPresent(rip_debuff) and target.DebuffRemaining(rip_debuff) < 3 and target.HealthPercent() < 25 Spell(ferocious_bite)
    #healing_touch,if=talent.bloodtalons.enabled&buff.predatory_swiftness.up&(combo_points>=4|buff.predatory_swiftness.remains<1.5)
    if Talent(bloodtalons_talent) and BuffPresent(predatory_swiftness_buff) and { ComboPoints() >= 4 or BuffRemaining(predatory_swiftness_buff) < 1.5 } Spell(healing_touch)
    #savage_roar,if=buff.savage_roar.remains<3
    if BuffRemaining(savage_roar_buff) < 3 Spell(savage_roar)
    #pool_resource,for_next=1
    #thrash_cat,cycle_targets=1,if=remains<4.5&(active_enemies>1|(combo_points=5&!talent.bloodtalons.enabled&buff.omen_of_clarity.react))
    if target.DebuffRemaining(thrash_cat_debuff) < 4.5 and { Enemies() > 1 or ComboPoints() == 5 and not Talent(bloodtalons_talent) and BuffPresent(omen_of_clarity_melee_buff) } Spell(thrash_cat)
    unless target.DebuffRemaining(thrash_cat_debuff) < 4.5 and { Enemies() > 1 or ComboPoints() == 5 and not Talent(bloodtalons_talent) and BuffPresent(omen_of_clarity_melee_buff) } and SpellUsable(thrash_cat) and SpellCooldown(thrash_cat) < TimeToEnergyFor(thrash_cat)
    {
        #call_action_list,name=finisher,if=combo_points=5
        if ComboPoints() == 5 FeralFinisherActions()
        #thrash_cat,cycle_targets=1,if=talent.bloodtalons.enabled&combo_points=5&remains<4.5&buff.omen_of_clarity.react
        if Talent(bloodtalons_talent) and ComboPoints() == 5 and target.DebuffRemaining(thrash_cat_debuff) < 4.5 and BuffPresent(omen_of_clarity_melee_buff) Spell(thrash_cat)
        #rake,cycle_targets=1,if=combo_points<5&remains<3&target.time_to_die-remains>15&buff.king_of_the_jungle.up&active_enemies<16
        if ComboPoints() < 5 and target.DebuffRemaining(rake_debuff) < 3 and target.TimeToDie() - target.DebuffRemaining(rake_debuff) > 15 and BuffPresent(king_of_the_jungle_buff) and Enemies() < 16 Spell(rake)
        #call_action_list,name=maintain,if=combo_points<5&active_enemies<8
        if ComboPoints() < 5 and Enemies() < 8 FeralMaintainActions()
        #call_action_list,name=generator,if=combo_points<5&(energy.time_to_max<=1|buff.berserk.up|cooldown.tigers_fury.remains<3|buff.tigers_fury.up|buff.king_of_the_jungle.up|dot.rip.remains<8-combo_points|trinket.proc.all.react|buff.omen_of_clarity.react|(talent.bloodtalons.enabled&buff.predatory_swiftness.up&buff.predatory_swiftness.remains<6.5-combo_points))
        if ComboPoints() < 5 and { TimeToMaxEnergy() <= 1 or BuffPresent(berserk_cat_buff) or SpellCooldown(tigers_fury) < 3 or BuffPresent(tigers_fury_buff) or BuffPresent(king_of_the_jungle_buff) or target.DebuffRemaining(rip_debuff) < 8 - ComboPoints() or BuffPresent(trinket_proc_any_buff) or BuffPresent(omen_of_clarity_melee_buff) or Talent(bloodtalons_talent) and BuffPresent(predatory_swiftness_buff) and BuffRemaining(predatory_swiftness_buff) < 6.5 - ComboPoints() } FeralGeneratorActions()
    }
    if BuffRemains(rejuvenation) < 3.6 and SpellCooldown(tigers_fury) > 1 Spell(rejuvenation)
}

AddFunction FeralDefaultPredictActions
{
    #cat_form
    Spell(cat_form)
    #rake,if=buff.prowl.up|buff.shadowmeld.up
    if BuffPresent(prowl_buff) or BuffPresent(shadowmeld_buff) Spell(rake)
    #auto_attack
    #ferocious_bite,cycle_targets=1,if=dot.rip.ticking&dot.rip.remains<3&target.health.pct<25
    if target.DebuffPresent(rip_debuff) and target.DebuffRemaining(rip_debuff) < 3 and target.HealthPercent() < 25 Spell(ferocious_bite)
    #healing_touch,if=talent.bloodtalons.enabled&buff.predatory_swiftness.up&(combo_points>=4|buff.predatory_swiftness.remains<1.5)
    if Talent(bloodtalons_talent) and BuffPresent(predatory_swiftness_buff) and { ComboPoints() >= 4 or BuffRemaining(predatory_swiftness_buff) < 1.5 } Spell(healing_touch)
    #savage_roar,if=buff.savage_roar.remains<3
    if BuffRemaining(savage_roar_buff) < 3 Spell(savage_roar)
    #pool_resource,for_next=1
    #thrash_cat,cycle_targets=1,if=remains<4.5&(active_enemies>1|(combo_points=5&!talent.bloodtalons.enabled&buff.omen_of_clarity.react))
    if target.DebuffRemaining(thrash_cat_debuff) < 4.5 and { Enemies() > 1 or ComboPoints() == 5 and not Talent(bloodtalons_talent) and BuffPresent(omen_of_clarity_melee_buff) } Spell(thrash_cat)
    unless target.DebuffRemaining(thrash_cat_debuff) < 4.5 and { Enemies() > 1 or ComboPoints() == 5 and not Talent(bloodtalons_talent) and BuffPresent(omen_of_clarity_melee_buff) } and SpellUsable(thrash_cat) and SpellCooldown(thrash_cat) < TimeToEnergyFor(thrash_cat)
    {
        #call_action_list,name=finisher,if=combo_points=5
        if ComboPoints() == 5 FeralFinisherActions()
        #thrash_cat,cycle_targets=1,if=talent.bloodtalons.enabled&combo_points=5&remains<4.5&buff.omen_of_clarity.react
        if Talent(bloodtalons_talent) and ComboPoints() == 5 and target.DebuffRemaining(thrash_cat_debuff) < 4.5 and BuffPresent(omen_of_clarity_melee_buff) Spell(thrash_cat)
        #rake,cycle_targets=1,if=combo_points<5&remains<3&target.time_to_die-remains>15&buff.king_of_the_jungle.up&active_enemies<16
        if ComboPoints() < 5 and target.DebuffRemaining(rake_debuff) < 3 and target.TimeToDie() - target.DebuffRemaining(rake_debuff) > 15 and BuffPresent(king_of_the_jungle_buff) and Enemies() < 16 Spell(rake)
        #call_action_list,name=maintain,if=combo_points<5&active_enemies<8
        if ComboPoints() < 5 and Enemies() < 8 FeralMaintainActions()
    }
}

AddFunction FeralDefaultMovementActions
{
    # CHANGE: Get within melee range of the target.
    GetInMeleeRange()
    if target.InRange(wild_charge) Spell(wild_charge)
    #displacer_beast,if=movement.distance>10
    if 0 > 10 Spell(displacer_beast)
    #dash,if=movement.distance&buff.displacer_beast.down&buff.wild_charge_movement.down
    if 0 and BuffExpires(displacer_beast_buff) and True(wild_charge_movement_down) Spell(dash)

}

AddFunction FeralDefaultShortCdActions
{
    unless Spell(cat_form)
    {
        unless { BuffPresent(prowl_buff) or BuffPresent(shadowmeld_buff) } and Spell(rake)
        {
            #force_of_nature,if=charges=3rinket.proc.all.reactarget.time_to_die<20
            if Charges(force_of_nature_melee) == 3 or BuffPresent(trinket_proc_any_buff) or target.TimeToDie() < 20 Spell(force_of_nature_melee)
            #tigers_fury,if=(!buff.omen_of_clarity.react&energy.max-energy>=60)|energy.max-energy>=80
            if not BuffPresent(omen_of_clarity_melee_buff) and MaxEnergy() - Energy() >= 60 or MaxEnergy() - Energy() >= 80 Spell(tigers_fury)
        }
    }
}

# CHANGE: Helper function for Tiger's Fury sync condition.
AddFunction FeralTigersFurySyncCondition
{
    #tigers_fury,if=(!buff.omen_of_clarity.react&energy.max-energy>=60)|energy.max-energy>=80
    BuffPresent(tigers_fury_buff) or { not BuffPresent(omen_of_clarity_melee_buff) and MaxEnergy() - Energy() >= 60 or MaxEnergy() - Energy() >= 80 } and not SpellCooldown(tigers_fury) > 0
}

AddFunction FeralDefaultCdActions
{
    FeralDefaultMovementActions()
    unless Spell(cat_form)
        or { BuffPresent(prowl_buff) or BuffPresent(shadowmeld_buff) } and Spell(rake)
    {
        InterruptActions()
        #potion,name=draenic_agility,if=target.time_to_die<=40
        if target.TimeToDie() <= 40 UsePotionAgility()
		#incarnation,if=cooldown.berserk.remains<10&cooldown.tigers_fury.remains<10&energy.time_to_max>1
        if SpellCooldown(berserk_cat) < 10 and SpellCooldown(tigers_fury) < 10 and TimeToMaxEnergy() > 1 Spell(incarnation_melee)
		unless SpellCooldown(incarnation_melee) <= 0
		{
		    #berserk,if=buff.tigers_fury.up
            #if BuffPresent(tigers_fury_buff) Spell(berserk_cat)
            if FeralTigersFurySyncCondition() Spell(berserk_cat)
            # CHANGE: Synchronize abilities that are used with Tiger's Fury using Tiger Fury's conditions.
            #tigers_fury,if=(!buff.omen_of_clarity.react&energy.max-energy>=60)|energy.max-energy>=80
            #use_item,slot=trinket1,sync=tigers_fury
            #if not SpellCooldown(tigers_fury) > 0 UseItemActions()
            if FeralTigersFurySyncCondition() UseItemActions()
            #blood_fury,sync=tigers_fury
            #if not SpellCooldown(tigers_fury) > 0 Spell(blood_fury_apsp)
            if FeralTigersFurySyncCondition() Spell(blood_fury_apsp)
            #berserking,sync=tigers_fury
            if not SpellCooldown(tigers_fury) > 0 Spell(berserking)
            if FeralTigersFurySyncCondition() Spell(berserking)
            #arcane_torrent,sync=tigers_fury
            #if not SpellCooldown(tigers_fury) > 0 Spell(arcane_torrent_energy)
            if FeralTigersFurySyncCondition() Spell(arcane_torrent_energy)
            #potion,name=draenic_agility,sync=berserk,if=target.health.pct<25
            #if target.HealthPercent() < 25 and not SpellCooldown(berserk_cat) > 0 UsePotionAgility()
            if target.HealthPercent() < 25 and { BuffPresent(berserk_cat_buff) or FeralTigersFurySyncCondition() and SpellCooldown(berserk_cat) > 0 } UsePotionAgility()
            #shadowmeld,if=dot.rake.remains<4.5&energy>=35&dot.rake.pmultiplier<2&(buff.bloodtalons.up|!talent.bloodtalons.enabled)&(!talent.incarnation.enabled|cooldown.incarnation.remains>15)&!buff.king_of_the_jungle.up
            if target.DebuffRemaining(rake_debuff) < 4.5 and Energy() >= 35 and target.DebuffPersistentMultiplier(rake_debuff) < 2 and { BuffPresent(bloodtalons_buff) or not Talent(bloodtalons_talent) } and { not Talent(incarnation_talent) or SpellCooldown(incarnation_melee) > 15 } and not BuffPresent(king_of_the_jungle_buff) Spell(shadowmeld)
			FeralDefaultShortCdActions()
		}
    }
}

# ActionList: FeralFinisherActions --> main, predict

AddFunction FeralFinisherActions
{
    FeralFinisherPredictActions()
}

AddFunction FeralFinisherPredictActions
{
    #ferocious_bite,cycle_targets=1,max_energy=1,if=target.health.pct<25&dot.rip.ticking
    if Energy() >= EnergyCost(ferocious_bite max=1) and target.HealthPercent() < 25 and target.DebuffPresent(rip_debuff) Spell(ferocious_bite)
    #rip,cycle_targets=1,if=remains<3&target.time_to_die-remains>18
    if target.DebuffRemaining(rip_debuff) < 3 and target.TimeToDie() - target.DebuffRemaining(rip_debuff) > 18 Spell(rip)
    #rip,cycle_targets=1,if=remains<7.2&target.time_to_die-remains>18&(energy.time_to_max<=1|buff.berserk.up|(buff.tigers_fury.remains<=1&buff.tigers_fury.up)|dot.rake.remains<1)&(!talent.bloodtalons.enabled|(talent.bloodtalons.enabled&persistent_multiplier>=dot.rip.pmultiplier&(!buff.predatory_swiftness.up|buff.bloodtalons.up)))
    if target.DebuffRemaining(rip_debuff) < 7.2 and target.TimeToDie() - target.DebuffRemaining(rip_debuff) > 18 and { TimeToMaxEnergy() <= 1 or BuffPresent(berserk_cat_buff) or BuffRemaining(tigers_fury_buff) <= 1 and BuffPresent(tigers_fury_buff) or target.DebuffRemaining(rake_debuff) < 1 } and { not Talent(bloodtalons_talent) or Talent(bloodtalons_talent) and PersistentMultiplier(rip_debuff) >= target.DebuffPersistentMultiplier(rip_debuff) and { not BuffPresent(predatory_swiftness_buff) or BuffPresent(bloodtalons_buff) } } Spell(rip)
    #savage_roar,if=(energy.time_to_max<=1|buff.berserk.up|cooldown.tigers_fury.remains<3|dot.rake.remains<1)&buff.savage_roar.remains<12.6
    if { TimeToMaxEnergy() <= 1 or BuffPresent(berserk_cat_buff) or SpellCooldown(tigers_fury) < 3 or target.DebuffRemaining(rake_debuff) < 1 } and BuffRemaining(savage_roar_buff any=1) < 12.6 Spell(savage_roar)
    #ferocious_bite,max_energy=1,if=(energy.time_to_max<=1|buff.berserk.up|cooldown.tigers_fury.remains<3|dot.rake.remains<1)
    if Energy() >= EnergyCost(ferocious_bite max=1) and { TimeToMaxEnergy() <= 1 or BuffPresent(berserk_cat_buff) or SpellCooldown(tigers_fury) < 3 or target.DebuffRemaining(rake_debuff) < 1 } Spell(ferocious_bite)
}

# ActionList: FeralGeneratorActions --> main

AddFunction FeralGeneratorActions
{
    #swipe,if=active_enemies>=3
    if Enemies() >= 3 Spell(swipe)
    #shred,if=active_enemies<3
    if Enemies() < 3 Spell(shred)
}

# ActionList: FeralMaintainActions --> main, predict

AddFunction FeralMaintainActions
{
    FeralMaintainPredictActions()
}

AddFunction FeralMaintainPredictActions
{
    #rake,cycle_targets=1,if=remains<3&target.time_to_die-remains>15
    if target.DebuffRemaining(rake_debuff) < 3 and target.TimeToDie() - target.DebuffRemaining(rake_debuff) > 15 Spell(rake)
    #rake,cycle_targets=1,if=remains<4.5&target.time_to_die-remains>15&((!talent.bloodtalons.enabled&buff.tigers_fury.up)|(talent.bloodtalons.enabled&(!buff.predatory_swiftness.up|buff.bloodtalons.up)))
    if target.DebuffRemaining(rake_debuff) < 4.5 and target.TimeToDie() - target.DebuffRemaining(rake_debuff) > 15 and { not Talent(bloodtalons_talent) and BuffPresent(tigers_fury_buff) or Talent(bloodtalons_talent) and { not BuffPresent(predatory_swiftness_buff) or BuffPresent(bloodtalons_buff) } } Spell(rake)
    #moonfire_cat,cycle_targets=1,if=remains<4.2&active_enemies<6&target.time_to_die-remains>14
    if target.DebuffRemaining(moonfire_cat_debuff) < 4.2 and Enemies() < 6 and target.TimeToDie() - target.DebuffRemaining(moonfire_cat_debuff) > 14 Spell(moonfire_cat)
    #rake,if=persistent_multiplier>dot.rake.pmultiplier&active_enemies=1&target.time_to_die-remains>15
    if PersistentMultiplier(rake_debuff) > target.DebuffPersistentMultiplier(rake_debuff) and Enemies() == 1 and target.TimeToDie() - target.DebuffRemaining(rake_debuff) > 15 Spell(rake)
    #rake,if=buff.king_of_the_jungle.up&buff.king_of_the_jungle.remains<=3&dot.rake.remains<15&target.time_to_die-remains>15
    if BuffPresent(king_of_the_jungle_buff) and BuffRemaining(king_of_the_jungle_buff) <= 3 and target.DebuffRemaining(rake_debuff) < 15 and target.TimeToDie() - target.DebuffRemaining(rake_debuff) > 15 Spell(rake)
}

# ActionList: FeralPrecombatActions --> main, predict, shortcd, main

AddFunction FeralPrecombatActions
{
    #flask,type=greater_draenic_agility_flask
    #food,type=blackrock_barbecue
    #mark_of_the_wild,if=!aura.str_agi_int.up
    if not BuffPresent(str_agi_int_buff any=1) Spell(mark_of_the_wild)
    # CHANGE: Cast Healing Touch to gain Bloodtalons buff if less than 20s remaining on the buff.
    #healing_touch,if=talent.bloodtalons.enabled
    #if Talent(bloodtalons_talent) Spell(healing_touch)
    if Talent(bloodtalons_talent) and BuffRemaining(bloodtalons_buff) < 20 Spell(healing_touch)
    #cat_form
    Spell(cat_form)
    #prowl
    if BuffExpires(stealthed_buff any=1) Spell(prowl)
    #snapshot_stats
}

AddFunction FeralPrecombatPredictActions {}

AddFunction FeralPrecombatShortCdActions {}

AddFunction FeralPrecombatCdActions
{
    unless not BuffPresent(str_agi_int_buff any=1) and Spell(mark_of_the_wild)
        or Spell(cat_form)
        or BuffExpires(stealthed_buff any=1) and Spell(prowl)
    {
        #potion,name=draenic_agility
        UsePotionAgility()
    }
}

### Feral Icons
AddCheckBox(opt_druid_feral_aoe L(AOE) specialization=feral default)
AddCheckBox(opt_druid_feral_predict L(Predict) specialization=feral default)
AddCheckBox(opt_druid_feral_cooldowns L("Left: Small Cooldown Boxes") specialization=feral default)
AddCheckBox(opt_druid_feral_buff_debuff L("Right: Small SR/Bleed Boxes") specialization=feral default)

AddIcon specialization=feral checkbox=opt_druid_feral_cooldowns size=small
{
    Spell(survival_instincts)
    #if SpellCooldown(survival_instincts) Texture(ability_druid_tigersroar)
}

AddIcon specialization=feral checkbox=opt_druid_feral_cooldowns size=small
{
    Spell(incarnation_melee)
    #if BuffExpires(king_of_the_jungle_buff) Texture(spell_druid_incarnation)
}

AddIcon specialization=feral checkbox=opt_druid_feral_cooldowns size=small
{
    Spell(tigers_fury)
    #if BuffExpires(tigers_fury_buff) Texture(ability_mount_jungletiger)
}

AddIcon specialization=feral checkbox=opt_druid_feral_cooldowns size=small
{
    Spell(berserk_cat)
    #if BuffExpires(beresrk_cat_buff) Texture(ability_druid_berserk)
}

AddIcon specialization=feral help=cd
{
    if InCombat(no) FeralPrecombatCdActions()
    FeralDefaultCdActions()
}

AddIcon specialization=feral help=main enemies=1
{
    if InCombat(no) FeralPrecombatActions()
    FeralDefaultActions()
}

AddIcon specialization=feral help=predict enemies=1 checkbox=opt_druid_feral_predict
{
    if InCombat(no) FeralPrecombatPredictActions()
    FeralDefaultPredictActions()
}

AddIcon specialization=feral help=aoe checkbox=opt_druid_feral_aoe
{
    if InCombat(no) FeralPrecombatActions()
    FeralDefaultActions()
}

AddIcon specialization=feral help="Savage Roar" checkbox=opt_druid_feral_buff_debuff size=small
{
    if BuffExpires(savage_roar_buff) Texture(ability_druid_skinteeth)
}

AddIcon specialization=feral help="Rake" checkbox=opt_druid_feral_buff_debuff size=small
{
    if TargetDebuffExpires(rake_debuff) Texture(ability_druid_disembowel)
}

AddIcon specialization=feral help="Rip" checkbox=opt_druid_feral_buff_debuff size=small
{
    if TargetDebuffExpires(rip_debuff) Texture(ability_ghoulfrenzy)
}

AddIcon specialization=feral help="Moonfire" checkbox=opt_druid_feral_buff_debuff size=small
{
    if Talent(lunar_inspiration_talent) and TargetBuffExpires(moonfire_cat_debuff) Texture(spell_nature_starfall)
	if Talent(bloodtalons_talent) and BuffExpires(predatory_swiftness_buff) Texture(ability_hunter_pet_cat)
	if TargetBuffExpires(thrash_cat_debuff) Texture(spell_druid_thrash)
}



###
### Guardian
###
# Based on SimulationCraft profile "Druid_Guardian_T17M".
#    class=druid
#    spec=guardian
#    talents=0301022

# ActionList: GuardianDefaultActions --> main, shortcd, cd

AddFunction GuardianDefaultActions
{
    #auto_attack
    #cenarion_ward
    Spell(cenarion_ward)
    #rejuvenation,if=buff.heart_of_the_wild.up&remains<=0.3*duration
    if BuffPresent(heart_of_the_wild_tank_buff) and BuffRemaining(rejuvenation_buff) <= 0.3 * BaseDuration(rejuvenation_buff) and SpellKnown(enhanced_rejuvenation) Spell(rejuvenation)
    #healing_touch,if=buff.dream_of_cenarius.react&health.pct<30
    if BuffPresent(dream_of_cenarius_tank_buff) and HealthPercent() < 30 Spell(healing_touch)
    #pulverize,if=buff.pulverize.remains<0.5
    if BuffRemaining(pulverize_buff) < 0.5 and target.DebuffStacks(lacerate_debuff) >= 3 Spell(pulverize)
    #lacerate,if=talent.pulverize.enabled&buff.pulverize.remains<=(3-dot.lacerate.stack)*gcd&buff.berserk.down
    if Talent(pulverize_talent) and BuffRemaining(pulverize_buff) <= { 3 - target.DebuffStacks(lacerate_debuff) } * GCD() and BuffExpires(berserk_bear_buff) Spell(lacerate)
    #lacerate,if=!ticking
    if not target.DebuffPresent(lacerate_debuff) Spell(lacerate)
    #thrash_bear,if=!ticking
    if not target.DebuffPresent(thrash_bear_debuff) Spell(thrash_bear)
    #mangle
    Spell(mangle)
    #thrash_bear,if=remains<=0.3*duration
    if target.DebuffRemaining(thrash_bear_debuff) <= 0.3 * BaseDuration(thrash_bear_debuff) Spell(thrash_bear)
    #lacerate
    Spell(lacerate)
}

AddFunction GuardianDefaultShortCdActions
{
    #savage_defense
    Spell(savage_defense)
    #maul,if=buff.tooth_and_claw.react&incoming_damage_1s
    if BuffPresent(tooth_and_claw_buff) and IncomingDamage(1) > 0 Spell(maul)
    #frenzied_regeneration,if=rage>=80
    if Rage() >= 80 Spell(frenzied_regeneration)
}

AddFunction GuardianDefaultCdActions
{
    #skull_bash
    InterruptActions()
    #blood_fury
    Spell(blood_fury_apsp)
    #berserking
    Spell(berserking)
    #arcane_torrent
    Spell(arcane_torrent_energy)
    #use_item,slot=trinket2
    UseItemActions()
    #barkskin
    Spell(barkskin)
    #berserk,if=buff.pulverize.remains>10
    if BuffRemaining(pulverize_buff) > 10 Spell(berserk_bear)

    unless Spell(cenarion_ward)
    {
        #renewal,if=health.pct<30
        if HealthPercent() < 30 Spell(renewal)
        #heart_of_the_wild
        Spell(heart_of_the_wild_tank)

        unless BuffPresent(heart_of_the_wild_tank_buff) and BuffRemaining(rejuvenation_buff) <= 0.3 * BaseDuration(rejuvenation_buff) and SpellKnown(enhanced_rejuvenation) and Spell(rejuvenation)
        {
            #natures_vigil
            Spell(natures_vigil)

            unless BuffPresent(dream_of_cenarius_tank_buff) and HealthPercent() < 30 and Spell(healing_touch)
                or BuffRemaining(pulverize_buff) < 0.5 and target.DebuffStacks(lacerate_debuff) >= 3 and Spell(pulverize)
                or Talent(pulverize_talent) and BuffRemaining(pulverize_buff) <= { 3 - target.DebuffStacks(lacerate_debuff) } * GCD() and BuffExpires(berserk_bear_buff) and Spell(lacerate)
            {
                #incarnation
                Spell(incarnation_tank)
            }
        }
    }
}

# ActionList: GuardianPrecombatActions --> main, shortcd, cd

AddFunction GuardianPrecombatActions
{
    #flask,type=greater_draenic_agility_flask
    #food,type=sleeper_surprise
    #mark_of_the_wild,if=!aura.str_agi_int.up
    if not BuffPresent(str_agi_int_buff any=1) Spell(mark_of_the_wild)
    #bear_form
    Spell(bear_form)
    #snapshot_stats
    #cenarion_ward
    Spell(cenarion_ward)
}

AddFunction GuardianPrecombatShortCdActions {}

AddFunction GuardianPrecombatCdActions {}

### Guardian icons.
AddCheckBox(opt_druid_guardian_aoe L(AOE) specialization=guardian default)

AddIcon specialization=guardian help=shortcd enemies=1 checkbox=!opt_druid_guardian_aoe
{
    if InCombat(no) GuardianPrecombatShortCdActions()
    GuardianDefaultShortCdActions()
}

AddIcon specialization=guardian help=shortcd checkbox=opt_druid_guardian_aoe
{
    if InCombat(no) GuardianPrecombatShortCdActions()
    GuardianDefaultShortCdActions()
}

AddIcon specialization=guardian help=main enemies=1
{
    if InCombat(no) GuardianPrecombatActions()
    GuardianDefaultActions()
}

AddIcon specialization=guardian help=aoe checkbox=opt_druid_guardian_aoe
{
    if InCombat(no) GuardianPrecombatActions()
    GuardianDefaultActions()
}

AddIcon specialization=guardian help=cd enemies=1 checkbox=!opt_druid_guardian_aoe
{
    if InCombat(no) GuardianPrecombatCdActions()
    GuardianDefaultCdActions()
}

AddIcon specialization=guardian help=cd checkbox=opt_druid_guardian_aoe
{
    if InCombat(no) GuardianPrecombatCdActions()
    GuardianDefaultCdActions()
}

###
### Restoration
###

AddFunction RestorationPrecombatActions
{
    # Raid buffs.
    if not BuffPresent(str_agi_int any=1) Spell(mark_of_the_wild)
    # Healing Touch to refresh Harmony buff.
    if BuffRemaining(harmony_buff) < 6 Spell(healing_touch)
}

AddFunction RestorationMainActions
{
    # Cast instant/mana-free Healing Touch or Regrowth.
    if BuffStacks(sage_mender_buff) == 5 Spell(healing_touch)
    if BuffPresent(omen_of_clarity_heal_buff) Spell(regrowth)
    if BuffPresent(natures_swiftness_buff) Spell(healing_touch)

    # Maintain 100% uptime on Harmony mastery buff using Swiftmend.
    # Swiftmend requires either a Rejuvenation or Regrowth HoT to be on the target before
    # it is usable, but we want to show Swiftmend as usable as long as the cooldown is up.
    if BuffRemaining(harmony_buff) < 6 and { BuffCountOnAny(rejuvenation_buff) > 0 or BuffCountOnAny(regrowth_buff) > 0 } and not SpellCooldown(swiftmend) > 0 Texture(inv_relics_idolofrejuvenation help=Swiftmend)

    # Keep one Lifebloom up on the raid.
    if BuffRemainingOnAny(lifebloom_buff) < 4 Spell(lifebloom)

    # Cast Cenarion Ward on cooldown, usually on the tank.
    if Talent(cenarion_ward_talent) Spell(cenarion_ward)
}

AddFunction RestorationAoeActions
{
    if BuffPresent(tree_of_life_buff)
    {
        Spell(wild_growth)
        if BuffPresent(omen_of_clarity_heal_buff) Spell(regrowth)
    }
    unless BuffPresent(tree_of_life_buff)
    {
        Spell(wild_growth)
        if BuffCountOnAny(rejuvenation_buff) > 4 Spell(genesis)
    }
}

AddFunction RestorationShortCdActions
{
    # Maintain Efflorescence.
    if TotemExpires(mushroom) Spell(wild_mushroom_heal)
    # Don't cap out on Force of Nature charges.
    if Talent(force_of_nature_talent) and Charges(force_of_nature_heal count=0) >= 3 Spell(force_of_nature_heal)
}

AddFunction RestorationCdActions
{
    InterruptActions()
    Spell(blood_fury_apsp)
    Spell(berserking)
    if ManaPercent() < 97 Spell(arcane_torrent_energy)
    Spell(incarnation_heal)
    Spell(heart_of_the_wild_heal)
    Spell(natures_vigil)
}

### Restoration icons.
AddCheckBox(opt_druid_restoration_aoe L(AOE) specialization=restoration default)

AddIcon specialization=restoration help=shortcd
{
    RestorationShortCdActions()
}

AddIcon specialization=restoration help=main
{
    if not InCombat() RestorationPrecombatActions()
    RestorationMainActions()
}

AddIcon specialization=restoration help=aoe checkbox=opt_druid_restoration_aoe
{
    RestorationAoeActions()
}

AddIcon specialization=restoration help=cd
{
    RestorationCdActions()
}
Added Cooldown and SR/Debuff side boxes.
Merged cooldown boxes and removed interrupt suggestion.
Predict and Multiple-target rotation as separate options, not mutually exclusive (note I don't really use the predict box so I've no idea if it works well, but it was easy enough to leave in).

sn0wman
Posts: 3
Joined: Tue Nov 25, 2014 5:29 am

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Post by sn0wman » Tue Dec 23, 2014 4:18 am

As a Feral/Boomkin, any updates on the balance script? saw the ticket on curse project site but haven't seen any updates around it.

ShmooDude
Exalted
Posts: 1080
Joined: Tue Feb 08, 2011 5:51 pm

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Post by ShmooDude » Wed Dec 24, 2014 4:28 pm

Unmerged cooldown boxes. It really doesn't work unless you're always using all your cooldowns. If you ever want to hold it (on trash before boss for example) it doesn't work.
Set 4th buff/bleed box to show either moonfire or predatory swiftness (wanted to set it to thrash for CoS but gotta figure out what Jeshu has it labeled as)
Spoiler: show

Code: Select all

# Ovale druid script based on SimulationCraft.

Include(ovale_common)
Include(ovale_druid_spells)

AddCheckBox(opt_potion_agility ItemName(draenic_agility_potion) default)

AddFunction UsePotionAgility
{
    if CheckBoxOn(opt_potion_agility) and target.Classification(worldboss) Item(draenic_agility_potion usable=1)
}

AddFunction GetInMeleeRange
{
    if Stance(druid_bear_form) and not target.InRange(mangle) or { Stance(druid_cat_form) or Stance(druid_claws_of_shirvallah) } and not target.InRange(shred)
    {
        if target.InRange(wild_charge) Spell(wild_charge)
        Texture(misc_arrowlup help=L(not_in_melee_range))
    }
}

AddFunction UseItemActions
{
    Item(HandSlot usable=1)
    Item(Trinket0Slot usable=1)
    Item(Trinket1Slot usable=1)
}

AddFunction InterruptActions
{
    if not target.IsFriend() and target.IsInterruptible()
    {
        if target.InRange(skull_bash) Spell(skull_bash)
        if not target.Classification(worldboss)
        {
            if target.InRange(mighty_bash) Spell(mighty_bash)
            Spell(typhoon)
            if target.InRange(maim) Spell(maim)
            Spell(war_stomp)
        }
    }
}

###
### Feral
###
# Based on SimulationCraft profile "Druid_Feral_T17M".
#    class=druid
#    spec=feral
#    talents=3002002
#    glyphs=savage_roar

# ActionList: FeralDefaultActions --> main, predict, shortcd, cd

AddFunction FeralDefaultActions
{
    #cat_form
    Spell(cat_form)
    #rake,if=buff.prowl.up|buff.shadowmeld.up
    if BuffPresent(prowl_buff) or BuffPresent(shadowmeld_buff) Spell(rake)
    #auto_attack
    #ferocious_bite,cycle_targets=1,if=dot.rip.ticking&dot.rip.remains<3&target.health.pct<25
    if target.DebuffPresent(rip_debuff) and target.DebuffRemaining(rip_debuff) < 3 and target.HealthPercent() < 25 Spell(ferocious_bite)
    #healing_touch,if=talent.bloodtalons.enabled&buff.predatory_swiftness.up&(combo_points>=4|buff.predatory_swiftness.remains<1.5)
    if Talent(bloodtalons_talent) and BuffPresent(predatory_swiftness_buff) and { ComboPoints() >= 4 or BuffRemaining(predatory_swiftness_buff) < 1.5 } Spell(healing_touch)
    #savage_roar,if=buff.savage_roar.remains<3
    if BuffRemaining(savage_roar_buff) < 3 Spell(savage_roar)
    #pool_resource,for_next=1
    #thrash_cat,cycle_targets=1,if=remains<4.5&(active_enemies>1|(combo_points=5&!talent.bloodtalons.enabled&buff.omen_of_clarity.react))
    if target.DebuffRemaining(thrash_cat_debuff) < 4.5 and { Enemies() > 1 or ComboPoints() == 5 and not Talent(bloodtalons_talent) and BuffPresent(omen_of_clarity_melee_buff) } Spell(thrash_cat)
    unless target.DebuffRemaining(thrash_cat_debuff) < 4.5 and { Enemies() > 1 or ComboPoints() == 5 and not Talent(bloodtalons_talent) and BuffPresent(omen_of_clarity_melee_buff) } and SpellUsable(thrash_cat) and SpellCooldown(thrash_cat) < TimeToEnergyFor(thrash_cat)
    {
        #call_action_list,name=finisher,if=combo_points=5
        if ComboPoints() == 5 FeralFinisherActions()
        #thrash_cat,cycle_targets=1,if=talent.bloodtalons.enabled&combo_points=5&remains<4.5&buff.omen_of_clarity.react
        if Talent(bloodtalons_talent) and ComboPoints() == 5 and target.DebuffRemaining(thrash_cat_debuff) < 4.5 and BuffPresent(omen_of_clarity_melee_buff) Spell(thrash_cat)
        #rake,cycle_targets=1,if=combo_points<5&remains<3&target.time_to_die-remains>15&buff.king_of_the_jungle.up&active_enemies<16
        if ComboPoints() < 5 and target.DebuffRemaining(rake_debuff) < 3 and target.TimeToDie() - target.DebuffRemaining(rake_debuff) > 15 and BuffPresent(king_of_the_jungle_buff) and Enemies() < 16 Spell(rake)
        #call_action_list,name=maintain,if=combo_points<5&active_enemies<8
        if ComboPoints() < 5 and Enemies() < 8 FeralMaintainActions()
        #call_action_list,name=generator,if=combo_points<5&(energy.time_to_max<=1|buff.berserk.up|cooldown.tigers_fury.remains<3|buff.tigers_fury.up|buff.king_of_the_jungle.up|dot.rip.remains<8-combo_points|trinket.proc.all.react|buff.omen_of_clarity.react|(talent.bloodtalons.enabled&buff.predatory_swiftness.up&buff.predatory_swiftness.remains<6.5-combo_points))
        if ComboPoints() < 5 and { TimeToMaxEnergy() <= 1 or BuffPresent(berserk_cat_buff) or SpellCooldown(tigers_fury) < 3 or BuffPresent(tigers_fury_buff) or BuffPresent(king_of_the_jungle_buff) or target.DebuffRemaining(rip_debuff) < 8 - ComboPoints() or BuffPresent(trinket_proc_any_buff) or BuffPresent(omen_of_clarity_melee_buff) or Talent(bloodtalons_talent) and BuffPresent(predatory_swiftness_buff) and BuffRemaining(predatory_swiftness_buff) < 6.5 - ComboPoints() } FeralGeneratorActions()
    }
    if BuffRemains(rejuvenation) < 3.6 and SpellCooldown(tigers_fury) > 1 Spell(rejuvenation)
}

AddFunction FeralDefaultPredictActions
{
    #cat_form
    Spell(cat_form)
    #rake,if=buff.prowl.up|buff.shadowmeld.up
    if BuffPresent(prowl_buff) or BuffPresent(shadowmeld_buff) Spell(rake)
    #auto_attack
    #ferocious_bite,cycle_targets=1,if=dot.rip.ticking&dot.rip.remains<3&target.health.pct<25
    if target.DebuffPresent(rip_debuff) and target.DebuffRemaining(rip_debuff) < 3 and target.HealthPercent() < 25 Spell(ferocious_bite)
    #healing_touch,if=talent.bloodtalons.enabled&buff.predatory_swiftness.up&(combo_points>=4|buff.predatory_swiftness.remains<1.5)
    if Talent(bloodtalons_talent) and BuffPresent(predatory_swiftness_buff) and { ComboPoints() >= 4 or BuffRemaining(predatory_swiftness_buff) < 1.5 } Spell(healing_touch)
    #savage_roar,if=buff.savage_roar.remains<3
    if BuffRemaining(savage_roar_buff) < 3 Spell(savage_roar)
    #pool_resource,for_next=1
    #thrash_cat,cycle_targets=1,if=remains<4.5&(active_enemies>1|(combo_points=5&!talent.bloodtalons.enabled&buff.omen_of_clarity.react))
    if target.DebuffRemaining(thrash_cat_debuff) < 4.5 and { Enemies() > 1 or ComboPoints() == 5 and not Talent(bloodtalons_talent) and BuffPresent(omen_of_clarity_melee_buff) } Spell(thrash_cat)
    unless target.DebuffRemaining(thrash_cat_debuff) < 4.5 and { Enemies() > 1 or ComboPoints() == 5 and not Talent(bloodtalons_talent) and BuffPresent(omen_of_clarity_melee_buff) } and SpellUsable(thrash_cat) and SpellCooldown(thrash_cat) < TimeToEnergyFor(thrash_cat)
    {
        #call_action_list,name=finisher,if=combo_points=5
        if ComboPoints() == 5 FeralFinisherActions()
        #thrash_cat,cycle_targets=1,if=talent.bloodtalons.enabled&combo_points=5&remains<4.5&buff.omen_of_clarity.react
        if Talent(bloodtalons_talent) and ComboPoints() == 5 and target.DebuffRemaining(thrash_cat_debuff) < 4.5 and BuffPresent(omen_of_clarity_melee_buff) Spell(thrash_cat)
        #rake,cycle_targets=1,if=combo_points<5&remains<3&target.time_to_die-remains>15&buff.king_of_the_jungle.up&active_enemies<16
        if ComboPoints() < 5 and target.DebuffRemaining(rake_debuff) < 3 and target.TimeToDie() - target.DebuffRemaining(rake_debuff) > 15 and BuffPresent(king_of_the_jungle_buff) and Enemies() < 16 Spell(rake)
        #call_action_list,name=maintain,if=combo_points<5&active_enemies<8
        if ComboPoints() < 5 and Enemies() < 8 FeralMaintainActions()
    }
}

AddFunction FeralDefaultMovementActions
{
    # CHANGE: Get within melee range of the target.
    GetInMeleeRange()
    if target.InRange(wild_charge) Spell(wild_charge)
    #displacer_beast,if=movement.distance>10
    if 0 > 10 Spell(displacer_beast)
    #dash,if=movement.distance&buff.displacer_beast.down&buff.wild_charge_movement.down
    if 0 and BuffExpires(displacer_beast_buff) and True(wild_charge_movement_down) Spell(dash)

}

AddFunction FeralDefaultShortCdActions
{
    unless Spell(cat_form)
    {
		FeralDefaultMovementActions()
        unless { BuffPresent(prowl_buff) or BuffPresent(shadowmeld_buff) } and Spell(rake)
        {
            #force_of_nature,if=charges=3rinket.proc.all.reactarget.time_to_die<20
            if Charges(force_of_nature_melee) == 3 or BuffPresent(trinket_proc_any_buff) or target.TimeToDie() < 20 Spell(force_of_nature_melee)
            #tigers_fury,if=(!buff.omen_of_clarity.react&energy.max-energy>=60)|energy.max-energy>=80
            if not BuffPresent(omen_of_clarity_melee_buff) and MaxEnergy() - Energy() >= 60 or MaxEnergy() - Energy() >= 80 Spell(tigers_fury)
        }
    }
}

# CHANGE: Helper function for Tiger's Fury sync condition.
AddFunction FeralTigersFurySyncCondition
{
    #tigers_fury,if=(!buff.omen_of_clarity.react&energy.max-energy>=60)|energy.max-energy>=80
    BuffPresent(tigers_fury_buff) or { not BuffPresent(omen_of_clarity_melee_buff) and MaxEnergy() - Energy() >= 60 or MaxEnergy() - Energy() >= 80 } and not SpellCooldown(tigers_fury) > 0
}

AddFunction FeralDefaultCdActions
{
    #FeralDefaultMovementActions()
    unless Spell(cat_form)
        or { BuffPresent(prowl_buff) or BuffPresent(shadowmeld_buff) } and Spell(rake)
    {
        InterruptActions()
        #potion,name=draenic_agility,if=target.time_to_die<=40
        if target.TimeToDie() <= 40 UsePotionAgility()
		#incarnation,if=cooldown.berserk.remains<10&cooldown.tigers_fury.remains<10&energy.time_to_max>1
        if SpellCooldown(berserk_cat) < 10 and SpellCooldown(tigers_fury) < 10 and TimeToMaxEnergy() > 1 Spell(incarnation_melee)
		unless SpellCooldown(incarnation_melee) <= 0
		{
		    #berserk,if=buff.tigers_fury.up
            #if BuffPresent(tigers_fury_buff) Spell(berserk_cat)
            if FeralTigersFurySyncCondition() Spell(berserk_cat)
            # CHANGE: Synchronize abilities that are used with Tiger's Fury using Tiger Fury's conditions.
            #tigers_fury,if=(!buff.omen_of_clarity.react&energy.max-energy>=60)|energy.max-energy>=80
            #use_item,slot=trinket1,sync=tigers_fury
            #if not SpellCooldown(tigers_fury) > 0 UseItemActions()
            if FeralTigersFurySyncCondition() UseItemActions()
            #blood_fury,sync=tigers_fury
            #if not SpellCooldown(tigers_fury) > 0 Spell(blood_fury_apsp)
            if FeralTigersFurySyncCondition() Spell(blood_fury_apsp)
            #berserking,sync=tigers_fury
            if not SpellCooldown(tigers_fury) > 0 Spell(berserking)
            if FeralTigersFurySyncCondition() Spell(berserking)
            #arcane_torrent,sync=tigers_fury
            #if not SpellCooldown(tigers_fury) > 0 Spell(arcane_torrent_energy)
            if FeralTigersFurySyncCondition() Spell(arcane_torrent_energy)
            #potion,name=draenic_agility,sync=berserk,if=target.health.pct<25
            #if target.HealthPercent() < 25 and not SpellCooldown(berserk_cat) > 0 UsePotionAgility()
            if target.HealthPercent() < 25 and { BuffPresent(berserk_cat_buff) or FeralTigersFurySyncCondition() and SpellCooldown(berserk_cat) > 0 } UsePotionAgility()
            #shadowmeld,if=dot.rake.remains<4.5&energy>=35&dot.rake.pmultiplier<2&(buff.bloodtalons.up|!talent.bloodtalons.enabled)&(!talent.incarnation.enabled|cooldown.incarnation.remains>15)&!buff.king_of_the_jungle.up
            if target.DebuffRemaining(rake_debuff) < 4.5 and Energy() >= 35 and target.DebuffPersistentMultiplier(rake_debuff) < 2 and { BuffPresent(bloodtalons_buff) or not Talent(bloodtalons_talent) } and { not Talent(incarnation_talent) or SpellCooldown(incarnation_melee) > 15 } and not BuffPresent(king_of_the_jungle_buff) Spell(shadowmeld)
			#FeralDefaultShortCdActions()
		}
    }
}

# ActionList: FeralFinisherActions --> main, predict

AddFunction FeralFinisherActions
{
    FeralFinisherPredictActions()
}

AddFunction FeralFinisherPredictActions
{
    #ferocious_bite,cycle_targets=1,max_energy=1,if=target.health.pct<25&dot.rip.ticking
    if Energy() >= EnergyCost(ferocious_bite max=1) and target.HealthPercent() < 25 and target.DebuffPresent(rip_debuff) Spell(ferocious_bite)
    #rip,cycle_targets=1,if=remains<3&target.time_to_die-remains>18
    if target.DebuffRemaining(rip_debuff) < 3 and target.TimeToDie() - target.DebuffRemaining(rip_debuff) > 18 Spell(rip)
    #rip,cycle_targets=1,if=remains<7.2&target.time_to_die-remains>18&(energy.time_to_max<=1|buff.berserk.up|(buff.tigers_fury.remains<=1&buff.tigers_fury.up)|dot.rake.remains<1)&(!talent.bloodtalons.enabled|(talent.bloodtalons.enabled&persistent_multiplier>=dot.rip.pmultiplier&(!buff.predatory_swiftness.up|buff.bloodtalons.up)))
    if target.DebuffRemaining(rip_debuff) < 7.2 and target.TimeToDie() - target.DebuffRemaining(rip_debuff) > 18 and { TimeToMaxEnergy() <= 1 or BuffPresent(berserk_cat_buff) or BuffRemaining(tigers_fury_buff) <= 1 and BuffPresent(tigers_fury_buff) or target.DebuffRemaining(rake_debuff) < 1 } and { not Talent(bloodtalons_talent) or Talent(bloodtalons_talent) and PersistentMultiplier(rip_debuff) >= target.DebuffPersistentMultiplier(rip_debuff) and { not BuffPresent(predatory_swiftness_buff) or BuffPresent(bloodtalons_buff) } } Spell(rip)
    #savage_roar,if=(energy.time_to_max<=1|buff.berserk.up|cooldown.tigers_fury.remains<3|dot.rake.remains<1)&buff.savage_roar.remains<12.6
    if { TimeToMaxEnergy() <= 1 or BuffPresent(berserk_cat_buff) or SpellCooldown(tigers_fury) < 3 or target.DebuffRemaining(rake_debuff) < 1 } and BuffRemaining(savage_roar_buff any=1) < 12.6 Spell(savage_roar)
    #ferocious_bite,max_energy=1,if=(energy.time_to_max<=1|buff.berserk.up|cooldown.tigers_fury.remains<3|dot.rake.remains<1)
    if Energy() >= EnergyCost(ferocious_bite max=1) and { TimeToMaxEnergy() <= 1 or BuffPresent(berserk_cat_buff) or SpellCooldown(tigers_fury) < 3 or target.DebuffRemaining(rake_debuff) < 1 } Spell(ferocious_bite)
}

# ActionList: FeralGeneratorActions --> main

AddFunction FeralGeneratorActions
{
    #swipe,if=active_enemies>=3
    if Enemies() >= 3 Spell(swipe)
    #shred,if=active_enemies<3
    if Enemies() < 3 Spell(shred)
}

# ActionList: FeralMaintainActions --> main, predict

AddFunction FeralMaintainActions
{
    FeralMaintainPredictActions()
}

AddFunction FeralMaintainPredictActions
{
    #rake,cycle_targets=1,if=remains<3&target.time_to_die-remains>15
    if target.DebuffRemaining(rake_debuff) < 3 and target.TimeToDie() - target.DebuffRemaining(rake_debuff) > 15 Spell(rake)
    #rake,cycle_targets=1,if=remains<4.5&target.time_to_die-remains>15&((!talent.bloodtalons.enabled&buff.tigers_fury.up)|(talent.bloodtalons.enabled&(!buff.predatory_swiftness.up|buff.bloodtalons.up)))
    if target.DebuffRemaining(rake_debuff) < 4.5 and target.TimeToDie() - target.DebuffRemaining(rake_debuff) > 15 and { not Talent(bloodtalons_talent) and BuffPresent(tigers_fury_buff) or Talent(bloodtalons_talent) and { not BuffPresent(predatory_swiftness_buff) or BuffPresent(bloodtalons_buff) } } Spell(rake)
    #moonfire_cat,cycle_targets=1,if=remains<4.2&active_enemies<6&target.time_to_die-remains>14
    if target.DebuffRemaining(moonfire_cat_debuff) < 4.2 and Enemies() < 6 and target.TimeToDie() - target.DebuffRemaining(moonfire_cat_debuff) > 14 Spell(moonfire_cat)
    #rake,if=persistent_multiplier>dot.rake.pmultiplier&active_enemies=1&target.time_to_die-remains>15
    if PersistentMultiplier(rake_debuff) > target.DebuffPersistentMultiplier(rake_debuff) and Enemies() == 1 and target.TimeToDie() - target.DebuffRemaining(rake_debuff) > 15 Spell(rake)
    #rake,if=buff.king_of_the_jungle.up&buff.king_of_the_jungle.remains<=3&dot.rake.remains<15&target.time_to_die-remains>15
    if BuffPresent(king_of_the_jungle_buff) and BuffRemaining(king_of_the_jungle_buff) <= 3 and target.DebuffRemaining(rake_debuff) < 15 and target.TimeToDie() - target.DebuffRemaining(rake_debuff) > 15 Spell(rake)
}

# ActionList: FeralPrecombatActions --> main, predict, shortcd, main

AddFunction FeralPrecombatActions
{
    #flask,type=greater_draenic_agility_flask
    #food,type=blackrock_barbecue
    #mark_of_the_wild,if=!aura.str_agi_int.up
    if not BuffPresent(str_agi_int_buff any=1) Spell(mark_of_the_wild)
    # CHANGE: Cast Healing Touch to gain Bloodtalons buff if less than 20s remaining on the buff.
    #healing_touch,if=talent.bloodtalons.enabled
    #if Talent(bloodtalons_talent) Spell(healing_touch)
    if Talent(bloodtalons_talent) and BuffRemaining(bloodtalons_buff) < 20 Spell(healing_touch)
    #cat_form
    Spell(cat_form)
    #prowl
    if BuffExpires(stealthed_buff any=1) Spell(prowl)
    #snapshot_stats
}

AddFunction FeralPrecombatPredictActions {}

AddFunction FeralPrecombatShortCdActions {}

AddFunction FeralPrecombatCdActions
{
    unless not BuffPresent(str_agi_int_buff any=1) and Spell(mark_of_the_wild)
        or Spell(cat_form)
        or BuffExpires(stealthed_buff any=1) and Spell(prowl)
    {
        #potion,name=draenic_agility
        UsePotionAgility()
    }
}

### Feral Icons
AddCheckBox(opt_druid_feral_aoe L(AOE) specialization=feral default)
AddCheckBox(opt_druid_feral_predict L(Predict) specialization=feral default)
AddCheckBox(opt_druid_feral_cooldowns L("Left: Small Cooldown Boxes") specialization=feral default)
AddCheckBox(opt_druid_feral_buff_debuff L("Right: Small SR/Bleed Boxes") specialization=feral default)

AddIcon specialization=feral checkbox=opt_druid_feral_cooldowns size=small
{
    Spell(survival_instincts)
    #if SpellCooldown(survival_instincts) Texture(ability_druid_tigersroar)
}

AddIcon specialization=feral checkbox=opt_druid_feral_cooldowns size=small
{
    Spell(incarnation_melee)
    #if BuffExpires(king_of_the_jungle_buff) Texture(spell_druid_incarnation)
}

AddIcon specialization=feral checkbox=opt_druid_feral_cooldowns size=small
{
    Spell(tigers_fury)
    #if BuffExpires(tigers_fury_buff) Texture(ability_mount_jungletiger)
}

AddIcon specialization=feral checkbox=opt_druid_feral_cooldowns size=small
{
    Spell(berserk_cat)
    #if BuffExpires(beresrk_cat_buff) Texture(ability_druid_berserk)
}

AddIcon specialization=feral help=shortcd
{
    if InCombat(no) FeralPrecombatShortCdActions()
    FeralDefaultShortCdActions()
}

AddIcon specialization=feral help=main enemies=1
{
    if InCombat(no) FeralPrecombatActions()
    FeralDefaultActions()
}

AddIcon specialization=feral help=predict enemies=1 checkbox=opt_druid_feral_predict
{
    if InCombat(no) FeralPrecombatPredictActions()
    FeralDefaultPredictActions()
}

AddIcon specialization=feral help=aoe checkbox=opt_druid_feral_aoe
{
    if InCombat(no) FeralPrecombatActions()
    FeralDefaultActions()
}

AddIcon specialization=feral help=cd
{
    if InCombat(no) FeralPrecombatCdActions()
    FeralDefaultCdActions()
}

AddIcon specialization=feral help="Savage Roar" checkbox=opt_druid_feral_buff_debuff size=small
{
    if BuffExpires(savage_roar_buff) Texture(ability_druid_skinteeth)
}

AddIcon specialization=feral help="Rake" checkbox=opt_druid_feral_buff_debuff size=small
{
    if TargetDebuffExpires(rake_debuff) Texture(ability_druid_disembowel)
}

AddIcon specialization=feral help="Rip" checkbox=opt_druid_feral_buff_debuff size=small
{
    if TargetDebuffExpires(rip_debuff) Texture(ability_ghoulfrenzy)
}

AddIcon specialization=feral help="Moonfire" checkbox=opt_druid_feral_buff_debuff size=small
{
    if Talent(lunar_inspiration_talent) and TargetBuffExpires(moonfire_cat_debuff) Texture(spell_nature_starfall)
	if Talent(bloodtalons_talent) and BuffExpires(predatory_swiftness_buff) Texture(ability_hunter_pet_cat)
	#if TargetBuffExpires(thrash_cat_debuff) Texture(spell_druid_thrash)
}



###
### Guardian
###
# Based on SimulationCraft profile "Druid_Guardian_T17M".
#    class=druid
#    spec=guardian
#    talents=0301022

# ActionList: GuardianDefaultActions --> main, shortcd, cd

AddFunction GuardianDefaultActions
{
    #auto_attack
    #cenarion_ward
    Spell(cenarion_ward)
    #rejuvenation,if=buff.heart_of_the_wild.up&remains<=0.3*duration
    if BuffPresent(heart_of_the_wild_tank_buff) and BuffRemaining(rejuvenation_buff) <= 0.3 * BaseDuration(rejuvenation_buff) and SpellKnown(enhanced_rejuvenation) Spell(rejuvenation)
    #healing_touch,if=buff.dream_of_cenarius.react&health.pct<30
    if BuffPresent(dream_of_cenarius_tank_buff) and HealthPercent() < 30 Spell(healing_touch)
    #pulverize,if=buff.pulverize.remains<0.5
    if BuffRemaining(pulverize_buff) < 0.5 and target.DebuffStacks(lacerate_debuff) >= 3 Spell(pulverize)
    #lacerate,if=talent.pulverize.enabled&buff.pulverize.remains<=(3-dot.lacerate.stack)*gcd&buff.berserk.down
    if Talent(pulverize_talent) and BuffRemaining(pulverize_buff) <= { 3 - target.DebuffStacks(lacerate_debuff) } * GCD() and BuffExpires(berserk_bear_buff) Spell(lacerate)
    #lacerate,if=!ticking
    if not target.DebuffPresent(lacerate_debuff) Spell(lacerate)
    #thrash_bear,if=!ticking
    if not target.DebuffPresent(thrash_bear_debuff) Spell(thrash_bear)
    #mangle
    Spell(mangle)
    #thrash_bear,if=remains<=0.3*duration
    if target.DebuffRemaining(thrash_bear_debuff) <= 0.3 * BaseDuration(thrash_bear_debuff) Spell(thrash_bear)
    #lacerate
    Spell(lacerate)
}

AddFunction GuardianDefaultShortCdActions
{
    #savage_defense
    Spell(savage_defense)
    #maul,if=buff.tooth_and_claw.react&incoming_damage_1s
    if BuffPresent(tooth_and_claw_buff) and IncomingDamage(1) > 0 Spell(maul)
    #frenzied_regeneration,if=rage>=80
    if Rage() >= 80 Spell(frenzied_regeneration)
}

AddFunction GuardianDefaultCdActions
{
    #skull_bash
    InterruptActions()
    #blood_fury
    Spell(blood_fury_apsp)
    #berserking
    Spell(berserking)
    #arcane_torrent
    Spell(arcane_torrent_energy)
    #use_item,slot=trinket2
    UseItemActions()
    #barkskin
    Spell(barkskin)
    #berserk,if=buff.pulverize.remains>10
    if BuffRemaining(pulverize_buff) > 10 Spell(berserk_bear)

    unless Spell(cenarion_ward)
    {
        #renewal,if=health.pct<30
        if HealthPercent() < 30 Spell(renewal)
        #heart_of_the_wild
        Spell(heart_of_the_wild_tank)

        unless BuffPresent(heart_of_the_wild_tank_buff) and BuffRemaining(rejuvenation_buff) <= 0.3 * BaseDuration(rejuvenation_buff) and SpellKnown(enhanced_rejuvenation) and Spell(rejuvenation)
        {
            #natures_vigil
            Spell(natures_vigil)

            unless BuffPresent(dream_of_cenarius_tank_buff) and HealthPercent() < 30 and Spell(healing_touch)
                or BuffRemaining(pulverize_buff) < 0.5 and target.DebuffStacks(lacerate_debuff) >= 3 and Spell(pulverize)
                or Talent(pulverize_talent) and BuffRemaining(pulverize_buff) <= { 3 - target.DebuffStacks(lacerate_debuff) } * GCD() and BuffExpires(berserk_bear_buff) and Spell(lacerate)
            {
                #incarnation
                Spell(incarnation_tank)
            }
        }
    }
}

# ActionList: GuardianPrecombatActions --> main, shortcd, cd

AddFunction GuardianPrecombatActions
{
    #flask,type=greater_draenic_agility_flask
    #food,type=sleeper_surprise
    #mark_of_the_wild,if=!aura.str_agi_int.up
    if not BuffPresent(str_agi_int_buff any=1) Spell(mark_of_the_wild)
    #bear_form
    Spell(bear_form)
    #snapshot_stats
    #cenarion_ward
    Spell(cenarion_ward)
}

AddFunction GuardianPrecombatShortCdActions {}

AddFunction GuardianPrecombatCdActions {}

### Guardian icons.
AddCheckBox(opt_druid_guardian_aoe L(AOE) specialization=guardian default)

AddIcon specialization=guardian help=shortcd enemies=1 checkbox=!opt_druid_guardian_aoe
{
    if InCombat(no) GuardianPrecombatShortCdActions()
    GuardianDefaultShortCdActions()
}

AddIcon specialization=guardian help=shortcd checkbox=opt_druid_guardian_aoe
{
    if InCombat(no) GuardianPrecombatShortCdActions()
    GuardianDefaultShortCdActions()
}

AddIcon specialization=guardian help=main enemies=1
{
    if InCombat(no) GuardianPrecombatActions()
    GuardianDefaultActions()
}

AddIcon specialization=guardian help=aoe checkbox=opt_druid_guardian_aoe
{
    if InCombat(no) GuardianPrecombatActions()
    GuardianDefaultActions()
}

AddIcon specialization=guardian help=cd enemies=1 checkbox=!opt_druid_guardian_aoe
{
    if InCombat(no) GuardianPrecombatCdActions()
    GuardianDefaultCdActions()
}

AddIcon specialization=guardian help=cd checkbox=opt_druid_guardian_aoe
{
    if InCombat(no) GuardianPrecombatCdActions()
    GuardianDefaultCdActions()
}

###
### Restoration
###

AddFunction RestorationPrecombatActions
{
    # Raid buffs.
    if not BuffPresent(str_agi_int any=1) Spell(mark_of_the_wild)
    # Healing Touch to refresh Harmony buff.
    if BuffRemaining(harmony_buff) < 6 Spell(healing_touch)
}

AddFunction RestorationMainActions
{
    # Cast instant/mana-free Healing Touch or Regrowth.
    if BuffStacks(sage_mender_buff) == 5 Spell(healing_touch)
    if BuffPresent(omen_of_clarity_heal_buff) Spell(regrowth)
    if BuffPresent(natures_swiftness_buff) Spell(healing_touch)

    # Maintain 100% uptime on Harmony mastery buff using Swiftmend.
    # Swiftmend requires either a Rejuvenation or Regrowth HoT to be on the target before
    # it is usable, but we want to show Swiftmend as usable as long as the cooldown is up.
    if BuffRemaining(harmony_buff) < 6 and { BuffCountOnAny(rejuvenation_buff) > 0 or BuffCountOnAny(regrowth_buff) > 0 } and not SpellCooldown(swiftmend) > 0 Texture(inv_relics_idolofrejuvenation help=Swiftmend)

    # Keep one Lifebloom up on the raid.
    if BuffRemainingOnAny(lifebloom_buff) < 4 Spell(lifebloom)

    # Cast Cenarion Ward on cooldown, usually on the tank.
    if Talent(cenarion_ward_talent) Spell(cenarion_ward)
}

AddFunction RestorationAoeActions
{
    if BuffPresent(tree_of_life_buff)
    {
        Spell(wild_growth)
        if BuffPresent(omen_of_clarity_heal_buff) Spell(regrowth)
    }
    unless BuffPresent(tree_of_life_buff)
    {
        Spell(wild_growth)
        if BuffCountOnAny(rejuvenation_buff) > 4 Spell(genesis)
    }
}

AddFunction RestorationShortCdActions
{
    # Maintain Efflorescence.
    if TotemExpires(mushroom) Spell(wild_mushroom_heal)
    # Don't cap out on Force of Nature charges.
    if Talent(force_of_nature_talent) and Charges(force_of_nature_heal count=0) >= 3 Spell(force_of_nature_heal)
}

AddFunction RestorationCdActions
{
    InterruptActions()
    Spell(blood_fury_apsp)
    Spell(berserking)
    if ManaPercent() < 97 Spell(arcane_torrent_energy)
    Spell(incarnation_heal)
    Spell(heart_of_the_wild_heal)
    Spell(natures_vigil)
}

### Restoration icons.
AddCheckBox(opt_druid_restoration_aoe L(AOE) specialization=restoration default)

AddIcon specialization=restoration help=shortcd
{
    RestorationShortCdActions()
}

AddIcon specialization=restoration help=main
{
    if not InCombat() RestorationPrecombatActions()
    RestorationMainActions()
}

AddIcon specialization=restoration help=aoe checkbox=opt_druid_restoration_aoe
{
    RestorationAoeActions()
}

AddIcon specialization=restoration help=cd
{
    RestorationCdActions()
}

Jeshu
Revered
Posts: 244
Joined: Tue Dec 14, 2010 5:34 pm

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Post by Jeshu » Sat Dec 27, 2014 6:37 pm

Leafkiller wrote:@Jeshu

How would you feel about putting the icon code into a separate file from the rotation functions? Also, would you consider making it easy to override a couple of the values without having to replicate the code? (basically make it easy to add a second to the SR and HT cleanup times) Then the Leafkiller script would be much simpler to write and maintain since it could share most of the rotation code and automatically receive any rotation improvements when you resync with simc. The focus then would be on the icon layout and what goes into each icon so the UI could be easily tailored to different tastes.
I will probably do that in the next release. There's a desire for an icon layout feature that I don't have time to implement so at least separating the functions from the icons will be more MVCish.

Ideally, I could borrow a 3rd party layout engine and just feed it input. I wonder if it's possible to do that with WeakAuras 2, and just give it a texture and a cooldown and let WA2 draw it on the screen? If anyone knows one way or the other, please let me know.

Jeshu
Revered
Posts: 244
Joined: Tue Dec 14, 2010 5:34 pm

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Post by Jeshu » Sat Dec 27, 2014 6:38 pm

sn0wman wrote:As a Feral/Boomkin, any updates on the balance script? saw the ticket on curse project site but haven't seen any updates around it.
That's the next big project after my current one for Ovale is complete, so hopefully RealSoonNow(TM).

Locked