From 1162be4465ea17b146d88f9a88294edd48252cbf Mon Sep 17 00:00:00 2001 From: Taracque Date: Fri, 31 Aug 2012 15:53:18 +0200 Subject: [PATCH] Added Blood Tap and Plague Leech talents for all specializations. Blood rotation adjusted. --- DKCrutch.lua | 111 +++++++++++++++++++++++++++++++++++++++++++++++----------- DKCrutch.toc | 6 +--- 2 files changed, 92 insertions(+), 25 deletions(-) diff --git a/DKCrutch.lua b/DKCrutch.lua index 898249f..ce8f8d2 100644 --- a/DKCrutch.lua +++ b/DKCrutch.lua @@ -1,5 +1,5 @@ ------------------------------------------------------------------------------- --- DKCrutch 0.5.1 +-- DKCrutch 0.5.2 -- -- Death Knight rune tracker and ability advisor ------------------------------------------------------------------------------- @@ -8,7 +8,7 @@ DKCrutch = {Locals = {}} local L = DKCrutch.Locals -DKCrutch.versionNumber = '0.5.1' +DKCrutch.versionNumber = '0.5.2' DKCrutch.talent = "" DKCrutch.isEnabled = false DKCrutch.talentUnsure = true @@ -18,6 +18,7 @@ DKCrutch.playerName = UnitName("player") DKCrutch.playerGUID = UnitGUID("player") DKCrutch.runeTracker = {} DKCrutch.runesUp = {} +DKCrutch.depletedCount = 0 DKCrutch.events = {} DKCrutch.SpellList = { ["Outbreak"] = GetSpellInfo(77575), @@ -29,7 +30,6 @@ DKCrutch.SpellList = { ["Scourge Strike"] = GetSpellInfo(55090), ["Festering Strike"] = GetSpellInfo(85948), ["Death Coil"] = GetSpellInfo(47541), - ["Blood Tap"] = GetSpellInfo(45529), ["Empower Rune Weapon"] = GetSpellInfo(47568), ["Horn of Winter"] = GetSpellInfo(57330), ["Howling Blast"] = GetSpellInfo(49184), @@ -40,6 +40,12 @@ DKCrutch.SpellList = { ["Rune Strike"] = GetSpellInfo(56815), ["Heart Strike"] = GetSpellInfo(55050), ["Blood Boil"] = GetSpellInfo(48721), + +-- talent specifig + ["Plague Leech"] = GetSpellInfo(123693), + ["Blood Tap"] = GetSpellInfo(45529), + ["Blood Charge"] = GetSpellInfo(114851), + ["Unholy Blight"] = GetSpellInfo(115989), -- buff, procs ["Sudden Doom"] = GetSpellInfo(81340), @@ -471,9 +477,9 @@ end function DKCrutch:AdviseBloodAbility() -- spell advisor local spell = "" - local cd + local obcd, cd - -- outbreak if frost fever or blood plague less than 2 sec remaining + -- check disease cooldowns local ffName, _, _, _, _, _, ffExpiration, ffUnitCaster = DKCrutch:hasDeBuff("target", DKCrutch.SpellList["Frost Fever"], "player") local bpName, _, _, _, _, _, bpExpiration, bpUnitCaster = DKCrutch:hasDeBuff("target", DKCrutch.SpellList["Blood Plague"], "player") if (not ffExpiration) then @@ -482,8 +488,18 @@ function DKCrutch:AdviseBloodAbility() if (not bpExpiration) then bpExpiration = 0 end - cd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Outbreak"]) - if (cd) and (cd<=0) and (IsSpellInRange(DKCrutch.SpellList["Outbreak"], "target") == 1) then + + -- 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 if ( (ffExpiration - GetTime()) <2) or ( (bpExpiration - GetTime()) < 2) then return "Outbreak" end @@ -505,31 +521,48 @@ function DKCrutch:AdviseBloodAbility() end end + -- Blood Tap if have at least 5 charges, and at least on fully depleted rune + if (DKCrutch.SpellList["Blood Tap"]) then + local name,_,_,count = DKCrutch:hasBuff("player", DKCrutch.SpellList["Blood Charge"]) + if (count>5) and (DKCrutch.depletedCount>0) then + return "Blood Charge" + end + end + + -- Plague Leech if Outbreak available, and have on fully depleted rune + if (DKCrutch.SpellList["Plague Leech"]) then + if (obcd) and (obcd<=0) and (IsSpellInRange(DKCrutch.SpellList["Outbreak"], "target") == 1) then + if (DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Plague Leech"]) <= 1) then + return "Plague Leech" + end + end + end + -- Death Strike if available cd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Death Strike"]) if (cd) and (cd<=1) then 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 return "Rune Strike" end - -- Heart Strike if available - cd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Heart Strike"]) - if (cd) and (cd<=1) and (IsUsableSpell(DKCrutch.SpellList["Heart Strike"])) then - return "Heart Strike" - end - return "" end function DKCrutch:AdviseFrostAbility() -- spell advisor local spell = "" - local cd + local obcd,cd -- Pillar of Frost if not on CD cd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Pillar of Frost"]) @@ -552,8 +585,8 @@ function DKCrutch:AdviseFrostAbility() if (not bpExpiration) then bpExpiration = 0 end - cd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Outbreak"]) - if (cd) and (cd<=0) and (IsSpellInRange(DKCrutch.SpellList["Outbreak"], "target") == 1) then + obcd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Outbreak"]) + if (obcd) and (obcd<=0) and (IsSpellInRange(DKCrutch.SpellList["Outbreak"], "target") == 1) then if ( (ffExpiration - GetTime()) <2) or ( (bpExpiration - GetTime()) < 2) then return "Outbreak" end @@ -574,7 +607,24 @@ function DKCrutch:AdviseFrostAbility() return "Plague Strike" end end - + + -- Blood Tap if have at least 5 charges, and at least on fully depleted rune + if (DKCrutch.SpellList["Blood Tap"]) then + local name,_,_,count = DKCrutch:hasBuff("player", DKCrutch.SpellList["Blood Charge"]) + if (count>5) and (DKCrutch.depletedCount>0) then + return "Blood Charge" + end + end + + -- Plague Leech if Outbreak available, and have on fully depleted rune + if (DKCrutch.SpellList["Plague Leech"]) then + if (obcd) and (obcd<=0) and (IsSpellInRange(DKCrutch.SpellList["Outbreak"], "target") == 1) then + if (DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Plague Leech"]) <= 1 ) then + return "Plague Leech" + end + end + end + -- Frost Strike if Killing Machine Procs local fscd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Frost Strike"]) if (fscd) and (fscd <= 1) and (DKCrutch:hasBuff("player", DKCrutch.SpellList["Killing Machine"])) then @@ -630,7 +680,7 @@ end function DKCrutch:AdviseUnholyAbility() -- spell advisor local spell = "" - local cd + local obcd,cd -- raise dead if has no pet and raise dead is not on cd cd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Raise Dead"]) @@ -647,8 +697,8 @@ function DKCrutch:AdviseUnholyAbility() if (not bpExpiration) then bpExpiration = 0 end - cd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Outbreak"]) - if (cd) and (cd<=0) and (IsSpellInRange(DKCrutch.SpellList["Outbreak"], "target") == 1) then + obcd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Outbreak"]) + if (obcd) and (obcd<=0) and (IsSpellInRange(DKCrutch.SpellList["Outbreak"], "target") == 1) then if ( (ffExpiration - GetTime()) <2) or ( (bpExpiration - GetTime()) < 2) then return "Outbreak" end @@ -676,6 +726,23 @@ function DKCrutch:AdviseUnholyAbility() return "Dark Transformation" end + -- Blood Tap if have at least 5 charges, and at least on fully depleted rune + if (DKCrutch.SpellList["Blood Tap"]) then + local name,_,_,count = DKCrutch:hasBuff("player", DKCrutch.SpellList["Blood Charge"]) + if (count>5) and (DKCrutch.depletedCount>0) then + return "Blood Charge" + end + end + + -- Plague Leech if Outbreak available, and have on fully depleted rune + if (DKCrutch.SpellList["Plague Leech"]) then + if (obcd) and (obcd<=0) and (IsSpellInRange(DKCrutch.SpellList["Outbreak"], "target") == 1) then + if (DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Plague Leech"]) <= 1) then + return "Plague Leech" + end + end + end + -- Scourge strike (or Death and Decay), if 4 death runes are up, or 2 unholy runes are up local ddcd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Death and Decay"]) local sscd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Scourge Strike"]) @@ -749,6 +816,8 @@ function DKCrutch:Update() runeCount[i] = 0 DKCrutch.runesUp[i] = 0 end + DKCrutch.depletedCount = 0 + for i=1,6,1 do start, duration, runeReady = GetRuneCooldown(i) runeType = GetRuneType(i) @@ -758,6 +827,8 @@ function DKCrutch:Update() else if (start) and (start ~= 0) and (GetTime()-start > 0) then runeCount[runeType] = runeCount[runeType] + ( ( (GetTime() - start) / duration ) * 10 ) + else + DKCrutch.depletedCount = DKCrutch.depletedCount + 1 end end end diff --git a/DKCrutch.toc b/DKCrutch.toc index 345393a..e4f23dd 100644 --- a/DKCrutch.toc +++ b/DKCrutch.toc @@ -2,14 +2,10 @@ ## Title: DKCrutch ## Notes: Death Knight rune tracker and rotation helper ## Author: Taracque, Dšgrov‡s of Arathor -## Version: 0.5.1 +## Version: 0.5.2 ## SavedVariables: DKCrutchDB ## OptionalDeps: ## Dependencies: -## X-Curse-Packaged-Version: v0.5.1release -## X-Curse-Project-Name: DKCrutch -## X-Curse-Project-ID: dkcrutch -## X-Curse-Repository-ID: wow/dkcrutch/mainline DKCrutch.lua DKCrutch_GUI.lua -- 1.7.9.5