From 1c1b15c01ca917e39e0351f31b8114278b528c66 Mon Sep 17 00:00:00 2001 From: Taracque Date: Tue, 28 Aug 2012 17:02:47 +0200 Subject: [PATCH] Updated talent detection. --- DKCrutch.lua | 41 ++++++++++++++++++----------------------- DKCrutch.toc | 4 ++-- 2 files changed, 20 insertions(+), 25 deletions(-) diff --git a/DKCrutch.lua b/DKCrutch.lua index 43e3d0f..d3c2e35 100755 --- a/DKCrutch.lua +++ b/DKCrutch.lua @@ -1,5 +1,5 @@ ------------------------------------------------------------------------------- --- DKCrutch 0.0.6 +-- DKCrutch 0.5.0 -- -- Death Knight rune tracker and ability advisor ------------------------------------------------------------------------------- @@ -8,7 +8,7 @@ DKCrutch = {Locals = {}} local L = DKCrutch.Locals -DKCrutch.versionNumber = '0.1.0' +DKCrutch.versionNumber = '0.5.0' DKCrutch.talent = "" DKCrutch.isEnabled = false DKCrutch.talentUnsure = true @@ -196,28 +196,23 @@ function DKCrutch.Options(msg) end function DKCrutch:detectTalent() - local _,_,_,_,unholy,_ = GetTalentTabInfo(3) - local _,_,_,_,frost,_ = GetTalentTabInfo(2) - local _,_,_,_,blood,_ = GetTalentTabInfo(1) - - if (unholy+blood+frost>0) then - if ((unholy>=blood) and (unholy>=frost)) then - if DKCrutch.talent ~= "unholy" then - DKCrutch.talent = "unholy" - end - end - if ((frost>=unholy) and (frost>=blood)) then - if DKCrutch.talent ~= "frost" then - DKCrutch.talent = "frost" - end - end - if ((blood>=unholy) and (blood>=frost)) then - DKCrutch.talent = "blood" - end - DKCrutch.talentUnsure = false - DKCrutch:adjustDeathTracker() - else + local spec = GetSpecialization() + + if (spec == 1) then + DKCrutch.talent = "blood" + end + if (spec == 2) then + DKCrutch.talent = "frost" + end + if (spec == 3) then + DKCrutch.talent = "unholy" + end + + if (spec == nil) then DKCrutch.talentUnsure = true + else + DKCrutch:adjustDeathTracker() + DKCrutch.talentUnsure = false end end diff --git a/DKCrutch.toc b/DKCrutch.toc index b55a5b6..cabf386 100755 --- a/DKCrutch.toc +++ b/DKCrutch.toc @@ -1,8 +1,8 @@ -## Interface: 40300 +## Interface: 50001 ## Title: DKCrutch ## Notes: Death Knight rune tracker and rotation helper ## Author: Taracque, Dšgrov‡s of Arathor -## Version: 0.1.0 +## Version: 0.5.0 ## SavedVariables: DKCrutchDB ## OptionalDeps: ## Dependencies: -- 1.7.9.5