From cb3aa4e6d690abfdcd9b8a4db9422848d9bcb0dd Mon Sep 17 00:00:00 2001 From: "Johnny C. Lam" Date: Thu, 15 May 2014 23:18:47 +0000 Subject: [PATCH] Add new parameter "buff_runes_none" for buffs that remove rune costs. git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@1451 d5049fe3-3747-40f7-a4b5-f36d6801af5f --- OvaleBestAction.lua | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/OvaleBestAction.lua b/OvaleBestAction.lua index 5542521..7a7ed8c 100644 --- a/OvaleBestAction.lua +++ b/OvaleBestAction.lua @@ -790,9 +790,20 @@ function OvaleBestAction:GetActionInfo(element, state) if si.blood or si.frost or si.unholy or si.death then -- Spell requires runes. - local runecd = state.currentTime + state:GetRunesCooldown(si.blood, si.unholy, si.frost, si.death, false) - if runecd > actionCooldownStart + actionCooldownDuration then - actionCooldownDuration = runecd - actionCooldownStart + local needRunes = true + -- "buff_runes_none" is the spell ID of the buff that makes casting the spell cost no runes. + local buffNoRunes = si.buff_runes_none + if buffNoRunes then + local aura = state:GetAura("player", buffNoRunes) + if state:IsActiveAura(aura) then + needRunes = false + end + end + if needRunes then + local ending = state.currentTime + state:GetRunesCooldown(si.blood, si.unholy, si.frost, si.death, false) + if ending > actionCooldownStart + actionCooldownDuration then + actionCooldownDuration = ending - actionCooldownStart + end end end end -- 1.7.9.5