Quantcast

- bug fix: recursive {}

Sidoine De Wispelaere [04-18-09 - 14:03]
- bug fix: recursive {}
- removed siphon life from Warlock spells
- black arrow added to hunter

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@29 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
OvaleCompile.lua
defaut/Chasseur.lua
defaut/Demoniste.lua
diff --git a/OvaleCompile.lua b/OvaleCompile.lua
index 4a50791..1a516a2 100644
--- a/OvaleCompile.lua
+++ b/OvaleCompile.lua
@@ -61,8 +61,6 @@ local function ParseOr(a,b)
 end

 local function ParseGroup(text)
-	text = string.gsub(text, "if%s+node(%d+)%s+node(%d+)",ParseIf)
-	text = string.gsub(text, "unless%s+node(%d+)%s+node(%d+)",ParseUnless)
 	local nodes={}

 	for w in string.gmatch(text, "node(%d+)") do
@@ -111,13 +109,21 @@ local function ParseDefine(key, value)
 end

 local function ParseAddIcon(params, text)
-	text = string.gsub(text, "(%w+)%s*%((.-)%)", ParseFunction)
-	text = subtest(text, "node(%d+)%s+and%s+node(%d+)", ParseAnd)
-	text = subtest(text, "node(%d+)%s+or%s+node(%d+)", ParseOr)
-	text = subtest(text, "(%d+%.?%d*)s%s+before%s+node(%d+)", ParseBefore)
-
-	text = subtest(text, "{([^{}]*)}", ParseGroup)
-
+	local original = text
+	while (1==1) do
+		local was = text
+		text = string.gsub(text, "(%w+)%s*%((.-)%)", ParseFunction)
+		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)
+		text = string.gsub(text, "if%s+node(%d+)%s+node(%d+)",ParseIf)
+		text = string.gsub(text, "unless%s+node(%d+)%s+node(%d+)",ParseUnless)
+		text = string.gsub(text, "{([node%d ]*)}", ParseGroup)
+		if (was == text) then
+			break
+		end
+	end
+
 	local masterNode
 	if (text) then
 		masterNode = string.match(text, "node(%d+)")
@@ -130,6 +136,7 @@ local function ParseAddIcon(params, text)
 	-- Si il reste autre chose que des espaces, c'est une erreur de syntaxe
 	text = string.gsub(text, "node%d+", "", 1)
 	if (string.match(text,"[^ ]")) then
+		Ovale:Print("Group:"..original)
 		Ovale:Print("syntax error:"..text)
 		return nil
 	end
@@ -238,7 +245,7 @@ function Ovale:DebugNode(node)
 	elseif (node.type == "and") then
 		text = self:DebugNode(node.a).." and "..self:DebugNode(node.b)
 	elseif (node.type == "or") then
-		text = self:DebugNode(node.a).." and "..self:DebugNode(node.b)
+		text = self:DebugNode(node.a).." or "..self:DebugNode(node.b)
 	else
 		text = "#unknown node type#"
 	end
diff --git a/defaut/Chasseur.lua b/defaut/Chasseur.lua
index b7f4c13..52dccf4 100644
--- a/defaut/Chasseur.lua
+++ b/defaut/Chasseur.lua
@@ -11,12 +11,15 @@ Define(RAPIDFIRE 3045)
 Define(KILLCOMMAND 34026)
 Define(BESTIALWRATH 19574)
 Define(HUNTERSMARK 53338)
+Define(BLACKARROW 63668)
+Define(LOCKANDLOAD 56453)

 AddCheckBox(multi SpellName(MULTISHOT))

 AddIcon
 {
 	if TargetDebuffExpires(HUNTERSMARK 0) Spell(HUNTERSMARK)
+	if TargetDebuffExpires(BLACKARROW 0) Spell(BLACKARROW)
 	if TargetDebuffExpires(SERPENTSTING 0) Spell(SERPENTSTING)
 	if TargetDebuffExpires(EXPLOSIVESHOT 0) Spell(EXPLOSIVESHOT)
 	Spell(AIMEDSHOT)
@@ -24,7 +27,7 @@ AddIcon
 	Spell(ARCANESHOT)
 	if TargetLifePercent(less 20) Spell(KILLSHOT)
 	if TargetDebuffExpires(HUNTERSMARK 2) Spell(HUNTERSMARK)
-	Spell(STEADYSHOT)
+	unless BuffPresent(LOCKANDLOAD) Spell(STEADYSHOT)
 }

 AddIcon
diff --git a/defaut/Demoniste.lua b/defaut/Demoniste.lua
index 57b7092..66f66f2 100644
--- a/defaut/Demoniste.lua
+++ b/defaut/Demoniste.lua
@@ -6,7 +6,6 @@ Define(CURSEAGONY 980)
 Define(CURSEDOOM 603)
 Define(CURSETONGUES 1714)
 Define(CURSEWEAKNESS 702)
-Define(SHIPHONLIFE 18265)
 Define(UNSTABLEAFFLICTION 30108)
 Define(CORRUPTION 172)
 Define(TALENTUNSTABLEAFFLICTION 1670)
@@ -46,7 +45,6 @@ if List(curse tongues) and TargetDebuffExpires(CURSETONGUES 2) Spell(CURSETONGUE
 if List(curse weakness) and TargetDebuffExpires(CURSEWEAKNESS 2) Spell(CURSEWEAKNESS)
 if List(curse agony) and TargetDebuffExpires(CURSEAGONY 0 mine=1) Spell(CURSEAGONY)
 if TargetDebuffExpires(CORRUPTION 0 mine=1) Spell(CORRUPTION)
-if TargetDebuffExpires(SHIPHONLIFE 0 mine=1) Spell(SHIPHONLIFE)

 if TargetLifePercent(less 25) and Level(more 76) Spell(DRAINSOUL)