From e35853e2301ae6ea474a38c3c441dd337e73684e Mon Sep 17 00:00:00 2001 From: "Johnny C. Lam" Date: Fri, 5 Apr 2013 06:20:55 +0000 Subject: [PATCH] Allow for melee haste to affect the GCD between melee specials. This is primarily for paladins, for whom melee haste does this through Sanctity of Battle. Those spells for which Sanctity of Battle apply should be tagged with "haste=melee" in a SpellInfo line. git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@892 d5049fe3-3747-40f7-a4b5-f36d6801af5f --- OvaleData.lua | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/OvaleData.lua b/OvaleData.lua index 81c9b85..04acec2 100644 --- a/OvaleData.lua +++ b/OvaleData.lua @@ -500,19 +500,21 @@ end function OvaleData:GetGCD(spellId) if spellId and self.spellInfo[spellId] then - if self.spellInfo[spellId].haste == "spell" then - local cd = self.spellInfo[spellId].gcd - if not cd then - cd = 1.5 + local si = self.spellInfo[spellId] + if si.haste then + local cd = si.gcd or 1.5 + if si.haste == "melee" then + cd = cd / OvalePaperDoll:GetMeleeHasteMultiplier() + elseif si.haste == "spell" then + cd = cd / OvalePaperDoll:GetSpellHasteMultiplier() end - cd = cd / OvalePaperDoll:GetSpellHasteMultiplier() - if (cd<1) then + if cd < 1 then cd = 1 end return cd - elseif self.spellInfo[spellId].gcd then - return self.spellInfo[spellId].gcd - end + elseif si.gcd then + return si.gcd + end end -- Default value -- 1.7.9.5