Quantcast

- better feral druid script (based on Murna "Cat DPS guide for Dummies" priority list)

Sidoine De Wispelaere [07-25-09 - 09:14]
- better feral druid script (based on Murna "Cat DPS guide for Dummies" priority list)
- added "Xs between A and B" keyword, which means that there must be at most X seconds between A and B. Used to unsync abilities using combo points

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@90 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
Ovale.lua
OvaleCompile.lua
defaut/Druide.lua
diff --git a/Ovale.lua b/Ovale.lua
index 00a4940..f3b6ad4 100644
--- a/Ovale.lua
+++ b/Ovale.lua
@@ -806,6 +806,24 @@ function Ovale:CalculerMeilleureAction(element)
 		else
 			return tempsA - element.time
 		end
+	elseif (element.type == "between") then
+		if (Ovale.trace) then
+			self:Print(element.time.."s between")
+		end
+		local tempsA = Ovale:CalculerMeilleureAction(element.a)
+		if (tempsA==nil) then
+			return nil
+		end
+		local tempsB = Ovale:CalculerMeilleureAction(element.b)
+		if (tempsB==nil) then
+			return nil
+		end
+		if (tempsA>tempsB and tempsA-tempsB<element.time) then
+			return 0
+		elseif (tempsB>tempsA and tempsB-tempsA<element.time) then
+			return 0
+		end
+		return nil
 	elseif (element.type == "and" or element.type == "if") then
 		if (Ovale.trace) then
 			self:Print(element.type)
diff --git a/OvaleCompile.lua b/OvaleCompile.lua
index bf32382..ee5375d 100644
--- a/OvaleCompile.lua
+++ b/OvaleCompile.lua
@@ -93,6 +93,12 @@ local function ParseBefore(a,b)
 	return "node"..#node
 end

+local function ParseBetween(t,a,b)
+	local newNode = {type="between", time=tonumber(t), a=node[tonumber(a)], b=node[tonumber(b)]}
+	node[#node+1] = newNode
+	return "node"..#node
+end
+
 local function ParseOr(a,b)
 	local newNode = {type="or", a=node[tonumber(a)], b=node[tonumber(b)]}
 	node[#node+1] = newNode
@@ -152,6 +158,7 @@ local function ParseAddIcon(params, text)
 	while (1==1) do
 		local was = text
 		text = string.gsub(text, "(%w+)%s*%((.-)%)", ParseFunction)
+		text = string.gsub(text, "(%d+%.?%d*)s%s+between%s+node(%d+)%s+and%s+node(%d+)", ParseBetween)
 		text = string.gsub(text, "node(%d+)%s+and%s+node(%d+)", ParseAnd)
 		text = string.gsub(text, "node(%d+)%s+or%s+node(%d+)", ParseOr)
 		text = string.gsub(text, "(%d+%.?%d*)s%s+before%s+node(%d+)", ParseBefore)
@@ -289,7 +296,9 @@ function Ovale:DebugNode(node)
 	elseif (node.type == "or") then
 		text = self:DebugNode(node.a).." or "..self:DebugNode(node.b)
 	elseif (node.type == "before") then
-		text = node.time .. "s before "..self:DebufNode(node.b)
+		text = node.time .. "s before "..self:DebugNode(node.a)
+	elseif (node.type == "between") then
+		text = node.time .. "s between "..self:DebugNode(node.a).." and "..self:DebugNode(node.b)
 	else
 		text = "#unknown node type#"
 	end
diff --git a/defaut/Druide.lua b/defaut/Druide.lua
index 2ded741..e7ba929 100644
--- a/defaut/Druide.lua
+++ b/defaut/Druide.lua
@@ -22,6 +22,7 @@ Define(RAKE 59886)
 Define(SAVAGEROAR 52610)
 Define(FEROCIOUSBITE 22568)
 Define(BERSERK 50334)
+Define(CLEARCASTING 16870)

 AddCheckBox(multi L(AOE))
 AddCheckBox(blood L(Blood))
@@ -54,23 +55,30 @@ AddIcon

 		if CheckBoxOn(lucioles) and	TargetDebuffExpires(FAERIEFERAL 2)
 			Spell(FAERIEFERAL)
-
-    	if TargetDebuffExpires(RAKE 0) Spell(RAKE)
-
+
 		if ComboPoints(more 4) and Mana(more 70)
 		{
 			if BuffExpires(SAVAGEROAR 5) Spell(SAVAGEROAR)
 			if TargetDebuffExpires(RIP 0) Spell(RIP)
-			Spell(FEROCIOUSBITE)
-		}
-
+		}
+
+		if {3s between BuffExpires(SAVAGEROAR 0) and TargetDebuffExpires(RIP 0)} and ComboPoints(more 2)
+			Spell(SAVAGEROAR)
+
 		if ComboPoints(less 5)
 		{
-			if Mana(less 40) Spell(TIGERSFURY)
+			if Mana(less 30) Spell(TIGERSFURY)
 			if TargetDebuffExpires(MANGLECAT 0)
 				Spell(MANGLECAT)
+			if TargetDebuffExpires(RAKE 0)
+				Spell(RAKE)
 			Spell(SHRED)
 		}
+
+		if BuffPresent(CLEARCASTING) Spell(SHRED)
+
+		if ComboPoints(more 4) and BuffPresent(SAVAGEROAR 8) and TargetDebuffPresent(RIP 8)
+			Spell(FEROCIOUSBITE)
 	}

 	unless Stance(1) or Stance(3)