From 22f473b54d3ce0361ea36fba6291ee65183e0777 Mon Sep 17 00:00:00 2001 From: Parnic Date: Tue, 13 Oct 2020 21:59:44 -0500 Subject: [PATCH] Fix SnD for 9.0, add support for Deeper Stratagem talent There's still some situations where refreshing SnD can give a much longer buff than expected...I'm not sure what those conditions are, though. --- modules/SliceAndDice.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/modules/SliceAndDice.lua b/modules/SliceAndDice.lua index dce3f69..a3d4401 100644 --- a/modules/SliceAndDice.lua +++ b/modules/SliceAndDice.lua @@ -20,6 +20,7 @@ local impSndBonusPerRank = 0.25 local maxComboPoints = 5 local sndEndTime = 0 local sndDuration = 0 +local sixComboPointsTalentID = 19240 local CurrMaxSnDDuration = 0 local PotentialSnDDuration = 0 @@ -66,6 +67,11 @@ function SliceAndDice.prototype:Enable(core) self:RegisterEvent(IceHUD.UnitPowerEvent, "ComboPointsChanged") end + if IceHUD.WowVer >= 70000 then + self:RegisterEvent("PLAYER_TALENT_UPDATE", "CheckMaxComboPoints") + self:CheckMaxComboPoints() + end + if not self.moduleSettings.alwaysFullAlpha then self:Show(false) else @@ -75,6 +81,11 @@ function SliceAndDice.prototype:Enable(core) self:SetBottomText1("") end +function SliceAndDice.prototype:CheckMaxComboPoints() + local talentID, name, texture, selected, available, spellID, unknown, row, column, known, grantedByAura = GetTalentInfoByID(sixComboPointsTalentID, GetActiveSpecGroup()) + maxComboPoints = selected and 6 or 5 +end + function SliceAndDice.prototype:Disable(core) SliceAndDice.super.prototype.Disable(self, core) end @@ -270,6 +281,10 @@ local function HasSpell(id) end local function ShouldHide() + if IceHUD.WowVer >= 90000 then + return false + end + return --[[(IceHUD.WowVer < 70000 or not IsSpellKnown(193316)) and]] not IsPlayerSpell(5171) -- IsSpellKnown returns incorrect info for SnD in 7.0 -- commented code is here in case we decide we'd like to use this module for Roll the Bones. -- if we do, though, the "active" check gets way more complicated since it can activate any number of 6 different abilities