From eec2160a7fea02dace3fb3ca4592bf884add7260 Mon Sep 17 00:00:00 2001 From: "Johnny C. Lam" Date: Fri, 5 Apr 2013 06:21:02 +0000 Subject: [PATCH] Handle new SpellInfo parameter "cd_haste". A spell whose cooldown is affected by haste effects can be tagged with "cd_haste=melee" or "cd_haste=spell". git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@893 d5049fe3-3747-40f7-a4b5-f36d6801af5f --- OvaleState.lua | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/OvaleState.lua b/OvaleState.lua index fa5d2f1..c9a2b3f 100644 --- a/OvaleState.lua +++ b/OvaleState.lua @@ -346,6 +346,13 @@ function OvaleState:ApplySpell(spellId, startCast, endCast, nextCast, nocd, targ end end end + if cd.duration > 0 and si.cd_haste then + if si.cd_haste == "melee" then + cd.duration = cd.duration / OvalePaperDoll:GetMeleeHasteMultiplier() + elseif si.cd_haste == "spell" then + cd.duration = cd.duration / OvalePaperDoll:GetSpellHasteMultiplier() + end + end cd.enable = 1 if si.toggle then cd.toggled = 1 @@ -487,11 +494,11 @@ function OvaleState:GetCD(spellId) if not spellId then return nil end - - if OvaleData.spellInfo[spellId] and OvaleData.spellInfo[spellId].cd then + local si = OvaleData.spellInfo[spellId] + if si and si.cd then local cdname - if OvaleData.spellInfo[spellId].sharedcd then - cdname = OvaleData.spellInfo[spellId].sharedcd + if si.sharedcd then + cdname = si.sharedcd else cdname = spellId end -- 1.7.9.5