Quantcast

- multiple icons

Sidoine De Wispelaere [01-17-09 - 19:17]
- multiple icons
- some customization
- bug fixes

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@4 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
Locale-enUS.lua
Locale-frFR.lua
Ovale.lua
Ovale.toc
OvaleCompile.lua
OvaleFrame.lua
OvaleIcone.lua
defaut/Chaman.lua
defaut/Demoniste.lua
defaut/Druide.lua
defaut/Guerrier.lua
defaut/Paladin.lua
defaut/Pretre.lua
diff --git a/Locale-enUS.lua b/Locale-enUS.lua
new file mode 100644
index 0000000..2d7b3b8
--- /dev/null
+++ b/Locale-enUS.lua
@@ -0,0 +1,11 @@
+local AceLocale = LibStub:GetLibrary("AceLocale-3.0")
+local L = AceLocale:NewLocale("Ovale", "enUS", true)
+if not L then return end
+L["Largeur des icônes"] = "Icon width"
+L["La largeur des icônes"] = "The icon width"
+L["Hauteur des icônes"] = "Icon height"
+L["La hauteur des icônes"] = "The icon height"
+L["Afficher en combat uniquement"] = "Show in combat only"
+L["Code"] = "Code"
+L["Compiler"] = "Compile"
+L["BUGTEXT"] = "Sometimes the button won't highlight when you try to confirm changes and the text will scroll if you click. Please, put the cursor at the bottom of the text before accepting the changes."
\ No newline at end of file
diff --git a/Locale-frFR.lua b/Locale-frFR.lua
index b777878..c486b4e 100644
--- a/Locale-frFR.lua
+++ b/Locale-frFR.lua
@@ -1,3 +1,11 @@
 local AceLocale = LibStub:GetLibrary("AceLocale-3.0")
-local L = AceLocale:NewLocale("Ovale", "frFR",true)
+local L = AceLocale:NewLocale("Ovale", "frFR", false)
 if not L then return end
+L["Largeur des icônes"] = true
+L["La largeur des icônes"] = true
+L["Hauteur des icônes"] = true
+L["La hauteur des icônes"] = true
+L["Afficher en combat uniquement"] = true
+L["Code"] = true
+L["Compiler"] = true
+L["BUGTEXT"] = "Parfois passer la souris sur le bouton de confirmation en bas de la fenêtre ne l'éclairera pas et cliquer sélectionnera du texte. Placez d'abord le curseur en bas du texte avant de confirmer les changements."
\ No newline at end of file
diff --git a/Ovale.lua b/Ovale.lua
index 7e54ac6..a762cef 100644
--- a/Ovale.lua
+++ b/Ovale.lua
@@ -21,7 +21,7 @@ Ovale.listeTalentsRemplie = false
 Ovale.frame = nil
 Ovale.checkBoxes = {}
 Ovale.dropDowns = {}
-Ovale.masterNode = nil
+Ovale.masterNodes = nil
 Ovale.bug = false

 Ovale.arbre = {}
@@ -44,19 +44,38 @@ local options =
 				combatUniquement =
 				{
 					type = "toggle",
-					name = "Afficher en combat uniquement",
+					name = L["Afficher en combat uniquement"],
 					get = function(info)
 						return Ovale.db.profile.apparence.enCombat
 					end,
 					set = function(info, v)
 						Ovale.db.profile.apparence.enCombat = v
-					end
+					end,
+					width = full
+				},
+				iconWidth =
+				{
+					type = "range",
+					name = L["Largeur des icônes"],
+					desc = L["La largeur des icônes"],
+					min = 16, max = 256, step = 1,
+					get = function(info) return Ovale.db.profile.apparence.iconWidth end,
+					set = function(info,value) Ovale.db.profile.apparence.iconWidth = value; Ovale:UpdateFrame() end
+				},
+				iconHeight =
+				{
+					type = "range",
+					name = L["Hauteur des icônes"],
+					desc = L["La hauteur des icônes"],
+					min = 16, max = 256, step = 1,
+					get = function(info) return Ovale.db.profile.apparence.iconHeight end,
+					set = function(info,value) Ovale.db.profile.apparence.iconHeight = value; Ovale:UpdateFrame() end
 				}
 			}
 		},
 		code =
 		{
-			name = "Code",
+			name = L["Code"],
 			type = "group",
 			args =
 			{
@@ -64,8 +83,9 @@ local options =
 				{
 					order = 2,
 					type = "input",
-					multiline = 20,
-					name = "Code",
+					multiline = 15,
+					name = L["Code"],
+					desc = L["BUGTEXT"],
 					get = function(info)
 						return Ovale.db.profile.code
 					end,
@@ -79,10 +99,10 @@ local options =
 				{
 					order = 1,
 					type = "execute",
-					name = "Compiler",
+					name = L["Compiler"],
 					func = function()
-						Ovale.masterNode = Ovale:Compile(Ovale.db.profile.code)
-						-- Ovale:Print(Ovale:DebugNode(Ovale.masterNode))
+						Ovale.masterNodes = Ovale:Compile(Ovale.db.profile.code)
+						Ovale:UpdateFrame()
 					end
 				}
 			}
@@ -120,7 +140,8 @@ end
 function Ovale:HandleProfileChanges()
 	if (self.firstInit) then
 		if (self.db.profile.code) then
-			self.masterNode = self:Compile(self.db.profile.code)
+			self.masterNodes = self:Compile(self.db.profile.code)
+			self:UpdateFrame()
 		end
 	end
 end
@@ -145,18 +166,18 @@ function Ovale:FirstInit()

 	self.frame = LibStub("AceGUI-3.0"):Create("OvaleFrame")

-	self.frame:SetWidth(64)
-	self.frame:SetHeight(64)
-	self.frame:SetPoint("TOPLEFT",self.db.profile.left,-self.db.profile.top)
+	self.frame:SetPoint("TOPLEFT",UIParent,"BOTTOMLEFT",self.db.profile.left,self.db.profile.top)

 	self.firstInit = true

 	options.args.profile = LibStub("AceDBOptions-3.0"):GetOptionsTable(self.db)
 	self.AceConfig:RegisterOptionsTable("Ovale", options.args.code, "Ovale")
 	self.AceConfig:RegisterOptionsTable("Ovale Profile", options.args.profile)
+	self.AceConfig:RegisterOptionsTable("Ovale Apparence", options.args.apparence)

 	self.AceConfigDialog:AddToBlizOptions("Ovale", "Ovale")
 	self.AceConfigDialog:AddToBlizOptions("Ovale Profile", "Profile", "Ovale")
+	self.AceConfigDialog:AddToBlizOptions("Ovale Apparence", "Apparence", "Ovale")

 	self.db.RegisterCallback( self, "OnNewProfile", "HandleProfileChanges" )
 	self.db.RegisterCallback( self, "OnProfileReset", "HandleProfileChanges" )
@@ -165,12 +186,9 @@ function Ovale:FirstInit()


 	if (self.db.profile.code) then
-		self.masterNode = self:Compile(self.db.profile.code)
+		self.masterNodes = self:Compile(self.db.profile.code)
 	end
-
-	--self:UpdateFrame()
-
-	self:Test()
+	self:UpdateFrame()
 end

 function Ovale:OnEnable()
@@ -598,11 +616,11 @@ function Ovale:ChargerDefaut()
 		profile =
 		{
 			code = Ovale.defaut[englishClass],
-			left = 0,
-			top = 0,
+			left = 500,
+			top = 500,
 			check = {},
 			list = {},
-			apparence = {enCombat=false}
+			apparence = {enCombat=false, iconWidth = 64, iconHeight = 64}
 		}
 	})
 end
@@ -623,6 +641,8 @@ end
 function Ovale:UpdateFrame()
 	self.frame:ReleaseChildren()

+	self.frame:UpdateIcons()
+
 	self.checkBoxes = {}

 	for k,v in pairs(self.casesACocher) do
@@ -659,8 +679,3 @@ end
 function Ovale:GetListValue(v)
 	return self.dropDowns[v] and self.dropDowns[v].value
 end
-
-function Ovale:Test()
-	this.node = {}
-
-end
\ No newline at end of file
diff --git a/Ovale.toc b/Ovale.toc
index 8a68d85..7e19194 100644
--- a/Ovale.toc
+++ b/Ovale.toc
@@ -12,6 +12,7 @@
 embeds.xml

 Locale-frFR.lua
+Locale-enUS.lua
 Ovale.lua
 Condition.lua
 OvaleIcone.lua
diff --git a/OvaleCompile.lua b/OvaleCompile.lua
index 5067920..2a20800 100644
--- a/OvaleCompile.lua
+++ b/OvaleCompile.lua
@@ -97,57 +97,85 @@ local function ParseDefine(key, value)
 	return ""
 end

+local function ParseAddIcon(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, "{([^{}]*)}", ParseGroup)
+
+	-- text = ParseGroup(text)
+	local masterNode
+	if (text) then
+		masterNode = string.match(text, "node(%d+)")
+	end
+	if (not masterNode) then
+		self:Print("no master node")
+		return nil
+	end
+	text = string.gsub(text, "node%d+", "", 1)
+	if (string.match(text,"[^ ]")) then
+		self:Print("syntax error:"..text)
+		return nil
+	end
+	masterNode = node[tonumber(masterNode)]
+	return masterNode
+end
+
 function Ovale:CompileInputs(text)
 	self.casesACocher = {}
 	self.listes = {}

 	text = string.gsub(text, "AddListItem%s*%(%s*(%w+)%s+(%w+)%s+\"(.-)\"%s*%)", ParseAddListItem)
 	text = string.gsub(text, "AddCheckBox%s*%(%s*(%w+)%s+\"(.-)\"%s*%)", ParseAddCheckBox)
-
-	self:UpdateFrame()
 	return text
 end

+local function ParseCanStopChannelling(text)
+	local spell = Ovale:GetSpellInfoOrNil(text)
+	if (spell) then
+		Ovale.canStopChannelling[spell] = true
+	else
+		Ovale:Print("CanStopChannelling with unknown spell "..text)
+	end
+end
+
 function Ovale:Compile(text)
 	self.bug = false
 	node = {}
 	defines = {}

+	-- Suppression des commentaires
 	text = string.gsub(text, "#.-\n","")
+	text = string.gsub(text, "#.*$","")

+	-- Define(CONSTANTE valeur)
 	text = string.gsub(text, "Define%s*%(%s*(%w+)%s+(%w+)%s*%)", ParseDefine)
-
+
+	-- On remplace les constantes par leur valeur
 	for k,v in pairs(defines) do
 		text = string.gsub(text, "([^%w])"..k.."([^%w])", "%1"..v.."%2")
 	end

-	text = self:CompileInputs(text)
+	-- Options diverses
+	Ovale.canStopChannelling = {}
+	text = string.gsub(text, "CanStopChannelling%s*%(%s*(%w+)%s*%)", ParseCanStopChannelling)
+

+	-- On vire les espaces en trop
 	text = string.gsub(text, "\n", " ")
 	text = string.gsub(text, "%s+", " ")

-	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)
+	-- On compile les AddCheckBox et AddListItem
+	text = self:CompileInputs(text)

-	text = subtest(text, "{([^{}]*)}", ParseGroup)
+	local masterNodes ={}

-	text = ParseGroup(text)
-	local masterNode
-	if (text) then
-		masterNode = string.match(text, "node(%d+)")
-	end
-	if (not masterNode) then
-		self:Print("no master node")
-		return nil
-	end
-	text = string.gsub(text, "node%d+", "", 1)
-	if (string.match(text,"[^ ]")) then
-		self:Print("syntax error:"..text)
-		return nil
+	-- On compile les AddIcon
+	for t in string.gmatch(text, "AddIcon%s*(%b{})") do
+		masterNodes[#masterNodes+1] = ParseAddIcon(t)
 	end
-	masterNode = node[tonumber(masterNode)]
-	return masterNode
+	return masterNodes
 end

 function Ovale:DebugNode(node)
diff --git a/OvaleFrame.lua b/OvaleFrame.lua
index c70e59a..0f4d964 100644
--- a/OvaleFrame.lua
+++ b/OvaleFrame.lua
@@ -38,8 +38,31 @@ do

 	local function frameOnMouseUp(this)
 		this:StopMovingOrSizing()
-		Ovale.db.profile.left = this:GetLeft()
-		Ovale.db.profile.top = this:GetTop()
+		if (Ovale.db.profile.left~=this:GetLeft() or Ovale.db.profile.top ~=this:GetTop()) then
+			Ovale.db.profile.left = this:GetLeft()
+			Ovale.db.profile.top = this:GetTop()
+		else
+			if (this.obj.content:IsShown()) then
+				this.obj.content:Hide()
+			else
+				this.obj.content:Show()
+			end
+		end
+	end
+
+	local function frameOnEnter(this)
+		--for i,child in ipairs(this.obj.children) do
+		--	child.frame:Show()
+		--end
+	--	this.obj.content:Show()
+	end
+
+
+	local function frameOnLeave(this)
+		--for i,child in ipairs(this.obj.children) do
+		--	child.frame:Hide()
+		--end
+		--this.obj.content:Hide()
 	end

 	local function titleOnMouseUp(this)
@@ -90,7 +113,6 @@ do

 	local function OnAcquire(self)
 		self.frame:SetParent(UIParent)
-		self.frame:SetFrameStrata("FULLSCREEN_DIALOG")
 		self:ApplyStatus()
 	end

@@ -142,9 +164,43 @@ do
 		content.height = contentheight
 	end

+	local function OnLayoutFinished(self, width, height)
+		-- self.content:SetWidth(width)
+		-- self.content:SetHeight(height)
+		if (not width) then
+			width = self.content:GetWidth()
+		end
+		self.content:SetWidth(width)
+		self.content:SetHeight(height+50)
+	end
+
+	local function UpdateIcons(self)
+		for k, icon in pairs(self.icone) do
+			icon:Hide()
+		end
+
+		for k,node in pairs(Ovale.masterNodes) do
+			if (not self.icone[k]) then
+				self.icone[k] = CreateFrame("Frame",nil,self.frame,"OvaleIcone");
+			end
+			self.icone[k].masterNode = node
+			self.icone[k]:SetPoint("TOPLEFT",self.frame,"TOPLEFT",Ovale.db.profile.apparence.iconWidth*(k-1),0)
+			self.icone[k]:SetWidth(Ovale.db.profile.apparence.iconWidth)
+			self.icone[k]:SetHeight(Ovale.db.profile.apparence.iconHeight)
+			self.icone[k]:Show();
+		end
+
+		self.frame:SetWidth(#Ovale.masterNodes * Ovale.db.profile.apparence.iconWidth)
+		self.frame:SetHeight(Ovale.db.profile.apparence.iconHeight)
+		self.content:SetPoint("TOPLEFT",self.frame,"TOPLEFT",#Ovale.masterNodes * Ovale.db.profile.apparence.iconWidth,0)
+	end
+
 	local function Constructor()
 		local frame = CreateFrame("Frame",nil,UIParent)
 		local self = {}
+
+		-- self.optionsVisible = false
+
 		self.type = "Frame"

 		self.Hide = Hide
@@ -155,10 +211,13 @@ do
 		self.SetStatusText = SetStatusText
 		self.SetStatusTable = SetStatusTable
 		self.ApplyStatus = ApplyStatus
-		self.OnWidthSet = OnWidthSet
-		self.OnHeightSet = OnHeightSet
+	--	self.OnWidthSet = OnWidthSet
+	--	self.OnHeightSet = OnHeightSet
+		self.LayoutFinished = OnLayoutFinished
+		self.UpdateIcons = UpdateIcons

 		self.localstatus = {}
+		self.icone = {}

 		self.frame = frame
 		frame.obj = self
@@ -167,30 +226,26 @@ do
 		frame:SetPoint("CENTER",UIParent,"CENTER",0,0)
 		frame:EnableMouse()
 		frame:SetMovable(true)
-		frame:SetResizable(true)
-		frame:SetFrameStrata("FULLSCREEN_DIALOG")
+		--frame:SetResizable(true)
+		frame:SetFrameStrata("BACKGROUND")
 		frame:SetScript("OnMouseDown", frameOnMouseDown)
 		-- title:SetScript("OnMouseDown",titleOnMouseDown)
 		frame:SetScript("OnMouseUp", frameOnMouseUp)
+		frame:SetScript("OnEnter", frameOnEnter)
+		frame:SetScript("OnLeave", frameOnLeave)

-		--[[frame:SetBackdrop(FrameBackdrop)
-		frame:SetBackdropColor(0,0,0,1)]]--
 		frame:SetScript("OnHide",frameOnClose)
-		frame:SetMinResize(400,200)
-		frame:SetToplevel(true)
-
-		self.icone = CreateFrame("Frame",nil,frame,"OvaleIcone");
-		self.icone:SetPoint("TOPLEFT",frame,"TOPLEFT",0,0)
-		self.icone:SetWidth(64)
-		self.icone:SetHeight(64)
-		self.icone:Show();

 		--Container Support
 		local content = CreateFrame("Frame",nil,frame)
 		self.content = content
 		content.obj = self
-		content:SetPoint("TOPLEFT",frame,"TOPLEFT",64,0)
-		content:SetPoint("BOTTOMRIGHT",frame,"BOTTOMRIGHT",0,0)
+		content.test = "test"
+		content:SetWidth(200)
+		content:SetHeight(100)
+		--content:SetPoint("BOTTOMRIGHT",frame,"BOTTOMRIGHT",0,0)
+		-- content:EnableMouse()
+		content:Hide()

 		AceGUI:RegisterAsContainer(self)

@@ -200,68 +255,3 @@ do
 	AceGUI:RegisterWidgetType(Type,Constructor,Version)
 end

-
-
---[[
-function OvaleFrame_OnLoad(self)
-	self.icone = CreateFrame("Frame",nil,self,"OvaleIcone");
-	self.icone:SetAllPoints(self)
-	self.icone:Show();
-
-	--self.cases = {}
-	--local case = CreateFrame("Button", "OvaleCheck", self)
-	--case:SetPoint("TOPLEFT", 0, 0)
-	--self.cases[#self.cases] = case
-	self.checkBoxes = {}
-
-	self.dropDowns = {};
-	local tf = LibStub("AceGUI-3.0"):Create("Frame")
-	tf:SetWidth(200)
-	tf:SetHeight(200)
-	local tl = LibStub("AceGUI-3.0"):Create("Label")
-		tl:SetText("Anfangstext")
-	local ti = LibStub("AceGUI-3.0"):Create("Icon")
-		ti:SetHeight(50)
-		ti:SetWidth(50)
-
-	tf:AddChild(tl)
-	tf:AddChild(ti)
-end
-
-function OvaleFrame_Update(self)
-	for v,k in pairs(self.checkBoxes) do
-		k:Hide()
-	end
-
-	for v,k in pairs(Ovale.casesACocher) do
-		if (not self.checkBoxes[v]) then
-			self.checkBoxes[v] = OvaleFrame_CreateCheckBox(self, v)
-		end
-		self.checkBoxes[v]:Show()
-		self.checkBoxes[v].text:SetText(k)
-	end
-
-end
-
-
--- Idem. Liste déroulante
-
-
-
-
-
-function OvaleFrame_OnUpdate(self)
-
-end
-function OvaleFrame_OnMouseDown(self,button)
-	if ( button == "LeftButton") then
-		self:StartMoving();
-	end
-end
-
-function OvaleFrame_OnMouseUp(self, button)
-	if ( button == "LeftButton" ) then
-		self:StopMovingOrSizing();
-	end
-end
-]]--
\ No newline at end of file
diff --git a/OvaleIcone.lua b/OvaleIcone.lua
index 271df91..fd40a32 100644
--- a/OvaleIcone.lua
+++ b/OvaleIcone.lua
@@ -5,7 +5,7 @@
 		Ovale.traced = false
 	end

-	local minAttente = Ovale:CalculerMeilleureAction(Ovale.masterNode)
+	local minAttente = Ovale:CalculerMeilleureAction(self.masterNode)
 	local meilleureAction = Ovale.retourAction

 	if (Ovale.trace) then
@@ -29,7 +29,7 @@
 		end

 		local spell, rank, displayName, icon, startTime, endTime, isTradeSkill = UnitChannelInfo("player")
-		if (spell) then
+		if (spell and not Ovale.canStopChannelling[spell]) then
 			local attenteFinCast = endTime/1000 - Ovale.maintenant
 			if (attenteFinCast > minAttente) then
 				minAttente = attenteFinCast
diff --git a/defaut/Chaman.lua b/defaut/Chaman.lua
index e69de29..5b31760 100644
--- a/defaut/Chaman.lua
+++ b/defaut/Chaman.lua
@@ -0,0 +1,17 @@
+Ovale.defaut["SHAMAN"] =
+[[AddCheckBox(chain "Chaîne d'éclairs")
+
+Define(CHAINLIGHTNING 421)
+Define(LIGHTNINGBOLT 403)
+Define(LAVABURST 51505)
+Define(WATERSHIELD 52127)
+Define(FLAMESHOCK 8050)
+Define(FLAMETHONG 8024)
+
+if BuffExpires(FLAMETHONG 2) Spell(FLAMETHONG)
+if BuffExpires(WATERSHIELD 2) Spell(WATERSHIELD)
+if TargetDebuffExpires(FLAMESHOCK 0) Spell(FLAMESHOCK)
+Spell(LAVABURST doNotRepeat=1)
+if CheckBoxOn(chain) Spell(CHAINLIGHTNING doNotRepeat=1)
+Spell(LIGHTNINGBOLT)
+]]
\ No newline at end of file
diff --git a/defaut/Demoniste.lua b/defaut/Demoniste.lua
index bfbb77c..7974f5e 100644
--- a/defaut/Demoniste.lua
+++ b/defaut/Demoniste.lua
@@ -27,7 +27,8 @@ Define(TALENTBACKDRAFT 1888)
 Define(CONFLAGRATE 17962)
 Define(DRAINSOUL 47855)

-
+AddIcon
+{
 if List(curse recklessness) and TargetDebuffExpires(CURSERECKLESSNESS 2) Spell(CURSERECKLESSNESS)
 if List(curse elements) and TargetDebuffExpires(CURSEELEMENTS 2) Spell(CURSEELEMENTS)
 if List(curse doom) and TargetDebuffExpires(CURSEDOOM 0 mine=1) Spell(CURSEDOOM)
@@ -40,10 +41,11 @@ if TargetDebuffExpires(UNSTABLEAFFLICTION 1.5 mine=1) Spell(UNSTABLEAFFLICTION d
 if TargetDebuffExpires(CORRUPTION 0 mine=1) Spell(CORRUPTION)
 if TalentPoints(TALENTBACKDRAFT more 0) and TargetDebuffExpires(IMMOLATE 3 mine=1)
    and TargetDebuffPresent(IMMOLATE mine=1) Spell(CONFLAGRATE doNotRepeat=1)
-if TargetDebuffExpires(IMMOLATE 1.5 mine=1) Spell(IMMOLATE doNotRepeat=1)
+if TargetDebuffExpires(IMMOLATE 1.5 mine=1) and TargetLifePercent(more 25) Spell(IMMOLATE doNotRepeat=1)

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

 if TalentPoints(TALENTEMBERSTORM more 0) Spell(SOULFIRE)
 Spell(SHADOWBOLT)
+}
 ]]
diff --git a/defaut/Druide.lua b/defaut/Druide.lua
index a780839..8c8548a 100644
--- a/defaut/Druide.lua
+++ b/defaut/Druide.lua
@@ -22,48 +22,68 @@ Define(ECLIPSESTARFIRE 48518)
 Define(ECLIPSEWRATH 48517)
 Define(TIGERSFURY 5217)

-if Stance(1)
+AddIcon
 {
-     if CheckBoxOn(lucioles) and TargetDebuffExpires(FAERIEFERAL 2)
-         Spell(FAERIEFERAL)
-
+  if Stance(1)
+  {
+     if CheckBoxOn(lucioles) and
+          TargetDebuffExpires(FAERIEFERAL 2)
+       Spell(FAERIEFERAL)
+
      Spell(MANGLEBEAR)
-
-     if CheckBoxOn(demo) and TargetDebuffExpires(DEMOROAR 2)
-         Spell(DEMOROAR)
-
+
+     if CheckBoxOn(demo) and
+          TargetDebuffExpires(DEMOROAR 2)
+       Spell(DEMOROAR)
+
      if CheckBoxOn(multi) Spell(SWIPE)
-
-     if CheckBoxOn(blood) and Mana(more 10) Spell(LACERATE)
-     if Mana(more 50) Spell(MAUL doNotRepeat=1)
-}
+
+     if CheckBoxOn(blood) and Mana(more 10)
+      Spell(LACERATE)
+  }

-if Stance(3)
-{
-     if CheckBoxOn(lucioles) and TargetDebuffExpires(FAERIEFERAL 2)
-         Spell(FAERIEFERAL)
+  if Stance(3)
+  {
+     if CheckBoxOn(lucioles) and
+         TargetDebuffExpires(FAERIEFERAL 2)
+       Spell(FAERIEFERAL)

      Spell(TIGERSFURY)
-
+
      if ComboPoints(more 4) and Mana(more 70)
-         Spell(RIP)
-
+       Spell(RIP)
+
      if ComboPoints(less 5)
      {
-         if TargetDebuffExpires(MANGLECAT 0) Spell(MANGLECAT)
-         Spell(SHRED)
+       if TargetDebuffExpires(MANGLECAT 0)
+          Spell(MANGLECAT)
+       Spell(SHRED)
      }
-}
+  }

-unless Stance(1) or Stance(3)
-{
-     if CheckBoxOn(lucioles) and TargetDebuffExpires(FAERIEFIRE 2)
-        Spell(FAERIEFIRE)
-
-     if TargetDebuffExpires(INSECTSWARM 0) Spell(INSECTSWARM)
-     if TargetDebuffExpires(MOONFIRE 0) Spell(MOONFIRE)
+  unless Stance(1) or Stance(3)
+  {
+     if CheckBoxOn(lucioles) and
+         TargetDebuffExpires(FAERIEFIRE 2)
+      Spell(FAERIEFIRE)
+
+     if TargetDebuffExpires(INSECTSWARM 0)
+       Spell(INSECTSWARM)
+     if TargetDebuffExpires(MOONFIRE 0)
+        Spell(MOONFIRE)
      unless BuffPresent(ECLIPSEWRATH)
-          Spell(STARFIRE)
+        Spell(STARFIRE)
      Spell(WRATH)
+  }
 }
+
+AddIcon
+{
+  if Stance(1)
+  {
+     if Mana(more 50)
+       Spell(MAUL doNotRepeat=1)
+  }
+}
+
 ]]
diff --git a/defaut/Guerrier.lua b/defaut/Guerrier.lua
index 549f4eb..3af89b9 100644
--- a/defaut/Guerrier.lua
+++ b/defaut/Guerrier.lua
@@ -29,74 +29,89 @@ Define(CONCUSSIONBLOW 12809)
 Define(REND 772)
 Define(OVERPOWER 7384)

-if List(cri commandement) and BuffExpires(COMMANDSHOUT 3)
-    Spell(COMMANDSHOUT)
-
-if List(cri guerre) and BuffExpires(BATTLESHOUT 3)
-    Spell(BATTLESHOUT)
-
-if TargetClassification(worldboss) and CheckBoxOn(demo)
-      and TargetDebuffExpires(DEMOSHOUT 2)
-    Spell(DEMOSHOUT)
-
-if Stance(2) #Defense
+AddIcon
 {
-   if TargetClassification(worldboss) and TargetDebuffExpires(THUNDERCLAP 2)
-      Spell(THUNDERCLAP)
-
-   if CheckBoxOn(multi)
-   {
-        Spell(THUNDERCLAP)
+     if List(cri commandement) and
+       BuffExpires(COMMANDSHOUT 3)
+          Spell(COMMANDSHOUT)
+
+     if List(cri guerre) and BuffExpires(BATTLESHOUT 3)
+          Spell(BATTLESHOUT)
+
+     if TargetClassification(worldboss)
+            and CheckBoxOn(demo)
+            and TargetDebuffExpires(DEMOSHOUT 2)
+          Spell(DEMOSHOUT)
+
+     if Stance(2) #Defense
+     {
+        if TargetClassification(worldboss)
+              and TargetDebuffExpires(THUNDERCLAP 2)
+            Spell(THUNDERCLAP)
+
+        if CheckBoxOn(multi)
+        {
+               Spell(THUNDERCLAP)
+               Spell(SHOCKWAVE)
+        }
+
+        Spell(REVENGE usable=1)
+        Spell(SHIELDSLAM)
+
+        if Mana(more 10) Spell(DEVASTATE priority=2)
+     }
+
+     if Stance(3) #berserker
+     {
+        Spell(VICTORY usable=1)
+
+       # if TargetLifePercent(less 20) Spell(EXECUTE)
+        Spell(EXECUTE usable=1)
+
+        Spell(SHIELDSLAM usable=1)
         Spell(SHOCKWAVE)
-   }
-
-   Spell(REVENGE usable=1)
-   Spell(SHIELDSLAM)
-
-   if Mana(more 10) Spell(DEVASTATE priority=2)
-}
+        Spell(CONCUSSIONBLOW)
+
+        Spell(BLOODTHIRST)
+        if CheckBoxOn(tourbillon) Spell(WHIRLWIND)
+        if BuffPresent(SLAMBUFF) Spell(SLAM)
+        Spell(MORTALSTRIKE)
+        Spell(DEVASTATE)
+
+        if TalentPoints(SLAMTALENT more 1)
+           and AfterWhiteHit(0.2)
+          Spell(SLAM)
+     }

-if Stance(3) #berserker
-{
-   Spell(VICTORY usable=1)
-
-  # if TargetLifePercent(less 20) Spell(EXECUTE)
-   Spell(EXECUTE usable=1)
-
-   Spell(SHIELDSLAM usable=1)
-   Spell(SHOCKWAVE)
-   Spell(CONCUSSIONBLOW)
-
-   Spell(BLOODTHIRST)
-   if CheckBoxOn(tourbillon) Spell(WHIRLWIND)
-   if BuffPresent(SLAMBUFF) Spell(SLAM)
-   Spell(MORTALSTRIKE)
-   Spell(DEVASTATE)
-
-   if TalentPoints(SLAMTALENT more 1) and AfterWhiteHit(0.2)
-       Spell(SLAM)
-}
+     if Stance(1) #combat
+     {
+        Spell(VICTORY usable=1)
+        Spell(OVERPOWER usable=1)
+        Spell(MORTALSTRIKE)
+
+        Spell(REND)
+
+        Spell(SHIELDSLAM usable=1)
+        Spell(SHOCKWAVE)
+        Spell(CONCUSSIONBLOW)
+
+        Spell(DEVASTATE)
+     }

-if Stance(1) #combat
-{
-   Spell(VICTORY usable=1)
-   Spell(OVERPOWER usable=1)
-   Spell(MORTALSTRIKE)
-
-   Spell(REND)
-
-   Spell(SHIELDSLAM usable=1)
-   Spell(SHOCKWAVE)
-   Spell(CONCUSSIONBLOW)
-
-   Spell(DEVASTATE)
+
+     if TargetDebuffExpires(SUNDER 5 stacks=5)
+        Spell(SUNDER)
 }

-if Mana(more 50)
+AddIcon
 {
-   if CheckBoxOn(multi) Spell(CLEAVE doNotRepeat=1)
-   if CheckBoxOff(multi) Spell(HEROICSTRIKE doNotRepeat=1)
+     if Mana(more 50)
+     {
+        if CheckBoxOn(multi)
+           Spell(CLEAVE doNotRepeat=1)
+        if CheckBoxOff(multi)
+          Spell(HEROICSTRIKE doNotRepeat=1)
+     }
 }

-if TargetDebuffExpires(SUNDER 5 stacks=5) Spell(SUNDER)
 ]]
diff --git a/defaut/Paladin.lua b/defaut/Paladin.lua
index 51d0875..fdefc99 100644
--- a/defaut/Paladin.lua
+++ b/defaut/Paladin.lua
@@ -8,24 +8,27 @@ AddListItem(jugement sagesse "Jugement de sagesse")
 AddCheckBox(consecration "Consécration")
 AddCheckBox(tempete "Tempête divine")

-if List(sceau piete) and BuffExpires(21084 3) Spell(21084)
-if List(sceau autorite) and BuffExpires(20375 3) Spell(20375)
-if List(sceau martyr)
+AddIcon
 {
-    if BuffExpires(53720 3) Spell(53720)
-    if BuffExpires(31892 3) Spell(31892)
+     if List(sceau piete) and BuffExpires(21084 3) Spell(21084)
+     if List(sceau autorite) and BuffExpires(20375 3) Spell(20375)
+     if List(sceau martyr)
+     {
+          if BuffExpires(53720 3) Spell(53720)
+          if BuffExpires(31892 3) Spell(31892)
+     }
+     if List(sceau vengeance)
+     {
+          if BuffExpires(31801 3) Spell(31801)
+          if BuffExpires(53736 3) Spell(53736)
+     }
+     if List(jugement lumiere) Spell(20271)
+     if List(jugement sagesse) Spell(53408)
+     if TargetLifePercent(less 35) Spell(24275)
+     Spell(35395) #Inquisition
+     if CheckBoxOn(tempete) Spell(53385)
+     if CheckBoxOn(consecration) Spell(26573)
+     Spell(20473) #Horion sacré
+     if BuffPresent(59578) Spell(19750 priority=2)
 }
-if List(sceau vengeance)
-{
-    if BuffExpires(31801 3) Spell(31801)
-    if BuffExpires(53736 3) Spell(53736)
-}
-if List(jugement lumiere) Spell(20271)
-if List(jugement sagesse) Spell(53408)
-if TargetLifePercent(less 20) Spell(24275)
-Spell(35395) #Inquisition
-if CheckBoxOn(tempete) Spell(53385)
-if CheckBoxOn(consecration) Spell(26573)
-Spell(20473) #Horion sacré
-if BuffPresent(59578) Spell(19750 priority=2)]]
-
\ No newline at end of file
+]]
diff --git a/defaut/Pretre.lua b/defaut/Pretre.lua
index e5596bc..49c17d0 100644
--- a/defaut/Pretre.lua
+++ b/defaut/Pretre.lua
@@ -2,31 +2,52 @@ Ovale.defaut["PRIEST"] =
 [[AddCheckBox(etreinte "Étreinte vampirique")
 AddCheckBox(mort "Mot de l'ombre : Mort")

-# Mot de pouvoir : Robustesse
-if BuffExpires(1243 5) and BuffExpires(21562 5) Spell(1243)
-# Forme d'ombre
-if BuffExpires(15473 0) Spell(15473)
+Define(DEATH 32379)
+Define(FORTITUDE 1243)
+Define(PRAYERFORTITUDE 21562)
+Define(SHADOWFORM 15473)
+Define(VAMPIRICEMBRACE 15286)
+Define(VAMPIRICTOUCH 34914)
+Define(PAIN 589)
+Define(TALENTDIVINEFURY 1181)
+Define(MINDBLAST 8092)
+Define(MINDFLAY 15407)
+Define(HOLYFIRE 14914)
+Define(SMITE 585)
+Define(DEVOURINGPLAGUE 2944)
+Define(SHADOWWEAVE 15332)

-if CheckBoxOn(etreinte) and TargetDebuffExpires(15286 0 mine=1)
-   Spell(15286 doNotRepeat=1)
+CanStopChannelling(MINDFLAY)

-#toucher vampirique
-if TargetDebuffExpires(34914 1 mine=1)
-   Spell(34914 doNotRepeat=1)
+AddIcon
+{
+     # Mot de pouvoir : Robustesse
+     if BuffExpires(FORTITUDE 5) and BuffExpires(PRAYERFORTITUDE 5) Spell(FORTITUDE)
+     # Forme d'ombre
+     if BuffExpires(SHADOWFORM 0) Spell(SHADOWFORM)

-#mot de l'ombre : douleur
-if TargetDebuffExpires(589 0 mine=1)
-   Spell(589)
-
-if TalentPoints(1181 less 1) # Fureur divine
-   Spell(8092) # Attaque mentale
-
-if CheckBoxOn(mort) and LifePercent(more 95) Spell(32379)
+     if CheckBoxOn(etreinte) and TargetDebuffExpires(VAMPIRICEMBRACE 0 mine=1)
+        Spell(VAMPIRICEMBRACE doNotRepeat=1)

-Spell(15407) #Fouet mental
+     if BuffPresent(SHADOWWEAVE stacks=5) and TargetDebuffExpires(PAIN 0 mine=1)
+        Spell(PAIN)

-if TargetDebuffExpires(14914 0 mine=1)
-    Spell(14914) #Flammes sacrées
+     if TargetDebuffExpires(VAMPIRICTOUCH 1 mine=1)
+        Spell(VAMPIRICTOUCH doNotRepeat=1)
+
+     if TalentPoints(TALENTDIVINEFURY less 1) # Fureur divine
+        Spell(MINDBLAST) # Attaque mentale
+
+     if TargetDebuffExpires(DEVOURINGPLAGUE 0 mine=1)
+	    Spell(DEVOURINGPLAGUE doNotRepeat=1)
+
+     if CheckBoxOn(mort) and LifePercent(more 95) Spell(DEATH)

-Spell(585) # châtiment
+     Spell(MINDFLAY priority=2)
+
+     if TargetDebuffExpires(HOLYFIRE 0 mine=1)
+        Spell(HOLYFIRE)
+
+     Spell(SMITE)
+}
 ]]