Quantcast

Frost priority has been updated and now uses separate priority list for Dual Wield

Taracque [06-01-13 - 14:41]
Frost priority has been updated and now uses separate priority list for Dual Wield
Filename
DKCrutch.lua
diff --git a/DKCrutch.lua b/DKCrutch.lua
index 0813a33..da28da2 100755
--- a/DKCrutch.lua
+++ b/DKCrutch.lua
@@ -539,7 +539,11 @@ function DKCrutch:AdviseAbility( hasTarget )
 			end
 		end
 		if (InCombatLockdown() and hasTarget) then
-			return DKCrutch:AdviseFrostAbility()
+			if (DKCrutch.dualWield) then
+				return DKCrutch:AdviseFrostAbilityDW()
+			else
+				return DKCrutch:AdviseFrostAbility()
+			end
 		else
 			-- check presence
 			if (not DKCrutch:hasBuff("player", DKCrutch.SpellList["Frost Presence"])) then
@@ -659,7 +663,7 @@ function DKCrutch:AdviseBloodAbility()
 	return ""
 end

-function DKCrutch:AdviseFrostAbility()
+function DKCrutch:AdviseFrostAbilityDW() -- Frost DK DualWield priority
 	-- spell advisor
 	local spell = ""
 	local obcd,cd
@@ -676,6 +680,7 @@ function DKCrutch:AdviseFrostAbility()
 		return "Raise Dead"
 	end

+	-- Priority 1: 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")
@@ -708,6 +713,7 @@ function DKCrutch:AdviseFrostAbility()
 		end
 	end

+	-- Priority 2: 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"])
@@ -733,27 +739,132 @@ function DKCrutch:AdviseFrostAbility()
 		end
 	end

-	-- Frost Strike if Killing Machine Procs
+	-- 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"])) then
+	if (fscd) and (fscd <= 1) and (DKCrutch:hasBuff("player", DKCrutch.SpellList["Killing Machine"]) or (UnitPower("player", 6) >= 90)) then
 		local _, _, _, cost = GetSpellInfo(DKCrutch.SpellList["Frost Strike"])
 		if (UnitPower("player", 6) >= cost) then
 			return "Frost Strike"
 		end
 	end

-	-- Obliterate if 2 death/unholy runes are up and Killing Machine Procs
+	-- Priority 4: Howling Blast if Rime proc
+	-- 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))
+	) 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
 	local obcd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Obliterate"])
-	if ((DKCrutch.runesUp[4] == 2) or (DKCrutch.runesUp[3] == 2)) and (DKCrutch:hasBuff("player", DKCrutch.SpellList["Killing Machine"]))  then
+	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
 	end

-	-- Frost Strike if  runic power > 90
-	local fscd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Frost Strike"])
-	if (fscd) and (fscd <= 1) and (UnitPower("player", 6) > 90) then
-		return "Frost Strike"
+	-- 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
+		local _, _, _, cost = GetSpellInfo(DKCrutch.SpellList["Frost Strike"])
+		if (UnitPower("player", 6) >= cost) then
+			return "Frost Strike"
+		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
+
+function DKCrutch:AdviseFrostAbility()
+	-- spell advisor
+	local spell = ""
+	local obcd,cd
+
+	-- Pillar of Frost if not on CD
+	cd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Pillar of Frost"])
+	if (cd) and (cd<=1) then
+		return "Pillar of Frost"
+	end
+
+	-- raise dead if not on cd and has Rune of the Fallen Crusader buff
+	cd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Raise Dead"])
+	if (cd) and (cd<=0) and (DKCrutch:hasBuff("player", DKCrutch.SpellList["Unholy Strength"])) 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")
+	if (not ffExpiration) then
+		ffExpiration = 0
+	end
+	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"
+		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"
+		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 (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"])
+		if (count) and (count>=5) and (DKCrutch.depletedCount>0) then
+			return "Blood Tap"
+		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
 	end

 	-- Howling Blast if Freezing Fog proc (Rime)
@@ -764,13 +875,17 @@ function DKCrutch:AdviseFrostAbility()
 		return "Howling Blast"
 	end

-	-- Obliterate
-	if (obcd) and (obcd <= 1) then
-		return "Obliterate"
+	-- Obliterate if runic power<90 OR Killing Machine Proc
+	local obcd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Obliterate"])
+	if (UnitPower("player", 6) >= 90) or (DKCrutch:hasBuff("player", DKCrutch.SpellList["Killing Machine"]))  then
+		if (obcd) and (obcd <= 1) then
+			return "Obliterate"
+		end
 	end
-
+
 	-- Frost Strike
-	if (fscd) and (fscd <= 1) and (IsUsableSpell(DKCrutch.SpellList["Frost Strike"])) then
+	local fscd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Frost Strike"])
+	if (fscd) and (fscd <= 1) then
 		local _, _, _, cost = GetSpellInfo(DKCrutch.SpellList["Frost Strike"])
 		if (UnitPower("player", 6) >= cost) then
 			return "Frost Strike"
@@ -782,6 +897,11 @@ function DKCrutch:AdviseFrostAbility()
 		return "Howling Blast"
 	end

+	-- Obliterate
+	if (obcd) and (obcd <= 1) then
+		return "Obliterate"
+	end
+
 	-- Horn of Winter
 	cd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Horn of Winter"])
 	if (cd) and (cd <= 1) then