Quantcast

Rotation adjustments for all specs

Taracque [10-20-14 - 10:18]
Rotation adjustments for all specs
Filename
DKCrutch.lua
diff --git a/DKCrutch.lua b/DKCrutch.lua
index ca3e35a..b44bea0 100755
--- a/DKCrutch.lua
+++ b/DKCrutch.lua
@@ -715,6 +715,18 @@ function DKCrutch:AdviseBloodAbility()
 		end
 	end

+	-- Death Strike if available
+	cd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Death Strike"])
+	if (cd) and (cd<=1) then
+		return "Death Strike"
+	end
+
+	-- Blood Boil if Blood runes are up
+	local bbcd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Blood Boil"])
+	if (bbcd) and (bbcd<=1) and (DKCrutch.runesUp[1] > 0) then
+		return "Blood Boil"
+	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"])
@@ -723,19 +735,20 @@ function DKCrutch:AdviseBloodAbility()
 		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
-		end
+	-- Death Coil if has enough runic power
+	local dccd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Death Coil"])
+	local _, _, _, cost = GetSpellInfo(DKCrutch.SpellList["Death Coil"])
+	if (dccd) and (dccd <= 1) and (UnitPower("player", 6) > cost) then
+		return "Death Coil"
 	end

-	-- Death Strike if available
-	cd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Death Strike"])
-	if (cd) and (cd<=1) then
-		return "Death Strike"
+	-- Blood Boil or Death and Decay
+	if (bbcd) and (bbcd<=1) then
+		return "Blood Boil"
+	end
+	local ddcd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Outbreak"])
+	if (ddcd) and (ddcd <= 1) and (DKCrutch.runesUp[2] > 0) then
+		return "Death and Decay"
 	end

 	return ""
@@ -771,10 +784,12 @@ function DKCrutch:AdviseFrostAbilityDW() -- Frost DK DualWield priority
 	if (not bpExpiration) then
 		bpExpiration = 0
 	end
-	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"
+
+	-- Death and Decay if AoE
+	local ddcd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Outbreak"])
+	if (DKCrutch.person["foeCount"]>1) then
+		if (ddcd) and (ddcd <= 1) and (DKCrutch.runesUp[2] > 0) then
+			return "Death and Decay"
 		end
 	end

@@ -794,6 +809,14 @@ function DKCrutch:AdviseFrostAbilityDW() -- Frost DK DualWield priority
 		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"])
@@ -823,24 +846,19 @@ function DKCrutch:AdviseFrostAbilityDW() -- Frost DK DualWield priority

 	-- 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 (
 		(DKCrutch:hasBuff("player", DKCrutch.SpellList["Freezing Fog"])) or
-		((DKCrutch.runesUp[4] == 0) and (DKCrutch.runesUp[2] == 0))
+		((DKCrutch.runesUp[4] > 0) or (DKCrutch.runesUp[3] > 0))
 	) then
 		return "Howling Blast"
 	end

 	-- Priority 5: Obliterate
-	-- Obliterate: if 2 death/unholy runes are up OR
-	-- 1 unholy UP and frost and death<2 OR
-	-- Killing Machine Procs  AND runic power>=35
+	-- Obliterate: Have unholy rune
 	local obcd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Obliterate"])
-	if ((DKCrutch.runesUp[4] == 2) or (DKCrutch.runesUp[2] == 2)) or
-		((DKCrutch.runesUp[2] == 1) and (DKCrutch.runesUp[4] < 2) and (DKCrutch.runesUp[3] < 2)) or
-	 	(DKCrutch:hasBuff("player", DKCrutch.SpellList["Killing Machine"]) and (UnitPower("player", 6) >= 35))  then
-		if (obcd) and (obcd <= 1) then
-			return "Obliterate"
-		end
+	if (DKCrutch.runesUp[2] > 0) and (obcd) and (obcd <= 1) then
+		return "Obliterate"
 	end

 	-- Howling Blast
@@ -870,6 +888,14 @@ function DKCrutch:AdviseFrostAbility()
 		return "Pillar of Frost"
 	end

+	-- 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) and (DKCrutch.hasT15_4pcs))) 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")
@@ -886,6 +912,14 @@ function DKCrutch:AdviseFrostAbility()
 		end
 	end

+	-- Death and Decay if AoE
+	local ddcd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Outbreak"])
+	if (DKCrutch.person["foeCount"]>1) then
+		if (ddcd) and (ddcd <= 1) and (DKCrutch.runesUp[2] > 0) 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
@@ -902,14 +936,6 @@ function DKCrutch:AdviseFrostAbility()
 		end
 	end

-	-- 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) and (DKCrutch.hasT15_4pcs))) then
-			return "Soul Reaper"
-		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"])
@@ -935,9 +961,9 @@ function DKCrutch:AdviseFrostAbility()
 		return "Howling Blast"
 	end

-	-- Obliterate if runic power<90 OR Killing Machine Proc
+	-- 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"]))  then
+	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
@@ -976,6 +1002,14 @@ function DKCrutch:AdviseUnholyAbility()
 		return "Raise Dead"
 	end

+	-- 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) and (DKCrutch.hasT15_4pcs))) 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")
@@ -999,16 +1033,6 @@ function DKCrutch:AdviseUnholyAbility()
 			return "Plague Strike"
 		end
 	end
-
-	-- 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
-			return "Icy Touch"
-		end
-	end
-	]]--

 	-- Blood Tap if have at least 10 charges, and have >=32 runic power
 	if (DKCrutch.SpellList["Blood Tap"]) then
@@ -1026,50 +1050,41 @@ function DKCrutch:AdviseUnholyAbility()
 		end
 	end

-	-- 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) and (DKCrutch.hasT15_4pcs))) then
-			return "Soul Reaper"
-		end
-	end
-
 	-- Dark Transform, if has pet and available
 	cd, _, enabled = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Dark Transformation"])
 	if (enabled ~= nil) and (cd) and (cd<=0) and (IsUsableSpell(DKCrutch.SpellList["Dark Transformation"])) and ( PetHasActionBar() ) then
 		return "Dark Transformation"
 	end

-	-- Death Coik if runic power>90
+	-- Death Coil if runic power>90
 	local dccd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Death Coil"])
 	local _, _, _, cost = GetSpellInfo(DKCrutch.SpellList["Death Coil"])
 	if (dccd) and (dccd <= 1) and (UnitPower("player", 6) > 90)	then
 		return "Death Coil"
 	end

-	-- Scourge strike (or Death and Decay), if 4 death runes are up, or 2 unholy runes are up
+	-- Death and Decay if available and AoE
 	local ddcd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Death and Decay"])
-	local sscd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Scourge Strike"])
-	if (DKCrutch.runesUp[4] == 4) or (DKCrutch.runesUp[2] == 2) then
-		if (ddcd) and (ddcd <= 1) then
-			return "Death and Decay"
-		else
-			if (sscd) and (sscd <= 1) then
-				return "Scourge Strike"
-			end
+	if (ddcd) and (ddcd <= 1) and (DKCrutch.person["foeCount"]>1) then
+		return "Death and Decay"
+	else
+		-- Scourge strike if death runes are up, or unholy runes are up
+		local sscd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Scourge Strike"])
+		if (sscd) and (sscd <= 1) and (DKCrutch.runesUp[4] > 0) or (DKCrutch.runesUp[2] > 0) then
+			return "Scourge Strike"
 		end
 	end

-	-- Blood boil, if AoE
+	-- Blood boil, if AoE and has death rune
 	if (DKCrutch.person["foeCount"]>1) then
-		local fscd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Blood Boil"])
-		if (fscd) and (fscd <= 1) then
+		local bbcd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Blood Boil"])
+		if (DKCrutch.runesUp[4] > 0) and (bbcd) and (bbcd <= 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
+		if (fscd) and (fscd <= 1) and ( (DKCrutch.runesUp[1] > 0) or (DKCrutch.runesUp[3] > 0) ) then
 			return "Festering Strike"
 		end
  	end