Allow for melee haste to affect the GCD between melee specials.
Johnny C. Lam [04-05-13 - 06:20]
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
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