From c5d25aa592c44281ef91b61ae4bed8f215f836ce Mon Sep 17 00:00:00 2001 From: Taracque Date: Sat, 10 Jan 2015 18:15:03 +0100 Subject: [PATCH] updated all rotations to 6.0 --- DKCrutch.lua | 450 +++++++++++++++++++++++++++++++++++++++------------------- DKCrutch.toc | 2 +- 2 files changed, 305 insertions(+), 147 deletions(-) diff --git a/DKCrutch.lua b/DKCrutch.lua index 15f3095..432e1a9 100755 --- a/DKCrutch.lua +++ b/DKCrutch.lua @@ -1,5 +1,5 @@ ------------------------------------------------------------------------------- --- DKCrutch 1.0.4 +-- DKCrutch 1.0.5 -- -- Death Knight rune tracker and ability advisor ------------------------------------------------------------------------------- @@ -8,7 +8,7 @@ DKCrutch = {Locals = {}} local L = DKCrutch.Locals -DKCrutch.versionNumber = '1.0.4' +DKCrutch.versionNumber = '1.0.5' DKCrutch.talent = "" DKCrutch.talentUnsure = true DKCrutch.DebugMode = false @@ -678,25 +678,44 @@ function DKCrutch:AdviseAbility( hasTarget ) return "" end +function DKCrutch:getDiseaseExpiration() + local _, _, _, _, _, _, ffExpiration = DKCrutch:hasDeBuff("target", DKCrutch.SpellList["Frost Fever"], "player") + local _, _, _, _, _, _, bpExpiration = DKCrutch:hasDeBuff("target", DKCrutch.SpellList["Blood Plague"], "player") + local _, _, _, _, _, _, npExpiration = DKCrutch:hasDeBuff("target", DKCrutch.SpellList["Necrotic Plague"], "player"); + if (not ffExpiration) then + ffExpiration = 0; + else + ffExpiration = ffExpiration - GetTime(); + end + if (not bpExpiration) then + bpExpiration = 0; + else + bpExpiration = bpExpiration - GetTime(); + end + if (not npExpiration) then + npExpiration = 0; + else + npExpiration = npExpiration - GetTime(); + end + + return ffExpiration, bpExpiration, npExpiration +end + function DKCrutch:AdviseBloodAbility() -- spell advisor local spell = "" local obcd, cd -- 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 - ffExpiration = 0 - end - if (not bpExpiration) then - bpExpiration = 0 - end - + local ffExpiration, bpExpiration, npExpiration = DKCrutch:getDiseaseExpiration(); + -- 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 + if ( + ( (DKCrutch.tier7talent == 21207) and ( npExpiration < 5 ) and ( npExpiration > 1 ) ) or + ( (DKCrutch.tier7talent ~= 21207) and ( ( ffExpiration < 5 ) or ( bpExpiration < 5) ) and ( ( ffExpiration > 1) and ( bpExpiration > 1) ) ) + ) then return "Blood Boil" end end @@ -704,7 +723,10 @@ function DKCrutch:AdviseBloodAbility() -- 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 + if ( + ( (DKCrutch.tier7talent == 21207) and ( npExpiration <= 0 ) ) or + ( (DKCrutch.tier7talent ~= 21207) and ( ffExpiration < 2 ) or ( bpExpiration < 2) ) + ) then return "Outbreak" end end @@ -712,7 +734,10 @@ function DKCrutch:AdviseBloodAbility() -- icy touch cd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Icy Touch"]) if (cd<=0) and ( IsSpellInRange(DKCrutch.SpellList["Icy Touch"],"target") == 1) then - if ( (ffExpiration - GetTime()) <3) then + if ( + ( (DKCrutch.tier7talent == 21207) and (npExpiration <= 0) ) or + ( (DKCrutch.tier7talent ~= 21207) and (ffExpiration < 3) ) + ) then return "Icy Touch" end end @@ -720,7 +745,10 @@ function DKCrutch:AdviseBloodAbility() -- plague strike cd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Plague Strike"]) if (cd) and (cd<=0) and ( IsSpellInRange(DKCrutch.SpellList["Plague Strike"],"target") == 1) then - if ( (bpExpiration - GetTime()) <3) then + if ( + ( (DKCrutch.tier7talent == 21207) and (npExpiration <= 0) ) or + ( (DKCrutch.tier7talent ~= 21207) and (bpExpiration < 3) ) + ) then return "Plague Strike" end end @@ -767,6 +795,8 @@ function DKCrutch:AdviseFrostAbilityDW() -- Frost DK DualWield priority -- spell advisor local spell = "" local obcd,cd,enabled,_ + -- Diseases + local ffExpiration, bpExpiration, npExpiration = DKCrutch:getDiseaseExpiration(); -- Pillar of Frost if not on CD cd, _, enabled = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Pillar of Frost"]) @@ -774,85 +804,142 @@ function DKCrutch:AdviseFrostAbilityDW() -- Frost DK DualWield priority return "Pillar of Frost" end - -- Priority 1: Soul Reaper - -- Soul Reaper, if target health < 35%, or 45% if has t15 4pcs - if (DKCrutch.SpellList["Soul Reaper"]) then - cd, _, enabled = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Soul Reaper"]) - if (enabled ~= nil) and (cd) and (cd<=0) and (UnitHealthMax("target")>0) and ((UnitHealth("target")/UnitHealthMax("target")<0.35) or ((UnitHealth("target")/UnitHealthMax("target")<0.45))) then - return "Soul Reaper" + -- Priority 1: Soul Reaper for 1 or 2 targets + if (DKCrutch.person["foeCount"]<=2) then + if (DKCrutch.SpellList["Soul Reaper"]) then + -- Soul Reaper, if target health < 35% + if (DKCrutch.SpellList["Soul Reaper"]) then + cd, _, enabled = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Soul Reaper"]) + if (enabled ~= nil) and (cd) and (cd<=0) and (UnitHealthMax("target")>0) and ((UnitHealth("target")/UnitHealthMax("target")<0.35)) then + return "Soul Reaper" + end + + -- Blood Tap, if target health < 35% and soul reaper cooldown is 0 + if (enabled == 10) then + if (DKCrutch.SpellList["Blood Tap"]) then + local name,_,_,count = DKCrutch:hasBuff("player", DKCrutch.SpellList["Blood Charge"]) + if (count) and (count>=5) and (DKCrutch.depletedCount>0) then + return "Blood Tap" + end + end + end + end end end - -- Priority 2: Diseases - -- 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") - if (not ffExpiration) then - ffExpiration = 0 - end - if (not bpExpiration) then - bpExpiration = 0 + -- Breath of Sindragosa, if runic power > 75 + if (DKCrutch.tier7talent == 21209) and (DKCrutch.SpellList["Breath of Sindragosa"]) then + local bscd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Breath of Sindragosa"]); + if (bscd) and (bscd <= 1) and (UnitPower("player", 6) > 75) then + return "Breath of Sindragosa"; + end + -- If Breath of Sindragosa active focus on RP generation + local msName, _, _, _, _, _, msExpiration = DKCrutch:hasDeBuff("target", DKCrutch.SpellList["Mark of Sindragosa"], "player"); + if (msName) and (msExpiration - GetTime() > 0) then + if (DKCrutch.person["foeCount"]>2) then + -- AOE + -- Death and Decay if have 1 unholy rune + local ddcd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Death and Decay"]) + if (ddcd) and (ddcd <= 1) and (DKCrutch.runesUp[2] == 1) then + return "Death and Decay" + end + -- Plague Strike if have 2 unholy rune + cd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Plague Strike"]) + if (cd) and (cd<=0) and ( IsSpellInRange(DKCrutch.SpellList["Plague Strike"],"target") == 1) and (DKCrutch.runesUp[2] == 2) then + return "Plague Strike" + end + else + -- Single Target + -- oblitarate + local obcd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Obliterate"]) + if (DKCrutch:hasBuff("player", DKCrutch.SpellList["Killing Machine"])) then + if (obcd) and (obcd <= 1) then + return "Obliterate" + end + end + local hbcd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Howling Blast"]) + if (hbcd) and (hbcd<=0) and (UnitPower("player", 6) < 88) then + return "Howling Blast" + end + if (obcd) and (obcd <= 1) and (UnitPower("player", 6) < 76) then + return "Obliterate" + end + end + if (DKCrutch.tier1talent == 19166) and (DKCrutch.SpellList["Plague Leech"]) then + if (DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Plague Leech"]) <= 1) then + return "Plague Leech"; + end + end + if (DKCrutch.SpellList["Blood Tap"]) then + local name,_,_,count = DKCrutch:hasBuff("player", DKCrutch.SpellList["Blood Charge"]) + if (count) and (count>=5) and (DKCrutch.depletedCount>0) then + return "Blood Tap" + end + end + end end - -- Death and Decay if AoE + -- Defile local ddcd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Death and Decay"]) - if (DKCrutch.person["foeCount"]>1) then - if (ddcd) and (ddcd <= 1) and (DKCrutch.runesUp[2] > 0) then + if (DKCrutch.tier7talent == 21208) then + if (ddcd) and (ddcd <= 1) then return "Death and Decay" end - end - - -- howling blast - local hbcd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Howling Blast"]) - if (hbcd) and (hbcd<=0) and ( IsSpellInRange(DKCrutch.SpellList["Howling Blast"],"target") == 1) then - if ( (ffExpiration - GetTime()) <3) then - return "Howling Blast" - end - end - - -- plague strike - cd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Plague Strike"]) - if (cd) and (cd<=0) and ( IsSpellInRange(DKCrutch.SpellList["Plague Strike"],"target") == 1) then - if ( (bpExpiration - GetTime()) <3) then - return "Plague Strike" + else + -- Death and Decay if 3 or more targets + local ddcd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Death and Decay"]) + if (DKCrutch.person["foeCount"]>2) then + if (ddcd) and (ddcd <= 1) and (DKCrutch.runesUp[2] > 0) then + return "Death and Decay" + end end end - -- Outbreak if nothing else… - 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 - 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) and (count>=5) and (DKCrutch.depletedCount>0) then - return "Blood Tap" + -- Frost Strike if Killing Machine Procs OR Runic Power >= 88 + local fscd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Frost Strike"]) + if (fscd) and (fscd <= 1) and (DKCrutch:hasBuff("player", DKCrutch.SpellList["Killing Machine"]) or (UnitPower("player", 6) >= 88)) then + if (UnitPower("player", 6) >= 40) then + return "Frost Strike" 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) and (DKCrutch.depletedCount>0) then - if (DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Plague Leech"]) <= 1 ) then - return "Plague Leech" - end + -- howling blast, if death rune count > 1 or unholy rune count > 1 + local hbcd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Howling Blast"]) + if (hbcd) and (hbcd<=0) and ((DKCrutch.runesUp[4]>1) or (DKCrutch.runesUp[2]>1)) and ( IsSpellInRange(DKCrutch.SpellList["Howling Blast"],"target") == 1) then + return "Howling Blast" + end + + -- Unholy blight and debuffs are expiring + if (DKCrutch.tier1talent == 19217) and (DKCrutch.SpellList["Unholy Blight"]) then + cd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Unholy Blight"]) + if (cd) and (cd<=0) and ( + ((DKCrutch.tier7talent ~= 21207) and ((ffExpiration<3) or (bpExpiration<3))) or + ((DKCrutch.tier7talent == 21207) and (npExpiration <= 0)) + ) then + return "Unholy Blight" end end - - -- Priority 3: Frost Strike - -- Frost Strike if Killing Machine Procs OR Runic Power >= 90 - local fscd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Frost Strike"]) - if (fscd) and (fscd <= 1) and (DKCrutch:hasBuff("player", DKCrutch.SpellList["Killing Machine"]) or (UnitPower("player", 6) >= 90)) then - if (UnitPower("player", 6) >= 40) then - return "Frost Strike" + + -- Howling blast, if rime, or dieseases are expired + if (hbcd) and (hbcd<=0) and ( IsSpellInRange(DKCrutch.SpellList["Howling Blast"],"target") == 1) and ( + ((DKCrutch.tier7talent ~= 21207) and ((ffExpiration<3) or (bpExpiration<3))) or + ((DKCrutch.tier7talent == 21207) and (npExpiration <= 0)) + ) then + return "Howling Blast" + end + + -- Plague Strike if diseases are expired + cd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Plague Strike"]) + if (cd) and (cd<=0) and ( IsSpellInRange(DKCrutch.SpellList["Plague Strike"],"target") == 1) then + if ( + ((DKCrutch.tier7talent ~= 21207) and (bpExpiration < 3)) or + ((DKCrutch.tier7talent == 21207) and (npExpiration <= 0)) + ) then + return "Plague Strike" end end - -- Priority 4: Howling Blast if Rime proc -- Howling Blast if Freezing Fog proc (Rime) -- Have Death or Frost rune if (hbcd) and (hbcd <= 1) and ( @@ -862,25 +949,37 @@ function DKCrutch:AdviseFrostAbilityDW() -- Frost DK DualWield priority return "Howling Blast" end - -- Priority 5: Obliterate - -- Obliterate: Have unholy rune + -- Frost Strike if runic power > 76 + if (fscd) and (fscd <= 1) and (IsUsableSpell(DKCrutch.SpellList["Frost Strike"])) and (UnitPower("player", 6) >= 76) then + return "Frost Strike" + end + + -- Obliterate if have unholy rune and killing machine not proc local obcd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Obliterate"]) - if (DKCrutch.runesUp[2] > 0) and (obcd) and (obcd <= 1) then + if (DKCrutch.runesUp[2] > 0) and (obcd) and (obcd <= 1) and (DKCrutch.runesUp[2] > 0) and not(DKCrutch:hasBuff("player", DKCrutch.SpellList["Killing Machine"])) then return "Obliterate" end - -- Howling Blast + -- Howling blast if (hbcd) and (hbcd <= 1) then return "Howling Blast" end - -- Frost Strike - if (fscd) and (fscd <= 1) and (IsUsableSpell(DKCrutch.SpellList["Frost Strike"])) then - if (UnitPower("player", 6) >= 40) then - return "Frost Strike" + -- 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) and (DKCrutch.depletedCount>0) then + if (DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Plague Leech"]) <= 1 ) then + return "Plague Leech" + end end end + -- Empower rune weapon + cd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Empower Rune Weapon"]) + if (cd) and (cd <= 1) then + return "Empower Rune Weapon" + end + return "" end @@ -895,42 +994,118 @@ function DKCrutch:AdviseFrostAbility() return "Pillar of Frost" end - -- Soul Reaper, if target health < 35%, or 45% if has t15 4pcs + -- Soul Reaper, if target health < 35% if (DKCrutch.SpellList["Soul Reaper"]) then cd, _, enabled = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Soul Reaper"]) - if (enabled ~= nil) and (cd) and (cd<=0) and (UnitHealthMax("target")>0) and ((UnitHealth("target")/UnitHealthMax("target")<0.35) or ((UnitHealth("target")/UnitHealthMax("target")<0.45))) then + if (enabled ~= nil) and (cd) and (cd<=0) and (UnitHealthMax("target")>0) and (UnitHealth("target")/UnitHealthMax("target")<0.35) then return "Soul Reaper" end 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") - if (not ffExpiration) then - ffExpiration = 0 + -- Breath of Sindragosa, if runic power > 75 + if (DKCrutch.tier7talent == 21209) and (DKCrutch.SpellList["Breath of Sindragosa"]) then + local bscd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Breath of Sindragosa"]); + if (bscd) and (bscd <= 1) and (UnitPower("player", 6) > 75) then + return "Breath of Sindragosa"; + end + -- If Breath of Sindragosa active focus on RP generation + local msName, _, _, _, _, _, msExpiration = DKCrutch:hasDeBuff("target", DKCrutch.SpellList["Mark of Sindragosa"], "player"); + if (msName) and (msExpiration - GetTime() > 0) then + if (DKCrutch.person["foeCount"]>2) then + -- AOE + -- Death and Decay if have 1 unholy rune + local ddcd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Death and Decay"]) + if (ddcd) and (ddcd <= 1) and (DKCrutch.runesUp[2] == 1) then + return "Death and Decay" + end + -- Plague Strike if have 2 unholy rune + cd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Plague Strike"]) + if (cd) and (cd<=0) and ( IsSpellInRange(DKCrutch.SpellList["Plague Strike"],"target") == 1) and (DKCrutch.runesUp[2] == 2) then + return "Plague Strike" + end + else + -- Single Target + -- oblitarate + local obcd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Obliterate"]) + if (DKCrutch:hasBuff("player", DKCrutch.SpellList["Killing Machine"])) then + if (obcd) and (obcd <= 1) then + return "Obliterate" + end + end + local hbcd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Howling Blast"]) + if (hbcd) and (hbcd<=0) and (UnitPower("player", 6) < 88) then + return "Howling Blast" + end + if (obcd) and (obcd <= 1) and (UnitPower("player", 6) < 76) then + return "Obliterate" + end + end + if (DKCrutch.tier1talent == 19166) and (DKCrutch.SpellList["Plague Leech"]) then + if (DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Plague Leech"]) <= 1) then + return "Plague Leech"; + end + end + if (DKCrutch.SpellList["Blood Tap"]) then + local name,_,_,count = DKCrutch:hasBuff("player", DKCrutch.SpellList["Blood Charge"]) + if (count) and (count>=5) and (DKCrutch.depletedCount>0) then + return "Blood Tap" + end + end + end end - if (not bpExpiration) then - bpExpiration = 0 + + -- Defile + local ddcd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Death and Decay"]) + if (DKCrutch.tier7talent == 21208) then + if (ddcd) and (ddcd <= 1) then + return "Death and Decay" + end + else + -- Death and Decay if 3 or more targets + local ddcd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Death and Decay"]) + if (DKCrutch.person["foeCount"]>2) then + if (ddcd) and (ddcd <= 1) and (DKCrutch.runesUp[2] > 0) then + return "Death and Decay" + end + end end + + -- outbreak if frost fever or blood plague less than 2 sec remaining + local ffExpiration, bpExpiration, npExpiration = DKCrutch:getDiseaseExpiration(); + 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 + if ( + ((DKCrutch.tier7talent ~= 21207) and ((ffExpiration < 2) or (bpExpiration < 2))) or + ((DKCrutch.tier7talent == 21207) and (npExpiration <= 0)) + ) then return "Outbreak" end end -- Death and Decay if AoE local ddcd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Death and Decay"]) - if (DKCrutch.person["foeCount"]>1) then + if (DKCrutch.person["foeCount"]>2) then if (ddcd) and (ddcd <= 1) and (DKCrutch.runesUp[2] > 0) then return "Death and Decay" end end + -- Unholy blight and debuffs are expiring + if (DKCrutch.tier1talent == 19217) and (DKCrutch.SpellList["Unholy Blight"]) then + cd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Unholy Blight"]) + if (cd) and (cd<=0) and ( + ((DKCrutch.tier7talent ~= 21207) and ((ffExpiration<3) or (bpExpiration<3))) or + ((DKCrutch.tier7talent == 21207) and (npExpiration <= 0)) + ) then + return "Unholy Blight" + end + end + -- howling blast local hbcd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Howling Blast"]) if (hbcd) and (hbcd<=0) and ( IsSpellInRange(DKCrutch.SpellList["Howling Blast"],"target") == 1) then - if ( (ffExpiration - GetTime()) <3) then + if ( ffExpiration < 3) then return "Howling Blast" end end @@ -938,49 +1113,40 @@ function DKCrutch:AdviseFrostAbility() -- plague strike cd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Plague Strike"]) if (cd) and (cd<=0) and ( IsSpellInRange(DKCrutch.SpellList["Plague Strike"],"target") == 1) then - if ( (bpExpiration - GetTime()) <3) then + if ( + ((DKCrutch.tier7talent ~= 21207) and (bpExpiration < 2)) or + ((DKCrutch.tier7talent == 21207) and (npExpiration <= 0)) + ) then 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) and (count>=5) and (DKCrutch.depletedCount>0) then - return "Blood Tap" - end + -- Obliterate if all runes are up or killing machine not proc + local obcd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Obliterate"]) + if (DKCrutch.runesUp[2] > 0) and (obcd) and (obcd <= 1) and ( + (DKCrutch.runesUp[1] + DKCrutch.runesUp[2] + DKCrutch.runesUp[3] + DKCrutch.runesUp[4]) == 6) or + not(DKCrutch:hasBuff("player", DKCrutch.SpellList["Killing Machine"]) + ) then + return "Obliterate" 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) and (DKCrutch.depletedCount>0) then - if (DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Plague Leech"]) <= 1 ) then - return "Plague Leech" - end - end + -- Frost Strike if runic power > 40 + if (fscd) and (fscd <= 1) and (IsUsableSpell(DKCrutch.SpellList["Frost Strike"])) and (UnitPower("player", 6) >= 40) then + return "Frost Strike" end - -- Howling Blast if Freezing Fog proc (Rime) - if (hbcd) and (hbcd <= 1) and ( - (DKCrutch:hasBuff("player", DKCrutch.SpellList["Freezing Fog"])) or - ((DKCrutch.runesUp[4] == 0) and (DKCrutch.runesUp[2] == 0)) + -- Howling blast, if rime, or dieseases are expired + if (hbcd) and (hbcd<=0) and ( IsSpellInRange(DKCrutch.SpellList["Howling Blast"],"target") == 1) and ( + (DKCrutch:hasBuff("player", DKCrutch.SpellList["Freezing Fog"])) ) then return "Howling Blast" end - -- Obliterate if runic power<90 OR Killing Machine Proc, or no depleted rune - local obcd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Obliterate"]) - if (UnitPower("player", 6) >= 90) or (DKCrutch:hasBuff("player", DKCrutch.SpellList["Killing Machine"])) or (DKCrutch.depletedCount == 0) then - if (obcd) and (obcd <= 1) then - return "Obliterate" - end - end - - -- Frost Strike - local fscd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Frost Strike"]) - if (fscd) and (fscd <= 1) then - if (UnitPower("player", 6) >= 40) then - return "Frost Strike" + -- 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) and (count>=5) and (DKCrutch.depletedCount>0) then + return "Blood Tap" end end @@ -1015,18 +1181,7 @@ function DKCrutch:AdviseUnholyAbility() return "Raise Dead" end - local ffName, _, _, _, _, _, ffExpiration = DKCrutch:hasDeBuff("target", DKCrutch.SpellList["Frost Fever"], "player"); - local bpName, _, _, _, _, _, bpExpiration = DKCrutch:hasDeBuff("target", DKCrutch.SpellList["Blood Plague"], "player"); - local npName, _, _, _, _, _, npExpiration = DKCrutch:hasDeBuff("target", DKCrutch.SpellList["Necrotic Plague"], "player"); - if (not ffExpiration) then - ffExpiration = 0; - end - if (not bpExpiration) then - bpExpiration = 0; - end - if (not npExpiration) then - npExpiration = 0; - end + local ffExpiration, bpExpiration, npExpiration = DKCrutch:getDiseaseExpiration(); -- Plague Leech if (DKCrutch.tier1talent == 19166) and (DKCrutch.SpellList["Plague Leech"]) then @@ -1037,8 +1192,8 @@ function DKCrutch:AdviseUnholyAbility() end end -- or if diseases will expire in 2 sec on target - if ((DKCrutch.tier7talent == 21207) and (npExpiration - GetTime() < 2) ) or -- necrotic plague - ((DKCrutch.tier7talent ~= 21207) and (ffExpiration - GetTime() < 2) and (bpExpiration - GetTime() < 2) ) + if ((DKCrutch.tier7talent == 21207) and (npExpiration <= 0) ) or -- necrotic plague + ((DKCrutch.tier7talent ~= 21207) and (ffExpiration < 2) and (bpExpiration < 2) ) then if (DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Plague Leech"]) <= 1) then return "Plague Leech"; @@ -1094,9 +1249,9 @@ function DKCrutch:AdviseUnholyAbility() if (DKCrutch.tier1talent == 19217) and (DKCrutch.SpellList["Unholy Blight"]) then cd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Unholy Blight"]) if (cd) and (cd<=0) and ( - ((DKCrutch.tier7talent == 21207) and (npExpiration - GetTime() < 2) ) + ( (DKCrutch.tier7talent == 21207) and (npExpiration <= 0) ) or - ((DKCrutch.tier7talent ~= 21207) and (ffExpiration - GetTime()<3) or (bpExpiration - GetTime()<3) ) + ( (DKCrutch.tier7talent ~= 21207) and (ffExpiration < 3) or (bpExpiration < 3) ) ) then return "Unholy Blight" end @@ -1105,9 +1260,9 @@ function DKCrutch:AdviseUnholyAbility() -- Outbreak if frost fever or blood plague less than 2 sec remaining if (obcd) and (obcd<=0) and (IsSpellInRange(DKCrutch.SpellList["Outbreak"], "target") == 1) then if ( - ((DKCrutch.tier7talent == 21207) and (npExpiration - GetTime() < 2) ) + ((DKCrutch.tier7talent == 21207) and (npExpiration <= 0) ) or - ((DKCrutch.tier7talent ~= 21207) and ((ffExpiration - GetTime() <2) or ( (bpExpiration - GetTime()) < 2)) ) + ((DKCrutch.tier7talent ~= 21207) and ((ffExpiration < 2) or ( bpExpiration < 2)) ) ) then return "Outbreak" end @@ -1117,9 +1272,9 @@ function DKCrutch:AdviseUnholyAbility() cd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Plague Strike"]) if (cd) and (cd<=0) and ( IsSpellInRange(DKCrutch.SpellList["Plague Strike"],"target") == 1) then if ( - ((DKCrutch.tier7talent == 21207) and (npExpiration - GetTime() < 2) ) + ((DKCrutch.tier7talent == 21207) and (npExpiration <= 0) ) or - ((DKCrutch.tier7talent ~= 21207) and ((ffExpiration - GetTime() <2) or ( (bpExpiration - GetTime()) < 2))) + ((DKCrutch.tier7talent ~= 21207) and ((ffExpiration <2) or ( bpExpiration < 2))) ) then return "Plague Strike" end @@ -1219,7 +1374,10 @@ function DKCrutch:AdviseUnholyAbility() -- Unholy blight and debuffs are expiring if (DKCrutch.tier1talent == 19217) and (DKCrutch.SpellList["Unholy Blight"]) then cd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Unholy Blight"]) - if (cd) and (cd<=0) and (ffExpiration<3) or (bpExpiration<3) then + if (cd) and (cd<=0) and ( + ((DKCrutch.tier7talent ~= 21207) and ((ffExpiration<3) or (bpExpiration<3))) or + ((DKCrutch.tier7talent == 21207) and (npExpiration <= 0)) + ) then return "Unholy Blight" end end diff --git a/DKCrutch.toc b/DKCrutch.toc index fa6b24c..fa2dc82 100755 --- a/DKCrutch.toc +++ b/DKCrutch.toc @@ -2,7 +2,7 @@ ## Title: DKCrutch ## Notes: Death Knight rune tracker and rotation helper ## Author: Taracque, Dšgrov‡s of Arathor -## Version: 1.0.4 +## Version: 1.0.5 ## SavedVariables: DKCrutchDB ## OptionalDeps: ## Dependencies: -- 1.7.9.5