From 7b88f1d84cf58edf9bdacf934d2a6406af542d32 Mon Sep 17 00:00:00 2001 From: Kevin Lyles Date: Wed, 5 Sep 2012 22:16:03 -0500 Subject: [PATCH] Updated to new API for spec and talent information --- WeightsWatcher.lua | 37 ++++++++----------------------------- 1 file changed, 8 insertions(+), 29 deletions(-) diff --git a/WeightsWatcher.lua b/WeightsWatcher.lua index 2173320..9380086 100644 --- a/WeightsWatcher.lua +++ b/WeightsWatcher.lua @@ -522,42 +522,21 @@ function WeightsWatcher.Broken(dataType) end local function checkForTitansGrip() - if WeightsWatcher.player.class ~= "WARRIOR" then - return false - end - local name, _, _, _, rank = GetTalentInfo(2, 20, false, false) - if name == L["Titan's Grip"] then - return rank == 1 - end - -- Minor rearranging of the tree - for i = 1, GetNumTalents(2, false, false) do - name, _, _, _, rank = GetTalentInfo(2, i, false, false) - if name == L["Titan's Grip"] then - return rank == 1 - end - end - -- Major rearranging of the tree - for i = 1, GetNumTalentTabs(false, false) do - for j = 1, GetNumTalents(2, false, false) do - name, _, _, _, rank = GetNumTalents(i, j, false, false) - if name == L["Titan's Grip"] then - return rank == 1 - end - end + if class == "WARRIOR" then + return GetSpecialization() == 2 and WeightsWatcher.player.level >= 38 end return false end local function checkForDualWield() local class = WeightsWatcher.player.class - if class == "ROGUE" or class == "DEATHKNIGHT" then - return true - elseif class == "HUNTER" and UnitLevel("player") >= 20 then + if class == "ROGUE" or class == "DEATHKNIGHT" or class == "HUNTER" then return true - elseif class == "SHAMAN" then - return GetPrimaryTalentTree() == 2 - elseif class == "WARRIOR" then - return GetPrimaryTalentTree() == 2 + elseif class == "SHAMAN" or class == "WARRIOR" then + return GetSpecialization() == 2 + elseif class == "MONK" then + local spec = GetSpecialization() + return spec == 1 or spec == 3 end return false end -- 1.7.9.5