From 96ddb014ee15349d7f28ac7e2912cb28ca5bdc4e Mon Sep 17 00:00:00 2001 From: Taracque Date: Wed, 15 Oct 2014 21:02:33 +0200 Subject: [PATCH] 6.0.0 compatible --- DKCrutch.lua | 80 +++++++++++----------------------------------------------- DKCrutch.toc | 4 +-- 2 files changed, 17 insertions(+), 67 deletions(-) diff --git a/DKCrutch.lua b/DKCrutch.lua index 5ce29af..2d35cf8 100755 --- a/DKCrutch.lua +++ b/DKCrutch.lua @@ -1,5 +1,5 @@ ------------------------------------------------------------------------------- --- DKCrutch 0.9.6 +-- DKCrutch 0.9.9 -- -- Death Knight rune tracker and ability advisor ------------------------------------------------------------------------------- @@ -8,7 +8,7 @@ DKCrutch = {Locals = {}} local L = DKCrutch.Locals -DKCrutch.versionNumber = '0.9.6' +DKCrutch.versionNumber = '0.9.9' DKCrutch.talent = "" DKCrutch.talentUnsure = true DKCrutch.DebugMode = false @@ -39,9 +39,6 @@ DKCrutch.SpellList = { ["Pillar of Frost"] = GetSpellInfo(51271), ["Frost Strike"] = GetSpellInfo(49143), ["Death Strike"] = GetSpellInfo(49998), - ["Rune Strike"] = GetSpellInfo(56815), - ["Heart Strike"] = GetSpellInfo(55050), - ["Blood Boil"] = GetSpellInfo(48721), ["Soul Reaper"] = GetSpellInfo(130736), -- talent specifig @@ -65,8 +62,8 @@ DKCrutch.SpellList = { ["Blood Charge"] = GetSpellInfo(114851), -- debuffs - ["Frost Fever"] = GetSpellInfo(59921), - ["Blood Plague"] = GetSpellInfo(59879) + ["Frost Fever"] = GetSpellInfo(55095), + ["Blood Plague"] = GetSpellInfo(55078) } DKCrutch.lastSpell = "" DKCrutch.lastProc = "" @@ -165,7 +162,7 @@ function DKCrutch.events.PLAYER_LOGIN() end function DKCrutch:SetSwingBarWidth(element, time, speed, maxwidth) - DKCrutch:Debug("SetSwingBarWidth" .. " t: " .. time .." s:" .. speed , maxwidth) + --DKCrutch:Debug("SetSwingBarWidth" .. " t: " .. time .." s:" .. speed , maxwidth) local width = ( time / speed * maxwidth ); if ( width < 1 ) then width = 1; @@ -214,7 +211,7 @@ function DKCrutch:ResetSwingFrame(element) end function DKCrutch.VanishFrame(element,elapsed) - DKCrutch:Debug("VanishFrame", elapsed) + --DKCrutch:Debug("VanishFrame", elapsed) if ( element.vanish > 0 ) then element.vanish = element.vanish - elapsed; if ( element.vanish <= 0 ) then @@ -472,6 +469,7 @@ end function DKCrutch:hasDeBuff(unit, spellName, casterUnit) local i = 1 + while true do local name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable = UnitDebuff(unit, i) if not name then @@ -593,6 +591,7 @@ function DKCrutch:AdviseAbility( hasTarget ) DKCrutch:detectTalent() end if (DKCrutch.talent == "unholy") then + DKCrutch:Debug("unholy", hasTarget) if (InCombatLockdown() and hasTarget) then -- show shadow infusion count or Dark Transformation CD if (not DKCrutchDB.procDisabled) then @@ -615,7 +614,7 @@ function DKCrutch:AdviseAbility( hasTarget ) end -- check pet status local cd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Raise Dead"]) - if (cd<=0) and (PetHasActionBar() ~= 1) and (not IsMounted()) then + if (cd<=0) and (not PetHasActionBar()) and (not IsMounted()) then return "Raise Dead" end end @@ -683,14 +682,6 @@ function DKCrutch:AdviseBloodAbility() bpExpiration = 0 end - -- Refresh diseases with Blood Boil if available - cd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Blood Boil"]) - if (cd) and (cd<=0) and (IsUsableSpell(DKCrutch.SpellList["Outbreak"], "target") == 1) then - if ( ( (ffExpiration - GetTime()) <5) or ( (bpExpiration - GetTime()) < 5) ) and ( ( (ffExpiration - GetTime()) > 1) and ( (bpExpiration - GetTime()) > 1) ) then - return "Blood Boil" - end - end - -- outbreak if frost fever or blood plague less than 2 sec remaining obcd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Outbreak"]) if (obcd) and (obcd<=0) and (IsSpellInRange(DKCrutch.SpellList["Outbreak"], "target") == 1) then @@ -738,21 +729,6 @@ function DKCrutch:AdviseBloodAbility() return "Death Strike" end - -- Heart Strike if available, and at least 1 blood runes is up - cd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Heart Strike"]) - if (cd) and (cd<=1) and (IsUsableSpell(DKCrutch.SpellList["Heart Strike"])) and (DKCrutch.runesUp[1]>=1) then - return "Heart Strike" - end - - -- Rune Strike if available - cd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Rune Strike"]) - if (cd) and (cd<=1) and (IsUsableSpell(DKCrutch.SpellList["Rune Strike"])) then - local _, _, _, cost = GetSpellInfo(DKCrutch.SpellList["Rune Strike"]) - if (UnitPower("player", 6) >= cost) then - return "Rune Strike" - end - end - return "" end @@ -877,12 +853,6 @@ function DKCrutch:AdviseFrostAbilityDW() -- Frost DK DualWield priority end end - -- Horn of Winter - cd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Horn of Winter"]) - if (cd) and (cd <= 1) then - return "Horn of Winter" - end - return "" end @@ -995,12 +965,6 @@ function DKCrutch:AdviseFrostAbility() return "Obliterate" end - -- Horn of Winter - cd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Horn of Winter"]) - if (cd) and (cd <= 1) then - return "Horn of Winter" - end - return "" end @@ -1011,10 +975,10 @@ function DKCrutch:AdviseUnholyAbility() -- raise dead if has no pet and raise dead is not on cd cd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Raise Dead"]) - if (cd<=0) and (PetHasActionBar() ~= 1) then + if (cd<=0) and (not PetHasActionBar()) then return "Raise Dead" end - + -- outbreak if frost fever or blood plague less than 2 sec remaining local ffName, _, _, _, _, _, ffExpiration, ffUnitCaster = DKCrutch:hasDeBuff("target", DKCrutch.SpellList["Frost Fever"], "player") local bpName, _, _, _, _, _, bpExpiration, bpUnitCaster = DKCrutch:hasDeBuff("target", DKCrutch.SpellList["Blood Plague"], "player") @@ -1099,18 +1063,10 @@ function DKCrutch:AdviseUnholyAbility() end end - -- Blood boil, if AoE - if (DKCrutch.person["foeCount"]>1) then - local fscd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Blood Boil"]) - if (fscd) and (fscd <= 1) then - return "Blood Boil" - end - else -- Festering Strike if (blood=2 or frost=2) - local fscd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Festering Strike"]) - if (fscd) and (fscd <= 1) and ( (DKCrutch.runesUp[1] == 2) or (DKCrutch.runesUp[3] == 2) ) then - return "Festering Strike" - end + local fscd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Festering Strike"]) + if (fscd) and (fscd <= 1) and ( (DKCrutch.runesUp[1] == 2) or (DKCrutch.runesUp[3] == 2) ) then + return "Festering Strike" end -- Death coil if Sudden Doom proc, or runic power > 90 @@ -1153,12 +1109,6 @@ function DKCrutch:AdviseUnholyAbility() end end - -- Horn of Winter - cd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Horn of Winter"]) - if (cd) and (cd <= 1) then - return "Horn of Winter" - end - -- Empower Rune Weapon cd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Empower Rune Weapon"]) if (cd) and (cd <= 1) and (DKCrutch.runesUp[2] == 0) then @@ -1198,7 +1148,7 @@ function DKCrutch:Update() DKCrutch.runeTracker[3]:SetValue(runeCount[1]) local guid = UnitGUID("target") - if UnitName("target") == nil or UnitIsFriend("player","target") ~= nil or UnitHealth("target") == 0 then + if (UnitName("target") == nil) or (UnitIsFriend("player","target")) or UnitHealth("target") == 0 then guid = nil end diff --git a/DKCrutch.toc b/DKCrutch.toc index 2ed78bb..9427e3e 100755 --- a/DKCrutch.toc +++ b/DKCrutch.toc @@ -1,8 +1,8 @@ -## Interface: 50400 +## Interface: 60000 ## Title: DKCrutch ## Notes: Death Knight rune tracker and rotation helper ## Author: Taracque, Dšgrov‡s of Arathor -## Version: 0.9.6 +## Version: 0.9.9 ## SavedVariables: DKCrutchDB ## OptionalDeps: ## Dependencies: -- 1.7.9.5