Register

Leafkiller's MoP Feral/Guardian Ovale Script

Face-rippin fun.

Moderator: Forum Administrators

Revered
Posts: 378
Joined: Tue Feb 08, 2011 5:51 pm

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Postby ShmooDude » Sat Jul 13, 2013 12:57 pm

Kihrawr wrote:I started experimenting with Shmoodude's version of the script. One question I had about its behavior is with Thrash. One of the things that seems to be happening is that I get a Rune proc, and I would have just enough time to get a Rip up, but the script suggests that I Thrash instead of building combo points. This is presumably because Clearcasting is up, so it doesn't waste Energy, but it does cost a GCD. I then don't have time to get the Rip off before the Rune proc fades.

Basically I'm wondering if the script is taking into account the time remaining on the Rune proc before suggesting Thrash, since it pushes back your ability to get Rip up. I'm also assuming getting a Rip up would be more of a DPS gain than Thrashing for single target, but maybe I'm wrong about that.


Its because Clearcasting Thrash is fairly high up in the list and doesn't have a test for that particular instance. And given that those exact conditions occur in ~14% of simcraft's 7.5 minute fights, I don't think it'd even be possible to tell whether that'd be a dps upgrade or not (the two 50k interations I did and it ended up a 60 DPS downgrade, well within the margin of error). Besides, a rune buffed thrash isn't exactly a bad thing.

Honestly I've actually been thinking seeing if adding more thrashes to rune procs would work out well (ie if you're likely not gonna make a rip, make sure to get a thrash in there rather than always raking like it does now with the exception of clearcast or another buff expiring)

Kihrawr wrote:Another question I had. Why do all of these scripts suggest Healing Touch after Tiger's Fury instead of before? I would have thought that Healing Touch first would be better so you don't waste the GCD while Tiger's Fury is up?


PS Healing Touch is cast at 4 or more combo points OR if PS is about to expire
NS Healing touch is cast at 5 combo points if you don't already have DoC up and a useful Rip/FB will be used next.

Chances are you're reaching these thresholds after using Tiger's Fury. If you use it before at anything less than 4 combo points, you don't guarantee it'll be there for your next Rip (though with our 4 piece its fairly close). Honestly GCDs aren't that big of a worry during TF (except maybe during berserk, but pretty sure even then its still a DPS up).

EDIT: @aggixx Btw, I'd wait till my next version before trying to integrate any of my functionality. I updated a lot of the functions to use variables (basically just an addfunction that returns a number) so that they can all be updated from a single area. For example the Rake base damage and attack power modifiers were in correct before and I'd have those numbers in several areas. Now they're just all in one place for ease of use. Will also make it easier to add new types of trinkets if that's something you're wanting to do.

I'd post it now but 5.3.5 has a few more bugs that need to be ironed out (target based bleed snapshotting and damage modifier buffs (savage roar, etc.). I fixed my local copy of the savage modifier buffs bug but I'm waiting on the other fix from Jeshu so that I can update it for that before I post a new one.

Honored
Posts: 51
Joined: Wed May 25, 2011 3:12 pm

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Postby Kihrawr » Sat Jul 13, 2013 1:40 pm

ShmooDude wrote:Its because Clearcasting Thrash is fairly high up in the list and doesn't have a test for that particular instance. And given that those exact conditions occur in ~14% of simcraft's 7.5 minute fights, I don't think it'd even be possible to tell whether that'd be a dps upgrade or not (the two 50k interations I did and it ended up a 60 DPS downgrade, well within the margin of error). Besides, a rune buffed thrash isn't exactly a bad thing.


Yeah, I honestly wasn't sure how they compared. Hence the questions. :)

Will the script suggest a non-Clearcasting Thrash with a Rune proc up? I would think that would be a DPS loss if it prevents you from getting a Rip up. Another thing I've noticed is that the script will ask you to Faerie Fire during a Rune proc as well. I would think that deferring Faerie Fire until you get your bleeds up would be better.

I've also seen the script want to pool energy during a Rune proc, so Mangle is showing up but the script wants me to wait before hitting it. This can lead to some frantic last minute spamming when it finally lights up as I try to get the Rip up. Again, maybe I'm doing it wrong, but my instinct when Rune procs is to pound CP-generators frantically to try to get the combo points built to get the Rip up. Waiting to hit an ability that generates CP if I have that energy available seems counter-intuitive to me, especially when playing DoC spec, since I need time to hit Healing Touch before the Rip also if possible.

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

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Postby Jeshu » Sat Jul 13, 2013 5:11 pm

ShmooDude wrote:I'd post it now but 5.3.5 has a few more bugs that need to be ironed out (target based bleed snapshotting and damage modifier buffs (savage roar, etc.). I fixed my local copy of the savage modifier buffs bug but I'm waiting on the other fix from Jeshu so that I can update it for that before I post a new one.


Please try Ovale 5.3.6. It should be fixed regarding aura snapshots and macro'ed abilities.

I will probably also try to add another script condition that returns the "normalized AP-modified weapon damage" which I believe is the "weapon damage" cited in most damage formulas. Currently the WeaponDamage() script condition returns the average of the min and max damage of the equipped mainhand (with some munging for cat and bear druids), but in the general case, you would also need the type of weapon to figure out the correct normalized attack speed to use in the calculation. It's not needed for ferals, but will be needed for other classes that have attacks based on weapon damage.

Revered
Posts: 378
Joined: Tue Feb 08, 2011 5:51 pm

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Postby ShmooDude » Sat Jul 13, 2013 9:57 pm

Jeshu wrote:Please try Ovale 5.3.6. It should be fixed regarding aura snapshots and macro'ed abilities.


Aura snapshots are fixed only for target.debuff and not lastspell (or last, which are the same thing afaik). Since those are essentially legacy functions at this point I'm not sure it matters but figured I'd let you know.

The snapshotting doesn't seem to be 100% in regards to catching (near) instantaneous buff changes. Right now a TF macro can have both results (ie it might think it has the buff up, but then again it might not). The same is true if you reverse the order of the abilities (if i cast rake before TF, it also can produce both results). If I had to guess, its because the server can return the info in either order (which the combat log is notorious for doing).

It also doesn't solve the problem of incorrect suggestions for expiring buffs (but there may not be a viable solution for that; my script currently is decent with this because I give some allowance at the end of buffs to not use bleeds and so it only switches back for a split second, not really long enough for the player to react; that won't really be the case for most scripts I don't think though) For ferals, the old method of always being wrong is probably better because we can just always apply another rake which isn't a huge dps loss anyhow. Unsure about other classes.

The only fully accurate method I could think of would be to go from the damage directly and ignore all these other factors (except crit) in trying to calculate it (afaik no dots have "damage ranges"; please feel free to correct me if I'm wrong). While this would work extremely well for Rake, most other dots would have to "wait" until the damage ticked. I suppose maybe we could use the current method as an estimate until we see the raw damage tick and then update it?

Simply might not be a solvable problem and with the exception of macro'd abilities, probably doesn't come up as often as we think given that its been there the entire time.

target.DebuffComboPoints always returns 0; For now I'll probably just use target.Debuff for everything but that till fixed as you can't reliably get Rip up on a significant number of targets anyhow.

Jeshu wrote:I will probably also try to add another script condition that returns the "normalized AP-modified weapon damage" which I believe is the "weapon damage" cited in most damage formulas. Currently the WeaponDamage() script condition returns the average of the min and max damage of the equipped mainhand (with some munging for cat and bear druids), but in the general case, you would also need the type of weapon to figure out the correct normalized attack speed to use in the calculation. It's not needed for ferals, but will be needed for other classes that have attacks based on weapon damage.


Ah, yeah, good point. While most specs only rely on one item type and could probably make assumptions as to their AP coefficient, this would definitely be the more correct method.

Also, would it be possible to have access to the upgrade state of a trinket? This would allow me to account for all possible ilvls of a trinket (where as now I can only differentiate between ones with different item IDs and have to make assumptions about the upgrade level).

EDIT: Also, are certain calls more CPU intensive than others? I went and checked the CPU usage of my script and its roughly doubled over current Leafkillers (course its also about double the length too). I guess I'm asking if there's any way for me to optimize. Current script can drop FPS from like 60 to 40 at the target dummies if all my procs are up (especially Renataki's probably because it requires calculation based on stacks)

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

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Postby Jeshu » Sun Jul 14, 2013 5:13 am

ShmooDude wrote:
Jeshu wrote:Please try Ovale 5.3.6. It should be fixed regarding aura snapshots and macro'ed abilities.


Aura snapshots are fixed only for target.debuff and not lastspell (or last, which are the same thing afaik). Since those are essentially legacy functions at this point I'm not sure it matters but figured I'd let you know.


I'm not sure what you mean here. Which script conditions aren't working and do you have an example script I can look at? They're not legacy script conditions because not all spells apply auras.

ShmooDude wrote:The snapshotting doesn't seem to be 100% in regards to catching (near) instantaneous buff changes. Right now a TF macro can have both results (ie it might think it has the buff up, but then again it might not). The same is true if you reverse the order of the abilities (if i cast rake before TF, it also can produce both results). If I had to guess, its because the server can return the info in either order (which the combat log is notorious for doing).


This I don't think we can do that much about. Ovale can only see the game from what happens in the combat log, including everything that the player does, so if two events are simultaneous and can have slight ordering issues in the combat log, there's nothing Ovale can do.

ShmooDude wrote:It also doesn't solve the problem of incorrect suggestions for expiring buffs (but there may not be a viable solution for that; my script currently is decent with this because I give some allowance at the end of buffs to not use bleeds and so it only switches back for a split second, not really long enough for the player to react; that won't really be the case for most scripts I don't think though) For ferals, the old method of always being wrong is probably better because we can just always apply another rake which isn't a huge dps loss anyhow. Unsure about other classes.


You'll need to explain what is the "problem of incorrect suggestions for expiring buffs". I'm not sure what you're referring to here. Again, an example script would be helpful.

ShmooDude wrote:The only fully accurate method I could think of would be to go from the damage directly and ignore all these other factors (except crit) in trying to calculate it (afaik no dots have "damage ranges"; please feel free to correct me if I'm wrong). While this would work extremely well for Rake, most other dots would have to "wait" until the damage ticked. I suppose maybe we could use the current method as an estimate until we see the raw damage tick and then update it?


This is easy to do, but it's not helpful for dealing with SimC action lists that ask for the stats active for a buff. For the narrow problem of comparing damage of a DoT, you can already check on the damage caused by a DoT tick using LastDamage.

ShmooDude wrote:target.DebuffComboPoints always returns 0; For now I'll probably just use target.Debuff for everything but that till fixed as you can't reliably get Rip up on a significant number of targets anyhow.


This is a bug. I'll take a look. If you could submit a ticket to remind me, that would be great.

ShmooDude wrote:Also, would it be possible to have access to the upgrade state of a trinket? This would allow me to account for all possible ilvls of a trinket (where as now I can only differentiate between ones with different item IDs and have to make assumptions about the upgrade level).


This isn't too hard to implement. Could you submit an enhancement ticket for this? I will probably just expose the item level of the gear in a given slot instead of the upgrade level.

ShmooDude wrote:EDIT: Also, are certain calls more CPU intensive than others? I went and checked the CPU usage of my script and its roughly doubled over current Leafkillers (course its also about double the length too). I guess I'm asking if there's any way for me to optimize. Current script can drop FPS from like 60 to 40 at the target dummies if all my procs are up (especially Renataki's probably because it requires calculation based on stacks)


There are probably ways to optimize, but in the end, complex scripts just take a lot of time to process. Ovale is easily one of the most CPU-hungry addons because it tries to compute so much on every frame refresh (OnUpdate). It basically executes the entire script in each frame refresh. This could be changed, but these are parts of the Ovale code that I'm not comfortable tinkering with yet.

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

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Postby Jeshu » Sun Jul 14, 2013 5:20 am

@SchmooDude: One way you could perhaps optimize your script is to get some help from the player. Create a checkbox list that lets the player select which trinkets are equipped and you can use that data to make some of the script unreachable if it doesn't pertain to the selected trinkets.

Revered
Posts: 378
Joined: Tue Feb 08, 2011 5:51 pm

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Postby ShmooDude » Sun Jul 14, 2013 8:30 am

Jeshu wrote:
ShmooDude wrote:Aura snapshots are fixed only for target.debuff and not lastspell (or last, which are the same thing afaik). Since those are essentially legacy functions at this point I'm not sure it matters but figured I'd let you know.


I'm not sure what you mean here. Which script conditions aren't working and do you have an example script I can look at? They're not legacy script conditions because not all spells apply auras.


Code: Select all
AddIcon
{
target.DebuffDamageMultiplier(RAKE)
}
AddIcon
{
LastDamageMultiplier(RAKE)
}


Those two can differ when using a TF/Rake macro. If it catches the Tiger's Fury and waits to update the stat, target.debuff will wait where as last won't (ie target.debuff will be 15% higher than last). If it doesn't catch Tiger's Fury, then they'll match.

Jeshu wrote:This I don't think we can do that much about. Ovale can only see the game from what happens in the combat log, including everything that the player does, so if two events are simultaneous and can have slight ordering issues in the combat log, there's nothing Ovale can do.


I agree, this is probably as close as we're going to get until Blizzard updates the combat log to be more accurate (which is something they've said they wanted to do in the past, but I have my doubts it'll ever get down, probably not a high priority).

Jeshu wrote:You'll need to explain what is the "problem of incorrect suggestions for expiring buffs". I'm not sure what you're referring to here. Again, an example script would be helpful.


Code: Select all
# don't use anything else that affects the damage multiplier when testing, just tiger's fury
AddIcon { if DamageMultiplier(RAKE) >= 1.15 Spell(RAKE) }

vs.
Code: Select all
AddIcon { if BuffPresent(TIGERS_FURY) Spell(RAKE) }


The first will appear and disappear a little after the second (when if we were 100% accurate they should both function identically). This means that the first icon will suggest Rake incorrectly for a split second before the character sheet updates. Again, probably not a solvable problem for ovale but thought you'd want to know in case you have any ideas.

Jeshu wrote:This is easy to do, but it's not helpful for dealing with SimC action lists that ask for the stats active for a buff. For the narrow problem of comparing damage of a DoT, you can already check on the damage caused by a DoT tick using LastDamage.


I knew there was a function for this, I remember playing around with it but for the life of me couldn't remember what it was. There's a couple things that keep it from being usable for what I want:
1) I can't tell if its a crit or not (this would have to be factored out, I'd also need a crit damage bonus value)
2) It only considers the last damage event, and not the last damage event on the target (which is probably correct compared to all the other "last" functions, so I guess I'm asking for a target.DebuffDamage() function)

I'll make an enhance ticket for this too.

Jeshu wrote:This is a bug. I'll take a look. If you could submit a ticket to remind me, that would be great.


Will do

Jeshu wrote:This isn't too hard to implement. Could you submit an enhancement ticket for this? I will probably just expose the item level of the gear in a given slot instead of the upgrade level.


Either way works, pretty sure the coding requirements on your end will be roughly the same (have to pull the upgrade level out of the tooltip and then recalculate the ilvl from the base item).

Jeshu wrote:There are probably ways to optimize, but in the end, complex scripts just take a lot of time to process. Ovale is easily one of the most CPU-hungry addons because it tries to compute so much on every frame refresh (OnUpdate). It basically executes the entire script in each frame refresh. This could be changed, but these are parts of the Ovale code that I'm not comfortable tinkering with yet.


Yeah, comparisons seem to take a lot of power where as anything that's fairly static is cheap. For example I have a bunch of functions that return just a number that's used in multiple parts of the script. I tried removing these to see if it affected the performance and it had zero impact except for the initial compile time when I pasted the script in (I assume, wasn't really noticeable).

In particular, these code blocks seem to be fairly intensive if you or anyone else has any ideas.

Code: Select all
AddFunction TigersFuryRakeUsableBeforeExpire # Checks to make sure you have the energy/cooldown to use a bleed before the Rune buff expires
{
   if Energy() >= EnergyForRake()
      {BuffRemains(TIGERS_FURY) > {ExpiringBuffSafetyMargin()}} and BuffRemains(TIGERS_FURY) > {SpellCooldown(RAKE)+ExpiringBuffSafetyMargin()}
   unless Energy() >= EnergyForRake()
      {BuffRemains(TIGERS_FURY) > {TimeTilEnergyForRake()+ExpiringBuffSafetyMargin()} or BuffPresent(CLEARCASTING)} and BuffRemains(TIGERS_FURY) > {SpellCooldown(RAKE)+ExpiringBuffSafetyMargin()}
}


Only really requires a lot of CPU power while TF is up, then goes back to more normal levels. When the similar code blocks for all the other buffs run simultaneously, it really eats up the cpu cycles. Think I'm gonna add one test to the function that calls this one so it only triggers towards the end of a buff when there's a possibility of it being true.
Last edited by ShmooDude on Tue Jul 16, 2013 3:39 pm, edited 1 time in total.

Exalted
User avatar
Posts: 1334
Joined: Fri Nov 25, 2011 7:49 pm

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Postby aggixx » Sun Jul 14, 2013 1:38 pm

ShmooDude wrote:Its because Clearcasting Thrash is fairly high up in the list and doesn't have a test for that particular instance. And given that those exact conditions occur in ~14% of simcraft's 7.5 minute fights, I don't think it'd even be possible to tell whether that'd be a dps upgrade or not (the two 50k interations I did and it ended up a 60 DPS downgrade, well within the margin of error). Besides, a rune buffed thrash isn't exactly a bad thing.

Pretty much this. I've toyed with it in the past but I've never been able to get restricting it's use to actually be a clear DPS gain. If you see a situation where you know it's the difference between getting that Rip off or not you should definitely ignore the script and go for the Rip, but realistically that is a very rare scenario that would be difficult for the script to detect and not worth the CPU cycles or time to implement.
Kihrawr wrote:I've also seen the script want to pool energy during a Rune proc, so Mangle is showing up but the script wants me to wait before hitting it. This can lead to some frantic last minute spamming when it finally lights up as I try to get the Rip up. Again, maybe I'm doing it wrong, but my instinct when Rune procs is to pound CP-generators frantically to try to get the combo points built to get the Rip up. Waiting to hit an ability that generates CP if I have that energy available seems counter-intuitive to me, especially when playing DoC spec, since I need time to hit Healing Touch before the Rip also if possible.

This is just an oversight I believe, probably best to add a filler conditional for this, something like "if rune is up and rip ratio > 1.15" would work I think.
Jeshu wrote:I will probably also try to add another script condition that returns the "normalized AP-modified weapon damage" which I believe is the "weapon damage" cited in most damage formulas.

As far as I'm aware that is indeed the "weapon damage" used in all ability damage formulas.
Jeshu wrote:
ShmooDude wrote:EDIT: Also, are certain calls more CPU intensive than others? I went and checked the CPU usage of my script and its roughly doubled over current Leafkillers (course its also about double the length too). I guess I'm asking if there's any way for me to optimize. Current script can drop FPS from like 60 to 40 at the target dummies if all my procs are up (especially Renataki's probably because it requires calculation based on stacks)

There are probably ways to optimize, but in the end, complex scripts just take a lot of time to process. Ovale is easily one of the most CPU-hungry addons because it tries to compute so much on every frame refresh (OnUpdate). It basically executes the entire script in each frame refresh. This could be changed, but these are parts of the Ovale code that I'm not comfortable tinkering with yet.

Doesn't really surprise me at all the be honest looking at some of the things you implemented in the script, some of them immediately struck me as CPU hungry. I'm sure there's a lot more efficient ways of achieving some of the things by implementing the Ovale instead of trying to do them in the script.

For example, adjusting the Damage() function so that when you have insufficient energy to cast a spell it returns the damage of the spell based on what buffs you would have in (Energy()-Cost)/EnergyRegen() seconds. That way you wouldn't need many of the extra functions you added.

Melee Crit functions are already implemented, so you're good there. An optional boolean parameter that would ceil the value at 100 would probably be helpful (default would be true, but you could set it to false for calculation of abilities like Chaos Bolt or Soul Fire).

Physical damage reduction of the target (armor) would probably be more suited to being implemented in Ovale rather than in the script. At least in the last version you posted you're doing a ton of unnecessary calculations when you could just have it return a hard-coded decimal value. Edit: Something like this:
Code: Select all
AddFunction ArmorReduction
{
   if target.DebuffPresent(WEAKENED_ARMOR any=1)
   {
      if target.Level(less 1) 0.679
      0.698
   }
   unless target.DebuffPresent(WEAKENED_ARMOR any=1)
   {
      if target.Level(less 1) 0.651
      0.671
   }
}

That only has values for bosses, and uses level 92 armor values for everything else, but it keeps it very simple. And since our sunder applies three stacks at a time it's not really worth calculating anything but 3 and 0 stacks.
Image

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

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Postby Jeshu » Sun Jul 14, 2013 4:19 pm

aggixx wrote:Physical damage reduction of the target (armor) would probably be more suited to being implemented in Ovale rather than in the script.

The way I was planning on implementing the armor reduction was like this:
Code: Select all
target.Damage(ferocious_bite)
target.Damage(rake ignorearmor=1)

Target needs to be specified to figure out the appropriate armor reduction to damage.

There's also the more general problem of dealing with target debuffs that increase damage taken, or increase crit chance, etc. These I'm not sure I can implement in Ovale, though I can at least factor in the standard target debuffs available in a raid.

Posts: 10
Joined: Wed May 22, 2013 3:16 am

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Postby Raolf » Sun Jul 14, 2013 11:29 pm

Hey guys, thanks again for all the work you do for your feral brethren.

I went back several days in the posts, and didn't (kind of) notice anything that addressed this, but for me, 5.3.6 is still suggesting rake for pretty much all combo point generation. I use DroodFocus as well, and I'm definitely being told to reapply weaker rakes. I reverted to 5.3.2, and the issue didn't come up. I'm assuming this is tied to the discussion about snapshots, which was posted as fixed. If so, is there something I may be missing?

On a side note, I can't seem to stay logged in to the site on Firefox, but Chrome works fine. Any link I click after logging in on Firefox sends me right back to the login page. Any clue?

Revered
User avatar
Posts: 271
Joined: Fri Dec 24, 2010 1:57 pm

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Postby Steakbomb » Mon Jul 15, 2013 12:07 am

I don't believe the script is fully working with 5.3.6. The script that Shmoo made was meant for 5.3.2

The issue with Firefox is probably that you don't have cookies enabled in Firefox where as you do in Chrome.
Image

Revered
Posts: 378
Joined: Tue Feb 08, 2011 5:51 pm

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Postby ShmooDude » Mon Jul 15, 2013 6:53 am

Raolf wrote:Hey guys, thanks again for all the work you do for your feral brethren.

I went back several days in the posts, and didn't (kind of) notice anything that addressed this, but for me, 5.3.6 is still suggesting rake for pretty much all combo point generation. I use DroodFocus as well, and I'm definitely being told to reapply weaker rakes. I reverted to 5.3.2, and the issue didn't come up. I'm assuming this is tied to the discussion about snapshots, which was posted as fixed. If so, is there something I may be missing?

On a side note, I can't seem to stay logged in to the site on Firefox, but Chrome works fine. Any link I click after logging in on Firefox sends me right back to the login page. Any clue?


Yeah, apparently 5.3.6 has a bug in the LastSpellEstimatedDamage function in that it no longer accounts for DamageMultiplier where as the Damage function still does, causing a disconnect in the ratios. I put in a ticket for Jeshu.

@Jeshu I noticed a while back that you added to spell info the ability to specify my own damage function for an ability but I've never gotten it to work. My question is, would using this (once functional) have any performance advantage or is it simply another way to call that function (or does it confer some other advantage)? If it does, I'd love to try it out. If not then I'm not really worried about it.

Revered
Posts: 378
Joined: Tue Feb 08, 2011 5:51 pm

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Postby ShmooDude » Mon Jul 15, 2013 5:16 pm

5.3.6 Script

Spoiler: show
Code: Select all
# ShmooDude's modified Leafkiller's Feral/Guardian druid script.
# Support/Discussion thread: http://fluiddruid.net/forum/viewtopic.php?f=3&t=857

############################
## Define Spells, Buffs, Items, Talents ##
############################

# Shared spells
Define(BARKSKIN 22812)
    SpellInfo(BARKSKIN cd=60)
Define(FERAL_SPIRIT 110807)
   SpellInfo(FERAL_SPIRIT cd=120)
Define(HEALING_TOUCH 5185)
Define(MARK_OF_THE_WILD 1126)
    SpellInfo(MARK_OF_THE_WILD duration=3600)
    SpellAddBuff(MARK_OF_THE_WILD MARK_OF_THE_WILD=1)
Define(SYMBIOSIS 110309)
    SpellAddBuff(SYMBIOSIS SYMBIOSIS=1)
Define(WRATH 5176)

# Shared buffs
Define(DREAM_OF_CENARIUS_DAMAGE 108381)
    SpellInfo(DREAM_OF_CENARIUS_DAMAGE duration=30 )
    SpellAddBuff(DREAM_OF_CENARIUS_DAMAGE DREAM_OF_CENARIUS_DAMAGE=1)
Define(NATURES_VIGIL 124974)
    SpellInfo(NATURES_VIGIL cd=180)
    SpellAddBuff(NATURES_VIGIL NATURES_VIGIL=1)
Define(PREDATORY_SWIFTNESS 69369)
    SpellAddBuff(PREDATORY_SWIFTNESS PREDATORY_SWIFTNESS=1)
Define(PRIMAL_FURY 16961)
Define(TRICKS 57933)
    SpellAddBuff(TRICKS TRICKS=1)
Define(WEAKENED_ARMOR 113746)
    SpellInfo(WEAKENED_ARMOR duration=30)
Define(WEAKENED_BLOWS 115798)
    SpellInfo(WEAKENED_BLOWS duration=30)
Define(CLEARCASTING 135700)

# Trinket and Weapon Enchant buffs
Define(ROR_CRIT 139117)
    SpellInfo(ROR_CRIT duration=10)
Define(ROR_MASTERY 139120)
    SpellInfo(ROR_MASTERY duration=10)
Define(ROR_HASTE 139121)
    SpellInfo(ROR_HASTE duration=10)
    SpellList(ROR ROR_CRIT ROR_MASTERY ROR_HASTE)
Define(DANCING_STEEL 120032)
   SpellInfo(DANCING_STEEL duration=12)
Define(SOUL_CHARM 138756)
   SpellInfo(SOUL_CHARM duration=20)
Define(BLADES 138737)
Define(BAD_JUJU 138939)
   SpellInfo(BAD_JUJU duration=20)
Define(VICIOUS_TALISMAN 138700)
   SpellInfo(VICIOUS_TALISMAN duration=20)

# Shared items
ItemList(ROR_ITEM 94532 95802 96174 96546 96918)
ItemList(SOUL_CHARM_ITEM 96741 96369 95997 94512 95625)
ItemList(BAD_JUJU_ITEM 96781 96409 96037 94523 95665)
ItemList(VICIOUS_TALISMAN_ITEM 94511)

# Talents
Define(NATURES_SWIFTNESS_TALENT 4)
Define(RENEWAL_TALENT 5)
Define(CENARION_WARD_TALENT 6)
Define(FAERIE_SWARM_TALENT 7)
Define(TYPHOON_TALENT 9)
Define(SOUL_OF_THE_FOREST 10)
Define(INCARNATION_TALENT 11)
Define(FORCE_OF_NATURE_TALENT 12)
Define(MIGHTY_BASH_TALENT 15)
Define(HEART_OF_THE_WILD_TALENT 16)
Define(DREAM_OF_CENARIUS_TALENT 17)
Define(NATURES_VIGIL_TALENT 18)

# Talent spells
Define(CENARION_WARD 102351)
    SpellInfo(CENARION_WARD cd=30)
Define(FORCE_OF_NATURE 106737)
    SpellInfo(FORCE_OF_NATURE duration=15 cd=60)
Define(HEART_OF_THE_WILD 108292)
    SpellInfo(HEART_OF_THE_WILD cd=360)
    SpellAddBuff(HEART_OF_THE_WILD HEART_OF_THE_WILD=1)
Define(INCARNATION 106731)
    SpellInfo(INCARNATION cd=180)
Define(MIGHTY_BASH 5211)
    SpellInfo(MIGHTY_BASH cd=50)
Define(NATURES_SWIFTNESS 132158)
    SpellInfo(NATURES_SWIFTNESS cd=60)
    SpellAddBuff(NATURES_SWIFTNESS NATURES_SWIFTNESS=1)
Define(RENEWAL 108238)
    SpellInfo(RENEWAL cd=120)
Define(TYPHOON 132469)
    SpellInfo(TYPHOON cd=20)
Define(WILD_CHARGE 102401)
    SpellInfo(WILD_CHARGE cd=15)

#Glyphs
Define(GLYPH_OF_SHRED 114234)
Define(GLYPH_OF_SAVAGERY 127540)

# Shared spells
Define(FAERIE_FERAL 770)
    SpellInfo(FAERIE_FERAL duration=300 cd=6)
    SpellAddTargetDebuff(FAERIE_FERAL FAERIE_FERAL=1 WEAKENED_ARMOR=1)
Define(FAERIE_SWARM 102355)
    SpellInfo(FAERIE_SWARM duration=300 cd=6)
    SpellAddTargetDebuff(FAERIE_SWARM FAERIE_SWARM=1 WEAKENED_ARMOR=1)

# Cat spells
Define(BERSERK_CAT 106951) #cat cd buff
    SpellInfo(BERSERK_CAT duration=15 cd=180)
    SpellAddBuff(BERSERK_CAT BERSERK_CAT=1)
Define(CAT_FORM 768)
    SpellAddBuff(CAT_FORM CAT_FORM=1)
Define(FEROCIOUS_BITE 22568) #cat finish 25-50 energy
    SpellInfo(FEROCIOUS_BITE energy=25 combo=0)
Define(INCARNATION_CAT 102543)
    SpellInfo(INCARNATION_CAT duration=30 cd=180)
Define(MAIM 22570) #cat interrupt
    SpellInfo(MAIM cd=10 energy=35 combo=0)
Define(MANGLE_CAT 33876) #cat bleed+debuff
    SpellInfo(MANGLE_CAT inccounter=ripshreds energy=35 combo=1)
    SpellInfo(MANGLE_CAT critcombo=1 if_spell=PRIMAL_FURY)
Define(RAKE 1822) #cat bleed
    SpellInfo(RAKE combo=1 duration=15 energy=35 tick=3)
    SpellInfo(RAKE critcombo=1 if_spell=PRIMAL_FURY)
    SpellAddTargetDebuff(RAKE RAKE=1)
    SpellDamageBuff(RAKE DREAM_OF_CENARIUS_DAMAGE=1.25)
Define(RAVAGE 6785)
    SpellInfo(RAVAGE inccounter=ripshreds energy=45 combo=1)
    SpellInfo(RAVAGE critcombo=1 if_spell=PRIMAL_FURY)
Define(RAVAGE_BANG 102545)
    SpellInfo(RAVAGE_BANG inccounter=ripshreds energy=0 combo=1)
    SpellInfo(RAVAGE_BANG critcombo=1 if_spell=PRIMAL_FURY)
Define(RIP 1079) #cat bleed
    SpellInfo(RIP resetcounter=ripshreds duration=16 energy=30 tick=2 combo=0)
    SpellAddTargetDebuff(RIP RIP=1)
    SpellDamageBuff(RIP DREAM_OF_CENARIUS_DAMAGE=1.25)
Define(SAVAGE_ROAR_OLD 52610)
    SpellInfo(SAVAGE_ROAR_OLD duration=18 combo=0 energy=25)
    SpellAddBuff(SAVAGE_ROAR_OLD SAVAGE_ROAR_OLD=1)
Define(SAVAGE_ROAR_GLYPHED 127538)
    SpellInfo(SAVAGE_ROAR_GLYPHED duration=12 combo=-5 energy=25)
    SpellAddBuff(SAVAGE_ROAR_GLYPHED SAVAGE_ROAR_GLYPHED=1)
    SpellList(SAVAGE_ROAR 52610 127538)
Define(SHRED 5221) #cat behind
    SpellInfo(SHRED inccounter=ripshreds energy=40 combo=1)
    SpellInfo(SHRED critcombo=1 if_spell=PRIMAL_FURY)
Define(SHRED_BANG 114236)
    SpellInfo(SHRED_BANG inccounter=ripshreds energy=40 combo=1)
    SpellInfo(SHRED_BANG critcombo=1 if_spell=PRIMAL_FURY)
Define(STAMPEDE 81022)
    SpellAddBuff(STAMPEDE STAMPEDE=1)
Define(SKULL_BASH_CAT 80965) #cat interrupt
    SpellInfo(SKULL_BASH_CAT cd=15 energy=15)
Define(THRASH_CAT 106830)
    SpellInfo(THRASH_CAT duration=15 energy=50 tick=3)
    SpellAddTargetDebuff(THRASH_CAT THRASH_CAT=1 WEAKENED_BLOWS=1)
    SpellDamageBuff(THRASH_CAT DREAM_OF_CENARIUS_DAMAGE=1.25)
Define(TIGERS_FURY 5217) #cat buff
    SpellInfo(TIGERS_FURY duration=6 energy=-60 cd=30)
    SpellAddBuff(TIGERS_FURY TIGERS_FURY=1)

# Bear spells
Define(BEAR_FORM 5487)
    SpellAddBuff(BEAR_FORM BEAR_FORM=1)
Define(BERSERK_BEAR 106952) #cat+bear cd buff
    SpellInfo(BERSERK_BEAR duration=10 cd=180 )
    SpellAddBuff(BERSERK_BEAR BERSERK_BEAR=1)
Define(ENRAGE 5229)
Define(FRENZIED_REGEN 22842)
Define(INCARNATION_BEAR 102558)
    SpellInfo(INCARNATION_BEAR duration=30 cd=180 )
Define(LACERATE 33745)
Define(MANGLE_BEAR 33878)
    SpellInfo(MANGLE_BEAR cd=3 buffnocd=INCARNATION_BEAR buffnocd=BERSERK_BEAR)
Define(MAUL 6807)
Define(MIGHT_OF_URSOC 106922)
Define(SAVAGE_DEFENSE 62606)
Define(SURVIVAL_INSTINCTS 61336)
Define(SWIPE_BEAR 779)
Define(THRASH_BEAR 77758)
Define(TOOTH_AND_CLAW 135286)
    SpellAddBuff(TOOTH_AND_CLAW TOOTH_AND_CLAW=1)
Define(TOOTH_AND_CLAW_DEBUFF 135601)
    SpellAddTargetDebuff(TOOTH_AND_CLAW_DEBUFF TOOTH_AND_CLAW_DEBUFF=1)

###############
## Define Settings ##
###############

AddCheckBox(cooldownsL "Show Left Rotation Boxes" default)
AddCheckBox(cooldownsR "Show Right Cooldown Boxes" default)
AddCheckBox(altpredictive "Alternate predictive box")
AddCheckBox(bearaoe "Bear AOE Rotation")
AddCheckBox(cooldownsRatio "Show Rake and Rip Ratio Boxes" mastery=2)
AddCheckBox(lucioles SpellName(FAERIE_FERAL) default mastery=2)
AddCheckBox(berserk "Cat Berserk" default mastery=2)
AddCheckBox(infront "Frontal attack" mastery=2)
AddCheckBox(predictive "Hide predictive box" mastery=2)
AddCheckBox(nvbounce "Use healing CDs for damage" mastery=2)

################
## Helper Functions ##
################

# Static Variables; Left as functions instead of Defines for added flexibility and consistency in coding (ex: multiple ilvls of trinkets if we can figure that out)
AddFunction ExpiringBuffSafetyMargin { 0.3 }
AddFunction BossArmor { 24835 }
AddFunction WeakenedArmorPercent { 0.04 }
AddFunction TigersFuryMultiplier { 1.15 }
AddFunction RuneMultiplier { 2 } # Not the actual amount like the rest, but given the power of the rune buff the script should still function properly
AddFunction HeartOfTheWildAgiModifier { 1.06 }
AddFunction LeatherSpecAgiModifier { 1.05 }
AddFunction StatsBuffBonus { 0.05 }
AddFunction RakeBaseDamage { 99 }
AddFunction RakeDamagePerAttackPower { 0.3 }
AddFunction RipBaseDamage { 113 }
AddFunction RipDamagePerComboPoint { 320 }
AddFunction RipDamagePerComboPointAttackPower { 0.0484 }
AddFunction ThrashBaseDamage { 4662 }
AddFunction ThrashDamagePerAttackPower { 1.121 }
AddFunction FerociousBiteBaseDamage { 500 }
AddFunction FerociousBiteDamagePerComboPoint { 762 }
AddFunction FerociousBiteDamagePerComboPointAttackPower { 0.196 }
AddFunction FerociousBiteCritChanceBonus { 0.25 }
AddFunction MangleCatBaseDamage { 78 }
AddFunction MangleCatWeaponDamageMultiplier { 5 }
AddFunction CritPerAP { 2519.04 }
AddFunction DancingSteelAttackPower { 3300 }
AddFunction SoulCharmAttackPower
{
   if HasTrinket(96741) 3430 # Heroic TF 2/2 upgrade
   if HasTrinket(96369) 3244 # Heroic 2/2 upgrade
   if HasTrinket(95997) 3038 # Normal TF 2/2 upgrade
   if HasTrinket(94512) 2874 # Normal 2/2 upgrade
   if HasTrinket(95625) 2384 # LFR 2/2 upgrade
}
AddFunction BadJujuAttackPower
{
   if HasTrinket(96781) 18864 # Heroic TF 2/2 upgrade
   if HasTrinket(96409) 17840 # Heroic 2/2 upgrade
   if HasTrinket(96037) 16712 # Normal TF 2/2 upgrade
   if HasTrinket(94523) 15806 # Normal 2/2 upgrade
   if HasTrinket(95665) 13118 # LFR 2/2 upgrade
}
AddFunction ViciousTalismanAttackPower
{
   17600 # 2/2 upgrade
}
AddFunction EnergyForThrash
{
   if BuffExpires(BERSERK_CAT) 50
   25
}
AddFunction EnergyForRake
{
   if BuffExpires(BERSERK_CAT) 35
   18
}
AddFunction EnergyForRip
{
   if BuffExpires(BERSERK_CAT) 30
   15
}
AddFunction EnergyForMangle
{
   if BuffExpires(BERSERK_CAT) 35
   18
}
AddFunction EnergyForFerociousBite
{
   if BuffExpires(BERSERK_CAT) 50
   25
}

# Armor Functions
AddFunction ArmorReduction
{
   if target.DebuffPresent(WEAKENED_ARMOR any=1)
   {
      if target.Level(less 1) 0.679
      0.698
   }
   if target.Level(less 1) 0.651
   0.671
}

# Time till energy for abilities functions (must come before Rune functions)
# Moved energy check from functions to main code to fix predictive algorithm bug within ovale
AddFunction TimeTilEnergyForThrash
{
   if { EnergyForThrash() - Energy() } / EnergyRegen() < SpellCooldown(TIGERS_FURY)
      { EnergyForThrash() - Energy() } / EnergyRegen()
   SpellCooldown(TIGERS_FURY)
}
AddFunction TimeTilEnergyForRake
{
   if { EnergyForRake() - Energy() } / EnergyRegen() < SpellCooldown(TIGERS_FURY)
      { EnergyForRake() - Energy() } / EnergyRegen()
   SpellCooldown(TIGERS_FURY)
}
AddFunction TimeTilEnergyForRip
{
   if { EnergyForRip() - Energy() } / EnergyRegen() < SpellCooldown(TIGERS_FURY)
      { EnergyForRip() - Energy() } / EnergyRegen()
   SpellCooldown(TIGERS_FURY)
}

# Ratio Calculation assistnace functions
AddFunction PrimordiusStats # Primordius Stats Buff
{
   {1 + 0.05 * DebuffStacks(136184)} * {1 - 0.1 * DebuffStacks(136185)} # Thick and Fragile bones
}
AddFunction StatsMultiplier
{
   if TalentPoints(HEART_OF_THE_WILD) # Leatherwearer, Heart of the Wild, Mark of the Wild, Primordius Buffs
   {
      LeatherSpecAgiModifier() * HeartOfTheWildAgiModifier() * {1 + StatsBuffBonus() * BuffStacks(str_agi_int any=1)} * PrimordiusStats()
   }
   LeatherSpecAgiModifier() * {1 + StatsBuffBonus() * BuffStacks(str_agi_int any=1)} * PrimordiusStats()
}
AddFunction DancingSteelAttackPowerIncrease
{
   DancingSteelAttackPower()*StatsMultiplier()
}
AddFunction DancingSteelCritChanceIncrease
{
    DancingSteelAttackPowerIncrease()/CritPerAP()/{1+0.1*BuffStacks(attack_power_multiplier any=1)}
}
AddFunction SoulCharmAttackPowerIncrease
{
   SoulCharmAttackPower()*BuffStacks(BLADES)*StatsMultiplier()
}
AddFunction SoulCharmCritChanceIncrease
{
   SoulCharmAttackPowerIncrease()/CritPerAP()/{1+0.1*BuffStacks(attack_power_multiplier any=1)}
}
AddFunction BadJujuAttackPowerIncrease
{
   BadJujuAttackPower()*StatsMultiplier()
}
AddFunction BadJujuCritChanceIncrease
{
   BadJujuAttackPowerIncrease()/CritPerAP()/{1+0.1*BuffStacks(attack_power_multiplier any=1)}
}
AddFunction ViciousTalismanAttackPowerIncrease
{
   ViciousTalismanAttackPower()*StatsMultiplier()
}
AddFunction ViciousTalismanCritChanceIncrease
{
   ViciousTalismanAttackPowerIncrease()/CritPerAP()/{1+0.1*BuffStacks(attack_power_multiplier any=1)}
}

# Rake functions
AddFunction RakeTickDamage # Switched to raw numbers in place of Damage(RAKE) for 5.3.4+ compatibility
{
    # rake_tick_damage = (tick_damage + coeff * AP) * damage_multiplier * crit_multiplier * bleed_multiplier
    {RakeBaseDamage() + AttackPower()*RakeDamagePerAttackPower()} * DamageMultiplier(RAKE) * {1+MeleeCritChance()/100} * {1+Mastery()/100}
}
AddFunction LastRakeTickDamage
{
    # rake_tick_damage = (tick_damage + coeff * AP) * damage_multiplier * crit_multiplier * bleed_multiplier
    {RakeBaseDamage() + target.DebuffAttackPower(RAKE)*RakeDamagePerAttackPower()} * target.DebuffDamageMultiplier(RAKE) * {1+target.DebuffMeleeCritChance(RAKE)/100} * {1+target.DebuffMastery(RAKE)/100}
}
AddFunction RuneRakeUsableBeforeExpire # Checks to make sure you have the energy/cooldown to use a bleed before the Rune buff expires
{
   if BuffRemains(ROR_MASTERY) > SpellCooldown(RAKE)
   {
      if Energy() >= EnergyForRake()
         BuffRemains(ROR_MASTERY) > ExpiringBuffSafetyMargin()
      BuffRemains(ROR_MASTERY) > TimeTilEnergyForRake()+ExpiringBuffSafetyMargin()
   }
}
AddFunction RuneExpiresRakeMultiplier
{
    if BuffPresent(ROR_MASTERY)
   {
      if RuneRakeUsableBeforeExpire() 1
      RuneMultiplier()
   }
      1
}
AddFunction TigersFuryRakeUsableBeforeExpire # Checks to make sure you have the energy/cooldown to use a bleed before the Rune buff expires
{
   if BuffRemains(TIGERS_FURY) > SpellCooldown(RAKE)
   {
      if Energy() >= EnergyForRake()
         BuffRemains(TIGERS_FURY) > ExpiringBuffSafetyMargin()
      BuffRemains(TIGERS_FURY) > TimeTilEnergyForRake()+ExpiringBuffSafetyMargin()
   }
}
AddFunction TigersFuryExpiresRakeMultiplier
{
    if BuffPresent(TIGERS_FURY)
   {
      if TigersFuryRakeUsableBeforeExpire() 1
      TigersFuryMultiplier()
   }
      1
}
AddFunction DancingSteelRakeUsableBeforeExpire
{
   if BuffRemains(DANCING_STEEL any=1) > SpellCooldown(RAKE)
   {
      if Energy() >= EnergyForRake()
         BuffRemains(DANCING_STEEL any=1) > ExpiringBuffSafetyMargin()
      BuffRemains(DANCING_STEEL any=1) > TimeTilEnergyForRake()+ExpiringBuffSafetyMargin()
   }
}
AddFunction DancingSteelExpiresRakeMultiplier
{
    if BuffPresent(DANCING_STEEL any=1)
   {
      if DancingSteelRakeUsableBeforeExpire() 1
      {RakeTickDamage() / {{{RakeBaseDamage() + {RakeDamagePerAttackPower() * {AttackPower()-DancingSteelAttackPowerIncrease()}}} * DamageMultiplier(RAKE) * {1+{{MeleeCritChance()-DancingSteelCritChanceIncrease()}/100}}} * {1 + Mastery()/100}}}
   }
      1
}
AddFunction SoulCharmRakeUsableBeforeExpire
{
   if BuffRemains(SOUL_CHARM any=1) > SpellCooldown(RAKE)
   {
      if Energy() >= EnergyForRake()
         BuffRemains(SOUL_CHARM any=1) > ExpiringBuffSafetyMargin()
      BuffRemains(SOUL_CHARM any=1) > TimeTilEnergyForRake()+ExpiringBuffSafetyMargin()
   }
}
AddFunction SoulCharmExpiresRakeMultiplier
{
   if BuffPresent(SOUL_CHARM any=1)
   {
      if SoulCharmRakeUsableBeforeExpire() 1
      {RakeTickDamage() / {{{RakeBaseDamage() + {RakeDamagePerAttackPower() * {AttackPower()-SoulCharmAttackPowerIncrease()}}} * DamageMultiplier(RAKE) * {1+{{MeleeCritChance()-SoulCharmCritChanceIncrease()}/100}}} * {1 + Mastery()/100}}}
   }
      1
}
AddFunction BadJujuRakeUsableBeforeExpire
{
   if BuffRemains(BAD_JUJU any=1) > SpellCooldown(RAKE)
   {
      if Energy() >= EnergyForRake()
         BuffRemains(BAD_JUJU any=1) > ExpiringBuffSafetyMargin()
      BuffRemains(BAD_JUJU any=1) > TimeTilEnergyForRake()+ExpiringBuffSafetyMargin()
   }
}
AddFunction BadJujuExpiresRakeMultiplier
{
   if BuffPresent(BAD_JUJU any=1)
   {
      if BadJujuRakeUsableBeforeExpire() 1
      {RakeTickDamage() / {{{RakeBaseDamage() + {RakeDamagePerAttackPower() * {AttackPower()-BadJujuAttackPowerIncrease()}}} * DamageMultiplier(RAKE) * {1+{{MeleeCritChance()-BadJujuCritChanceIncrease()}/100}}} * {1 + Mastery()/100}}}
   }
      1
}
AddFunction ViciousTalismanRakeUsableBeforeExpire
{
   if BuffRemains(VICIOUS_TALISMAN any=1) > SpellCooldown(RAKE)
   {
      if Energy() >= EnergyForRake()
         BuffRemains(VICIOUS_TALISMAN any=1) > ExpiringBuffSafetyMargin()
      BuffRemains(VICIOUS_TALISMAN any=1) > TimeTilEnergyForRake()+ExpiringBuffSafetyMargin()
   }
}
AddFunction ViciousTalismanExpiresRakeMultiplier
{
   if BuffPresent(VICIOUS_TALISMAN any=1)
   {
      if ViciousTalismanRakeUsableBeforeExpire() 1
      {RakeTickDamage() / {{{RakeBaseDamage() + {RakeDamagePerAttackPower() * {AttackPower()-BadJujuAttackPowerIncrease()}}} * DamageMultiplier(RAKE) * {1+{{MeleeCritChance()-BadJujuCritChanceIncrease()}/100}}} * {1 + Mastery()/100}}}
   }
      1

}
AddFunction TotalRakeMultiplier
{
    RuneExpiresRakeMultiplier()*TigersFuryExpiresRakeMultiplier()*DancingSteelExpiresRakeMultiplier()*SoulCharmExpiresRakeMultiplier()*BadJujuExpiresRakeMultiplier()*ViciousTalismanExpiresRakeMultiplier()
}
AddFunction FutureRakeTickDamage
{
    RakeTickDamage() / TotalRakeMultiplier()
}

# Rip functions
AddFunction RipTickDamage  # Switched to raw numbers in place of Damage(RIP) for 5.3.4+ compatibility
{
    {RipBaseDamage() + {{RipDamagePerComboPoint() + {RipDamagePerComboPointAttackPower() * AttackPower()}} * ComboPoints()}} * DamageMultiplier(RIP) * {1+MeleeCritChance()/100} * {1 + Mastery()/100}
}
AddFunction LastRipTickDamage
{
    {RipBaseDamage() + {{RipDamagePerComboPoint() + {RipDamagePerComboPointAttackPower() * target.DebuffAttackPower(RIP)}} * LastComboPoints(RIP)}} * target.DebuffDamageMultiplier(RIP) * {1+target.DebuffMeleeCritChance(RIP)/100} * {1 + target.DebuffMastery(RIP)/100}
}
AddFunction RuneRipUsableBeforeExpire # Checks to make sure you have the energy/cooldown to use a bleed before the Rune buff expires
{
   if BuffRemains(ROR_MASTERY) > SpellCooldown(RIP)
   {
      if Energy() >= EnergyForRip()
         BuffPresent(ROR_MASTERY) and BuffRemains(ROR_MASTERY) > ExpiringBuffSafetyMargin()
      BuffRemains(ROR_MASTERY) > TimeTilEnergyForRip()+ExpiringBuffSafetyMargin()
   }
}
AddFunction RuneRipExpiresRipMultiplier
{
    if BuffPresent(ROR_MASTERY)
   {
      if RuneRipUsableBeforeExpire() 1
      RuneMultiplier()
   }
      1
}
AddFunction TigersFuryRipUsableBeforeExpire
{
   if BuffRemains(TIGERS_FURY) > SpellCooldown(RIP)
   {
      if Energy() >= EnergyForRip()
         BuffRemains(TIGERS_FURY) > ExpiringBuffSafetyMargin()
      BuffPresent(TIGERS_FURY) and BuffRemains(TIGERS_FURY) > TimeTilEnergyForRip()+ExpiringBuffSafetyMargin()
   }
}
AddFunction TigersFuryExpiresRipMultiplier
{
    if BuffPresent(TIGERS_FURY)
   {
      if TigersFuryRipUsableBeforeExpire() 1
      TigersFuryMultiplier()
   }
      1
}
AddFunction DancingSteelRipUsableBeforeExpire
{
   if BuffRemains(DANCING_STEEL any=1) > SpellCooldown(RIP)
   {
      if Energy() >= EnergyForRip()
         BuffRemains(DANCING_STEEL any=1) > ExpiringBuffSafetyMargin()
      BuffRemains(DANCING_STEEL any=1) > TimeTilEnergyForRip()+ExpiringBuffSafetyMargin()
   }
}
AddFunction DancingSteelExpiresRipMultiplier
{
    if BuffPresent(DANCING_STEEL any=1)
   {
      if DancingSteelRakeUsableBeforeExpire() 1
      {RipTickDamage() / {{{RipBaseDamage() + {{RipDamagePerComboPoint() + {RipDamagePerComboPointAttackPower() * {AttackPower()-DancingSteelAttackPowerIncrease()}}} * ComboPoints()}} * DamageMultiplier(RIP) * {1+{{MeleeCritChance()-DancingSteelCritChanceIncrease()}/100}}} * {1 + Mastery()/100}}}
   }
      1
}
AddFunction SoulCharmRipUsableBeforeExpire
{
   if BuffRemains(SOUL_CHARM any=1) > SpellCooldown(RIP)
   {
      if Energy() >= EnergyForRip()
         BuffRemains(SOUL_CHARM any=1) > ExpiringBuffSafetyMargin()
      BuffRemains(SOUL_CHARM any=1) > TimeTilEnergyForRip()+ExpiringBuffSafetyMargin()
   }
}
AddFunction SoulCharmExpiresRipMultiplier
{
    if BuffPresent(SOUL_CHARM any=1)
   {
      if SoulCharmRipUsableBeforeExpire() 1
      {RipTickDamage() / {{{RipBaseDamage() + {{RipDamagePerComboPoint() + {RipDamagePerComboPointAttackPower() * {AttackPower()-SoulCharmAttackPowerIncrease()}}} * ComboPoints()}} * DamageMultiplier(RIP) * {1+{{MeleeCritChance()-DancingSteelCritChanceIncrease()}/100}}} * {1 + Mastery()/100}}}
   }
      1
}
AddFunction BadJujuRipUsableBeforeExpire
{
   if BuffRemains(BAD_JUJU any=1) > SpellCooldown(RIP)
   {
      if Energy() >= EnergyForRip()
         BuffRemains(BAD_JUJU any=1) > ExpiringBuffSafetyMargin()
      BuffRemains(BAD_JUJU any=1) > TimeTilEnergyForRip()+ExpiringBuffSafetyMargin()
   }
}
AddFunction BadJujuExpiresRipMultiplier
{
    if BuffPresent(BAD_JUJU any=1)
   {
      if BadJujuRipUsableBeforeExpire() 1
      {RipTickDamage() / {{{RipBaseDamage() + {{RipDamagePerComboPoint() + {RipDamagePerComboPointAttackPower() * {AttackPower()-SoulCharmAttackPowerIncrease()}}} * ComboPoints()}} * DamageMultiplier(RIP) * {1+{{MeleeCritChance()-DancingSteelCritChanceIncrease()}/100}}} * {1 + Mastery()/100}}}
   }
      1
}
AddFunction ViciousTalismanRipUsableBeforeExpire
{
   if BuffRemains(VICIOUS_TALISMAN any=1) > SpellCooldown(RIP)
   {
      if Energy() >= EnergyForRip()
         BuffRemains(VICIOUS_TALISMAN any=1) > ExpiringBuffSafetyMargin()
      BuffRemains(VICIOUS_TALISMAN any=1) > TimeTilEnergyForRip()+ExpiringBuffSafetyMargin()
   }
}
AddFunction ViciousTalismanExpiresRipMultiplier
{
    if BuffPresent(VICIOUS_TALISMAN any=1)
   {
      if ViciousTalismanRipUsableBeforeExpire() 1
      {RipTickDamage() / {{{RipBaseDamage() + {{RipDamagePerComboPoint() + {RipDamagePerComboPointAttackPower() * {AttackPower()-SoulCharmAttackPowerIncrease()}}} * ComboPoints()}} * DamageMultiplier(RIP) * {1+{{MeleeCritChance()-DancingSteelCritChanceIncrease()}/100}}} * {1 + Mastery()/100}}}
   }
      1 
}
AddFunction TotalRipMultiplier
{
    RuneRipExpiresRipMultiplier()*TigersFuryExpiresRipMultiplier()*DancingSteelExpiresRipMultiplier()*SoulCharmExpiresRipMultiplier()*BadJujuExpiresRipMultiplier()*ViciousTalismanExpiresRipMultiplier()
}
AddFunction FutureRipTickDamage
{
    RipTickDamage() / TotalRipMultiplier()
}
AddFunction RipDamageTillDead
{
    # The damage from Rip that is cast under the current conditions and lasting till target is dead.
    # Multiply the damage per tick with the number of ticks that can fit into the time to die.
    FutureRipTickDamage() * {target.TimeToDie() / 2}
}
AddFunction ExistingRipDamageTillDead
{
    # The damage from Rip that is already on the target and lasting till target is dead.
    if target.DebuffPresent(RIP)
    {
        # Multiply the damage per tick with the number of ticks that can fit into the time to die.
        LastRipTickDamage() * {target.TimeToDie() / 2}
    }
        0
}

# Ratio functions
AddFunction RakeRatio
{
    if TargetDebuffPresent(RAKE) 100 * FutureRakeTickDamage()/LastRakeTickDamage()
    100.0
}
AddFunction RipRatio
{
    if TargetDebuffPresent(RIP) 100 * FutureRipTickDamage()/LastRipTickDamage()
    100.0
}

# Damage ability functions
AddFunction FerociousBiteDamage # Switched to raw numbers in place of Damage(FEROCIOUS_BITE) for 5.3.4+ compatibility
{
   if {1+FerociousBiteCritChanceBonus()+{MeleeCritChance()/100}} > 100
      {FerociousBiteBaseDamage() + {FerociousBiteDamagePerComboPoint() + FerociousBiteDamagePerComboPointAttackPower() * AttackPower()} * ComboPoints()} * DamageMultiplier(FEROCIOUS_BITE) * 2 * 2 * ArmorReduction()
   {FerociousBiteBaseDamage() + {FerociousBiteDamagePerComboPoint() + FerociousBiteDamagePerComboPointAttackPower() * AttackPower()} * ComboPoints()} * DamageMultiplier(FEROCIOUS_BITE)  * {1+FerociousBiteCritChanceBonus()+{MeleeCritChance()/100}} * 2 * ArmorReduction()
}
AddFunction MangleCatDamage
{
   {MangleCatBaseDamage() + {WeaponDamage(MH) + AttackPower()/14} * MangleCatWeaponDamageMultiplier()} * DamageMultiplier(MANGLE_CAT) * {1+MeleeCritChance()/100} * ArmorReduction()
}
AddFunction ThrashCatDamage
{
   {ThrashBaseDamage() + AttackPower()*ThrashDamagePerAttackPower()} * DamageMultiplier(THRASH_CAT) * {1+MeleeCritChance()/100} * {1+Mastery()/100}
}

# Misc functions
AddFunction FaerieFire
{
    if TalentPoints(FAERIE_SWARM_TALENT) Spell(FAERIE_SWARM)
    Spell(FAERIE_FERAL)
}
AddFunction SavageRoar
{
    if Glyph(GLYPH_OF_SAVAGERY) Spell(SAVAGE_ROAR_GLYPHED)
    if ComboPoints(more 0) Spell(SAVAGE_ROAR_OLD)
}
AddFunction UsePotion
{
    #virmens_bite_potion
    if CheckBoxOn(potions) and target.Classification(worldboss) Item(virmens_bite_potion)
}



#############################
## Feral rotation functions (Mastery=2) ##
#############################

AddFunction NotInCombat
{
    unless InCombat() {
        if BuffExpires(str_agi_int 400 any=1) Spell(MARK_OF_THE_WILD)
        if BuffExpires(DREAM_OF_CENARIUS_DAMAGE) and TalentPoints(DREAM_OF_CENARIUS_TALENT) Spell(HEALING_TOUCH)
        unless Stance(3) Spell(CAT_FORM)
        if Glyph(GLYPH_OF_SAVAGERY) and ComboPoints() ==0 {
            if BuffRemains(SAVAGE_ROAR_GLYPHED) <15 and TimeToMaxEnergy() < BuffRemains(SAVAGE_ROAR_GLYPHED)-11.5
            or BuffRemains(SAVAGE_ROAR_GLYPHED) <9 and TimeToMaxEnergy() < BuffRemains(SAVAGE_ROAR_GLYPHED)-8.5
            or BuffRemains(SAVAGE_ROAR_GLYPHED) <6 and TimeToMaxEnergy() < BuffRemains(SAVAGE_ROAR_GLYPHED)-5.5
            or BuffRemains(SAVAGE_ROAR_GLYPHED) <3 and TimeToMaxEnergy() < BuffRemains(SAVAGE_ROAR_GLYPHED)-2.5
            or BuffExpires(SAVAGE_ROAR_GLYPHED) {
                SavageRoar()
            }
        }
        if TalentPoints(FORCE_OF_NATURE_TALENT) Spell(FORCE_OF_NATURE)
    }
}

AddFunction FillerActions {
    #thrash_cat,if=dot.thrash_cat.remains<3&target.time_to_die>=6&combo_points>=5
    if target.DebuffRemains(THRASH_CAT) <3 and target.TimeToDie() >=9 and ComboPoints() >=5 Spell(THRASH_CAT)
    if TalentPoints(INCARNATION_TALENT)
    {
        #ravage
        if BuffPresent(INCARNATION_CAT) Spell(RAVAGE)
    }
    if not TalentPoints(INCARNATION_TALENT) or BuffExpires(INCARNATION_CAT)
    {
        #actions.filler+=/shred,if=(buff.omen_of_clarity.react|buff.berserk.up|energy.regen>=15)&buff.king_of_the_jungle.down
        if BuffPresent(CLEARCASTING) or BuffPresent(BERSERK_CAT) or EnergyRegen() >=15
        and {not CheckBoxOn(infront)
            or {Glyph(GLYPH_OF_SHRED) and {BuffPresent(TIGERS_FURY) or BuffPresent(BERSERK_CAT)}}}
        Spell(SHRED)
        #actions.filler+=/mangle_cat,if=buff.king_of_the_jungle.down
        Spell(MANGLE_CAT)
    }
}

AddFunction SpareGcdCooldowns {
    if TalentPoints(FORCE_OF_NATURE_TALENT)
    {
        #treants
        Spell(FORCE_OF_NATURE)
    }
    # Spirit Wolves goes here when symbiosis is supported appropriately.
}

AddFunction SavageRoarOrWeakenedArmorMissing
{
    #savage_roar,if=buff.savage_roar.down
    if BuffExpires(SAVAGE_ROAR) SavageRoar()
   
    #faerie_fire,if=debuff.weakened_armor.stack<3
    if target.DebuffStacks(WEAKENED_ARMOR any=1) <3 and CheckBoxOn(lucioles) FaerieFire()
}

AddFunction RangeCheck
{
   #range check
    unless target.InRange(MANGLE_CAT) Texture(ability_druid_catformattack)
}

AddFunction IncarnationBerserkLogic
{
    #incarnation,if=energy<=35&!buff.omen_of_clarity.react&cooldown.tigers_fury.remains=0&cooldown.berserk.remains=0
    #use_item,name=eternal_blossom_grips,sync=tigers_fury
    #tigers_fury,if=(energy<=35&!buff.omen_of_clarity.react)|buff.king_of_the_jungle.up
    #berserk,if=buff.tigers_fury.up|(target.time_to_die<15&cooldown.tigers_fury.remains>6)
    if {{Energy() <=35 and BuffExpires(CLEARCASTING)} or BuffPresent(INCARNATION_CAT)} and Spell(TIGERS_FURY)
    {
        if CheckBoxOn(berserk) and Spell(BERSERK_CAT)
        {
            if TalentPoints(INCARNATION_TALENT) Spell(INCARNATION)
            if not TalentPoints(INCARNATION_TALENT) or BuffPresent(INCARNATION_CAT) Spell(BERSERK_CAT)
        }
        unless BuffPresent(BERSERK_CAT) Spell(TIGERS_FURY)
    }
    if CheckBoxOn(berserk) and TalentPoints(INCARNATION_TALENT) and BuffPresent(BERSERK_CAT) Spell(INCARNATION_CAT)
}

AddFunction ExecuteRangeRipFerociousBiteLogic # Left one Doc line in here and added a talent check, normally tried to take them out but this one was annoyingly in a bad place so left here for simplicities sake
{
    #ferocious_bite,if=combo_points>=1&dot.rip.ticking&dot.rip.remains<=3&target.health.pct<=25
    if target.HealthPercent() <=25 and ComboPoints() >=1 and target.DebuffPresent(RIP) and target.DebuffRemains(RIP) <=4 Spell(FEROCIOUS_BITE)
   
    #thrash_cat,if=target.time_to_die>=6&buff.omen_of_clarity.react&dot.thrash_cat.remains<3
    if target.TimeToDie() >=9 and BuffPresent(CLEARCASTING) and target.DebuffRemains(THRASH_CAT) <3 Spell(THRASH_CAT)
   
    #ferocious_bite,if=(target.time_to_die<=4&combo_points>=5)|(target.time_to_die<=1&combo_points>=3)
    if target.TimeToDie() <=4 and ComboPoints() >=5 Spell(FEROCIOUS_BITE)
    if target.TimeToDie() <=1 and ComboPoints() >=3 Spell(FEROCIOUS_BITE)
   
    if target.HealthPercent() <=25
    {
        #savage_roar,if=buff.savage_roar.remains<=3&combo_points>0&target.health.pct<25
        if BuffRemains(SAVAGE_ROAR) <=3 and ComboPoints() >0 SavageRoar()
       
        if ComboPoints() >=5
        {
            #natures_swiftness,if=buff.dream_of_cenarius_damage.down&buff.predatory_swiftness.down&combo_points>=5&target.health.pct<=25
            if TalentPoints(DREAM_OF_CENARIUS_TALENT) and TalentPoints(NATURES_SWIFTNESS_TALENT) and BuffExpires(DREAM_OF_CENARIUS_DAMAGE) and BuffExpires(PREDATORY_SWIFTNESS) and BuffRemains(SAVAGE_ROAR) >5 Spell(NATURES_SWIFTNESS)
           
            #virmens_bite_potion,if=combo_points>=5&$(time_til_bitw)<15&$(rip_ratio)>=1.15&buff.dream_of_cenarius_damage.up
            # if not HasTrinket(ROR_ITEM) and ComboPoints() >=5 and BuffPresent(DREAM_OF_CENARIUS_DAMAGE) and RipRatio() >=115 UsePotion()
           
            #virmens_bite_potion,if=combo_points>=5&$(time_til_bitw)<15&buff.rune_of_reorigination.up&buff.dream_of_cenarius_damage.up
            # if HasTrinket(ROR_ITEM) and ComboPoints() >=5 and BuffPresent(DREAM_OF_CENARIUS_DAMAGE) and BuffPresent(ROR_MASTERY) UsePotion()
           
            #virmens_bite_potion,if=target.time_to_die<=40
            # if target.TimeToDie() <=40 UsePotion()
           
            #rip,line_cd=30,if=combo_points>=5&buff.virmens_bite_potion.up&buff.dream_of_cenarius_damage.up&target.health.pct<=25&target.time_to_die>30
            if RipDamageTillDead() > {ExistingRipDamageTillDead() + FerociousBiteDamage()} Spell(RIP)
         
            #pool_resource,wait=0.25,if=combo_points>=5&dot.rip.ticking&target.health.pct<=25&((energy<50&buff.berserk.down)|(energy<25&buff.berserk.remains>1))
            #ferocious_bite,if=combo_points>=5&dot.rip.ticking&target.health.pct<=25
            if target.DebuffPresent(RIP)
            {
                unless Energy() >= EnergyForFerociousBite() SpareGcdCooldowns()
                wait if Energy() >= EnergyForFerociousBite() Spell(FEROCIOUS_BITE)
            }
        }
    }
}

AddFunction DocRipLogic # If any changes are applicable to NonDoc logic, also make changes there!!!
{
   if target.HealthPercent() >25 and ComboPoints() >=5 and target.TimeToDie() >30 and RipRatio() >=92
   {
      #natures_swiftness,if=enabled&buff.dream_of_cenarius_damage.down&buff.predatory_swiftness.down&combo_points>=5&$(rip_ratio)>=0.92&target.time_to_die>30
      if TalentPoints(NATURES_SWIFTNESS_TALENT) and BuffExpires(DREAM_OF_CENARIUS_DAMAGE) and BuffExpires(PREDATORY_SWIFTNESS) Spell(NATURES_SWIFTNESS)
       
      #rip,if=combo_points>=5&$(rip_ratio)>=1.15&target.time_to_die>30
      if RipRatio() >= 115 Spell(RIP)
   }
   
   #rip,if=combo_points>=5&target.time_to_die>=6&dot.rip.remains<2&buff.dream_of_cenarius_damage.up
   if target.TimeToDie() >=6 and ComboPoints() >=5 and target.DebuffRemains(RIP) <2 and BuffPresent(DREAM_OF_CENARIUS_DAMAGE) Spell(RIP)
   
   #rip,if=combo_points>=5&target.time_to_die>=6&dot.rip.remains<6.0&buff.dream_of_cenarius_damage.up&dot.rip.multiplier<=tick_multiplier
   if target.TimeToDie() >=6 and ComboPoints() >=5 and target.DebuffRemains(RIP) <6 and BuffPresent(DREAM_OF_CENARIUS_DAMAGE) and RipRatio() >=100 Spell(RIP)
   
   #natures_swiftness,if=buff.dream_of_cenarius_damage.down&buff.predatory_swiftness.down&combo_points>=5&dot.rip.remains<3&(buff.berserk.up|dot.rip.remains+1.9<=cooldown.tigers_fury.remains)
   if TalentPoints(NATURES_SWIFTNESS_TALENT) and BuffExpires(DREAM_OF_CENARIUS_DAMAGE)
      and BuffExpires(PREDATORY_SWIFTNESS) and ComboPoints() >=5 and target.DebuffRemains(RIP) <3
   {
      Spell(NATURES_SWIFTNESS)
   }
   
    #rip,if=combo_points>=5&target.time_to_die>=6&dot.rip.remains<2&(buff.berserk.up|dot.rip.remains+1.9<=cooldown.tigers_fury.remains)
    if target.TimeToDie() >=6 and ComboPoints() >=5 and target.DebuffRemains(RIP) <2
    {
        Spell(RIP)
    }
}

AddFunction NonDocRipLogic # If any changes are applicable to Doc logic, also make changes there!!!
{
   #rip,if=combo_points>=5&$(rip_ratio)>=1.15&target.time_to_die>30
   #rip,if=combo_points>=5&target.time_to_die>=6&dot.rip.remains<2&(buff.berserk.up|dot.rip.remains+1.9<=cooldown.tigers_fury.remains)
   if {target.HealthPercent() >25 and ComboPoints() >=5 and target.TimeToDie() >30 and RipRatio() >= 115} or {target.TimeToDie() >=6 and ComboPoints() >=5 and target.DebuffRemains(RIP) <2}
      Spell(RIP)
}

AddFunction SavageRoarRefreshLogic
{
    #savage_roar,if=buff.savage_roar.remains<=3&combo_points>0&buff.savage_roar.remains+2>dot.rip.remains
    if BuffRemains(SAVAGE_ROAR) <=3 and ComboPoints() >0 and {BuffRemains(SAVAGE_ROAR) +2 > target.DebuffRemains(RIP)} SavageRoar()
   
    #savage_roar,if=buff.savage_roar.remains<=6&combo_points>=5&buff.savage_roar.remains+2<=dot.rip.remains
    if BuffRemains(SAVAGE_ROAR) <=6 and ComboPoints() >=5 and {BuffRemains(SAVAGE_ROAR) +2 <= target.DebuffRemains(RIP)} SavageRoar()
}

AddFunction NonExcuteRangeFerociuosBiteLogic
{
    #actions.doc+=/pool_resource,wait=0.1,if=combo_points>=5&((energy<50&buff.berserk.down)|(energy<25&buff.berserk.remains>1))&dot.rip.ticking&!(dot.rip.remains-2<=energy.time_to_max-1)&!(buff.savage_roar.remains-3<=energy.time_to_max-1)
    #actions.doc+=/ferocious_bite,if=combo_points>=5&dot.rip.ticking&!(dot.rip.remains-2<=energy.time_to_max-1)&!(buff.savage_roar.remains-3<=energy.time_to_max-1)&!((buff.savage_roar.remains-6<=energy.time_to_max-1)&buff.savage_roar.remains+2<=$(rip_remains))
    if ComboPoints() >=5 and target.DebuffPresent(RIP) and BuffPresent(SAVAGE_ROAR)
    and not target.DebuffRemains(RIP)-2 <= TimeToMaxEnergy()-1
    and not BuffRemains(SAVAGE_ROAR)-3 <= TimeToMaxEnergy()-1
    and not {BuffRemains(SAVAGE_ROAR)-6 <= TimeToMaxEnergy()-1
        and BuffRemains(SAVAGE_ROAR)+2 <= target.DebuffRemains(RIP)}
    and target.DebuffRemains(RIP) >=5
    {
        unless Energy() >= EnergyForFerociousBite() SpareGcdCooldowns()
        wait if Energy() >= EnergyForFerociousBite() Spell(FEROCIOUS_BITE)
    }
}

AddFunction RakeLogic
{
    if target.TimeToDie() - target.DebuffRemains(RAKE) >3
    {
      #rake,if=buff.rune_of_reorigination.up&dot.rake.remains<9&(buff.rune_of_reorigination.remains<=1.5)
      if BuffPresent(ROR_MASTERY) and target.DebuffRemains(RAKE) <9 and BuffRemains(ROR_MASTERY) <=1.5 and TimeTilEnergyForRake() + ExpiringBuffSafetyMargin() < BuffRemains(ROR_MASTERY)
         Spell(RAKE)
         
      #rake,if=(tick_damage-tick_dmg)*5+tick_damage>action.mangle_cat.hit_damage
      if FutureRakeTickDamage()*6 - LastRakeTickDamage()*5 >= MangleCatDamage()
         Spell(RAKE)
         
      #rake,if=target.time_to_die-dot.rake.remains>3&dot.rake.remains<3.0&(buff.berserk.up|(cooldown.tigers_fury.remains+0.8)>=dot.rake.remains|energy>60)
      if {Energy() < EnergyForRake() and target.DebuffRemains(RAKE) < 3 + TimeTilEnergyForRake()}
         or target.DebuffRemains(RAKE) < 3
         Spell(RAKE)
   }
   unless target.TimeToDie() - target.DebuffRemains(RAKE) >3
   {
      #rake,if=(tick_damage-tick_dmg)*5+tick_damage>action.mangle_cat.hit_damage
      if FutureRakeTickDamage()*{target.TimeToDie()/3+1} - LastRakeTickDamage()*target.TimeToDie()/3 >= MangleCatDamage()
         Spell(RAKE)
   }
}

AddFunction ThrashLogic
{
    #pool_resource,wait=0.25,for_next=1
    #thrash_cat,if=dot.thrash_cat.remains<3&target.time_to_die>=6&(dot.rip.remains>=4|buff.berserk.up)
   if {Energy() < EnergyForThrash() and target.DebuffRemains(THRASH_CAT) < {3 + TimeTilEnergyForThrash()}
      and target.TimeToDie() - TimeTilEnergyForThrash() >=9
      and {target.DebuffRemains(RIP) - TimeTilEnergyForThrash() >=4
         or BuffPresent(BERSERK_CAT)}}
   or {target.DebuffRemains(THRASH_CAT) < 3
      and target.TimeToDie() >=9
      and {target.DebuffRemains(RIP) >=4
         or BuffPresent(BERSERK_CAT)}}
    {
        if TimeTilEnergyForThrash() >=1.5 SpareGcdCooldowns()
        wait if Energy() >= EnergyForThrash() Spell(THRASH_CAT)
    }
}

# Feral rotation for talent builds with "Dream of Cenarius".

AddFunction FillerConditionsDoC
{
    #run_action_list,name=filler,if=buff.omen_of_clarity.react
    if BuffPresent(CLEARCASTING) FillerActions()
    #run_action_list,name=filler,if=(combo_points<5&dot.rip.remains<3)|(combo_points=0&buff.savage_roar.remains<2)
    if {ComboPoints() <5 and target.DebuffRemains(RIP) <3} or {ComboPoints() ==0 and BuffRemains(SAVAGE_ROAR) <2} FillerActions()
    #run_action_list,name=filler,if=buff.predatory_swiftness.remains>1
    if BuffRemains(PREDATORY_SWIFTNESS) >1 FillerActions()
    #run_action_list,name=filler,if=target.time_to_die<=8.5
    if target.TimeToDie() <=8.5 FillerActions()
    #run_action_list,name=filler,if=buff.tigers_fury.up|buff.berserk.up
    if BuffPresent(TIGERS_FURY) or BuffPresent(BERSERK_CAT) FillerActions()
    #run_action_list,name=filler,if=cooldown.tigers_fury.remains<=3
    if SpellCooldown(TIGERS_FURY) <=3 FillerActions()
    #run_action_list,name=filler,if=energy.time_to_max<=1
    if TimeToMaxEnergy() <=1 FillerActions()
}

AddFunction MainActionsDoC
{
    #healing_touch,if=buff.predatory_swiftness.up&buff.predatory_swiftness.remains<=1.5&buff.dream_of_cenarius_damage.down
    if BuffPresent(PREDATORY_SWIFTNESS) and BuffRemains(PREDATORY_SWIFTNESS) <=1.5 and BuffExpires(DREAM_OF_CENARIUS_DAMAGE) Spell(HEALING_TOUCH)
   
   SavageRoarOrWeakenedArmorMissing()
   
   #healing_touch,if=buff.predatory_swiftness.up&combo_points>=4&buff.dream_of_cenarius_damage.down
   if BuffPresent(PREDATORY_SWIFTNESS) and BuffExpires(DREAM_OF_CENARIUS_DAMAGE) and ComboPoints() >=4 Spell(HEALING_TOUCH)
   
   #healing_touch,if=buff.natures_swiftness.up
   if BuffPresent(NATURES_SWIFTNESS) Spell(HEALING_TOUCH)

   RangeCheck()
   
   IncarnationBerserkLogic()
   
   #Also includes Clearcasting Thrash and end of fight Ferocious Bite
   ExecuteRangeRipFerociousBiteLogic()
   
   DocRipLogic()
   
   SavageRoarRefreshLogic()
   
   NonExcuteRangeFerociuosBiteLogic()
   
   #rake,if=target.time_to_die-dot.rake.remains>3&dot.rake.remains<6.0&buff.dream_of_cenarius_damage.up&dot.rake.multiplier<=tick_multiplier
    if target.TimeToDie() - target.DebuffRemains(RAKE) >3 and target.DebuffRemains(RAKE) <6 and BuffPresent(DREAM_OF_CENARIUS_DAMAGE) and RakeRatio() >=100 Spell(RAKE)
   
   RakeLogic()

    ThrashLogic()
}

# Feral rotation for talent builds without "Dream of Cenarius".

AddFunction FillerConditionsNonDoC
{
    #run_action_list,name=filler,if=buff.omen_of_clarity.react
    if BuffPresent(CLEARCASTING) FillerActions()
    #run_action_list,name=filler,if=(combo_points<5&dot.rip.remains<3)|(combo_points=0&buff.savage_roar.remains<2)
    if {ComboPoints() <5 and target.DebuffRemains(RIP) <3} or {ComboPoints() ==0 and BuffRemains(SAVAGE_ROAR) <2} FillerActions()
    #run_action_list,name=filler,if=target.time_to_die<=8.5
    if target.TimeToDie() <=8.5 FillerActions()
    #run_action_list,name=filler,if=buff.tigers_fury.up|buff.berserk.up
    if BuffPresent(TIGERS_FURY) or BuffPresent(BERSERK_CAT) FillerActions()
    #run_action_list,name=filler,if=cooldown.tigers_fury.remains<=3
    if SpellCooldown(TIGERS_FURY) <=3 FillerActions()
    #run_action_list,name=filler,if=energy.time_to_max<=1
    if TimeToMaxEnergy() <=1 FillerActions()
   #run_action_list,name=filler,if=combo_points<5
   if TalentPoints(SOUL_OF_THE_FOREST_TALENT) and ComboPoints() <5 FillerActions()

}

AddFunction MainActionsNonDoC
{
   SavageRoarOrWeakenedArmorMissing()
   
   RangeCheck()
   
   #incarnation,if=energy<=35&!buff.omen_of_clarity.react&cooldown.tigers_fury.remains=0&cooldown.berserk.remains=0
    #use_item,name=eternal_blossom_grips,sync=tigers_fury
    #tigers_fury,if=(energy<=35&!buff.omen_of_clarity.react)|buff.king_of_the_jungle.up
    #berserk,if=buff.tigers_fury.up|(target.time_to_die<15&cooldown.tigers_fury.remains>6)
   IncarnationBerserkLogic()
   
   #Also includes Clearcasting Thrash and end of fight Ferocious Bite
   ExecuteRangeRipFerociousBiteLogic()
   
   NonDocRipLogic()
   
    SavageRoarRefreshLogic()
   
   NonExcuteRangeFerociuosBiteLogic()
   
   RakeLogic()
   
   ThrashLogic()
}

AddFunction Prediction
{
    if Stance(3)
   {
        if TalentPoints(DREAM_OF_CENARIUS_TALENT)
      {
            MainActionsDoC()
      }
        MainActionsNonDoC()
    }
    if Stance(1)
   {
        if BuffPresent(HEART_OF_THE_WILD) Spell(FRENZIED_REGEN)
         Spell(CAT_FORM)
    }
    if Stance(0)
   {
        if BuffPresent(HEART_OF_THE_WILD)
            if BuffExpires(HEART_OF_THE_WILD) Texture(spell_holy_blessingofagility)
        Spell(CAT_FORM)
    }
    if Stance(4) or Stance(2) Spell(CAT_FORM)
}

#####################
## Feral icons (Mastery=2) ##
#####################
AddIcon help=Rake size=small mastery=2 checkboxon=cooldownsRatio
{
    RakeRatio()
}

AddIcon help=Rip size=small mastery=2 checkboxon=cooldownsRatio
{
    RipRatio()
}

AddIcon help=cd size=small mastery=2 checkboxon=cooldownsL {
    if target.InRange(SKULL_BASH_CAT) Spell(SKULL_BASH_CAT)
    unless target.Classification(worldboss)
    {
        if TalentPoints(MIGHTY_BASH_TALENT) and target.InRange(MIGHTY_BASH) Spell(MIGHTY_BASH)
        if TalentPoints(TYPHOON_TALENT) and target.InRange(SKULL_BASH_CAT) Spell(TYPHOON)
        if ComboPoints() >0 and target.InRange(MAIM) Spell(MAIM)
    }
    Spell(WILD_CHARGE)
}

AddIcon help=cd size=small mastery=2 checkboxon=cooldownsL { # Berserk Icon
    if BuffPresent(TIGERS_FURY) Spell(BERSERK_CAT)
    if 0s before Spell(BERSERK_CAT) Texture(Ability_mount_polarbear_white)
}


# Predictive rotation
AddIcon help=predictive size=small mastery=2 checkboxon=altpredictive {
    Prediction()
}

AddIcon help=extraCD size=small mastery=2 checkboxon=altpredictive {   
    if TalentPoints(HEART_OF_THE_WILD_TALENT) Spell(HEART_OF_THE_WILD)
    if TalentPoints(DREAM_OF_CENARIUS_TALENT) {
        if TalentPoints(NATURES_SWIFTNESS_TALENT) Spell(NATURES_SWIFTNESS)
        if TalentPoints(CENARION_WARD_TALENT) Spell(CENARION_WARD)
        if TalentPoints(RENEWAL_TALENT) Spell(RENEWAL)
    }
    if TalentPoints(NATURES_VIGIL_TALENT) Spell(NATURES_VIGIL)
}

# Main rotation
AddIcon help=main mastery=2 {
    NotInCombat()
    if Stance(3)
   {
        if TalentPoints(DREAM_OF_CENARIUS_TALENT)
        {
            MainActionsDoC()
            FillerConditionsDoC()
            SpareGcdCooldowns()
        }
        MainActionsNonDoC()
        FillerConditionsNonDoC()
        SpareGcdCooldowns()
    }
    if Stance(1) {
        if BuffPresent(HEART_OF_THE_WILD) {
            if CheckBoxOff(bearaoe) BearMain()
            BearMainAOE()
        }
        unless BuffPresent(HEART_OF_THE_WILD) Spell(CAT_FORM)
    }
    if Stance(0) {
        if BuffPresent(HEART_OF_THE_WILD) {
            if CastTime(WRATH) <BuffRemains(HEART_OF_THE_WILD) Spell(WRATH)
            Spell(CAT_FORM)
        }
        Spell(CAT_FORM)
    }
    if Stance(4) or Stance(2) Spell(CAT_FORM)
}

# Predictive rotation
AddIcon help=predictive mastery=2 checkboxoff=predictive {
    Prediction()
}

AddIcon help=cd size=small mastery=2 checkboxon=cooldownsR { # Rake
    if BuffExpires(SAVAGE_ROAR) Texture(ability_druid_skinteeth)
}
AddIcon help=cd size=small mastery=2 checkboxon=cooldownsR { # Rip
    if TargetDebuffExpires(RIP) Texture(ability_ghoulfrenzy)
}
AddIcon help=cd size=small mastery=2 checkboxon=cooldownsR { # Rake
    if TargetDebuffExpires(RAKE) Texture(ability_druid_disembowel)
}
AddIcon help=cd size=small mastery=2 checkboxon=cooldownsR {
    Spell(TIGERS_FURY)
}
################################
## Guardian rotation functions (Mastery=3) ##
################################

AddFunction BearMain {
    if Threat() <100 and target.DebuffPresent(LACERATE) and target.DebuffRemains(LACERATE) <2 Spell(LACERATE)
    if Threat() <100 and BuffPresent(INCARNATION_BEAR) and target.DebuffRemains(THRASH_BEAR) <2 Spell(THRASH_BEAR)
   
    Spell(MANGLE_BEAR)
   
   
    # Debuff maintenance.
    if target.DebuffRemains(WEAKENED_BLOWS 3 any=1) <=3 Spell(THRASH_BEAR)
    if target.DebuffRemains(WEAKENED_ARMOR 3 any=1) <=3 or target.DebuffStacks(WEAKENED_ARMOR any=1) <3
    {
        FaerieFire()
    }
   
    Spell(LACERATE)
    if target.DebuffPresent(THRASH_BEAR 6) FaerieFire()
    Spell(THRASH_BEAR)
}

AddFunction BearMainAOE {
    Spell(MANGLE_BEAR)
    Spell(THRASH_BEAR)
    Spell(SWIPE_BEAR)
}

#######################
## Guardian icons (Mastery=3) ##
#######################

AddIcon help=Rake size=small mastery=3 checkboxon=cooldownsRatio
{
    # Offset the guardian icons if the user has bleed ratios enabled
}

AddIcon help=Rip size=small mastery=3 checkboxon=cooldownsRatio
{
    # Offset the guardian icons if the user has bleed ratios enabled
}

AddIcon help=cd size=small mastery=3 checkboxon=cooldownsL {
    Spell(BARKSKIN)
}

AddIcon help=cd size=small mastery=3 checkboxon=cooldownsL {
    if TalentPoints(NATURES_SWIFTNESS_TALENT) Spell(NATURES_SWIFTNESS)
    if TalentPoints(RENEWAL_TALENT) Spell(RENEWAL)
    if TalentPoints(CENARION_WARD_TALENT) Spell(CENARION_WARD)
}

AddIcon mastery=3 size=small checkboxon=altpredictive checkboxoff=cooldownsL {
    if Rage(less 11) Spell(ENRAGE useable=1)
    Spell(SAVAGE_DEFENSE usable=1)
    Spell(FRENZIED_REGEN)
}

AddIcon mastery=3 size=small checkboxon=altpredictive checkboxoff=cooldownsL {
    if BuffPresent(TOOTH_AND_CLAW) and target.DebuffExpires(TOOTH_AND_CLAW_DEBUFF) Spell(TOOTH_AND_CLAW)
    Spell(MAUL)
}

# Main rotation
AddIcon help=main mastery=3 {
    if InCombat(no) and BuffRemains(str_agi_int any=1) <400 Spell(MARK_OF_THE_WILD)
    unless Stance(1) Spell(BEAR_FORM)
   
    if CheckBoxOff(bearaoe) BearMain()
    BearMainAOE()
}

AddIcon help=defense mastery=3 checkboxoff=altpredictive {
    if Rage(less 11) Spell(ENRAGE useable=1)
    Spell(SAVAGE_DEFENSE usable=1)
    Spell(FRENZIED_REGEN)
}

AddIcon help=cd size=small mastery=3 checkboxon=cooldownsR {
    Spell(SURVIVAL_INSTINCTS)
}

AddIcon help=cd size=small mastery=3 checkboxon=cooldownsR {
    Spell(MIGHT_OF_URSOC)
}

AddIcon help=cd size=small mastery=3 checkboxon=cooldownsR {
    if TalentPoints(INCARNATION_TALENT) Spell(INCARNATION_BEAR)
    if TalentPoints(FORCE_OF_NATURE_TALENT) Spell(FORCE_OF_NATURE)
}

AddIcon help=cd size=small mastery=3 checkboxon=cooldownsR {
    Spell(BERSERK_BEAR)
}


First a disclaimer, This script is VERY CPU intensive (something like 4-5x the processing time of current leafkiller's script); even on target dummies it pretty much murders my frame rates from like 60 to 30 at its peak (more buffs you have proc'd the more CPU intensive it is). Just wanted everyone to be aware of this. That said this version does seem to be slightly faster than the 5.3.2 script now that I've optimized it a bit by removing duplicate calls (if X unless X logic was unnecessary as functions will return as soon as they get a valid value). EDIT: Jeshu said he fixed the throttling functionality in ovale. It was updating every frame instead of every 10th of a second OR when something happened (which acutally isn't very often so mostly every 10th of a second). Has a pretty decent impact on the performance of the script (I changed mine internally, probably not the proper way but it works enough) but hopefully 5.3.7 will come out soon. :)

Now, onto the features:

Buff prediction now supports all current tier trinkets (currently assumes 2/2 upgrade for all trinkets until Jeshu adds the ability to detect ilvl; all new trinkets are currently untested as I only have my two which were in the previous script).
Changed rune buff prediction to assume a 2:1 ratio (instead of being in the main script, there were some bugs with that; while not 100% accurate should still give accurate predictions if not a perfectly accurate ratio).
Armor now assumes level 92 unless its a boss level, weakened armor is all or nothing (no stack based; this is all done to improve performance)
Enabled the if RipRatio >= 115 then apply a new rip all the time instead of just under rune conditions.
Changed Rake to be based on damage done instead of a ratio (so for example a slightly under 100 ratio Rake under rune is still a dps up to keep raking).
Rake will now also be used on mobs about to die if its still a DPS up (like when rake hits harder than mangle; before wouldn't do it if the rake dot outlasted the mob).
Resplit DoC and non-doc (mostly for performance reasons, though was likely pretty minor; bulk of the calculations are for the buff prediction stuff).

Might be a bug or two as I haven't tested it quite as much as I wanted, let me know (especially with other trinkets).

Probably last update for a bit as I got everything in it I wanted essentially. Also gonna see what'd it take to get added to nernian's addon so updating is easier and everyone doesn't have to copy/paste from here.

EDIT: Couple of minor bug fixes, please recopy.
Last edited by ShmooDude on Tue Jul 16, 2013 6:45 pm, edited 2 times in total.

Honored
Posts: 65
Joined: Tue Jul 16, 2013 12:58 pm

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Postby bacevicius » Tue Jul 16, 2013 1:06 pm

agixx, I know you are the one adding code etc to leafkiller however , I know nothing about code and or where to put stuff, I have ovale 5.3.6 and the most recent update from curse... I am still getting sometimes 7 rake spam recommendations even when I have 5 CP and a rip should be applied .. I do have RoR 530 lvl. however the rake spam was happening even before that trinket . Also sometimes there will be nothing proc'd and it wants me to rake way past 5 CP when I could have bitten and or ripped. also the new leafkiller automatically wants you to rip the minute it sees the ROR proc along with rake spam? I thought you were supposed to rip on 5 CP would a 2 CP rip really outdo a 5 one with the ROR buff . also I have noticed that with all the rake spamming my dps has actually gone down with the trinket and I do track it and do what the script says. I replaced bad juju with it and kept the TF renataki which is what is with my ROR now . can you please tell me is this going to be fixed. I just cant find a reason to spam rake sometimes 6 to 7 times in a row with 5 CP waiting ror buff or not/// that just dosent make sense when shred should be in there. Thanks for letting me reply
Bacevicius, Undermine

Revered
Posts: 378
Joined: Tue Feb 08, 2011 5:51 pm

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Postby ShmooDude » Tue Jul 16, 2013 1:22 pm

bacevicius wrote:I have ovale 5.3.6...


5.3.6 has some bugs in it, revert to 5.3.2 and it will fix your problems until the bugs are fixed (either in the script by moving to some of the new functions which aren't broken or by a new ovale release, I got strong hopes 5.3.7 will be a stable release).

Honored
Posts: 51
Joined: Wed May 25, 2011 3:12 pm

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Postby Kihrawr » Tue Jul 16, 2013 2:05 pm

ShmooDude wrote:EDIT: Jeshu said he fixed the throttling functionality in ovale. It was updating every frame instead of every 10th of a second OR when something happened (which acutally isn't very often so mostly every 10th of a second). Has a pretty decent impact on the performance of the script (I changed mine internally, probably not the proper way but it works enough) but hopefully 5.3.7 will come out soon. :)


Where do we patch the throttling in Ovale to fix it? I want to fix my local copy.

Honored
Posts: 65
Joined: Tue Jul 16, 2013 12:58 pm

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Postby bacevicius » Tue Jul 16, 2013 2:51 pm

Thanks . so I can uninstall 53.6 and put back ovale 5.3.2 and keep the new 5.3.6 scripts theve made right?

Revered
Posts: 378
Joined: Tue Feb 08, 2011 5:51 pm

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Postby ShmooDude » Tue Jul 16, 2013 3:22 pm

Kihrawr wrote:
ShmooDude wrote:EDIT: Jeshu said he fixed the throttling functionality in ovale. It was updating every frame instead of every 10th of a second OR when something happened (which acutally isn't very often so mostly every 10th of a second). Has a pretty decent impact on the performance of the script (I changed mine internally, probably not the proper way but it works enough) but hopefully 5.3.7 will come out soon. :)


Where do we patch the throttling in Ovale to fix it? I want to fix my local copy.


idk how Jeshu fixed it, I tried a bunch of stuff for the built in code and couldn't get it to work, lol.

I did this:

At the very top of the OnUpdate() function in OvaleFrame.lua
Code: Select all
      local curTime = API_GetTime()
      local preTime = Ovale.now
      if (curTime - 0.1 > preTime) or next(Ovale.refreshNeeded) then


Don't forget to add the corresponding end just before the end of the OnUpdate() function. I tried it with return but couldn't get that to work for some reason, its very weird.

EDIT: A couple of bug fixes have been made to my script, please recopy if you copied it before 7/16 at ~4:03 PM Eastern

Revered
Posts: 378
Joined: Tue Feb 08, 2011 5:51 pm

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Postby ShmooDude » Wed Jul 17, 2013 4:04 am

Question for those using my script.

I'm encountering a weird bug where ovale is forgetting about the stats for Rip in the target.Debuff functions. Question is, is anyone else getting this bug (you'll notice cause the Rip ratio goes into the thousands) and if so where? I've only ever encountered it in raids (never happens on target dummies on which I do *extensive* testing) but seeing as I don't really do a whole lot of other content I can't be certain its not occurring elsewhere.

If you are encountering this bug, could you please post here with your group makeup (since I never see it solo, its almost gotta be something to do with that)?

Posts: 28
Joined: Sun Jan 13, 2013 12:11 pm

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Postby Spanja » Wed Jul 17, 2013 1:25 pm

I have a random error with your script, I haven't find the cause yet :

Spoiler: show
Message: Interface\AddOns\Ovale\Ovale.lua:81: script ran too long
Time: 07/17/13 19:17:15
Count: 1
Stack: [C]: ?
Interface\AddOns\Ovale\Ovale.lua:81: in function <Interface\AddOns\Ovale\Ovale.lua:78>
Interface\AddOns\Ovale\Ovale.lua:354: in function `Logf'
Interface\AddOns\Ovale\OvaleBestAction.lua:316: in function <Interface\AddOns\Ovale\OvaleBestAction.lua:312>
(tail call): ?
Interface\AddOns\Ovale\OvaleBestAction.lua:125: in function <Interface\AddOns\Ovale\OvaleBestAction.lua:111>
(tail call): ?
Interface\AddOns\Ovale\OvaleBestAction.lua:323: in function <Interface\AddOns\Ovale\OvaleBestAction.lua:312>
(tail call): ?
Interface\AddOns\Ovale\OvaleBestAction.lua:440: in function <Interface\AddOns\Ovale\OvaleBestAction.lua:437>
(tail call): ?
Interface\AddOns\Ovale\OvaleBestAction.lua:440: in function <Interface\AddOns\Ovale\OvaleBestAction.lua:437>
...
Interface\AddOns\Ovale\OvaleBestAction.lua:323: in function <Interface\AddOns\Ovale\OvaleBestAction.lua:312>
(tail call): ?
Interface\AddOns\Ovale\OvaleBestAction.lua:125: in function <Interface\AddOns\Ovale\OvaleBestAction.lua:111>
(tail call): ?
Interface\AddOns\Ovale\OvaleBestAction.lua:323: in function <Interface\AddOns\Ovale\OvaleBestAction.lua:312>
(tail call): ?
(tail call): ?
(tail call): ?
Interface\AddOns\Ovale\OvaleFrame.lua:184: in function `OnUpdate'
Interface\AddOns\Ovale\OvaleFrame.lua:82: in function <Interface\AddOns\Ovale\OvaleFrame.lua:81>

Locals:


And in combat before the LUA error, I get a log spam from Ovale which drops my fps to 3~4 :

Spoiler: show
Ovale: GetAura: aura 106830 not found on target filter=HARMFUL mine=true
Ovale: Condition debuffremains(1=106830,target=target,filter=debuff,) returned 0, nil, 0, 0, 0
Ovale: value 3
Ovale: 0.000000+(t-0.000000)*0.000000 < 3.000000+(t-0.000000)*0.000000
Ovale: target = nil, health = 0, maxHealth = 0
Ovale: Condition timetodie(target=target,) returned 0, nil, 0, 29627.518, -1
Ovale: value 9
Ovale: 0.000000+(t-29627.518000)*-1.000000 >= 9.000000+(t-0.000000)*0.000000
Ovale: and return 0, 29618.518 [1104]
Ovale: Condition combopoints() returned 0, nil, 0, 0, 0
Ovale: value 5
Ovale: 0.000000+(t-0.000000)*0.000000 >= 5.000000+(t-0.000000)*0.000000
Ovale: and return nil [1111]
Ovale: if return nil [1114]
Ovale: if [1115]
Ovale: Condition talentpoints(1=11,) returned 0, nil, 0, 0, 0
Ovale: if return nil [1115]
Ovale: if [1122]
Ovale: or
Ovale: Condition talentpoints(1=11,) returned 0, nil, 0, 0, 0
Ovale: Aura 102543 not found in state for 0x0380000002B831C9
Ovale: GetAura: aura 102543 not found on player filter=HELPFUL mine=true
Ovale: timeBefore = 0, ending = 0
Ovale: Condition buffexpires(1=102543,filter=buff,) returned 0, nil, nil, nil, nil
Ovale: group [1121]
Ovale: if [1120]
Ovale: and [1119]
Ovale: or
Ovale: or
Ovale: Aura 135700 not found in state for 0x0380000002B831C9
Ovale: GetAura: aura 135700 not found on player filter=HELPFUL mine=true
Ovale: Condition buffpresent(1=135700,filter=buff,) returned nil, nil, nil, nil, nil
Ovale: Aura 106951 not found in state for 0x0380000002B831C9
Ovale: GetAura: aura 106951 not found on player filter=HELPFUL mine=true
Ovale: Condition buffpresent(1=106951,filter=buff,) returned nil, nil, nil, nil, nil
Ovale: Condition energyregen() returned 0, nil, 11.939790344238, 0, 0
Ovale: value 15
Ovale: 11.939790+(t-0.000000)*0.000000 >= 15.000000+(t-0.000000)*0.000000
Ovale: and return nil [1119]
Ovale: if return nil [1120]
Ovale: start=29627.518000 attenteFinCast=29627.518 [1093]
Ovale: Action 33876 can start at 29627.518000
Ovale: group best action 33876 remains 29627.518, nil [1121]
Ovale: if return 29627.518, nil [1122]
Ovale: group best action 33876 remains 29627.518, nil [1123]
Ovale: if return 29627.518, nil [1713]
Ovale: group best action 33876 remains 29627.518, nil [1718]
Ovale: group [1128]
Ovale: if [1127]
Ovale: Condition talentpoints(1=12,) returned 0, nil, 0, 0, 0
Ovale: if return nil [1127]
Ovale: group best action 770 remains 29627.518, nil [1875]
Ovale: if return 29627.518, nil [1878]
Ovale: if [1883]
Ovale: Condition stance(1=1,) returned nil, nil, nil, nil, nil
Ovale: if return nil [1883]
Ovale: if [1884]
Ovale: Condition stance(1=0,) returned nil, nil, nil, nil, nil


This happened too with old 5.3.6 version of your script.

Revered
Posts: 378
Joined: Tue Feb 08, 2011 5:51 pm

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Postby ShmooDude » Wed Jul 17, 2013 2:11 pm

Spanja wrote:I have a random error with your script, I haven't find the cause yet :

Spoiler: show
Message: Interface\AddOns\Ovale\Ovale.lua:81: script ran too long
Time: 07/17/13 19:17:15
Count: 1
Stack: [C]: ?
Interface\AddOns\Ovale\Ovale.lua:81: in function <Interface\AddOns\Ovale\Ovale.lua:78>
Interface\AddOns\Ovale\Ovale.lua:354: in function `Logf'
Interface\AddOns\Ovale\OvaleBestAction.lua:316: in function <Interface\AddOns\Ovale\OvaleBestAction.lua:312>
(tail call): ?
Interface\AddOns\Ovale\OvaleBestAction.lua:125: in function <Interface\AddOns\Ovale\OvaleBestAction.lua:111>
(tail call): ?
Interface\AddOns\Ovale\OvaleBestAction.lua:323: in function <Interface\AddOns\Ovale\OvaleBestAction.lua:312>
(tail call): ?
Interface\AddOns\Ovale\OvaleBestAction.lua:440: in function <Interface\AddOns\Ovale\OvaleBestAction.lua:437>
(tail call): ?
Interface\AddOns\Ovale\OvaleBestAction.lua:440: in function <Interface\AddOns\Ovale\OvaleBestAction.lua:437>
...
Interface\AddOns\Ovale\OvaleBestAction.lua:323: in function <Interface\AddOns\Ovale\OvaleBestAction.lua:312>
(tail call): ?
Interface\AddOns\Ovale\OvaleBestAction.lua:125: in function <Interface\AddOns\Ovale\OvaleBestAction.lua:111>
(tail call): ?
Interface\AddOns\Ovale\OvaleBestAction.lua:323: in function <Interface\AddOns\Ovale\OvaleBestAction.lua:312>
(tail call): ?
(tail call): ?
(tail call): ?
Interface\AddOns\Ovale\OvaleFrame.lua:184: in function `OnUpdate'
Interface\AddOns\Ovale\OvaleFrame.lua:82: in function <Interface\AddOns\Ovale\OvaleFrame.lua:81>

Locals:


And in combat before the LUA error, I get a log spam from Ovale which drops my fps to 3~4 :

Spoiler: show
Ovale: GetAura: aura 106830 not found on target filter=HARMFUL mine=true
Ovale: Condition debuffremains(1=106830,target=target,filter=debuff,) returned 0, nil, 0, 0, 0
Ovale: value 3
Ovale: 0.000000+(t-0.000000)*0.000000 < 3.000000+(t-0.000000)*0.000000
Ovale: target = nil, health = 0, maxHealth = 0
Ovale: Condition timetodie(target=target,) returned 0, nil, 0, 29627.518, -1
Ovale: value 9
Ovale: 0.000000+(t-29627.518000)*-1.000000 >= 9.000000+(t-0.000000)*0.000000
Ovale: and return 0, 29618.518 [1104]
Ovale: Condition combopoints() returned 0, nil, 0, 0, 0
Ovale: value 5
Ovale: 0.000000+(t-0.000000)*0.000000 >= 5.000000+(t-0.000000)*0.000000
Ovale: and return nil [1111]
Ovale: if return nil [1114]
Ovale: if [1115]
Ovale: Condition talentpoints(1=11,) returned 0, nil, 0, 0, 0
Ovale: if return nil [1115]
Ovale: if [1122]
Ovale: or
Ovale: Condition talentpoints(1=11,) returned 0, nil, 0, 0, 0
Ovale: Aura 102543 not found in state for 0x0380000002B831C9
Ovale: GetAura: aura 102543 not found on player filter=HELPFUL mine=true
Ovale: timeBefore = 0, ending = 0
Ovale: Condition buffexpires(1=102543,filter=buff,) returned 0, nil, nil, nil, nil
Ovale: group [1121]
Ovale: if [1120]
Ovale: and [1119]
Ovale: or
Ovale: or
Ovale: Aura 135700 not found in state for 0x0380000002B831C9
Ovale: GetAura: aura 135700 not found on player filter=HELPFUL mine=true
Ovale: Condition buffpresent(1=135700,filter=buff,) returned nil, nil, nil, nil, nil
Ovale: Aura 106951 not found in state for 0x0380000002B831C9
Ovale: GetAura: aura 106951 not found on player filter=HELPFUL mine=true
Ovale: Condition buffpresent(1=106951,filter=buff,) returned nil, nil, nil, nil, nil
Ovale: Condition energyregen() returned 0, nil, 11.939790344238, 0, 0
Ovale: value 15
Ovale: 11.939790+(t-0.000000)*0.000000 >= 15.000000+(t-0.000000)*0.000000
Ovale: and return nil [1119]
Ovale: if return nil [1120]
Ovale: start=29627.518000 attenteFinCast=29627.518 [1093]
Ovale: Action 33876 can start at 29627.518000
Ovale: group best action 33876 remains 29627.518, nil [1121]
Ovale: if return 29627.518, nil [1122]
Ovale: group best action 33876 remains 29627.518, nil [1123]
Ovale: if return 29627.518, nil [1713]
Ovale: group best action 33876 remains 29627.518, nil [1718]
Ovale: group [1128]
Ovale: if [1127]
Ovale: Condition talentpoints(1=12,) returned 0, nil, 0, 0, 0
Ovale: if return nil [1127]
Ovale: group best action 770 remains 29627.518, nil [1875]
Ovale: if return 29627.518, nil [1878]
Ovale: if [1883]
Ovale: Condition stance(1=1,) returned nil, nil, nil, nil, nil
Ovale: if return nil [1883]
Ovale: if [1884]
Ovale: Condition stance(1=0,) returned nil, nil, nil, nil, nil


This happened too with old 5.3.6 version of your script.


For the first, I believe that's bliz saying that ovale took too much CPU time and thus stopped it (its capped at like 300ms per run or something?). However it still functions fine despite that error happening occasionally.
The second (which I experienced once over ~4 hours) I'm not really sure how to parse, maybe jeshu could help.

Chances are it may just be that the script is trying to do too much and I'll have to cut it down to the bare minimum or find a different logic that's less CPU intensive.

Posts: 28
Joined: Sun Jan 13, 2013 12:11 pm

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Postby Spanja » Thu Jul 18, 2013 5:00 am

That should be an Ovale problem because I just got the same error "script ran too long" with Nerien Balance script, which I didn't get before Ovale 5.3.6 version.

Posts: 2
Joined: Thu Jul 18, 2013 2:38 pm

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Postby green312 » Thu Jul 18, 2013 2:46 pm

Hello,
I have a problem with this script: everytime I have ff and tigers fury up it shows rake. Even if the bleed is already active. Im not sure if this is the right place to ask for my problem, sorry if not.

EDIT: Nevermind, problem was the new ovale version as said before.
But now there is another problem, its recomending Mangle even if Im standing behind the target. Is there any way to turn this off?

Honored
Posts: 97
Joined: Thu Mar 14, 2013 9:29 am

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Postby Paloro » Thu Jul 18, 2013 3:13 pm

Mangle is actually the better cp generator outside of Berserk and TF.
Image

Posts: 2
Joined: Thu Jul 18, 2013 2:38 pm

Re: Leafkiller's MoP Feral/Guardian Ovale Script

Postby green312 » Thu Jul 18, 2013 3:48 pm

Paloro wrote:Mangle is actually the better cp generator outside of Berserk and TF.


Ah ok thanks, noxxic wasnt saying anything about that.

PreviousNext

Return to Kitty DPS

Who is online

Users browsing this forum: Dandeleon, Eddybull, Google [Bot] and 5 guests