Quantcast

MoP merge

Sidoine De Wispelaere [08-29-12 - 20:03]
MoP merge

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@515 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
Ovale.lua
Ovale.toc
OvaleAura.lua
OvaleBestAction.lua
OvaleCompile.lua
OvaleCondition.lua
OvaleData.lua
OvaleFrame.lua
OvaleFuture.lua
OvaleGUID.lua
OvaleIcone.lua
OvaleIcone.xml
OvaleOptions.lua
OvaleState.lua
defaut/Chaman.lua
defaut/Chasseur.lua
defaut/Chevalier.lua
defaut/Demoniste.lua
defaut/Druide.lua
defaut/Guerrier.lua
defaut/Mage.lua
defaut/Moine.lua
defaut/Paladin.lua
defaut/Pretre.lua
defaut/Voleur.lua
diff --git a/Ovale.lua b/Ovale.lua
index 05f440d..c132532 100644
--- a/Ovale.lua
+++ b/Ovale.lua
@@ -320,4 +320,9 @@ function Ovale:ToggleCheckBox(v)
 		v = v - 1
 	end
 end
+
+function Ovale:Error(text)
+	self:Print("Fatal error: " .. text)
+	self.bug = true
+end
 --</public-static-methods>
diff --git a/Ovale.toc b/Ovale.toc
index 7ad6c5d..401e46f 100644
--- a/Ovale.toc
+++ b/Ovale.toc
@@ -1,9 +1,10 @@
-## Interface: 40300
+## Interface: 50001
+## X-Min-Interface: 50000
 ## Title: Ovale Spell Priority
 ## Notes: Show the icon of the next spell to cast
 ## Notes-frFR: Affiche l'icône du prochain sort à lancer
 ## Author: Sidoine
-## Version: 4.3.13
+## Version: 5.0.0
 ## OptionalDeps: Ace3, Masque, Recount, Skada, LibBabble-CreatureType-3.0, LibRangeCheck-2.0
 ## SavedVariables: OvaleDB
 ## SavedVariablesPerCharacter: OvaleDBPC
@@ -51,4 +52,5 @@ defaut\Mage.lua
 defaut\Paladin.lua
 defaut\Pretre.lua
 defaut\Voleur.lua
+defaut\Moine.lua
 defaut\Chevalier.lua
diff --git a/OvaleAura.lua b/OvaleAura.lua
index ae0f3d4..5597898 100644
--- a/OvaleAura.lua
+++ b/OvaleAura.lua
@@ -149,9 +149,9 @@ function OvaleAura:UpdateAuras(unitId, unitGUID)
 			end

 			if unitId == "player" then
-				if OvaleData.buffSpellList.spellhaste[spellId] then
+				if OvaleData.buffSpellList.spell_haste[spellId] then
 					hateSorts = 5
-				elseif OvaleData.buffSpellList.meleehaste[spellId] then
+				elseif OvaleData.buffSpellList.melee_haste[spellId] then
 					hateCaC = 10
 				elseif OvaleData.buffSpellList.heroism[spellId] then
 					hateHero = 30
@@ -231,28 +231,53 @@ function OvaleAura:GetAura(unitId, spellId, mine)
 	return self:GetAuraByGUID(UnitGUID(unitId), spellId, mine, unitId)
 end

+function OvaleAura:GetStealable(unitId)
+	local auraTable = self.aura[UnitGUID(unitId)]
+	if not auraTable then
+		return nil
+	end
+	local starting,ending
+
+	for spellId, ownerTable in pairs(auraTable) do
+		local aura = ownerTable.other
+		if aura and aura.stealable then
+			if not starting or aura.start < starting then
+				starting = aura.start
+			end
+			if not ending or aura.ending > ending then
+				ending = aura.ending
+			end
+		end
+	end
+	return starting, ending
+end
+
 -- Look for the last of my aura on any targt that will expires.
 -- Returns its expiration time
-function OvaleAura:GetExpirationTimeOnAnyTarget(spellId)
+function OvaleAura:GetExpirationTimeOnAnyTarget(spellId, excludingTarget)
 	local ending = nil
 	local starting = nil
+	local count = 0

 	for unitId,auraTable in pairs(self.aura) do
-		if auraTable[spellId] then
-			local aura = auraTable[spellId].mine
-			if aura then
-				local newEnding = aura.ending
-				local newStarting = aura.start
-				if newStarting and (not staring or newStarting < starting) then
-					starting = newStarting
-				end
-				if newEnding and (not ending or newEnding > ending) then
-					ending = newEnding
+		if unitId ~= excludingTarget then
+			if auraTable[spellId] then
+				local aura = auraTable[spellId].mine
+				if aura then
+					local newEnding = aura.ending
+					local newStarting = aura.start
+					if newStarting and (not staring or newStarting < starting) then
+						starting = newStarting
+					end
+					if newEnding and (not ending or newEnding > ending) then
+						ending = newEnding
+					end
+					count = count + 1
 				end
-			end
-		end
+			end
+		end
 	end
-	return starting, ending
+	return starting, ending, count
 end

 function OvaleAura:Debug()
diff --git a/OvaleBestAction.lua b/OvaleBestAction.lua
index f514624..814cfb2 100644
--- a/OvaleBestAction.lua
+++ b/OvaleBestAction.lua
@@ -40,6 +40,23 @@ end
 local function isAfter(time1, time2)
 	return not time1 or (time2 and time1>time2)
 end
+
+local function minTime(time1, time2)
+	if isBefore(time1, time2) then
+		return time1
+	else
+		return time2
+	end
+end
+
+local function maxTime(time1, time2)
+	if isAfter(time1, time2) then
+		return time1
+	else
+		return time2
+	end
+end
+
 --</private-static-methods>

 --<public-static-methods>
@@ -63,7 +80,7 @@ function OvaleBestAction:GetActionInfo(element)
 		target = OvaleCondition.defaultTarget
 	end

-	if (element.func == "Spell" ) then
+	if (element.func == "spell" ) then
 		action = OvaleActionBar:GetForSpell(spellId)
 		if not OvaleData.spellList[spellId] and not action then
 			Ovale:Log("Spell "..spellId.." not learnt")
@@ -72,6 +89,28 @@ function OvaleBestAction:GetActionInfo(element)

 		actionCooldownStart, actionCooldownDuration, actionEnable = OvaleData:GetComputedSpellCD(spellId)

+		local si = OvaleData:GetSpellInfo(spellId)
+		if si then
+			if si.stance and si.stance > 0 and GetShapeshiftForm()~=si.stance then
+				return nil
+			end
+
+			if si.combo == 0 and OvaleState.state.combo == 0 then
+				return nil
+			end
+			for k,v in pairs(OvaleData.secondaryPower) do
+				if si[v] and si[v] > OvaleState.state[v] then
+					return nil
+				end
+			end
+			if si.blood or si.frost or si.unholy or si.death then
+				local runecd = OvaleState:GetRunes(si.blood, si.frost, si.unholy, si.death, false)
+				if runecd > actionCooldownStart + actionCooldownDuration then
+					actionCooldownDuration = runecd - actionCooldownStart
+				end
+			end
+		end
+
 		spellName = OvaleData.spellList[spellId]
 		if not spellName then
 			spellName = GetSpellInfo(spellId)
@@ -80,7 +119,7 @@ function OvaleBestAction:GetActionInfo(element)
 		actionInRange = IsSpellInRange(spellName, target)
 		actionUsable = IsUsableSpell(spellId)
 		actionShortcut = nil
-	elseif (element.func=="Macro") then
+	elseif (element.func=="macro") then
 		action = OvaleActionBar:GetForMacro(element.params[1])
 		if action then
 			actionTexture = GetActionTexture(action)
@@ -92,7 +131,7 @@ function OvaleBestAction:GetActionInfo(element)
 		else
 			Ovale:Log("Unknown macro "..element.params[1])
 		end
-	elseif (element.func=="Item") then
+	elseif (element.func=="item") then
 		local itemId
 		if (type(element.params[1]) == "number") then
 			itemId = element.params[1]
@@ -117,7 +156,7 @@ function OvaleBestAction:GetActionInfo(element)
 		actionCooldownStart, actionCooldownDuration, actionEnable = GetItemCooldown(itemId)
 		actionShortcut = nil
 		actionIsCurrent = nil
-	elseif element.func=="Texture" then
+	elseif element.func=="texture" then
 		actionTexture = "Interface\\Icons\\"..element.params[1]
 		actionCooldownStart = OvaleState.maintenant
 		actionCooldownDuration = 0
@@ -142,6 +181,16 @@ function OvaleBestAction:GetActionInfo(element)
 					actionUsable, actionShortcut, actionIsCurrent, actionEnable, spellId, target, element.params.nored
 end

+function OvaleBestAction:ComputeBool(element)
+	local start, ending, priority, element = self:Compute(element)
+	--Special case of a value element: it must not be 0
+	if element and element.type == "value" and element.value == 0 and element.rate == 0 then
+		return nil
+	else
+		return start, ending, priority, element
+	end
+end
+
 function OvaleBestAction:Compute(element)
 	if (Ovale.bug and not Ovale.trace) then
 		return nil
@@ -153,7 +202,7 @@ function OvaleBestAction:Compute(element)

 	--TODO: crer un objet par type au lieu de ce if else if tout moche
 	if (element.type=="function")then
-		if (element.func == "Spell" or element.func=="Macro" or element.func=="Item" or element.func=="Texture") then
+		if (element.func == "spell" or element.func=="macro" or element.func=="item" or element.func=="texture") then
 			local action
 			local actionTexture, actionInRange, actionCooldownStart, actionCooldownDuration,
 				actionUsable, actionShortcut, actionIsCurrent, actionEnable, spellId = self:GetActionInfo(element)
@@ -243,25 +292,25 @@ function OvaleBestAction:Compute(element)
 				Ovale:Print("Function "..element.func.." not found")
 				return nil
 			end
-			local start, ending, rate = classe(element.params)
+			local start, ending, value, origin, rate = classe(element.params)

 			if (Ovale.trace) then
 				local parameterList = element.func.."("
 				for k,v in pairs(element.params) do
 					parameterList = parameterList..k.."="..v..","
 				end
-				Ovale:Print("Function "..parameterList..") returned "..nilstring(start)..","..nilstring(ending)..","..nilstring(rate))
+				Ovale:Print("Function "..parameterList..") returned "..nilstring(start)..","..nilstring(ending)..","..nilstring(value)..","..nilstring(origin)..","..nilstring(rate))
 			end

-			if rate then
+			if value  then
 				if not element.result then
 					element.result = { type = "value" }
 				end
 				local result = element.result
-				result.value = start
-				result.origin = ending
+				result.value = value
+				result.origin = origin
 				result.rate = rate
-				return 0, nil, 3, result
+				return start, ending, 3, result
 			else
 				return start, ending
 			end
@@ -340,7 +389,7 @@ function OvaleBestAction:Compute(element)
 		if (Ovale.trace) then
 			Ovale:Print(element.type.." ["..element.nodeId.."]")
 		end
-		local startA, endA = self:Compute(element.a)
+		local startA, endA, prioriteA, elementA = self:ComputeBool(element.a)
 		if (startA==nil) then
 			if Ovale.trace then Ovale:Print(element.type.." return nil  ["..element.nodeId.."]") end
 			return nil
@@ -349,7 +398,13 @@ function OvaleBestAction:Compute(element)
 			if Ovale.trace then Ovale:Print(element.type.." return startA=endA  ["..element.nodeId.."]") end
 			return nil
 		end
-		local startB, endB, prioriteB, elementB = self:Compute(element.b)
+
+		local startB, endB, prioriteB, elementB
+		if element.type == "if" then
+			startB, endB, prioriteB, elementB = self:Compute(element.b)
+		else
+			startB, endB, prioriteB, elementB = self:ComputeBool(element.b)
+		end
 		if isAfter(startB, endA) or isAfter(startA, endB) then
 			if Ovale.trace then Ovale:Print(element.type.." return nil ["..element.nodeId.."]") end
 			return nil
@@ -368,7 +423,7 @@ function OvaleBestAction:Compute(element)
 		if Ovale.trace then
 			Ovale:Print(element.type)
 		end
-		local startA, endA = self:Compute(element.a)
+		local startA, endA = self:ComputeBool(element.a)
 		local startB, endB, prioriteB, elementB = self:Compute(element.b)

 		if isBeforeEqual(startA, startB) and isAfterEqual(endA, endB) then
@@ -391,13 +446,20 @@ function OvaleBestAction:Compute(element)

 		if Ovale.trace then Ovale:Print(element.type.." return "..nilstring(startB)..","..nilstring(endB)) end
 		return startB, endB, prioriteB, elementB
-	elseif (element.type == "or") then
-		if (Ovale.trace) then
+	elseif element.type == "not" then
+		local startA, endA = self:ComputeBool(element.a)
+		if startA then
+			return endA, nil
+		else
+			return 0, nil
+		end
+	elseif element.type == "or" then
+		if Ovale.trace then
 			Ovale:Print(element.type)
 		end

-		local startA, endA = self:Compute(element.a)
-		local startB, endB = self:Compute(element.b)
+		local startA, endA = self:ComputeBool(element.a)
+		local startB, endB = self:ComputeBool(element.b)
 		if isBefore(endA,OvaleState.currentTime) then
 			return startB,endB
 		elseif isBefore(endB,OvaleState.currentTime) then
@@ -420,16 +482,46 @@ function OvaleBestAction:Compute(element)
 	elseif element.type == "operator" then
 		local startA, endA, prioA, elementA = self:Compute(element.a)
 		local startB, endB, prioB, elementB = self:Compute(element.b)
-		if not elementA or not elementB then
-			Ovale:Log("operator " .. element.operator .. ": elementA or elementB is nil")
-			return nil
+		--if not elementA or not elementB then
+		--	Ovale:Log("operator " .. element.operator .. ": elementA or elementB is nil")
+		--	return nil
+		--end
+
+		local a,b,c,x,y,z
+
+		if elementA then
+			a = elementA.value
+			b = elementA.origin
+			c = elementA.rate
+		else
+			-- A boolean used in a number context has the value 1
+			a = 1
+			b = 0
+			c = 0
+		end
+		if elementB then
+			x = elementB.value
+			y = elementB.origin
+			z = elementB.rate
+		else
+			x = 1
+			y = 0
+			z = 0
+		end
+
+		if startA == endA then
+			startA = 0; endA = nil;	a = 0; b = 0; c= 0
+		end
+		if startB == endB then
+			startB = 0; endB = nil; x =0; y =0; z =0
+		end
+
+		if isBefore(startA, startB) then
+			startA = startB
+		end
+		if isAfter(endA, endB) then
+			endA = endB
 		end
-		local a = elementA.value
-		local b = elementA.origin
-		local c = elementA.rate
-		local x = elementB.value
-		local y = elementB.origin
-		local z = elementB.rate

 		if not a or not x or not b or not y then
 			Ovale:Log("operator " .. element.operator .. ": a or x is nil")
@@ -467,9 +559,15 @@ function OvaleBestAction:Compute(element)
 			if z == 0 then
 				l = a/x; m = b; n = c/x
 			else
-				Ovale:Print("ERROR: second operator of / must be constant")
+				Ovale:Print("ERROR: second value of / must be constant")
 				Ovale.bug = true
 			end
+		elseif element.operator == '%' then
+			if c == 0 and z == 0 then
+				l = c % z; m = 0; n = 0
+			else
+				Ovale:Error("Parameters of % must be constants")
+			end
 		elseif element.operator == '<' then
 			-- a + (t-b)*c = x + (t-y)*z
 			-- (t-b)*c - (t-y)*z = x - a
@@ -478,35 +576,53 @@ function OvaleBestAction:Compute(element)
 			-- t = (x-a + b*c - y*z)/(c-z)
 			if c == z then
 				if a-b*c < x-y*z then
-					return 0
+					return startA, endA
 				else
 					return nil
 				end
 			else
 				local t = (x-a + b*c - y*z)/(c-z)
 				if c > z then
-					return 0, t
+					return startA, minTime(endA, t)
 				else
-					return t, nil
+					return maxTime(startA, t), endA
 				end
 			end
+		elseif element.operator == '<=' then
+			if c == z then
+				if a - b*c <= x-y*z then return startA, endA else return nil end
+			else
+				local t = (x-a + b*c - y*z)/(c-z)
+				if c > z then return startA, minTime(endA, t) else return maxTime(startA, t), endA end
+			end
 		elseif element.operator == '>' then
 			if c == z then
-				Ovale:Log("> with c==z")
 				if a-b*c > x-y*z then
-					Ovale:Log("a>x")
-					return 0
+					return startA, endA
 				else
 					return nil
 				end
 			else
 				local t = (x-a + b*c - y*z)/(c-z)
 				if c < z then
-					return 0, t
+					return startA, minTime(endA, t)
 				else
-					return t, nil
+					return maxTime(startA, t), endA
 				end
 			end
+		elseif element.operator == '==' then
+			if c == z then
+				if a - b*c == x-y*z then return startA,endA else return nil end
+			else
+				return nil
+			end
+		elseif element.operator == '>=' then
+			if c == z then
+				if a - b*c >= x-y*z then return startA, endA else return nil end
+			else
+				local t = (x-a + b*c - y*z)/(c-z)
+				if c < z then return startA, minTime(endA, t) else return maxTime(startA, t), endA end
+			end
 		end
 		if not element.result then
 			element.result = { type = "value" }
diff --git a/OvaleCompile.lua b/OvaleCompile.lua
index 2e28c21..63c5f63 100644
--- a/OvaleCompile.lua
+++ b/OvaleCompile.lua
@@ -20,7 +20,7 @@ local function ParseParameters(params)
 	if not params then
 		return paramList
 	end
-	for k,v in string.gmatch(params, "(%w+)=([-%w\\_%.]+)") do
+	for k,v in string.gmatch(params, "([%w_]+)=([-%w\\_%.]+)") do
 		if (string.match(v,"^%-?%d+%.?%d*$")) then
 			v = tonumber(v)
 		end
@@ -29,7 +29,7 @@ local function ParseParameters(params)
 		end
 		paramList[k] = v
 	end
-	params = string.gsub(params,"%w+=[-%w\\_%.]+","")
+	params = string.gsub(params,"[%w_]+=[-%w\\_%.]+","")
 	local n=0
 	for w in string.gmatch(params, "[-%w_\\%.]+") do
 		if (string.match(w,"^%-?%d+%.?%d*$")) then
@@ -72,7 +72,7 @@ local function TestConditions(paramList)
 	if paramList.glyph and not HasGlyph(paramList.glyph) then
 		return false
 	end
-	if paramList.mastery and paramList.mastery~=GetPrimaryTalentTree() then
+	if paramList.mastery and paramList.mastery~=GetSpecialization() then
 		return false
 	end
 	if paramList.talent and not HasTalent(paramList.talent) then
@@ -151,6 +151,8 @@ local function ParseFunction(prefix, func, params)
 		return customFunctions[func]
 	end

+	func = string.lower(func)
+
 	local newNode = { type="function", func=func, params=paramList}
 	return AddNode(newNode)
 end
@@ -243,6 +245,11 @@ local function ParseAnd(a,b)
 	return AddNode(newNode)
 end

+local function ParseNot(a)
+	local newNode = {type="not", a=node[tonumber(a)]}
+	return AddNode(newNode)
+end
+
 local function ParseBefore(a,b)
 	local newNode = {type="before", time=node[tonumber(a)], a=node[tonumber(b)]}
 	return AddNode(newNode)
@@ -357,7 +364,9 @@ local function ParseCommands(text)
 		text = string.gsub(text, "(%w+)%.?(%w*)%s*%((.-)%)", ParseFunction)
 		text = string.gsub(text, "(%d+%.?%d*)s", ParseTime)
 		text = string.gsub(text, "([^%w])(%d+%.?%d*)", ParseNumber)
-		text = string.gsub(text, "node(%d+)%s*([%*%+%-%/])%s*node(%d+)", ParseOp)
+		text = string.gsub(text, "node(%d+)%s*([%*%/%%])%s*node(%d+)", ParseOp)
+		text = string.gsub(text, "node(%d+)%s*([%+%-])%s*node(%d+)", ParseOp)
+		text = string.gsub(text, "{([node%d ]*)}", ParseGroup)
 		if was == text then
 			break
 		end
@@ -365,7 +374,17 @@ local function ParseCommands(text)

 	while (1==1) do
 		local was = text
-		text = string.gsub(text, "node(%d+)%s*([%>%<])%s*node(%d+)", ParseOp)
+		text = string.gsub(text, "node(%d+)%s*([%>%<]=?)%s*node(%d+)", ParseOp)
+		text = string.gsub(text, "node(%d+)%s*(==)%s*node(%d+)", ParseOp)
+		text = string.gsub(text, "{([node%d ]*)}", ParseGroup)
+		if was == text then
+			break
+		end
+	end
+
+	while (1==1) do
+		local was = text
+		text = string.gsub(text, "not%s+node(%d+)", ParseNot)
 		text = string.gsub(text, "between%s+node(%d+)%s+and%s+node(%d+)", ParseBetween)
 		text = string.gsub(text, "from%s+node(%d+)%s+until%s+node(%d+)", ParseFromUntil)
 		text = string.gsub(text, "(more)%s+than%s+node(%d+)%s+node(%d+)", ParseCompare)
@@ -381,7 +400,8 @@ local function ParseCommands(text)

 	while (1==1) do
 		local was = text
-		text = string.gsub(text, "node(%d+)%s*([%*%+%-%/%>%<])%s*node(%d+)", ParseOp)
+		text = string.gsub(text, "not%s+node(%d+)", ParseNot)
+		text = string.gsub(text, "node(%d+)%s*([%*%+%-%/%>%<]=?|==)%s*node(%d+)", ParseOp)
 		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, "if%s+node(%d+)%s+node(%d+)",ParseIf)
@@ -412,11 +432,13 @@ local function ParseCommands(text)
 	return masterNode
 end

-local function ParseAddIcon(params, text)
+local function ParseAddIcon(params, text, secure)
 	-- On convertit le numéro de node en node
 	local masterNode = ParseCommands(text)
+	if not masterNode then return nil end
 	masterNode = node[tonumber(masterNode)]
 	masterNode.params = ParseParameters(params)
+	masterNode.secure = secure
 	if not TestConditions(masterNode.params) then
 		return nil
 	end
@@ -453,8 +475,8 @@ function OvaleCompile:CompileInputs(text)
 	Ovale.casesACocher = {}
 	Ovale.listes = {}

-	text = string.gsub(text, "AddListItem%s*%(%s*(%w+)%s+(%w+)%s+\"(.-)\"%s*(.-)%s*%)", ParseAddListItem)
-	text = string.gsub(text, "AddCheckBox%s*%(%s*(%w+)%s+\"(.-)\"%s*(.-)%s*%)", ParseAddCheckBox)
+	text = string.gsub(text, "AddListItem%s*%(%s*([%w_]+)%s+([%w_]+)%s+\"(.-)\"%s*(.-)%s*%)", ParseAddListItem)
+	text = string.gsub(text, "AddCheckBox%s*%(%s*([%w_]+)%s+\"(.-)\"%s*(.-)%s*%)", ParseAddCheckBox)
 	return text
 end

@@ -469,11 +491,11 @@ function OvaleCompile:Compile(text)
 	text = string.gsub(text, "#.*$","")

 	-- Define(CONSTANTE valeur)
-	text = string.gsub(text, "Define%s*%(%s*(%w+)%s+(%w+)%s*%)", ParseDefine)
+	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 = subtest(text, "([^%w])"..k.."([^%w])", "%1"..v.."%2")
+		text = subtest(text, "([^%w_])"..k.."([^%w_])", "%1"..v.."%2")
 	end

 	-- Fonctions
@@ -507,6 +529,13 @@ function OvaleCompile:Compile(text)
 	local masterNodes ={}

 	-- On compile les AddIcon
+	for p,t in string.gmatch(text, "AddActionIcon%s*(.-)%s*(%b{})") do
+		local newNode = ParseAddIcon(p,t,true)
+		if newNode then
+			masterNodes[#masterNodes+1] = newNode
+		end
+	end
+
 	for p,t in string.gmatch(text, "AddIcon%s*(.-)%s*(%b{})") do
 		local newNode = ParseAddIcon(p,t)
 		if newNode then
diff --git a/OvaleCondition.lua b/OvaleCondition.lua
index 3fe49b7..155431a 100644
--- a/OvaleCondition.lua
+++ b/OvaleCondition.lua
@@ -63,7 +63,9 @@ local function avecHate(temps, hate)
 end

 local function compare(a, comparison, b)
-	if (comparison == "more") then
+	if not comparison then
+		return 0, nil, a, 0, 0 -- this is not a compare, returns the value a
+	elseif comparison == "more" then
 		if (not b or (a~=nil and a>b)) then
 			return 0
 		else
@@ -75,12 +77,14 @@ local function compare(a, comparison, b)
 		else
 			return nil
 		end
-	else
+	elseif comparison == "less" then
 		if (not a or (b~=nil and a<b)) then
 			return 0
 		else
 			return nil
 		end
+	else
+		Ovale:Error("unknown compare term "..comparison.." (should be more, equal, or less)")
 	end
 end

@@ -149,8 +153,37 @@ end
 -- that can be on any unit except the target
 -- Returns the first to expires, the last to expires
 -- Returns nil if the debuff is not present
-local function getOtherAura(spellId, suppTime)
-	return OvaleState:GetExpirationTimeOnAnyTarget(spellId)
+local function getOtherAura(spellId, suppTime, excludingTarget)
+	if excludingTarget then
+		excludingTarget = UnitGUID(excludingTarget)
+	end
+	return OvaleState:GetExpirationTimeOnAnyTarget(spellId, excludingTarget)
+end
+
+local function GetRuneCount(type, death)
+	local ret = 0
+	local atTime = nil
+	local rate = nil
+	type = runeType[type]
+	for i=1,6 do
+		local rune = OvaleState.state.rune[i]
+		if rune and (rune.type == type or (rune.type == 4 and death==1)) then
+			if rune.cd > OvaleState.currentTime then
+				onCd = true
+				if not atTime or rune.cd < atTime then
+					atTime = rune.cd
+					rate = 1/rune.duration
+				end
+			else
+				ret = ret + 1
+			end
+		end
+	end
+	if atTime then
+		return ret + 1, atTime, rate
+	else
+		return ret, 0, 0
+	end
 end

 local function GetRune(condition)
@@ -222,57 +255,33 @@ end
 local lastEnergyValue = nil
 local lastEnergyTime

-local function GetManaAndRate(withBerserker)
-	local _,className = UnitClass("player")
-	local current = OvaleState.state.mana
-	if current~=lastEnergyValue then
-		lastEnergyValue = current
-		lastEnergyTime = OvaleState.currentTime
-	end
-
-	local rate
-
-	if className == "ROGUE" or (className == "DRUID" and GetShapeshiftForm(true) == 3) then
-		rate = 10 * OvaleAura.meleeHaste
-		if (className == "ROGUE") then
-			local rush = OvaleState:GetAura("player", 13750, true)
-			if rush and rush.stacks>0 then
-				rate = rate * 2
-			end
-		elseif withBerserker then
-			local berserk = OvaleState:GetAura("player", 50334, true)
-			if berserk and berserk.stacks>0 then
-				mana = mana/2
-			end
-		end
-	elseif className == "HUNTER" then
-		rate = 4 * OvaleAura.meleeHaste
-	else
-		rate = 0
-	end
-
-	return lastEnergyValue, lastEnergyTime, rate
-end
-
-local function GetManaTime(mana, withBerserker)
-	local lastEnergyValue, lastEnergyTime, rate = GetManaAndRate(withBerserker)
-
-	if rate > 0 then
-		local limit = math.ceil((mana - lastEnergyValue) / rate + lastEnergyTime)
-		return limit
+local function testValue(comparator, limit, value, atTime, rate)
+	if not value or not atTime then
+		return nil
+	elseif not comparator then
+		return 0, nil, value, atTime, rate
 	else
-		if OvaleState.state.mana>=mana then
-			return OvaleState.currentTime-1
+		if rate == 0 then
+			if comparator == "more" then
+				if value > limit then return 0 else return nil end
+			elseif comparator == "less" then
+				if value < limit then return 0 else return nil end
+			else
+				Ovale:Error("Unknown operator "..comparator)
+			end
+		elseif comparator == "more" then
+			return (limit-value)/rate + atTime
+		elseif comparator == "less" then
+			return 0, (limit-value)/rate + atTime
 		else
-			return nil
-		end
+			Ovale:Error("Unknown operator "..comparator)
+		end
 	end
 end

-
 -- Recherche un aura sur la cible et récupère sa durée et le nombre de stacks
 -- return start, ending, stacks
-local function GetTargetAura(condition, filter, target)
+local function GetTargetAura(condition, target)
 	if (not target) then
 		target=condition.target
 		if (not target) then
@@ -285,7 +294,10 @@ local function GetTargetAura(condition, filter, target)
 	end
 	local spellId = condition[1]

-	local mine = (condition.mine == 1)
+	local mine = true
+	if condition.any then
+		mine = false
+	end

 	local aura
 	if type(spellId) == "number" then
@@ -300,13 +312,13 @@ local function GetTargetAura(condition, filter, target)
 	elseif spellId == "Magic" or spellId == "Disease" or spellId=="Curse" or spellId=="Poison" then
 		aura = OvaleState:GetAura(target, spellId, mine)
 	else
-		Ovale:Print("ERROR: unknown buff "..spellId)
-		Ovale.bug = true
-		return 0,0
+		Ovale:Error("unknown buff "..spellId)
+		return 0,0,0
 	end

 	if not aura then
-		return 0,0
+		Ovale:Log("Aura "..spellId.." not found")
+		return 0,0,0
 	end

 	if Ovale.trace then
@@ -324,9 +336,9 @@ local function GetTargetAura(condition, filter, target)
 		else
 			ending = aura.ending
 		end
-		return aura.start, ending
+		return aura.start, ending, aura.stacks
 	else
-		return 0,0
+		return 0,0,0
 	end
 end

@@ -343,7 +355,7 @@ local function getTargetDead(target)
 	end
 	if UnitHealthMax(target)==1 then
 		Ovale:Log("Dummy, return in the future")
-		return nil
+		return OvaleState.currentTime + 3600
 	end
 	if second~=lastSaved[target] and targetGUID[target] then
 		lastSaved[target] = second
@@ -368,6 +380,16 @@ local function getTargetDead(target)
 		return nil
 	end
 end
+
+local function isSameSpell(spellIdA, spellIdB, spellNameB)
+	if spellIdB then
+		return spellIdA == spellIdB
+	elseif spellIdA and spellNameB then
+		return GetSpellInfo(spellIdA) == spellNameB
+	else
+		return false
+	end
+end
 --</private-static-methods>

 --<public-static-properties>
@@ -388,34 +410,40 @@ OvaleCondition.conditions=
 			return 0.1
 		end
 	end,]]
-	-- Test how many armor set parts are equiped by the player
-	-- 1 : set number
-	-- 2 : "more" or "less"
-	-- 3 : limit
-	ArmorSetParts = function(condition)
+	-- Get how many armor set parts are equiped by the player
+	-- 1 : set name
+	-- returns : bool or number
+	armorsetparts = function(condition)
 		local nombre = 0
 		if OvaleEquipement.nombre[condition[1]] then
 			nombre = OvaleEquipement.nombre[condition[1]]
 		end
 		return compare(nombre, condition[2], condition[3])
 	end,
-	attackPower = function(condition)
+	-- Get the attack power
+	-- returns : bool or number
+	attackpower = function(condition)
 		local base, posBuff, negBuff = UnitAttackPower("player")
-		return base + posBuff + negBuff, 0, 0
-	end,
-	BuffDuration = function(condition)
-		--local name, rank, icon, count, debuffType, duration = UnitBuff("player", OvaleData:GetSpellInfoOrNil(condition[1]))
-		--if not name then
---			return nil
-	--	end
-		local start, ending = GetTargetAura(condition, "HELPFUL", getTarget(condition.target))
+		return compare(base + posBuff + negBuff, condition[1], condition[2])
+	end,
+	buffcount = function(condition)
+		return OvaleState:GetExpirationTimeOnAnyTarget(condition[1]), 0, 0
+	end,
+	-- Get the aura total duration (not only the remaining time)
+	-- 1 : spell id
+	-- returns : bool or number
+	-- alias: debuffduration
+	buffduration = function(condition)
+		local start, ending = GetTargetAura(condition, getTarget(condition.target))
 		return compare(diffTime(start, ending), condition[2], condition[3])
 	end,
 	-- Test if a buff will expire on the player after a given time
-	-- 1 : buff spell id
+	-- 1 : aura spell id
 	-- 2 : expiration time
-	BuffExpires = function(condition)
-		local start, ending = GetTargetAura(condition, "HELPFUL", getTarget(condition.target))
+	-- returns : bool
+	-- alias: debuffexpires
+	buffexpires = function(condition)
+		local start, ending = GetTargetAura(condition, getTarget(condition.target))
 		local timeBefore = avecHate(condition[2], condition.haste)
 		if Ovale.trace then
 			Ovale:Print("timeBefore = " .. nilstring(timeBefore))
@@ -423,80 +451,151 @@ OvaleCondition.conditions=
 		end
 		return addTime(ending, -timeBefore)
 	end,
-	buffExpires = function(condition)
-		local start, ending = GetTargetAura(condition, "HELPFUL", getTarget(condition.target))
+	-- Get the aura remaining time
+	-- 1 : aura spell id
+	-- returns : number
+	-- alias: debuffremains
+	buffremains = function(condition)
+		local start, ending = GetTargetAura(condition, getTarget(condition.target))
 		if ending then
-			return ending - start, start, -1
+			return start, ending, ending - start, start, -1
 		else
 			return nil
 		end
 	end,
-	-- Test if a time has elapsed since the last buff gain
-	-- 1 : buff spell id
-	-- 2 : time since the buff gain
-	BuffGain = function(condition)
+	-- Returns the time elapsed since the last buff gain
+	-- TODO won't work because the aura is not kept in cache
+	-- 1 : aura spell id
+	-- returns : number
+	-- alias: debuffgain
+	buffgain = function(condition)
+		Ovale:Error("not implemented")
+		if true then return nil end
 		local spellId = condition[1]
+		if not spellId then Ovale:Error("buffgain parameter spellId is not optional"); return end
 		local target = getTarget(condition.target)
-		if spellId then
-			local aura = OvaleState:GetAura(target,spellId, true)
-			if not aura then
-				return 0
-			end
-			local timeGain = aura.gain
-			if not timeGain then
-				timeGain = 0
-			end
-
-			return timeGain + condition[2]
+		local aura = OvaleState:GetAura(target,spellId,true)
+		if not aura then
+			return 0, nil, 0, 0, 1
 		end
-		return 0
+		local timeGain = aura.gain
+		if not timeGain then
+			return 0, nil, 0, 0, 1
+		end
+		return 0, nil, 0, timeGain, 1
 	end,
 	-- Test if a buff is active
 	-- 1 : the buff spell id
 	-- stacks : minimum number of stacks
-	BuffPresent = function(condition)
-		local start, ending = GetTargetAura(condition, "HELPFUL", getTarget(condition.target))
+	-- returns : bool
+	-- alias: debuffpresent
+	buffpresent = function(condition)
+		local start, ending = GetTargetAura(condition, getTarget(condition.target))
 		local timeBefore = avecHate(condition[2], condition.haste)
 		return start, addTime(ending, -timeBefore)
 	end,
-	BuffStealable = function(condition)
-		local i = 1
-		local stealable = false
-		local target = getTarget(condition.target)
-		while true do
-			local name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable = UnitBuff(target, i)
-			if not name then
-				break
-			end
-			if isStealable then
-				stealable = true
-				break
-			end
-			i = i + 1
+	-- Get a buff stack size
+	-- 1: the buff spell id
+	-- returns: number
+	-- alias: debuffstacks
+	buffstacks = function(condition)
+		local start, ending, stacks = GetTargetAura(condition, getTarget(condition.target))
+		return start, ending, stacks, 0, 0
+	end,
+	-- Is there a stealable buff on the target?
+	-- returns: bool
+	buffstealable = function(condition)
+		return OvaleAura:GetStealable(getTarget(condition.target))
+	end,
+	-- Get many burning embers count
+	-- returns: bool or number
+	burningembers = function(condition)
+		return testValue(condition[1], condition[2], OvaleState.state.burningembers, OvaleState.currentTime, OvaleState.powerRate.burningembers)
+	end,
+	-- Check if the player can cast (cooldown is down)
+	-- 1: spellId
+	-- returns: bool
+	cancast = function(condition)
+		local name, rank, icon, cost, isFunnel, powerType, castTime = OvaleData:GetSpellInfoOrNil(condition[1])
+		local actionCooldownStart, actionCooldownDuration, actionEnable = OvaleData:GetComputedSpellCD(condition[1])
+		local startCast = actionCooldownStart + actionCooldownDuration
+		if startCast<OvaleState.currentTime then
+			startCast = OvaleState.currentTime
 		end
-		return testbool(stealable, condition[1])
+		--TODO why + castTime?
+		return startCast + castTime/1000
 	end,
-	Casting = function(condition)
-		if OvaleState.currentSpellId == condition[1] then
-			return OvaleState.startCast, OvaleState.endCast
+	-- Is the target casting a spell?
+	-- 1: the spell id, spell name, spell list, "harmful", or "helpful"
+	-- returns: bool
+	casting = function(condition)
+		local casting
+		local target = getTarget(condition.target)
+		local spellId = condition[1]
+		local start, ending, castSpellId, castSpellName, _
+		if target == "player" then
+			start = OvaleState.startCast
+			ending = OvaleState.endCast
+			castSpellId = OvaleState.currentSpellId
 		else
+			castSpellName, _, _, _, start, ending = UnitCastingInfo(target)
+			if not castSpellName then
+				castSpellName, _, _, _, start, ending = UnitChannelInfo(target)
+			end
+		end
+		if not castSpellId and not castSpellName then
+			return nil
+		end
+		if not spellId then
+			return start, ending
+		elseif type(spellId) == "number" then
+			if isSameSpell(spellId, castSpellId, castSpellName) then
+				return start, ending
+			else
+				return nil
+			end
+		elseif OvaleData.buffSpellList[spellId] then
+			local found = false
+			for k,v in pairs(OvaleData.buffSpellList[spellId]) do
+				if isSameSpell(v, castSpellId, castSpellName) then
+					return start, ending
+				end
+			end
 			return nil
+		elseif spellId == "harmful" then
+			if not castSpellName then
+				castSpellName = GetSpellInfo(castSpellId)
+			end
+			if IsHarmfulSpell(castSpellName) then
+				return start, ending
+			else
+				return nil
+			end
+		elseif spellId == "helpful" then
+			if not castSpellName then
+				castSpellName = GetSpellInfo(castSpellId)
+			end
+			if IsHelpfulSpell(castSpellName) then
+				return start, ending
+			else
+				return nil
+			end
 		end
 	end,
-	CastTime = function(condition)
+	-- Get the spell casting time
+	-- 1: the spell id
+	-- returns: bool or number
+	casttime = function(condition)
 		local name, rank, icon, cost, isFunnel, powerType, castTime = OvaleData:GetSpellInfoOrNil(condition[1])
 		if Ovale.trace then
 			Ovale:Print("castTime/1000 = " .. (castTime/1000) .. " " .. condition[2] .. " " .. condition[3])
 		end
 		return compare(castTime/1000, condition[2], condition[3])
 	end,
-	castTime = function(condition)
-		local name, rank, icon, cost, isFunnel, powerType, castTime = OvaleData:GetSpellInfoOrNil(condition[1])
-		return castTime/1000, 0, 0
-	end,
 	-- Test if a list of checkboxes is off
 	-- 1,... : the checkboxes names
-	CheckBoxOff = function(condition)
+	-- returns: bool
+	checkboxoff = function(condition)
 		for k,v in pairs(condition) do
 			if (Ovale:IsChecked(v)) then
 				return nil
@@ -506,7 +605,8 @@ OvaleCondition.conditions=
 	end,
 	-- Test if a list of checkboxes is on
 	-- 1,... : the checkboxes names
-	CheckBoxOn = function(condition)
+	-- returns: bool
+	checkboxon = function(condition)
 		for k,v in pairs(condition) do
 			if (not Ovale:IsChecked(v)) then
 				return nil
@@ -514,13 +614,21 @@ OvaleCondition.conditions=
 		end
 		return 0
 	end,
-	Class = function(condition)
+	-- Get the chi
+	chi = function(condition)
+		return testValue(condition[1], condition[2], OvaleState.state.chi, OvaleState.currentTime, OvaleState.powerRate.chi)
+	end,
+	-- Check the class of the target
+	-- 1: the class to check
+	-- returns: bool
+	class = function(condition)
 		local loc, noloc = UnitClass(getTarget(condition.target))
 		return testbool(noloc == condition[1], condition[2])
 	end,
 	-- Test the target classification
 	-- 1 : normal, elite, or worldboss
-	Classification = function(condition)
+	-- returns: bool
+	classification = function(condition)
 		local classification
 		local target = getTarget(condition.target)
 		if UnitLevel(target)==-1 then
@@ -534,39 +642,40 @@ OvaleCondition.conditions=
 			end
 		end

-		if (condition[1]==classification) then
-			return 0
-		else
-			return nil
-		end
+		return testbool(condition[1]==classification, condition[2])
 	end,
 	-- Test how many combo points a feral druid or a rogue has
-	-- 1 : "less" or "more"
-	-- 2 : the limit
-	ComboPoints = function(condition)
-		local points = OvaleState.state.combo
-		return compare(points, condition[1], condition[2])
-	end,
-	comboPoints = function(condition)
-		return OvaleState.state.combo, 0, 0
-	end,
-	Counter = function(condition)
-		return compare(OvaleState:GetCounterValue(condition[1]), condition[2], condition[3])
+	-- returns: bool or number
+	combopoints = function(condition)
+		return compare(OvaleState.state.combo, condition[1], condition[2])
 	end,
+	-- Get a counter value
+	-- 1: the counter name
+	-- returns: bool or number
 	counter = function(condition)
-		return OvaleState:GetCounterValue(condition[1]), 0, 0
+		return compare(OvaleState:GetCounterValue(condition[1]), condition[2], condition[3])
 	end,
-	CreatureFamily = function(condition)
+	-- Check the target creature family
+	-- 1: the family
+	-- returns: bool
+	creaturefamily = function(condition)
 		return testbool(UnitCreatureFamily(getTarget(condition.target)) == LBCT[condition[1]], condition[2])
 	end,
-	CreatureType = function(condition)
+	-- Check the target has any of the creature type
+	-- 1,...: a creature type
+	-- returns: bool
+	creaturetype = function(condition)
+		local creatureType = UnitCreatureType(getTarget(condition.target))
 		for _,v in pairs(condition) do
-			if (UnitCreatureType(getTarget(condition.target)) == LBCT[v]) then
+			if (creatureType == LBCT[v]) then
 				return 0
 			end
 		end
 		return nil
 	end,
+	-- Get a spell damage
+	-- 1: spell id
+	-- returns: number
 	damage = function(condition)
 		local spellInfo = OvaleData:GetSpellInfo(condition[1])
 		if not spellInfo then
@@ -594,109 +703,86 @@ OvaleCondition.conditions=
 		if spellInfo.bonusspholy then
 			ret = ret + spellInfo.bonusspholy * GetSpellBonusDamage(2) * OvaleState.state.holy
 		end
-		return ret * OvaleAura.damageMultiplier, 0, 0
-	end,
-	damageMultiplier = function(condition)
-		return OvaleAura.damageMultiplier, 0, 0
-	end,
-	DeadIn = function(condition)
-		local deadAt = getTargetDead(getTarget(condition.target))
-		if condition[1] == "more" then
-			return 0, addTime(deadAt, -condition[2])
-		else
-			return addTime(deadAt, -condition[2]), nil
+		return 0, nil, ret * OvaleAura.damageMultiplier, 0, 0
+	end,
+	-- Get the current damage multiplier
+	-- TODO: use OvaleState
+	-- returns: number
+	damagemultiplier = function(condition)
+		local ret = OvaleAura.damageMultiplier
+		if condition[1] then
+			local si = OvaleData:GetSpellInfo(condition[1])
+			if si and si.combo == 0 then
+				ret = ret * OvaleState.state.combo
+			end
 		end
+		return 0, nil, ret, 0, 0
 	end,
-	deadIn = function(condition)
-		return getTargetDead(getTarget(condition.target)), 0, -1
-	end,
-	-- Test if a debuff will expire on the target after a given time, or if there is less than the
-	-- given number of stacks (if stackable)
-	-- 1 : buff spell id
-	-- 2 : expiration time
-	-- stacks : how many stacks
-	-- mine : 1 means that if the debuff is not ours, the debuff is ignored
-	DebuffExpires = function(condition)
-		local start, ending = GetTargetAura(condition, "HARMFUL", getTarget(condition.target))
-		local tempsMax = avecHate(condition[2], condition.haste)
-		return addTime(ending, -tempsMax)
-	end,
-	debuffExpires = function(condition)
-		local start, ending = GetTargetAura(condition, "HARMFUL", getTarget(condition.target))
-		if ending then
-			return ending - start, start, -1
-		else
-			return nil
-		end
+	-- Get the remaining time until the target is dead
+	-- returns: bool or number
+	deadin = function(condition)
+		return testValue(condition[1], condition[2], 0, getTargetDead(getTarget(condition.target)), -1)
 	end,
-	DebuffPresent = function(condition)
-		local start, ending = GetTargetAura(condition, "HARMFUL", getTarget(condition.target))
-		local timeBefore = avecHate(condition[2], condition.haste)
-		return start, addTime(ending, -timeBefore)
-	end,
-	Distance = function(condition)
-		if LRC then
-			local target = getTarget(condition.target)
-			local minRange, maxRange = LRC:GetRange(target)
-			if maxRange == nil or minRange == nil then
-				return nil
-			end
-			if condition[1] == "more" then
-				if condition[2]~=nil and maxRange>condition[2] then
-					return 0
-				else
-					return nil
-				end
-			else
-				if condition[2]~=nil and minRange<condition[2] then
-					return 0
-				else
-					return nil
-				end
-			end
-		end
+	-- Get the demonic fury
+	-- returns: bool or number
+	demonicfury = function(condition)
+		return testValue(condition[1], condition[2], OvaleState.state.demonicfury, OvaleState.currentTime, OvaleState.powerRate.demonicfury)
 	end,
+	-- Get the distance to the target
+	-- returns: bool or number
 	distance = function(condition)
 		if LRC then
-			return LRC:GetRange(getTarget(condition.target))
+			return compare(LRC:GetRange(getTarget(condition.target)), condition[1], condition[2])
 		else
 			return nil
-		end
+		end
 	end,
 	--Compare to eclipse power. <0 lunar, >0 solar
-	Eclipse = function(condition)
-		return compare(OvaleState.state.eclipse, condition[1], condition[2])
-	end,
+	-- returns: bool or number
 	eclipse = function(condition)
-		return OvaleState.state.eclipse
-	end,
-	EffectiveMana = function(condition)
-		local limit = GetManaTime(condition[2], true)
-		if condition[1]=="more" then
-			return limit, nil
-		else
-			return 0,limit
-		end
+		return compare(OvaleState.state.eclipse, condition[1], condition[2])
 	end,
-	effectiveMana = function(condition)
-		return GetManaAndRate(true)
+	eclipsedir = function(condition)
+		return compare(OvaleState:GetEclipseDir(), condition[1], condition[2])
 	end,
-	EndCastTime = function(condition)
-		local name, rank, icon, cost, isFunnel, powerType, castTime = OvaleData:GetSpellInfoOrNil(condition[1])
-		local actionCooldownStart, actionCooldownDuration, actionEnable = OvaleData:GetComputedSpellCD(condition[1])
-		local startCast = actionCooldownStart + actionCooldownDuration
-		if startCast<OvaleState.currentTime then
-			startCast = OvaleState.currentTime
-		end
-		return startCast + castTime/1000
+	-- Get the effective mana (e.g. if spell cost is divided by two, will returns the mana multiplied by two)
+	-- TODO: not working
+	-- returns: bool or number
+	effectivemana = function(condition)
+		return testValue(condition[1], condition[2], OvaleState.state.mana, OvaleState.currentTime, OvaleState.powerRate.mana)
 	end,
+	-- Get the number of enemies
+	-- returns: bool or number
 	enemies = function(condition)
-		return OvaleEnemies:GetNumberOfEnemies(), 0, 0
+		return compare(OvaleEnemies:GetNumberOfEnemies(), condition[1], condition[2])
 	end,
-	Exists = function(condition)
+	-- Get the energy
+	-- returns: bool or number
+	energy = function(condition)
+		return testValue(condition[1], condition[2], OvaleState.state.energy, OvaleState.currentTime, OvaleState.powerRate.energy)
+	end,
+	-- Checks if the target exists
+	-- returns: bool
+	exists = function(condition)
 		return testbool(UnitExists(getTarget(condition.target)) == 1, condition[1])
 	end,
-	Glyph = function(condition)
+	["false"] = function(condition)
+		return nil
+	end,
+	-- Get the focus
+	-- returns: bool or number
+	focus = function(condition)
+		return testValue(condition[1], condition[2], OvaleState.state.focus, OvaleState.currentTime, OvaleState.powerRate.focus)
+	end,
+	-- Get the global countdown
+	-- returns: bool or number
+	gcd = function(condition)
+		return compare(OvaleState.gcd, condition[1], condition[2])
+	end,
+	-- Check if a glyph is active
+	-- 1: the glyph spell id
+	-- returns: bool
+	glyph = function(condition)
 		local present = false
 		for i = 1, GetNumGlyphSockets() do
 			local enabled, glypType, glyphTooltipIndex, glyphSpellID = GetGlyphSocketInfo(i)
@@ -707,10 +793,14 @@ OvaleCondition.conditions=
 		end
 		return testbool(present, condition[2])
 	end,
-	HasFullControl = function(condition)
+	-- Check if the player has full control of his character
+	-- returns: bool
+	hasfullcontrol = function(condition)
 		return testbool(HasFullControl(), condition[1])
 	end,
-	HasShield = function(condition)
+	-- Check if a shield is equipped
+	-- returns: bool
+	hasshield = function(condition)
 		local _,_,id = string.find(GetInventoryItemLink("player",GetInventorySlotInfo("SecondaryHandSlot")) or "","(item:%d+:%d+:%d+:%d+)")
 		if (not id) then
 			return testbool(false, condition[1])
@@ -719,77 +809,65 @@ OvaleCondition.conditions=
 		local _,_,_,_,_,_,_,_,itemLoc = GetItemInfo(id)
 		return testbool(itemLoc=="INVTYPE_SHIELD", condition[1])
 	end,
-	HolyPower = function(condition)
+	-- Get the holy power
+	-- returns: bool or number
+	holypower = function(condition)
 		return compare(OvaleState.state.holy, condition[1], condition[2])
 	end,
-	holyPower = function(condition)
-		return OvaleState.state.holy, 0, 0
-	end,
-	InCombat = function(condition)
+	-- Check if the player is in combat
+	-- returns: bool
+	incombat = function(condition)
 		return testbool(Ovale.enCombat, condition[1])
 	end,
-	InRange = function(condition)
+	-- Check if the spell is flying to the target
+	-- 1: spell id
+	-- returns: bool
+	inflighttotarget = function(condition)
+		return testbool(OvaleFuture:InFlight(condition[1] or OvaleState.currentSpellId == condition[1]), condition[2])
+	end,
+	-- Check if the target is in the spell range
+	-- 1: spell id
+	-- returns: bool
+	inrange = function(condition)
+		--TODO is IsSpellInRange using spell id now?
 		local spellName = GetSpellInfo(condition[1])
 		return testbool(IsSpellInRange(spellName,getTarget(condition.target))==1,condition[2])
 	end,
-	item = function(condition)
+	-- Get an item cooldown time
+	itemcooldown = function(condition)
 		local actionCooldownStart, actionCooldownDuration, actionEnable = GetItemCooldown(condition[1])
-		return actionCooldownDuration, actionCooldownStart, -1
+		return 0, nil, actionCooldownDuration, actionCooldownStart, -1
 	end,
-	ItemCount = function(condition)
-		if condition.charges == 1 then
-			return compare(GetItemCount(condition[1], false, true), condition[2], condition[3])
-		else
-			return compare(GetItemCount(condition[1]), condition[2], condition[3])
-		end
+	-- Get an item count
+	-- returns: bool or number
+	itemcount = function(condition)
+		return compare(GetItemCount(condition[1]), condition[2], condition[3])
 	end,
-	itemCount = function(condition)
-		if condition.charges == 1 then
-			return GetItemCount(condition[1], false, true), 0, 0
-		else
-			return GetItemCount(condition[1]), 0, 0
-		end
-	end,
-	IsCasting = function(condition)
-		local casting
-		local target = getTarget(condition.target)
-		local spellId = condition.spell
-		if not spellId then
-			return testbool(UnitCastingInfo(target) or UnitChannelInfo(target), condition[1])
-		elseif type(spellId) == "number" then
-			local spellName = GetSpellInfo(spellId)
-			return testbool(UnitCastingInfo(target)==spellName or UnitChannelInfo(target) == spellName, condition[1])
-		elseif OvaleData.buffSpellList[spellId] then
-			local castSpellName = UnitCastingInfo(target) or UnitChannelInfo(target)
-			local found = false
-			for k,v in pairs(OvaleData.buffSpellList[spellId]) do
-				local spellName = GetSpellInfo(v)
-				if spellName == castSpellName then
-					found = true
-					break
-				end
-			end
-			return testbool(found, condition[1])
-		elseif spellId == "harmful" then
-			local castSpellName = UnitCastingInfo(target) or UnitChannelInfo(target)
-			return testbool(castSpellName and IsHarmfulSpell(castSpellName), condition[1])
-		elseif spellId == "helpful" then
-			local castSpellName = UnitCastingInfo(target) or UnitChannelInfo(target)
-			return testbool(castSpellName and IsHelpfulSpell(castSpellName), condition[1])
-		end
+	-- Get an item charges
+	-- returns: bool or number
+	itemcharges = function(condition)
+		return compare(GetItemCount(condition[1], false, true), condition[2], condition[3])
 	end,
-	IsFeared = function(condition)
+	-- Check if the player is feared
+	-- returns: bool
+	isfeared = function(condition)
 		local fearSpellList = OvaleData:GetFearSpellList()
 		return testbool(not HasFullControl() and isDebuffInList(fearSpellList), condition[1])
 	end,
-	IsFriend = function(condition)
+	-- Check if the target is a friend
+	-- returns: bool
+	isfriend = function(condition)
 		return testbool(UnitIsFriend("player", getTarget(condition.target)), condition[1])
 	end,
-	IsIncapacitated = function(condition)
+	-- Check if the player is incapacited
+	-- returns: bool
+	isincapacitated = function(condition)
 		local incapacitateSpellList = OvaleData:GetIncapacitateSpellList()
 		return testbool(not HasFullControl() and isDebuffInList(incapacitateSpellList), condition[1])
 	end,
-	IsInterruptible = function(condition)
+	-- Check if the target is interruptible
+	-- returns: bool
+	isinterruptible = function(condition)
 		local target = getTarget(condition.target)
 		local spell, rank, name, icon, start, ending, isTradeSkill, castID, protected = UnitCastingInfo(target)
 		if not spell then
@@ -797,89 +875,84 @@ OvaleCondition.conditions=
 		end
 		return testbool(protected ~= nil and not protected, condition[1])
 	end,
-	IsRooted = function(condition)
+	-- Check if the player is rooted
+	-- returns: bool
+	isrooted = function(condition)
 		local rootSpellList = OvaleData:GetRootSpellList()
 		return testbool(isDebuffInList(rootSpellList), condition[1])
 	end,
-	IsStunned = function(condition)
+	-- Check if the player is stunned
+	-- returns: bool
+	isstunned = function(condition)
 		local stunSpellList = OvaleData:GetStunSpellList()
 		return testbool(not HasFullControl() and isDebuffInList(stunSpellList), condition[1])
 	end,
-	LastSpellDamage = function(condition)
+	-- Get the last spell damage value
+	-- 1: the spell id
+	-- returns: number or bool
+	lastspelldamage = function(condition)
 		local spellId = condition[1]
 		if not OvaleSpellDamage:Get(spellId) then
 			return nil
 		end
 		return compare(OvaleSpellDamage:Get(spellId), condition[2], condition[3])
 	end,
-	lastSpellDamage = function(condition)
-		return OvaleSpellDamage:Get(condition[1])
-	end,
-	lastSpellDamageMultiplier = function(condition)
-		return OvaleFuture.lastSpellDM[condition[1]], 0, 0
-	end,
-	lastSpellAttackPower = function(condition)
-		return OvaleFuture.lastSpellAP[condition[1]], 0, 0
-	end,
-	lastSpellSpellPower = function(condition)
-		return OvaleFuture.lastSpellSP[condition[1]], 0, 0
-	end,
-	LastSwing = function(condition)
-		local ret = OvaleSwing:GetLast(condition[1])
-		if condition[2] and ret then
-			ret = ret + condition[2]
-		end
-		return 0, ret
-	end,
-	lastSwing = function(condition)
-		return OvaleState.currentTime - OvaleSwing:GetLast(condition[1]), 0, 1
-	end,
-	-- Compare with the player level
-	-- 1 : "less" or "more"
-	-- 2 : the limit
-	Level = function(condition)
-		return compare(UnitLevel(getTarget(condition.target)), condition[1], condition[2])
-	end,
+	-- Get the last spell damage multiplier
+	-- 1: the spell id
+	-- returns: number or bool
+	lastspelldamagemultiplier = function(condition)
+		return compare(OvaleFuture.lastSpellDM[condition[1]], condition[2], condition[3])
+	end,
+	-- Get the last spell attack power
+	-- 1: the spell id
+	-- returns: number or bool
+	lastspellattackpower = function(condition)
+		return compare(OvaleFuture.lastSpellAP[condition[1]], condition[2], condition[3])
+	end,
+	-- Get the last spell spell power
+	-- 1: the spell id
+	-- returns: number or bool
+	lastspellspellpower = function(condition)
+		return compare(OvaleFuture.lastSpellSP[condition[1]], condition[2], condition[3])
+	end,
+	-- Get the time elasped since the last swing
+	-- 1: main or off
+	-- returns: number
+	lastswing = function(condition)
+		return 0, nil, 0, OvaleSwing:GetLast(condition[1]), 1
+	end,
+	-- Get the target level
+	-- returns: bool or number
 	level = function(condition)
-		return UnitLevel(condition.target)
-	end,
-	Life = function(condition)
-		local target = getTarget(condition.target)
-		return compare(UnitHealth(target), condition[1], condition[2])
+		return compare(UnitLevel(getTarget(condition.target)), condition[1], condition[2])
 	end,
+	-- Get the target hit points
+	-- returns: bool or number
 	life = function(condition)
 		local target = getTarget(condition.target)
-		return UnitHealth(target), 0, 0
+		return compare(UnitHealth(target), condition[1], condition[2])
 	end,
-	LifeMissing = function(condition)
+	-- Get the target missing hit points
+	-- returns: bool or number
+	lifemissing = function(condition)
 		local target = getTarget(condition.target)
 		return compare(UnitHealthMax(target)-UnitHealth(target), condition[1], condition[2])
 	end,
-	lifeMissing = function(condition)
-		local target = getTarget(condition.target)
-		return UnitHealthMax(target)-UnitHealth(target), 0, 0
-	end,
-	-- Test if the player life is bellow/above a given value in percent
-	-- 1 : "less" or "more"
-	-- 2 : the limit, in percent
-	LifePercent = function(condition)
-		local target = getTarget(condition.target)
-		if UnitHealthMax(target) == nil or UnitHealthMax(target) == 0 then
-			return nil
-		end
-		return compare(UnitHealth(target)/UnitHealthMax(target), condition[1], condition[2]/100)
-	end,
-	lifePercent = function(condition)
+	-- Get the target health percent
+	-- returns: bool or number
+	lifepercent = function(condition)
+		--TODO: use prediction based on the DPS on the target
 		local target = getTarget(condition.target)
 		if UnitHealthMax(target) == nil or UnitHealthMax(target) == 0 then
 			return nil
 		end
-		return 100 * UnitHealth(target)/UnitHealthMax(target), 0, 0
+		return compare(100*UnitHealth(target)/UnitHealthMax(target), condition[1], condition[2])
 	end,
 	-- Test if a list item is selected
 	-- 1 : the list name
 	-- 2 : the item name
-	List = function(condition)
+	-- returns: bool
+	list = function(condition)
 		if (condition[1]) then
 			if (Ovale:GetListValue(condition[1]) == condition[2]) then
 				return 0
@@ -887,63 +960,53 @@ OvaleCondition.conditions=
 		end
 		return nil
 	end,
-	-- Test if the player mana is above/bellow a given value
-	-- 1 : "less" or "more"
-	-- 2 : the mana/energy/rage... limit
-	Mana = function(condition)
+	-- Get the target mana
+	-- returns: bool or number
+	mana = function(condition)
 		local target = getTarget(condition.target)
 		if target == "player" then
-			local limit = GetManaTime(condition[2], false)
-			if condition[1]=="more" then
-				return limit, nil
-			else
-				return 0,limit
-			end
+			return testValue(condition[1], condition[2], OvaleState.state.mana, OvaleState.currentTime, OvaleState.powerRate.mana)
 		else
 			return compare(UnitPower(target), condition[1], condition[2])
 		end
 	end,
-	mana = function(condition)
-		return GetManaAndRate(false)
-	end,
-	ManaPercent = function(condition)
+	-- Get the target current mana percent
+	-- return: bool or number
+	manapercent = function(condition)
 		local target = getTarget(condition.target)
-		if UnitPowerMax(target) == 0 then
+		local powerMax = UnitPowerMax(target, 0)
+		if not powerMax or powerMax == 0 then
 			return nil
 		end
-		return compare(UnitPower(target)/UnitPowerMax(target), condition[1], condition[2]/100)
-	end,
-	manaPercent = function(condition)
-		local target = getTarget(condition.target)
-		if UnitPowerMax(target) == 0 then
-			return nil
+		if target == "player "then
+			local conversion = 100/powerMax
+			return testValue(condition[1], condition[2], OvaleState.state.mana * conversion, OvaleState.currentTime, OvaleState.powerRate.mana * conversion)
+		else
+			return compare(UnitPower(target, 0)*100/powerMax, condition[1], condition[2])
 		end
-		local value, t, rate = GetManaAndRate(false)
-		local conversion = 100/UnitPowerMax(target)
-		return value * conversion, t, rate * conversion
 	end,
-	MaxHealth = function(condition)
+	-- Get the target maximum health
+	-- return: bool or number
+	maxhealth = function(condition)
 		local target = getTarget(condition.target)
 		return compare(UnitMaxHealth(target), condition[1], condition[2])
 	end,
-	maxHealth = function(condition)
-		return UnitMaxHealth(getTarget(condition.target)), 0, 0
-	end,
-	maxMana = function(condition)
-		return UnitPowerMax(getTarget(condition.target)), 0, 0
-	end,
-	NextSwing = function(condition)
-		local ret = OvaleSwing:GetNext(condition[1])
-		if condition[2] and ret then
-			ret = ret - condition[2]
-		end
-		return ret
-	end,
-	nextSwing = function(condition)
-		return OvaleSwing:GetNext(condition[1]) - OvaleState.currentTime, 0, -1
-	end,
-	nextTick = function(condition)
-		local start, ending = GetTargetAura(condition, "HARMFUL", getTarget(condition.target))
+	-- Get the target maximum mana
+	-- return: bool or number
+	maxmana = function(condition)
+		return compare(UnitPowerMax(getTarget(condition.target)), condition[1], condition[2])
+	end,
+	-- Get the time until the next swing
+	-- 1: main or off
+	-- return: number
+	nextswing = function(condition)
+		return 0, nil, 0, OvaleSwing:GetNext(condition[1]), 0, -1
+	end,
+	-- Get the time until the next tick
+	-- 1: spell id
+	-- return: number
+	nexttick = function(condition)
+		local start, ending = GetTargetAura(condition, getTarget(condition.target))
 		local si = OvaleData.spellInfo[condition[1]]
 		if not si or not si.duration then
 			return nil
@@ -957,44 +1020,63 @@ OvaleCondition.conditions=
 			end
 			tickTime = tickTime + tickLength
 		end
-		return tickTime, 0, -1
+		return 0, nil, tickTime, 0, -1
 	end,
-	OtherDebuffExpires = function(condition)
-		local minTime, maxTime = getOtherAura(condition[1], condition[3])
+	-- Check if the aura is not on any other unit than the current target
+	-- 1: spell id
+	-- return: bool
+	-- alias: otherauraexpires
+	otherdebuffexpires = function(condition)
+		local minTime, maxTime = getOtherAura(condition[1], condition[3], "target")
 		if minTime then
 			local timeBefore = condition[2] or 0
 			return minTime - timeBefore, nil
 		end
 		return 0, nil
 	end,
-	OtherDebuffPresent = function(condition)
-		local minTime, maxTime = getOtherAura(condition[1], condition[3])
+	-- Check if the aura is present on any other unit than the current target
+	-- return: bool
+	-- alias: otheraurapresent
+	otherdebuffpresent = function(condition)
+		local minTime, maxTime = getOtherAura(condition[1], condition[3], "target")
 		if maxTime and maxTime>0 then
 			local timeBefore = condition[2] or 0
 			return 0, addTime(maxTime, -timeBefore)
 		end
 		return nil
 	end,
-	OtherAuraExpires = OtherDebuffExpires,
-	OtherAuraPresent = OtherDebuffPresent,
-	otherAura = function(condition)
+	-- Get the maximum aura remaining duration on any target
+	-- return: number
+	otherauraremains = function(condition)
 		local minTime, maxTime = getOtherAura(condition[1])
-		return 0, maxTime, -1
+		return 0, nil, 0, maxTime, -1
 	end,
-	Present = function(condition)
+	-- Check if the unit is present and alive
+	-- return: bool
+	present = function(condition)
 		local present = UnitExists(getTarget(condition.target)) and not UnitIsDead(getTarget(condition.target))
 		return testbool(present, condition[1])
 	end,
-	-- Test if any player pet is present (or not)
-	-- 1 : "yes" or "no"
-	PetPresent = function(condition)
+	-- Check what was the previous spell cast
+	-- 1: the spell to check
+	-- return: bool
+	previousspell = function(condition)
+		return testbool(condition[1] == OvaleState.lastSpellId, condition[2])
+	end,
+	-- Check if the pet is present and alive
+	-- return: bool
+	petpresent = function(condition)
 		local present = UnitExists("pet") and not UnitIsDead("pet")
 		return testbool(present, condition[1])
 	end,
-	-- Test the target level difference with the player
-	-- 1 : "less" or "more"
-	-- 2 : [target level]-[player level] limit
-	RelativeLevel = function(condition)
+	-- Get the rage
+	-- return: bool or number
+	rage = function(condition)
+		return testValue(condition[1], condition[2], OvaleState.state.rage, OvaleState.currentTime, OvaleState.powerRate.rage)
+	end,
+	-- Get [target level]-[player level]
+	-- return: number or bool
+	relativelevel = function(condition)
 		local difference
 		local target = getTarget(condition.target)
 		if UnitLevel(target) == -1 then
@@ -1002,20 +1084,39 @@ OvaleCondition.conditions=
 		else
 			difference = UnitLevel(target) - UnitLevel("player")
 		end
-
 		return compare(difference, condition[1], condition[2])
 	end,
-	remainingCastTime = function(condition)
+	-- Get the remaining cast time
+	remainingcasttime = function(condition)
 		local name, nameSubtext, text, texture, startTime, endTime, isTradeSkill, castID, notInterruptible = UnitCastingInfo(getTarget(condition.target))
 		if not endTime then
 			return nil
 		end
-		return 0, endTime/1000, -1
+		return 0, nil, 0, endTime/1000, -1
 	end,
-	Runes = function(condition)
+	-- Check if the runes are ready
+	-- 1: frost, death, unholy, or blood
+	-- 2: rune number
+	-- ...
+	-- nodeath: if 1, death runes are not allowed
+	-- return: bool
+	runes = function(condition)
 		return GetRune(condition)
 	end,
-	runes = function(condition)
+	-- Get the number of runes
+	-- 1: frost, death, unholy, or blood
+	-- death: if 1, death runes are allowed
+	-- return: bool
+	runecount = function(condition)
+		return 0, nil, GetRuneCount(condition[1], condition.death)
+	end,
+	-- Get the remaining cooldown until the runes are ready
+	-- 1: frost, death, unholy, or blood
+	-- 2: rune number
+	-- ...
+	-- nodeath: if 1, death runes are not allowed
+	-- return: number
+	runescooldown = function(condition)
 		local ret = GetRune(condition)
 		if not ret then
 			return nil
@@ -1023,81 +1124,165 @@ OvaleCondition.conditions=
 		if ret < OvaleState.maintenant then
 			ret = OvaleState.maintenant
 		end
-		return 0, ret, -1
+		return 0, nil, 0, ret, -1
 	end,
-	SoulShards = function(condition)
-		return compare(OvaleState.state.shard, condition[1], condition[2])
+	-- Get the runic power
+	-- returns: bool or number
+	runicpower = function(condition)
+		return testValue(condition[1], condition[2], OvaleState.state.runicpower, OvaleState.currentTime, OvaleState.powerRate.runicpower)
 	end,
-	soulShards = function(condition)
-		return OvaleState.state.shard
+	-- Get the shadow orbs count
+	-- returns: bool or number
+	shadoworbs = function(condition)
+		return testValue(condition[1], condition[2], OvaleState.state.shadoworbs, OvaleState.currentTime, OvaleState.powerRate.shadoworbs)
 	end,
-	Speed = function(condition)
-		return compare(GetUnitSpeed(getTarget(condition.target))*100/7, condition[1], condition[2])
+	-- Get the number of soul shards
+	-- return: number or bool
+	soulshards = function(condition)
+		return compare(OvaleState.state.shards, condition[1], condition[2])
 	end,
+	-- Get the unit speed (100 is runing speed)
+	-- return: number or bool
 	speed = function(condition)
-		return GetUnitSpeed(getTarget(condition.target))*100/7
+		return compare(GetUnitSpeed(getTarget(condition.target))*100/7, condition[1], condition[2])
 	end,
-	spell = function(condition)
-		local actionCooldownStart, actionCooldownDuration, actionEnable = OvaleData:GetComputedSpellCD(condition[1])
-		return actionCooldownDuration, actionCooldownStart, -1
+	-- Check if the spell is usable
+	spellusable = function(condition)
+		return testbool(IsUsableSpell(spellId), condition[1], condition[2])
+	end,
+	-- Get the spell cooldown
+	-- 1: spell ID
+	-- return: number
+	spellcooldown = function(condition)
+		if type(condition[1]) == "string" then
+			local sharedCd = OvaleState.state.cd[condition[1]]
+			if sharedCd then
+				return 0, nil, sharedCD.duration, sharedCD.start, -1
+			else
+				return nil
+			end
+		elseif not OvaleData.spellList[condition[1]] then
+			return 0, nil, 0, OvaleState.currentTime + 3600, -1
+		else
+			local actionCooldownStart, actionCooldownDuration, actionEnable = OvaleData:GetComputedSpellCD(condition[1])
+			return 0, nil, actionCooldownDuration, actionCooldownStart, -1
+		end
 	end,
-	spellPower = function(condition)
-		return GetSpellBonusDamage(2), 0, 0
+	-- Get the spell power
+	-- return: number or bool
+	spellpower = function(condition)
+		return compare(GetSpellBonusDamage(2), condition[1], condition[2])
 	end,
 	-- Test if the player is in a given stance
 	-- 1 : the stance
-	Stance = function(condition)
-		if (GetShapeshiftForm(true) == condition[1]) then
+	-- return: bool
+	stance = function(condition)
+		if (GetShapeshiftForm() == condition[1]) then
 			return 0
 		else
 			return nil
 		end
 	end,
-	Stealthed = function(condition)
+	-- Check if the player is stealthed
+	-- return: bool
+	stealthed = function(condition)
 		return testbool(IsStealthed(), condition[1])
 	end,
-	-- Test how many talent points has been spent in a talent
-	-- 1 : the talent identifier (use /script print(OvaleData.talentNameToId["Talent name"]) to retreive)
-	-- 2 : "more" or "less"
-	-- 3 : the limit
-	TalentPoints = function(condition)
+	-- Get the number of talents points (1 or 0)
+	-- 1 : the talent identifier (1 is the first talent in the first row, 2, the second, etc.) (use /script print(OvaleData.talentNameToId["Talent name"]) to retreive)
+	-- return: number or bool
+	talentpoints = function(condition)
 		return compare(OvaleData:GetTalentPoints(condition[1]), condition[2], condition[3])
 	end,
-	talentPoints = function(condition)
-		return OvaleData:GetTalentPoints(condition[1]), 0, 0
-	end,
-	-- Test if the target's target is the player (or is not)
-	-- 1 : "yes" (it should be the player) or "no"
-	TargetIsPlayer = function(condition)
+	-- Test if the unit target is the player (or is not)
+	-- return: bool
+	targetisplayer = function(condition)
 		return testbool(UnitIsUnit("player",getTarget(condition.target).."target"), condition[1])
 	end,
-	Threat = function(condition)
-		local isTanking, status, threatpct = UnitDetailedThreatSituation("player", getTarget(condition.target))
-		return compare(threatpct, condition[1], condition[2])
-	end,
+	-- Get the threat value (0 to 100)
+	-- return: number
 	threat = function(condition)
 		local isTanking, status, threatpct = UnitDetailedThreatSituation("player", getTarget(condition.target))
-		return threatpct
+		return compare(threatpct, condition[1], condition[2])
 	end,
-	TimeInCombat = function(condition)
-		if not Ovale.combatStartTime then
-			return nil
-		elseif condition[1] == "more" then
-			return Ovale.combatStartTime + condition[2]
+	-- Get the number of ticks of a DOT
+	-- 1: spell Id
+	-- return: bool or number
+	ticks = function(condition)
+		local si = OvaleData.spellInfo[condition[1]]
+		if not si or not si.duration then return nil end
+		local baseTickTime = si.tick or 3
+		local haste = OvaleAura.spellHaste
+		local d = si.duration
+		local t = floor(( baseTickTime * haste ) + 0.5 )
+		local n = d/t
+		local num
+		-- banker's rounding
+		if n - 0.5 == floor(n) and floor(n) % 2 == 0 then
+			num = ceil(n - 0.5)
 		else
-			return 0, Ovale.combatStartTime + condition[2]
+			num = floor(n + 0.5)
 		end
+		return compare(num, condition[2], condition[3])
 	end,
-	timeInCombat = function(condition)
-		return OvaleState.maintenant - Ovale.combatStartTime, OvaleState.maintenant, 1
-	end,
-	timeToDie = function(condition)
-		return 0, getTargetDead(getTarget(condition.target)), -1
-	end,
-	timeWithHaste = function(condition)
-		return avecHate(condition[1], "spell"),0,0
+	-- Get the remaining number of ticks
+	-- 1: spell Id
+	-- return: bool or number
+	ticksremain = function(condition)
+		local start, ending = GetTargetAura(condition, getTarget(condition.target))
+		local si = OvaleData.spellInfo[condition[1]]
+		if not si or not si.duration then
+			return nil
+		end
+		local ticks = floor(OvaleAura.spellHaste * (si.duration/(si.tick or 3)) + 0.5)
+		local tickLength = (ending - start) / ticks
+		local tickTime = start + tickLength
+		local remain = ticks - 1
+		for i=1,ticks do
+			if OvaleState.currentTime<=tickTime then
+				break
+			end
+			tickTime = tickTime + tickLength
+			remain = remain - 1
+		end
+		return start, ending, remain, tickTime, -1/tickLength
 	end,
-	TotemExpires = function(condition)
+	-- Get the duration of a tick
+	-- 1: spell id
+	-- return: number or bool
+	ticktime = function(condition)
+		--TODO not correct
+		local si = OvaleData.spellInfo[condition[1]]
+		if not si then return nil end
+		return compare(avecHate(si.tick or 3, "spell"), condition[2], condition[3])
+	end,
+	-- Get the time in combat
+	-- return: number or bool
+	timeincombat = function(condition)
+		return testValue(condition[1], condition[2], 0, Ovale.combatStartTime, 1)
+	end,
+	-- Get the time until the unit dies
+	-- return: number
+	timetodie = function(condition)
+		return 0, nil, 0, getTargetDead(getTarget(condition.target)), -1
+	end,
+	-- Get the energy
+	-- returns: bool or number
+	-- TODO: temp, need to allow function calls in functions call to do things link TimeTo(Energy() == 100) which would be TimeTo(Equal(Energy(), 100))
+	timetomaxenergy = function(condition)
+		local t = OvaleState.currentTime + OvaleState.powerRate.energy * (100 - OvaleState.state.energy)
+		return 0, nil, 0, t, -1
+	end,
+	-- Multiply a time by the current spell haste
+	-- 1: the time
+	-- return: number
+	timewithhaste = function(condition)
+		return 0, nil, avecHate(condition[1], "spell"),0,0
+	end,
+	-- Check if a totem is not there
+	-- 1: the totem
+	-- return: bool
+	totemexpires = function(condition)
 		if type(condition[1]) ~= "number" then
 			condition[1] = totemType[condition[1]]
 		end
@@ -1111,7 +1296,10 @@ OvaleCondition.conditions=
 		end
 		return addTime(startTime + duration, -(condition[2] or 0))
 	end,
-	TotemPresent = function(condition)
+	-- Check if a totem is present
+	-- 1: the totem
+	-- return: bool
+	totempresent = function(condition)
 		if type(condition[1]) ~= "number" then
 			condition[1] = totemType[condition[1]]
 		end
@@ -1125,7 +1313,10 @@ OvaleCondition.conditions=
 		end
 		return startTime, startTime + duration
 	end,
-	Tracking = function(condition)
+	-- Check if a tracking is enabled
+	-- 1: the spell id
+	-- return bool
+	tracking = function(condition)
 		local what = OvaleData:GetSpellInfoOrNil(condition[1])
 		local numTrackingTypes = GetNumTrackingTypes()
 		local present = false
@@ -1138,7 +1329,14 @@ OvaleCondition.conditions=
 		end
 		return testbool(present, condition[2])
 	end,
-	WeaponEnchantExpires = function(condition)
+	["true"] = function(condition)
+		return 0, nil
+	end,
+	-- Check if a weapon enchant is not present
+	-- 1: mainhand or offhand
+	-- [2]: the maximum time the weapon enchant should be present
+	-- return bool
+	weaponenchantexpires = function(condition)
 		local hasMainHandEnchant, mainHandExpiration, mainHandCharges, hasOffHandEnchant, offHandExpiration, offHandCharges = GetWeaponEnchantInfo()
 		if (condition[1] == "mainhand") then
 			if (not hasMainHandEnchant) then
@@ -1165,10 +1363,17 @@ OvaleCondition.conditions=
 }

 OvaleCondition.conditions.health = OvaleCondition.conditions.life
-OvaleCondition.conditions.Health = OvaleCondition.conditions.Life
-OvaleCondition.conditions.healthPercent = OvaleCondition.conditions.lifePercent
-OvaleCondition.conditions.HealthPercent = OvaleCondition.conditions.LifePercent
-OvaleCondition.conditions.HealthMissing = OvaleCondition.conditions.LifeMissing
+OvaleCondition.conditions.healthpercent = OvaleCondition.conditions.lifepercent
+OvaleCondition.conditions.healthmissing = OvaleCondition.conditions.lifemissing
+OvaleCondition.conditions.debuffcount = OvaleCondition.conditions.buffcount
+OvaleCondition.conditions.debuffexpires = OvaleCondition.conditions.buffexpires
+OvaleCondition.conditions.debuffpresent = OvaleCondition.conditions.buffpresent
+OvaleCondition.conditions.debuffgain = OvaleCondition.conditions.buffgain
+OvaleCondition.conditions.debuffduration = OvaleCondition.conditions.buffduration
+OvaleCondition.conditions.debuffremains = OvaleCondition.conditions.buffremains
+OvaleCondition.conditions.debuffstacks = OvaleCondition.conditions.buffstacks
+OvaleCondition.conditions.otherauraexpires = OvaleCondition.conditions.otherdebuffexpires
+OvaleCondition.conditions.otheraurapresent = OvaleCondition.conditions.otherdebuffpresent
 OvaleCondition.defaultTarget = "target"

 --</public-static-properties>
diff --git a/OvaleData.lua b/OvaleData.lua
index e1fe371..6765d1b 100644
--- a/OvaleData.lua
+++ b/OvaleData.lua
@@ -4,7 +4,6 @@
 OvaleData.spellList = {}
 OvaleData.firstInit = false
 OvaleData.className = nil
-OvaleData.spellInfo = {}
 --allows to fill the player talent tables on first use
 OvaleData.listeTalentsRemplie = false
 --key: talentId / value: points in this talent
@@ -18,6 +17,24 @@ OvaleData.spellInfo = {}
 --spells that count for scoring
 OvaleData.scoreSpell = {}

+OvaleData.power =
+{
+	mana = {id=0, mini=0},
+	rage = {id=1, mini=0, maxi=100},
+	focus ={id=2, mini=0, maxi=100},
+	energy = {id=3, mini=0, maxi=100},
+	runicpower = {id=6, mini=0, maxi=100},
+	shards = {id=7, mini=0, maxi=3},
+	eclipse = {id=8, mini=-100, maxi=100},
+	holy = {id=9, mini=0, maxi=5},
+	chi = {id=12, mini=0, maxi=4 },
+	shadoworbs = {id=13, mini=0, maxi=3},
+	burningembers = {id=14, mini=0},
+	demonicfury = {id=15, mini=0}
+}
+OvaleData.secondaryPower = {"focus", "shards", "holy", "chi", "shadoworbs", "burningembers", "demonicfury"}
+OvaleData.powerType = {}
+
 -- List haste buff that does not appear in the character sheet and that are not raid wide buffs
 OvaleData.selfHasteBuff =
 {
@@ -64,77 +81,75 @@ OvaleData.buffSpellList =
 		408, -- Kidney Shot
 		46968, -- Shockwave
 	},
-	strengthagility=
+
+	str_agi_int =
 	{
-		6673, -- Battle Shout
-		8076, -- Strength of Earth
-		57330, -- Horn of Winter
-		93435 --Roar of Courage (Cat, Spirit Beast)
+		20217, -- Blessing of Kings
+		1126, -- Mark of the Wild
+		-- Monk
 	},
 	stamina =
 	{
-		79105, -- Power Word: Fortitude
+		21562, -- Power Word: Fortitude
 		469, -- Commanding Shout
 		6307, -- Blood Pact
 		90364 -- Qiraji Fortitude
 	},
-	lowerarmor=
+	attack_power_multiplier=
 	{
-		58567, -- Sunder Armor (x3)
-		8647, -- Expose Armor
-		91565, -- Faerie Fire (x3)
-		35387, --Corrosive Spit (x3 Serpent)
-		50498 --Tear Armor (x3 Raptor)
+		6673, -- Battle Shout
+		57330, -- Horn of Winter
+		-- Hunter?
 	},
-	magicaldamagetaken=
+	spell_power_multiplier =
 	{
-		65142, -- Ebon Plague
-		60433, -- Earth and Moon
-		93068, -- Master Poisoner
-		1490, -- Curse of the Elements
-		85547, -- Jinx 1
-		86105, -- Jinx 2
-		34889, --Fire Breath (Dragonhawk)
-		24844 --Lightning Breath (Wind serpent)
+		109773,  -- Dark Intent
+		-- Shaman?
+		1459 -- Arcane Brillance
+	},
+	melee_haste =
+	{
+	  -- Frost and Unholy death knights, any rogue, Enhancement shaman
 	},
-	magicalcrittaken=
-    {
-        17800, -- Shadow and Flame
-        22959 -- Critical Mass
-    },
-	physicaldamagetaken=
+	spell_haste =
 	{
-		30069, -- Blood Frenzy (rank 1)
-		30070, -- Blood Frenzy (rank 2)
-		81327, -- Brittle Bones (rank 1)
-		81328, -- Brittle Bones (rank 2)
-		58684, -- Savage Combat (rank 1)
-		58683, -- Savage Combat (rank 2)
+		24907, -- Moonkin aura
+		49868, -- Mind Quickening
+		-- Elemental  shaman
+	},
+	critical_strike =
+	{
+		--Guardian and Feral druids, any hunter, any mage
+		1459 -- Arcane Brillance
+	},
+	mastery =
+	{
+		93435, --Roar of Courage (Cat, Spirit Beast)
+		116956, -- Grace of Air
+		19740 -- Blessing of Might
+	},
+	-- weakened_armor
+	physical_vulnerability=
+	{
+		55749, -- Physical Vulnaribility
 		55749, -- Acid Spit (Worm)
 		50518, -- Ravage (Ravager)
 	},
-	lowerphysicaldamage=
+	magic_vulnerability=
 	{
-		99, -- Demoralizing Roar
-		702, -- Curse of Weakness
-		1160, -- Demoralizing Shout
+		93068, -- Master Poisoner
+		1490, -- Curse of the Elements
+		34889, --Fire Breath (Dragonhawk)
+		24844 --Lightning Breath (Wind serpent)
+	},
+	lower_physical_damage=
+	{
+		115798, -- Weakened blows
 		26017, -- Vindication
-		81130, -- Scarlet Fever
 		50256, --Demoralizing Roar (Bear)
 		24423, -- Demoralizing Screech (Carrion Bird)
 	},
-	meleeslow=
-	{
-		55095, --Icy Touch
-		58179, --Infected Wounds rank 1
-		58180, --Infected Wounds rank 2
-		68055, --Judgments of the just
-		6343, --Thunderclap
-		8042, --Earth Shock
-		54404, --Dust Cloud (Tallstrider)
-		90315, -- Tailspin (Fox)
-	},
-	castslow =
+	cast_slow =
 	{
 		1714, --Curse of Tongues
         58604, --Lava Breath (Core Hound)
@@ -143,15 +158,9 @@ OvaleData.buffSpellList =
         73975, --Necrotic Strike
         31589 --Slow
 	},
-	bleed=
+	healing_reduced =
 	{
-		33876, --Mangle cat
-		33878, --Mangle bear
-		46856, -- Trauma rank 1
-		46857, -- Trauma rank 2
-		16511, --Hemorrhage
-		50271, --Tendon Rip (Hyena)
-		35290 --Gore (Boar)
+		--Arms or Fury warrior, any rogue, any hunter
 	},
 	heroism=
 	{
@@ -160,20 +169,9 @@ OvaleData.buffSpellList =
 		80353, --Time warp
 		90355 -- Ancient Hysteria (Core Hound)
 	},
-	meleehaste =
-	{
-		8515, -- Windfury
-		55610, -- Improved Icy Talons
-		53290 -- Hunting Party
-	},
-	spellhaste =
-	{
-		24907, -- Moonkin aura
-		2895, -- Wrath of Air Totem
-		49868 -- Mind Quickening
-	},
 	enrage =
 	{
+		--TODO update
 		49016, -- Unholy Frenzy
 		18499, -- Berserker Rage
 		12292, -- Death Wish
@@ -184,18 +182,12 @@ OvaleData.buffSpellList =
         52610, -- Savage Roar (Cat)
         76691, -- Vengeance (All Tank Specs)
 	},
-	criticalstrike =
+	ranged_vulnerability =
 	{
-		51740, -- Elemental Oath
-		51698, -- Honor Among Thieves (rank 1)
-		51700, -- Honor Among Thieves (rank 2)
-		51701, -- Honor Among Thieves (rank 3)
-		17007, -- Leader of the Pack
-		29801, -- Rampage
-		24604, -- Furious Howl (Wolf)
-		90309, -- Terrifying Roar (Devilsaur)
-	}
+		1130, -- Hunter's Mark
+	},
 }
+OvaleData.buffSpellList.bloodlust = OvaleData.buffSpellList.heroism
 --</public-static-properties>

 --<private-static-properties>
@@ -207,13 +199,19 @@ local rootSpellList = nil

 --<public-static-methods>
 function OvaleData:OnEnable()
+	for k,v in pairs(self.power) do
+		self.powerType[v.id] = k
+	end
+
 	self:FirstInit()
     self:RegisterEvent("PLAYER_TALENT_UPDATE")
     self:RegisterEvent("CHARACTER_POINTS_CHANGED")
 	self:RegisterEvent("SPELLS_CHANGED")
+	self:RegisterEvent("UNIT_PET")
 end

 function OvaleData:OnDisable()
+	self:UnregisterEvent("UNIT_PET")
     self:UnregisterEvent("SPELLS_CHANGED")
     self:UnregisterEvent("PLAYER_TALENT_UPDATE")
     self:UnregisterEvent("CHARACTER_POINTS_CHANGED")
@@ -229,6 +227,10 @@ function OvaleData:PLAYER_TALENT_UPDATE()
 --	Ovale:Print("PLAYER_TALENT_UPDATE")
 end

+function OvaleData:UNIT_PET()
+	self:FillPetSpellList()
+end
+
 --The user learnt a new spell
 function OvaleData:SPELLS_CHANGED()
 	self:FillSpellList()
@@ -288,47 +290,61 @@ function OvaleData:GetSpellInfoOrNil(spell)
 	end
 end

+function OvaleData:FillPetSpellList()
+	--TODO pas moyen d'avoir le nombre de skills pour le pet
+	local book=BOOKTYPE_PET
+	local numSpells, _ = HasPetSpells()
+	if not numSpells then return end
+	local i=1
+	while i <= numSpells do
+		local skillType, spellId = GetSpellBookItemInfo(i, book)
+		if skillType~="FUTURESPELL" and spellId then
+			local spellName = GetSpellBookItemName(i, book)
+			self.spellList[spellId] = spellName
+		end
+		i = i + 1
+	end
+end
+
 function OvaleData:FillSpellList()
 	self.spellList = {}
+
+	--TODO pas moyen d'avoir le nombre de skills pour le pet
 	local book=BOOKTYPE_SPELL
-	while true do
-		local i=1
-		while true do
-			local skillType, spellId = GetSpellBookItemInfo(i, book)
-			if not spellId then
-				break
-			end
-			if skillType~="FUTURESPELL" then
-				local spellName = GetSpellBookItemName(i, book)
-				self.spellList[spellId] = spellName
-			end
-			i = i + 1
-		end
-		if book==BOOKTYPE_SPELL then
-			book = BOOKTYPE_PET
-		else
-			break
+	local name, texture, offset, numSpells, isGuild = GetSpellTabInfo(2)
+
+	numSpells = numSpells + offset
+
+	local i=1
+	while i <= numSpells do
+		local skillType, spellId = GetSpellBookItemInfo(i, book)
+		if skillType~="FUTURESPELL" and spellId then
+			local spellName = GetSpellBookItemName(i, book)
+			self.spellList[spellId] = spellName
 		end
+		i = i + 1
 	end
+	self:FillPetSpellList()
 end

 function OvaleData:RemplirListeTalents()
-	local numTabs = GetNumTalentTabs();
-	for t=1, numTabs do
-		local numTalents = GetNumTalents(t);
-		for i=1, numTalents do
-			local nameTalent, icon, tier, column, currRank, maxRank = GetTalentInfo(t,i);
-			local link = GetTalentLink(t,i)
-			if link then
-				local a, b, talentId = string.find(link, "talent:(%d+)");
-				talentId = tonumber(talentId)
-				self.talentIdToName[talentId] = nameTalent
-				self.talentNameToId[nameTalent] = talentId
-				self.pointsTalent[talentId] = currRank
-				self.listeTalentsRemplie = true
-				Ovale.needCompile = true
-			end
+	local talentId = 1
+	while true do
+		local name, texture, tier, column, selected, available = GetTalentInfo(talentId)
+		if not name then
+			break
 		end
+		talentId = tonumber(talentId)
+		self.talentIdToName[talentId] = name
+		self.talentNameToId[name] = talentId
+		if selected then
+			self.pointsTalent[talentId] = 1
+		else
+			self.pointsTalent[talentId] = 0
+		end
+		self.listeTalentsRemplie = true
+		Ovale.needCompile = true
+		talentId = talentId + 1
 	end
 end

@@ -409,6 +425,7 @@ function OvaleData:GetComputedSpellCD(spellId)
 		actionCooldownStart, actionCooldownDuration, actionEnable = GetSpellCooldown(spellId)
 		-- Les chevaliers de la mort ont des infos fausses sur le CD quand ils n'ont plus les runes
 		-- On force à 1,5s ou 1s en présence impie
+		-- TODO: is it still the case in MoP?
 		if self.className=="DEATHKNIGHT" and actionCooldownDuration==10 and
 				(not self.spellInfo[spellId] or self.spellInfo[spellId].cd~=10) then
 			local impie = GetSpellInfo(48265)
diff --git a/OvaleFrame.lua b/OvaleFrame.lua
index e4f0121..05baecf 100644
--- a/OvaleFrame.lua
+++ b/OvaleFrame.lua
@@ -145,6 +145,8 @@ do
 		if not next(Ovale.refreshNeeded) and not forceRefresh then
 			return
 		end
+		if not Ovale.masterNodes then return end
+
 		self.lastUpdate = now

 		OvaleState:StartNewFrame()
@@ -162,6 +164,12 @@ do
 					Ovale:Log("Compute start = "..start)
 				end
 				local action = self.actions[k]
+				local icons
+				if action.secure then
+					icons = action.secureIcons
+				else
+					icons = action.icons
+				end
 				if element and element.type == "value" then
 					local actionTexture
 					if node.params.texture then
@@ -171,9 +179,9 @@ do
 					if element.value and element.origin and element.rate then
 						value = element.value + (OvaleState.maintenant - element.origin) * element.rate
 					end
-					action.icons[1]:SetValue(value, actionTexture)
-					if #action.icons > 1 then
-						action.icons[2]:Update(element, nil)
+					icons[1]:SetValue(value, actionTexture)
+					if #icons > 1 then
+						icons[2]:Update(element, nil)
 					end
 				else
 					local actionTexture, actionInRange, actionCooldownStart, actionCooldownDuration,
@@ -191,9 +199,9 @@ do
 					end

 					if (node.params.nocd and start~=nil and OvaleState.maintenant<start-node.params.nocd) then
-						action.icons[1]:Update(element, nil)
+						icons[1]:Update(element, nil)
 					else
-						action.icons[1]:Update(element, start, actionTexture, actionInRange, actionCooldownStart, actionCooldownDuration,
+						icons[1]:Update(element, start, actionTexture, actionInRange, actionCooldownStart, actionCooldownDuration,
 							actionUsable, actionShortcut, actionIsCurrent, actionEnable, spellId, actionTarget)
 					end

@@ -207,16 +215,16 @@ do
 						action.waitStart = nil
 					end

-					if OvaleOptions:GetApparence().moving and action.icons[1].debutAction and action.icons[1].finAction then
-						local top=1-(OvaleState.maintenant - action.icons[1].debutAction)/(action.icons[1].finAction-action.icons[1].debutAction)
+					if OvaleOptions:GetApparence().moving and icons[1].debutAction and icons[1].finAction then
+						local top=1-(OvaleState.maintenant - icons[1].debutAction)/(icons[1].finAction-icons[1].debutAction)
 						if top<0 then
 							top = 0
 						elseif top>1 then
 							top = 1
 						end
-						action.icons[1]:SetPoint("TOPLEFT",self.frame,"TOPLEFT",(action.left + top*action.dx)/action.scale,(action.top - top*action.dy)/action.scale)
-						if action.icons[2] then
-							action.icons[2]:SetPoint("TOPLEFT",self.frame,"TOPLEFT",(action.left + (top+1)*action.dx)/action.scale,(action.top - (top+1)*action.dy)/action.scale)
+						icons[1]:SetPoint("TOPLEFT",self.frame,"TOPLEFT",(action.left + top*action.dx)/action.scale,(action.top - top*action.dy)/action.scale)
+						if icons[2] then
+							icons[2]:SetPoint("TOPLEFT",self.frame,"TOPLEFT",(action.left + (top+1)*action.dx)/action.scale,(action.top - (top+1)*action.dy)/action.scale)
 						end
 					end

@@ -245,9 +253,9 @@ do
 							end
 							OvaleState:AddSpellToStack(spellId, start, start + castTime, nextCast, false, UnitGUID(spellTarget))
 							start, ending, priorite, element = OvaleBestAction:Compute(node)
-							action.icons[2]:Update(element, start, OvaleBestAction:GetActionInfo(element))
+							icons[2]:Update(element, start, OvaleBestAction:GetActionInfo(element))
 						else
-							action.icons[2]:Update(element, nil)
+							icons[2]:Update(element, nil)
 						end
 					end
 				end
@@ -275,6 +283,9 @@ do
 			for i, icon in pairs(action.icons) do
 				icon:Hide()
 			end
+			for i, icon in pairs(action.secureIcons) do
+				icon:Hide()
+			end
 		end

 		self.frame:EnableMouse(not OvaleOptions:GetApparence().clickThru)
@@ -294,7 +305,7 @@ do

 		for k,node in pairs(Ovale.masterNodes) do
 			if not self.actions[k] then
-				self.actions[k] = {icons={}}
+				self.actions[k] = {icons={}, secureIcons={}}
 			end
 			local action = self.actions[k]

@@ -332,12 +343,21 @@ do
 				action.dx = 0
 				action.dy = height
 			end
+			action.secure = node.secure

 			for l=1,nbIcons do
-				if (not action.icons[l]) then
-					action.icons[l] = CreateFrame("CheckButton", "Icon"..k.."n"..l,self.frame,"OvaleIcone");
-				end
-				local icon = action.icons[l]
+				local icon
+				if not node.secure then
+					if not action.icons[l] then
+						action.icons[l] = CreateFrame("CheckButton", "Icon"..k.."n"..l,self.frame,"OvaleIconTemplate");
+					end
+					icon = action.icons[l]
+				else
+					if not action.secureIcons[l] then
+						action.secureIcons[l] = CreateFrame("CheckButton", "SecureIcon"..k.."n"..l,self.frame,"SecureOvaleIconTemplate");
+					end
+					icon = action.secureIcons[l]
+				end
 				local scale = action.scale
 				if l> 1 then
 					scale = scale  * OvaleOptions:GetApparence().secondIconScale
diff --git a/OvaleFuture.lua b/OvaleFuture.lua
index 362c7bc..4243863 100644
--- a/OvaleFuture.lua
+++ b/OvaleFuture.lua
@@ -8,6 +8,7 @@ OvaleFuture.counter = {}
 --the spells that the player has casted but that did not reach their target
 --the result is computed by the simulator, allowing to ignore lag or missile travel time
 OvaleFuture.lastSpell = {}
+OvaleFuture.lastSpellId = nil
 --the attack power of the last spell
 OvaleFuture.lastSpellAP = {}
 OvaleFuture.lastSpellSP = {}
@@ -182,7 +183,7 @@ function OvaleFuture:COMBAT_LOG_EVENT_UNFILTERED(event, ...)
 						table.remove(self.lastSpell, i)
 						Ovale.refreshNeeded["player"] = true
 						--Ovale:Print("LOG_EVENT on supprime "..spellId.." a "..GetTime())
-					end
+					end
 					--Ovale:Print(UnitDebuff("target", "Etreinte de l'ombre"))
 					break
 				end
@@ -207,14 +208,23 @@ function OvaleFuture:AddSpellToList(spellId, lineId, startTime, endTime, channel
 		newSpell.target = UnitGUID("target")
 	end

+	local si = OvaleData.spellInfo[spellId]
+
+	self.lastSpellId = spellId
 	self.lastSpellAP[spellId] = UnitAttackPower("player")
 	self.lastSpellSP[spellId] = GetSpellBonusDamage(2)
 	self.lastSpellDM[spellId] = OvaleAura.damageMultiplier
 	self.lastSpell[#self.lastSpell+1] = newSpell
-	--Ovale:Print("on ajoute "..spellId..": ".. newSpell.start.." to "..newSpell.stop.." ("..OvaleState.maintenant..")" ..#self.lastSpell .. " " ..newSpell.target)
+	--Ovale:Print("on ajoute "..spellId..": ".. newSpell.start.." to "..newSpell.stop.." ("..tostring(OvaleState.maintenant)..")" ..#self.lastSpell .. " " ..tostring(newSpell.target))

-	if OvaleData.spellInfo[spellId] then
-		local si = OvaleData.spellInfo[spellId]
+	if si then
+		if si.combo == 0 then
+			local comboPoints = GetComboPoints("player")
+			--Ovale:Print("combo point " .. comboPoints)
+			if comboPoints > 0 then
+				self.lastSpellDM[spellId] = self.lastSpellDM[spellId] * comboPoints
+			end
+		end

 		if si.aura then
 			for target, targetInfo in pairs(si.aura) do
@@ -303,4 +313,14 @@ function OvaleFuture:Apply()
 		end
 	end
 end
+
+function OvaleFuture:InFlight(spellId)
+	for i,v in ipairs(self.lastSpell) do
+		if v.spellId == spellId then
+			return true
+		end
+	end
+	return false
+end
+
 --</public-static-methods>
diff --git a/OvaleGUID.lua b/OvaleGUID.lua
index 9cfb869..8fbb44e 100644
--- a/OvaleGUID.lua
+++ b/OvaleGUID.lua
@@ -16,8 +16,7 @@ function OvaleGUID:OnEnable()
 	self:Update("player")
 	self:RegisterEvent("PLAYER_LOGIN")
 	self:RegisterEvent("UNIT_TARGET")
-	self:RegisterEvent("PARTY_MEMBERS_CHANGED")
-	self:RegisterEvent("RAID_ROSTER_UPDATE")
+	self:RegisterEvent("GROUP_ROSTER_UPDATE")
 	self:RegisterEvent("UNIT_PET")
 	self:RegisterEvent("ARENA_OPPONENT_UPDATE")
 	self:RegisterEvent("PLAYER_FOCUS_CHANGED")
@@ -28,8 +27,7 @@ end
 function OvaleGUID:OnDisable()
 	self:UnregisterEvent("PLAYER_LOGIN")
 	self:UnregisterEvent("UNIT_TARGET")
-	self:UnregisterEvent("PARTY_MEMBERS_CHANGED")
-	self:UnregisterEvent("RAID_ROSTER_UPDATE")
+	self:UnregisterEvent("GROUP_ROSTER_UPDATE")
 	self:UnregisterEvent("UNIT_PET")
 	self:UnregisterEvent("ARENA_OPPONENT_UPDATE")
 	self:UnregisterEvent("PLAYER_FOCUS_CHANGED")
@@ -86,15 +84,8 @@ function OvaleGUID:UNIT_TARGET(event, unitId)
 	self:Update(unitId .. "target")
 end

-function OvaleGUID:PARTY_MEMBERS_CHANGED(event)
-	for i=1, GetNumPartyMembers() do
-		self:UpdateWithTarget("party"..i)
-		self:UpdateWithTarget("partypet"..i)
-	end
-end
-
-function OvaleGUID:RAID_ROSTER_UPDATE(event)
-	for i=1, GetNumRaidMembers() do
+function OvaleGUID:GROUP_ROSTER_UPDATE(event)
+	for i=1, GetNumGroupMembers() do
 		self:UpdateWithTarget("raid"..i)
 		self:UpdateWithTarget("raidpet"..i)
 	end
diff --git a/OvaleIcone.lua b/OvaleIcone.lua
index af9b493..e9ea321 100644
--- a/OvaleIcone.lua
+++ b/OvaleIcone.lua
@@ -139,7 +139,8 @@ local function Update(self, element, minAttente, actionTexture, actionInRange, a
 		else
 			self.aPortee:Hide()
 		end
-		if actionTarget=="focus" then
+		if actionTarget and actionTarget~="target" then
+			self.focusText:SetText(actionTarget)
 			self.focusText:Show()
 		else
 			self.focusText:Hide()
@@ -170,8 +171,25 @@ local function SetHelp(self, help)
 	self.help = help
 end

-local function SetParams(self, params)
+local function SetParams(self, params, secure)
 	self.params = params
+
+	self.actionButton = false
+	if secure then
+		for k,v in pairs(params) do
+			local f = string.find(k, "spell")
+			if f then
+				local prefix = string.sub(k, 1, f-1)
+				local suffix = string.sub(k, f + 5)
+				local param
+				Ovale:Print(prefix.."type"..suffix)
+				self:SetAttribute(prefix.."type"..suffix, "spell")
+				self:SetAttribute("unit", self.params.target or "target")
+				self:SetAttribute(k, OvaleData.spellList[v])
+				self.actionButton = true
+			end
+		end
+	end
 end

 local function SetFontScale(self, scale)
@@ -185,9 +203,11 @@ local function SetRangeIndicator(self, text)
 end
 --</public-methods>

-function OvaleIcone_OnClick(self)
-	Ovale:ToggleOptions()
-	self:SetChecked(0)
+function OvaleIcone_OnMouseUp(self)
+	if not self.actionButton then
+		Ovale:ToggleOptions()
+	end
+	self:SetChecked(1)
 end

 function OvaleIcone_OnEnter(self)
@@ -239,15 +259,18 @@ function OvaleIcone_OnLoad(self)
 	self.debutAction = nil
 	self.actionCourante = nil
 	self.params = nil
+	self.actionButton = false
 --</public-properties>

+	self:SetScript("OnMouseUp", OvaleIcone_OnMouseUp)

-	self.focusText:SetFontObject("GameFontNormal");
+	self.focusText:SetFontObject("GameFontNormalSmall");
 	self.focusText:SetAllPoints(self);
 	self.focusText:SetTextColor(1,1,1);
 	self.focusText:SetText(L["Focus"])

-	self:RegisterForClicks("LeftButtonUp")
+	--self:RegisterForClicks("LeftButtonUp")
+	self:RegisterForClicks("AnyUp")
 	self.SetSkinGroup = SetSkinGroup
 	self.Update = Update
 	self.SetHelp = SetHelp
diff --git a/OvaleIcone.xml b/OvaleIcone.xml
index 044555b..6d93fe4 100644
--- a/OvaleIcone.xml
+++ b/OvaleIcone.xml
@@ -1,9 +1,16 @@
 <Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\..\FrameXML\UI.xsd">

-  <CheckButton name="OvaleIcone" virtual="true" inherits="ActionButtonTemplate">
+  <CheckButton name="SecureOvaleIconTemplate" virtual="true" inherits="SecureActionButtonTemplate, ActionButtonTemplate">
+    <Scripts>
+      <OnLoad>OvaleIcone_OnLoad(self)</OnLoad>
+      <OnEnter>OvaleIcone_OnEnter(self)</OnEnter>
+      <OnLeave>OvaleIcone_OnLeave(self)</OnLeave>
+    </Scripts>
+  </CheckButton>
+
+  <CheckButton name="OvaleIconTemplate" virtual="true" inherits="ActionButtonTemplate">
     <Scripts>
       <OnLoad>OvaleIcone_OnLoad(self)</OnLoad>
-      <OnClick>OvaleIcone_OnClick(self)</OnClick>
       <OnEnter>OvaleIcone_OnEnter(self)</OnEnter>
       <OnLeave>OvaleIcone_OnLeave(self)</OnLeave>
     </Scripts>
diff --git a/OvaleOptions.lua b/OvaleOptions.lua
index 4894a7c..e44d39c 100644
--- a/OvaleOptions.lua
+++ b/OvaleOptions.lua
@@ -388,23 +388,8 @@ local options =
 					name = "List player spells",
 					type = "execute",
 					func = function()
-						local book=BOOKTYPE_SPELL
-						while true do
-							local i=1
-							while true do
-								local skillType, spellId = GetSpellBookItemInfo(i, book)
-								if not spellId then
-									break
-								end
-								local spellName = GetSpellBookItemName(i, book)
-								Ovale:Print(spellName..": "..spellId)
-								i = i + 1
-							end
-							if book == BOOKTYPE_SPELL then
-								book = BOOKTYPE_PET
-							else
-								break
-							end
+						for k,v in pairs(OvaleData.spellList) do
+							Ovale:Print(k ..":" .. v)
 						end
 					end
 				}
diff --git a/OvaleState.lua b/OvaleState.lua
index be073f7..0b95445 100644
--- a/OvaleState.lua
+++ b/OvaleState.lua
@@ -20,6 +20,8 @@ OvaleState.attenteFinCast = nil
 OvaleState.startCast = nil
 OvaleState.endCast = nil
 OvaleState.gcd = 1.5
+OvaleState.powerRate = {}
+OvaleState.lastSpellId = nil
 --</public-static-properties>

 --<private-static-properties>
@@ -42,20 +44,38 @@ function OvaleState:StartNewFrame()
 	self.gcd = OvaleData:GetGCD()
 end

+function OvaleState:UpdatePowerRates()
+	for k,v in pairs(OvaleData.power) do
+		self.powerRate[k] = 0
+	end
+
+	self.powerRate.energy = 10 * OvaleAura.meleeHaste
+
+	if OvaleState:GetAura("player", 13750, true) then
+		self.powerRate.energy = self.powerRate.energy * 2
+	end
+
+	self.powerRate.focus = 4 * OvaleAura.meleeHaste
+end
+
 function OvaleState:Reset()
+	self.lastSpellId = OvaleFuture.lastSpellId
 	self.serial = self.serial + 1
 	self.currentTime = self.maintenant
 	self.currentSpellId = nil
 	self.attenteFinCast = self.maintenant
 	self.state.combo = GetComboPoints("player")
-	self.state.mana = UnitPower("player")
-	self.state.shard = UnitPower("player", 7)
-	self.state.eclipse = UnitPower("player", 8)
-	self.state.holy = UnitPower("player", 9)
+	for k,v in pairs(OvaleData.power) do
+		self.state[k] = UnitPower("player", v.id)
+	end
+
+	self:UpdatePowerRates()
+
 	if OvaleData.className == "DEATHKNIGHT" then
 		for i=1,6 do
 			self.state.rune[i].type = GetRuneType(i)
 			local start, duration, runeReady = GetRuneCooldown(i)
+			self.state.rune[i].duration = duration
 			if runeReady then
 				self.state.rune[i].cd = start
 			else
@@ -91,6 +111,7 @@ function OvaleState:AddSpellToStack(spellId, startCast, endCast, nextCast, nocd,

 	local newSpellInfo = OvaleData.spellInfo[spellId]

+	self.lastSpellId = spellId
 	--On enregistre les infos sur le sort en cours
 	self.attenteFinCast = nextCast
 	self.currentSpellId = spellId
@@ -126,20 +147,42 @@ function OvaleState:AddSpellToStack(spellId, startCast, endCast, nextCast, nocd,
 	--(donc si il est dj lanc, on n'en tient pas compte)
 	if endCast >= self.maintenant then
 		--Mana
-		local _, _, _, cost = GetSpellInfo(spellId)
-		if cost then
-			self.state.mana = self.state.mana - cost
+		local _, _, _, cost, _, powerType = GetSpellInfo(spellId)
+		local power = OvaleData.powerType[powerType]
+		if cost and power and (not newSpellInfo or not newSpellInfo[power]) then
+			self.state[power] = self.state[power] - cost
 		end

 		if newSpellInfo then
-
-			if newSpellInfo.mana then
-				self.state.mana = self.state.mana - newSpellInfo.mana
+			for k,v in pairs(OvaleData.power) do
+				-- eclipse cost is on hit
+				if newSpellInfo[k] and k ~= "eclipse" then
+					if newSpellInfo[k] == 0 then
+						self.state[k] = 0
+					else
+						self.state[k] = self.state[k] - newSpellInfo[k]
+					end
+					if self.state[k] < v.mini then
+						self.state[k] = v.mini
+					end
+					if v.maxi and self.state[k] > v.maxi then
+						self.state[k] = v.maxi
+					else
+						local maxi = UnitPowerMax("player", v.id)
+						if maxi and self.state[k] > maxi then
+							self.state[k] = maxi
+						end
+					end
+				end
 			end

 			--Points de combo
 			if newSpellInfo.combo then
-				self.state.combo = self.state.combo + newSpellInfo.combo
+				if newSpellInfo.combo == 0 then
+					self.state.combo = 0
+				else
+					self.state.combo = self.state.combo + newSpellInfo.combo
+				end
 				if self.state.combo<0 then
 					self.state.combo = 0
 				end
@@ -157,22 +200,6 @@ function OvaleState:AddSpellToStack(spellId, startCast, endCast, nextCast, nocd,
 			if newSpellInfo.unholy then
 				self:AddRune(startCast, 2, newSpellInfo.unholy)
 			end
-			if newSpellInfo.holy then
-				self.state.holy = self.state.holy + newSpellInfo.holy
-				if self.state.holy < 0 then
-					self.state.holy = 0
-				elseif self.state.holy > 3 then
-					self.state.holy = 3
-				end
-			end
-			if newSpellInfo.shard then
-				self.state.shard = self.state.shard + newSpellInfo.shard
-				if self.state.shard < 0 then
-					self.state.shard = 0
-				elseif self.state.shard > 3 then
-					self.state.shard = 3
-				end
-			end
 		end
 	end

@@ -225,24 +252,8 @@ function OvaleState:AddSpellToStack(spellId, startCast, endCast, nextCast, nocd,
 				self:AddEclipse(endCast, 48517)
 			end
 		end
-		if newSpellInfo.starsurge then
-			local buffAura = self:GetAura("player", 48517, true) --Solar
-			if buffAura and buffAura.stacks>0 then
-				Ovale:Log("starsurge with solar buff = " .. (- newSpellInfo.starsurge))
-				self.state.eclipse = self.state.eclipse - newSpellInfo.starsurge
-			else
-				buffAura = self:GetAura("player", 48518, true) --Lunar
-				if buffAura and buffAura.stacks>0 then
-					Ovale:Log("starsurge with lunar buff = " .. newSpellInfo.starsurge)
-					self.state.eclipse = self.state.eclipse + newSpellInfo.starsurge
-				elseif self.state.eclipse < 0 then
-					Ovale:Log("starsurge with eclipse < 0 = " .. (- newSpellInfo.starsurge))
-					self.state.eclipse = self.state.eclipse - newSpellInfo.starsurge
-				else
-					Ovale:Log("starsurge with eclipse > 0 = " .. newSpellInfo.starsurge)
-					self.state.eclipse = self.state.eclipse + newSpellInfo.starsurge
-				end
-			end
+		if spellId == 78674 then -- starsurge
+			self.state.eclipse = self.state.eclipse + self:GetEclipseDir() * 20
 			if self.state.eclipse < -100 then
 				self.state.eclipse = -100
 				self:AddEclipse(endCast, 48518)
@@ -373,7 +384,7 @@ function OvaleState:AddEclipse(endCast, spellId)
 end

 function OvaleState:GetAuraByGUID(guid, spellId, mine, target)
-	if mine and self.aura[guid] and self.aura[guid][spellId] and self.aura[guid][spellId].serial == self.serial then
+	if self.aura[guid] and self.aura[guid][spellId] and self.aura[guid][spellId].serial == self.serial then
 		return self.aura[guid][spellId]
 	else
 		return OvaleAura:GetAuraByGUID(guid, spellId, mine, target)
@@ -384,23 +395,25 @@ function OvaleState:GetAura(target, spellId, mine)
 	return self:GetAuraByGUID(UnitGUID(target), spellId, mine, target)
 end

-
-function OvaleState:GetExpirationTimeOnAnyTarget(spellId)
-	local starting, ending = OvaleAura:GetExpirationTimeOnAnyTarget(spellId)
+function OvaleState:GetExpirationTimeOnAnyTarget(spellId, excludingTarget)
+	local starting, ending, count = OvaleAura:GetExpirationTimeOnAnyTarget(spellId, excludingTarget)
 	for unitId,auraTable in pairs(self.aura) do
-		local aura = auraTable[spellId]
-		if aura and aura.serial == self.serial then
-			local newEnding = aura.ending
-			local newStarting = aura.start
-			if newStarting and (not staring or newStarting < starting) then
-				starting = newStarting
-			end
-			if newEnding and (not ending or newEnding > ending) then
-				ending = newEnding
+		if unitId ~= excludingTarget then
+			local aura = auraTable[spellId]
+			if aura and aura.serial == self.serial then
+				local newEnding = aura.ending
+				local newStarting = aura.start
+				if newStarting and (not staring or newStarting < starting) then
+					starting = newStarting
+				end
+				if newEnding and (not ending or newEnding > ending) then
+					ending = newEnding
+				end
+				count = count + 1
 			end
 		end
 	end
-	return starting, ending
+	return starting, ending, count
 end

 function OvaleState:NewAura(guid, spellId)
@@ -416,4 +429,85 @@ function OvaleState:NewAura(guid, spellId)
 	myAura.gain = self.currentTime
 	return myAura
 end
+
+
+function OvaleState:GetEclipseDir()
+	local value
+	local buffAura = self:GetAura("player", 48517) --Solar
+	if buffAura and buffAura.stacks>0 then
+		value = -1
+	else
+		buffAura = self:GetAura("player", 48518) --Lunar
+		if buffAura and buffAura.stacks>0 then
+			value =1
+		elseif self.state.eclipse < 0 then
+			value = -1
+		else
+			value = 1
+		end
+	end
+	return value
+end
+
+local runes = {}
+local runesCD = {}
+
+function OvaleState:GetRunes(blood, frost, unholy, death, nodeath)
+	local nombre = 0
+	local nombreCD = 0
+	local maxCD = nil
+
+	for i=1,4 do
+		runesCD[i] = 0
+	end
+
+	runes[1] = blood or 0
+	runes[2] = frost or 0
+	runes[3] = unholy or 0
+	runes[4] = death or 0
+
+	for i=1,6 do
+		local rune = self.state.rune[i]
+		if rune then
+			if runes[rune.type] > 0 then
+				runes[rune.type] = runes[rune.type] - 1
+				if rune.cd > runesCD[rune.type] then
+					runesCD[rune.type] = rune.cd
+				end
+			elseif rune.cd < runesCD[rune.type] then
+				runesCD[rune.type] = rune.cd
+			end
+		end
+	end
+
+	if not nodeath then
+		for i=1,6 do
+			local rune = self.state.rune[i]
+			if rune and rune.type == 4 then
+				for j=1,3 do
+					if runes[j]>0 then
+						runes[j] = runes[j] - 1
+						if rune.cd > runesCD[j] then
+							runesCD[j] = rune.cd
+						end
+						break
+					elseif rune.cd < runesCD[j] then
+						runesCD[j] = rune.cd
+						break
+					end
+				end
+			end
+		end
+	end
+
+	for i=1,4 do
+		if runes[i]> 0 then
+			return nil
+		end
+		if not maxCD or runesCD[i]>maxCD then
+			maxCD = runesCD[i]
+		end
+	end
+	return maxCD
+end
 --</public-static-methods>
diff --git a/defaut/Chaman.lua b/defaut/Chaman.lua
index 548c410..181e888 100644
--- a/defaut/Chaman.lua
+++ b/defaut/Chaman.lua
@@ -1,209 +1,222 @@
-Ovale.defaut["SHAMAN"] =
-[[
-Define(BLOODLUST 2825)
-	SpellInfo(BLOODLUST cd=300)
-	SpellAddBuff(BLOODLUST BLOODLUST=40)
-Define(CHAINLIGHTNING 421)
-	SpellInfo(CHAINLIGHTNING)
-	SpellAddBuff(CHAINLIGHTNING MAELSTROMWEAPON=0)
-Define(EARTHQUAKE 61882)
-Define(EARTHSHOCK 8042)
-	SpellInfo(EARTHSHOCK cd=6 sharedcd=shock)
-	SpellAddTargetDebuff(EARTHSHOCK EARTHSHOCK=8)
-Define(ELEMENTALMASTERY 16166)
-	SpellInfo(ELEMENTALMASTERY cd=180)
-	SpellAddBuff(ELEMENTALMASTERY ELEMENTALMASTERY=30)
-Define(FERALSPIRIT 51533)
-	SpellInfo(FERALSPIRIT cd=120)
-Define(FIRENOVA 1535)
-	SpellInfo(FIRENOVA cd=10)
-Define(FLAMESHOCK 8050)
-	SpellInfo(FLAMESHOCK cd=6 sharedcd=shock)
-	SpellAddTargetDebuff(FLAMESHOCK FLAMESHOCK=18)
-Define(FLAMETHONGWEAPON 8024)
-Define(FROSTSHOCK 8056)
-	SpellInfo(FROSTSHOCK cd=6 sharedcd=shock)
-	SpellAddTargetDebuff(FROSTSHOCK FROSTSHOCK=8)
-Define(FROSTBANDWEAPON 8033)
-Define(HEROISM 32182)
-	SpellInfo(HEROISM cd=300)
-	SpellAddBuff(HEROISM HEROISM=40)
-Define(LAVABURST 51505)
-	SpellInfo(LAVABURST cd=8)
-Define(LAVALASH 60103)
-	SpellInfo(LAVALASH cd=10)
-Define(LIGHTNINGBOLT 403)
-	SpellAddBuff(LIGHTNINGBOLT MAELSTROMWEAPON=0)
-Define(LIGHTNINGSHIELD 324)
-	SpellAddBuff(LIGHTNINGSHIELD LIGHTNINGSHIELD=600)
-Define(PRIMALSTRIKE 73899)
-	SpellInfo(PRIMALSTRIKE cd=8)
-Define(ROCKBITERWEAPON 8017)
-Define(SHAMANISTICRAGE 30823)
-	SpellInfo(SHAMANISTICRAGE cd=60)
-	SpellAddBuff(SHAMANISTICRAGE SHAMANISTICRAGE=15)
-Define(SPIRITWALKERSGRACE 79206)
-	SpellInfo(SPIRITWALKERSGRACE cd=120)
-	SpellAddBuff(SPIRITWALKERSGRACE SPIRITWALKERSGRACE=15)
-Define(STORMSTRIKE 17364)
-	SpellInfo(STORMSTRIKE cd=8)
-	SpellAddTargetDebuff(STORMSTRIKE STORMSTRIKE=15)
-Define(THUNDERSTORM 51490)
-	SpellInfo(THUNDERSTORM cd=45)
-Define(UNLEASHELEMENTS 73680)
-	SpellInfo(UNLEASHELEMENTS cd=15)
-Define(UNLEASHFLAME 73683)
-	SpellInfo(UNLEASHFLAME cd=15)
-	SpellAddBuff(UNLEASHFLAME UNLEASHFLAME=8)
-Define(WATERSHIELD 52127)
-	SpellAddBuff(WATERSHIELD WATERSHIELD=600)
-Define(WINDSHEAR 57994)
-	SpellInfo(WINDSHEAR cd=6)
-Define(WINDFURYWEAPON 8232)
-
-#Buff
-Define(MAELSTROMWEAPON 53817)
-Define(UNLEASHWIND 73681)
-
-#Glyphs
-Define(GLYPHOFUNLEASHEDLIGHTNING 101052)
-
-#Fire
-Define(FIREELEMENTALTOTEM 2894)
-Define(MAGMATOTEM 8190)
-	SpellInfo(MAGMATOTEM cd=20)
-Define(SEARINGTOTEM 3599)
-	SpellInfo(SEARINGTOTEM cd=10) #Fake CD so it won't be displayed twice
-Define(FLAMETHONGTOTEM 8227)
-
-Define(TOTEMOFWRATH 30706)
-#Water
-Define(HEALINGSTREAMTOTEM 5394)
-Define(MANASPRINGTOTEM 5675)
-Define(TOTEMOFTRANQUILMIND 87718)
-#Air
-Define(GROUNDINGTOTEM 8177)
-Define(WINDFURYTOTEM 8512)
-Define(WRATHOFAIRTOTEM 3738)
-#Earth
-Define(STONECLAWTOTEM 5730)
-Define(STONESKINTOTEM 8071)
-Define(STRENGTHOFEARTHTOTEM 8075)
-Define(TREMORTOTEM 8143)
-
-
-ScoreSpells(LIGHTNINGSHIELD CHAINLIGHTNING FLAMESHOCK LAVABURST EARTHSHOCK LIGHTNINGBOLT
-			STORMSTRIKE LAVALASH UNLEASHELEMENTS)
-
-AddCheckBox(aoe L(AOE))
-AddCheckBox(chain SpellName(CHAINLIGHTNING) default mastery=1)
-
-AddIcon help=main mastery=1
+Ovale.defaut["SHAMAN"] = [[Define(ancestral_swiftness 16188)
+  SpellInfo(ancestral_swiftness cd=60 )
+  SpellAddBuff(ancestral_swiftness ancestral_swiftness=1)
+Define(ascendance 114049)
+  SpellInfo(ascendance cd=180 )
+Define(berserking 26297)
+  SpellInfo(berserking duration=10 cd=180 )
+  SpellAddBuff(berserking berserking=1)
+Define(blood_fury 20572)
+  SpellInfo(blood_fury duration=15 cd=120 )
+  SpellAddBuff(blood_fury blood_fury=1)
+Define(bloodlust 2825)
+  SpellInfo(bloodlust duration=40 cd=300 )
+  SpellAddBuff(bloodlust bloodlust=1)
+Define(chain_lightning 421)
+  SpellInfo(chain_lightning cd=3 )
+Define(earth_elemental_totem 2062)
+  SpellInfo(earth_elemental_totem duration=60 cd=300 )
+Define(earth_shock 8042)
+  SpellInfo(earth_shock sharedcd=shock cd=6 )
+Define(earthquake 77478)
+  SpellInfo(earthquake duration=3 )
+  SpellAddBuff(earthquake earthquake=1)
+Define(elemental_blast 117014)
+  SpellInfo(elemental_blast cd=12 )
+Define(elemental_mastery 16166)
+  SpellInfo(elemental_mastery duration=20 cd=120 )
+  SpellAddBuff(elemental_mastery elemental_mastery=1)
+Define(feral_spirit 51533)
+  SpellInfo(feral_spirit duration=30 cd=120 )
+Define(fire_elemental_totem 2894)
+  SpellInfo(fire_elemental_totem duration=60 cd=300 )
+Define(fire_nova 8349)
+Define(flame_shock 8050)
+  SpellInfo(flame_shock duration=24 tick=3 sharedcd=shock cd=6 )
+  SpellAddTargetDebuff(flame_shock flame_shock=1)
+Define(flametongue_weapon 8024)
+Define(lava_beam 114074)
+Define(lava_burst 51505)
+  SpellInfo(lava_burst cd=8 )
+Define(lava_lash 60103)
+  SpellInfo(lava_lash cd=10 )
+Define(lightning_bolt 403)
+Define(lightning_shield 26364)
+  SpellInfo(lightning_shield cd=3 )
+Define(maelstrom_weapon 51530)
+Define(magma_totem 8187)
+Define(searing_totem 3599)
+  SpellInfo(searing_totem duration=60 )
+Define(spiritwalkers_grace 79206)
+  SpellInfo(spiritwalkers_grace duration=15 cd=120 )
+  SpellAddBuff(spiritwalkers_grace spiritwalkers_grace=1)
+Define(stormblast 115356)
+  SpellInfo(stormblast duration=15 sharedcd=strike cd=8 )
+  SpellAddBuff(stormblast stormblast=1)
+Define(stormstrike 17364)
+  SpellInfo(stormstrike duration=15 sharedcd=strike cd=8 )
+  SpellAddBuff(stormstrike stormstrike=1)
+Define(thunderstorm 51490)
+  SpellInfo(thunderstorm duration=5 cd=45 )
+  SpellAddBuff(thunderstorm thunderstorm=1)
+Define(unleash_elements 73680)
+  SpellInfo(unleash_elements cd=15 )
+Define(unleash_flame 73683)
+  SpellInfo(unleash_flame duration=8 )
+  SpellAddBuff(unleash_flame unleash_flame=1)
+Define(unleashed_fury_ft 118470)
+  SpellInfo(unleashed_fury_ft duration=10 )
+  SpellAddBuff(unleashed_fury_ft unleashed_fury_ft=1)
+Define(wind_shear 57994)
+  SpellInfo(wind_shear duration=3 cd=12 )
+Define(windfury_weapon 8232)
+Define(ancestral_swiftness_talent 11)
+Define(elemental_blast_talent 18)
+Define(elemental_mastery_talent 10)
+Define(unleashed_fury_talent 16)
+AddIcon mastery=1 help=main
 {
-	unless InCombat()
+	if not InCombat()
 	{
-		#/flametongue_weapon,weapon=main
-		if WeaponEnchantExpires(mainhand 400) Spell(FLAMETHONGWEAPON)
+		main.Spell(flametongue_weapon)
 	}
-	#/lightning_shield
-	if BuffExpires(LIGHTNINGSHIELD 2) Spell(LIGHTNINGSHIELD)

-	#/unleash_elements,moving=1
-	if Speed(more 0) and Glyph(GLYPHOFUNLEASHEDLIGHTNING no) Spell(UNLEASHELEMENTS)
-
-	#/flame_shock,if=!ticking|ticks_remain<2|((buff.bloodlust.react|buff.elemental_mastery.up)&ticks_remain<3)
-	if TargetDebuffExpires(FLAMESHOCK 3 haste=spell mine=1) or {{BuffPresent(heroism) or BuffPresent(ELEMENTALMASTERY)} and TargetDebuffExpires(FLAMESHOCK 6 haste=spell mine=1)}
-		Spell(FLAMESHOCK)
-
-	#/lava_burst,if=dot.flame_shock.remains>cast_time
-	if target.debuffExpires(FLAMESHOCK mine=1) > castTime(LAVABURST) Spell(LAVABURST)
-
-	#/earth_shock,if=buff.lightning_shield.stack=9
-	if BuffPresent(LIGHTNINGSHIELD stacks=9) Spell(EARTHSHOCK)
-	#/earth_shock,if=buff.lightning_shield.stack>6&dot.flame_shock.remains>cooldown&dot.flame_shock.remains<cooldown+action.flame_shock.tick_time
-	if BuffPresent(LIGHTNINGSHIELD stacks=7) and { target.debuffExpires(FLAMESHOCK mine=1) > spell(EARTHSHOCK) }
-			and { target.debuffExpires(FLAMESHOCK mine=1) < spell(EARTHSHOCK) + timeWithHaste(3) } Spell(EARTHSHOCK)
+	{
+		if TalentPoints(elemental_blast_talent) and not BuffPresent(ascendance) Spell(elemental_blast)
+		if TalentPoints(unleashed_fury_talent) and not BuffPresent(ascendance) Spell(unleash_elements)
+		if not BuffPresent(ascendance) and {not target.DebuffPresent(flame_shock) or TicksRemain(flame_shock) <2 or {{BuffPresent(bloodlust) or BuffPresent(elemental_mastery) } and TicksRemain(flame_shock) <3 } } Spell(flame_shock)
+		if target.DebuffRemains(flame_shock) >CastTime(lava_burst) and {BuffPresent(ascendance) or SpellCooldown(lava_burst) } Spell(lava_burst)
+		if BuffPresent(lightning_shield) ==0 Spell(earth_shock)
+		if not TotemPresent(fire) Spell(searing_totem)
+		Spell(lightning_bolt)
+	}
+	if Enemies() >1
+	{
+		Spell(lava_beam)
+		if not TotemPresent(fire) Spell(searing_totem)
+		if not target.DebuffPresent(flame_shock) Spell(flame_shock)
+		if target.DebuffRemains(flame_shock) >CastTime(lava_burst) and SpellCooldown(lava_burst) Spell(lava_burst)
+		if ManaPercent() <80 Spell(thunderstorm)
+		if ManaPercent() >10 Spell(chain_lightning)
+		Spell(lightning_bolt)
+	}
+}
+AddIcon mastery=1 help=offgcd
+{
+	if not InCombat()
+	{
+		if not BuffPresent(lightning_shield) Spell(lightning_shield)
+	}
+	if target.IsInterruptible() Spell(wind_shear)

-	if TotemExpires(fire) Spell(SEARINGTOTEM)
-	#/spiritwalkers_grace,moving=1
-	if Speed(more 0) Spell(SPIRITWALKERSGRACE)
-	#/lightning_bolt
-	Spell(LIGHTNINGBOLT)
+	{
+		if TalentPoints(ancestral_swiftness_talent) and not BuffPresent(ascendance) Spell(ancestral_swiftness)
+	}
+	if Enemies() >1
+	{
+		if Enemies() >2 and not TotemPresent(fire) Spell(magma_totem)
+		if Enemies() >4 Spell(earthquake)
+	}
 }
-
-AddIcon help=aoe mastery=1 checkboxon=aoe
+AddIcon mastery=1 help=moving
 {
-	Spell(EARTHQUAKE)
-	if TargetDebuffPresent(FLAMESHOCK mine=1) Spell(FIRENOVA)
-	Spell(CHAINLIGHTNING)
+
+	{
+		Spell(unleash_elements)
+	}
 }
-
-AddIcon help=cd mastery=1
+AddIcon mastery=1 help=cd
 {
-	Spell(ELEMENTALMASTERY)
-	Item(Trinket0Slot usable=1)
-	Item(Trinket1Slot usable=1)
-	Spell(FIREELEMENTALTOTEM)
+	if target.HealthPercent() <25 or TimeInCombat() >5 Spell(bloodlust)
+
+	{
+		if {{SpellCooldown(ascendance) >10 or Level() <87 } and SpellCooldown(fire_elemental_totem) >10 } or BuffPresent(ascendance) or BuffPresent(bloodlust) or TotemPresent(fire_elemental_totem)  { Item(Trinket0Slot usable=1) Item(Trinket1Slot usable=1) }
+		if BuffPresent(bloodlust) or BuffPresent(ascendance) or {{SpellCooldown(ascendance) >10 or Level() <87 } and SpellCooldown(fire_elemental_totem) >10 } Spell(blood_fury)
+		if TalentPoints(elemental_mastery_talent) and TimeInCombat() >15 and {{not BuffPresent(bloodlust) and TimeInCombat() <120 } or {not BuffPresent(berserking) and not BuffPresent(bloodlust) and BuffPresent(ascendance) } or {TimeInCombat() >=200 and {SpellCooldown(ascendance) >30 or Level() <87 } } } Spell(elemental_mastery)
+		if not TotemPresent(fire) Spell(fire_elemental_totem)
+		if target.DebuffRemains(flame_shock) >0 and {target.DeadIn() <20 or BuffPresent(bloodlust) or TimeInCombat() >=180 } Spell(ascendance)
+		if not Spell(earth_elemental_totem)
+		Spell(spiritwalkers_grace)
+	}
+	if Enemies() >1
+	{
+		Spell(ascendance)
+	}
 }
-
-AddIcon help=main mastery=2
+AddIcon mastery=2 help=main
 {
-	unless InCombat()
+	if not InCombat()
 	{
-		#/windfury_weapon,weapon=main
-		if WeaponEnchantExpires(mainhand 400) Spell(WINDFURYWEAPON)
-		#/flametongue_weapon,weapon=off
-		if WeaponEnchantExpires(offhand 400) Spell(FLAMETHONGWEAPON)
+		main.Spell(windfury_weapon)
+		off.Spell(flametongue_weapon)
 	}

-	#/lightning_shield
-	if BuffExpires(LIGHTNINGSHIELD) Spell(LIGHTNINGSHIELD)
-
-	#/searing_totem
-	if TotemExpires(fire) Spell(SEARINGTOTEM)
-	#/stormstrike
-	Spell(STORMSTRIKE)
-	#/lava_lash
-	Spell(LAVALASH)
-	#/lightning_bolt,if=buff.maelstrom_weapon.react=5
-	if BuffPresent(MAELSTROMWEAPON stacks=5) Spell(LIGHTNINGBOLT)
-	#/unleash_elements
-	Spell(UNLEASHELEMENTS)
-	#/flame_shock,if=!ticking|buff.unleash_flame.up
-	if TargetDebuffExpires(FLAMESHOCK 0 mine=1) or BuffPresent(UNLEASHFLAME)
-		Spell(FLAMESHOCK)
-	#/earth_shock
-	Spell(EARTHSHOCK)
-	#/fire_nova,if=target.adds>1
-	#if TargetDebuffPresent(FLAMESHOCK mine=1) Spell(FIRENOVA)
-	#/lightning_bolt,if=buff.maelstrom_weapon.react>1
-	if BuffPresent(MAELSTROMWEAPON stacks=2) Spell(LIGHTNINGBOLT)
-
-	Spell(SHAMANISTICRAGE priority=2)
-	Spell(FERALSPIRIT priority=2)
+	{
+		if not TotemPresent(fire) Spell(searing_totem)
+		if TalentPoints(unleashed_fury_talent) Spell(unleash_elements)
+		if TalentPoints(elemental_blast_talent) Spell(elemental_blast)
+		if BuffPresent(maelstrom_weapon) ==5 or {ArmorSetParts(T13 more 4) ==1 and BuffPresent(maelstrom_weapon) >=4 and False() } Spell(lightning_bolt)
+		Spell(stormblast)
+		if BuffPresent(unleash_flame) and not target.DebuffPresent(flame_shock) Spell(flame_shock)
+		Spell(stormstrike)
+		Spell(lava_lash)
+		Spell(unleash_elements)
+		if BuffPresent(maelstrom_weapon) >=3 and target.DebuffPresent(unleashed_fury_ft) and not BuffPresent(ascendance) Spell(lightning_bolt)
+		if BuffPresent(ancestral_swiftness) Spell(lightning_bolt)
+		if BuffPresent(unleash_flame) and target.DebuffRemains(flame_shock) <=3 Spell(flame_shock)
+		Spell(earth_shock)
+		if BuffPresent(maelstrom_weapon) >1 and not BuffPresent(ascendance) Spell(lightning_bolt)
+	}
+	if Enemies() >1
+	{
+		if not TotemPresent(fire) Spell(searing_totem)
+		if target.DebuffPresent(flame_shock) Spell(lava_lash)
+		if Enemies() >2 and BuffPresent(maelstrom_weapon) >=3 Spell(chain_lightning)
+		Spell(unleash_elements)
+		if not target.DebuffPresent(flame_shock) Spell(flame_shock)
+		Spell(stormstrike)
+		if BuffPresent(maelstrom_weapon) ==5 and SpellCooldown(chain_lightning) >=2 Spell(lightning_bolt)
+		if Enemies() >2 and BuffPresent(maelstrom_weapon) >1 Spell(chain_lightning)
+		if BuffPresent(maelstrom_weapon) >1 Spell(lightning_bolt)
+	}
 }
-
-AddIcon help=aoe mastery=2 checkboxon=aoe
+AddIcon mastery=2 help=offgcd
 {
-	if BuffPresent(MAELSTROMWEAPON stacks=5) Spell(CHAINLIGHTNING)
-	if TotemExpires(fire) Spell(MAGMATOTEM)
-	if TotemPresent(fire) Spell(FIRENOVA)
-	Spell(LAVALASH)
-	if BuffPresent(MAELSTROMWEAPON stacks=4) Spell(CHAINLIGHTNING)
-	Spell(UNLEASHELEMENTS)
-	if TargetDebuffExpires(FLAMESHOCK 0 mine=1) Spell(FLAMESHOCK)
-	Spell(EARTHSHOCK)
-	Spell(STORMSTRIKE)
-	if BuffPresent(MAELSTROMWEAPON stacks=2) Spell(CHAINLIGHTNING)
-	Spell(LAVABURST)
+	if not InCombat()
+	{
+		if not BuffPresent(lightning_shield) Spell(lightning_shield)
+	}
+	if target.IsInterruptible() Spell(wind_shear)
+
+	{
+		if TalentPoints(ancestral_swiftness_talent) and BuffPresent(maelstrom_weapon) <2 Spell(ancestral_swiftness)
+	}
+	if Enemies() >1
+	{
+		if Enemies() >5 and not TotemPresent(fire) Spell(magma_totem)
+		if {DebuffCount(flame_shock) ==Enemies() } or DebuffCount(flame_shock) >=5 Spell(fire_nova)
+	}
 }
-
-AddIcon help=cd mastery=2
+AddIcon mastery=2 help=cd
 {
-	Spell(FERALSPIRIT)
-	Item(Trinket0Slot usable=1)
-	Item(Trinket1Slot usable=1)
-	Spell(FIREELEMENTALTOTEM)
+	if target.HealthPercent() <25 or TimeInCombat() >5 Spell(bloodlust)
+	 { Item(Trinket0Slot usable=1) Item(Trinket1Slot usable=1) }
+
+	{
+		Spell(blood_fury)
+		if TalentPoints(elemental_mastery_talent) Spell(elemental_mastery)
+		if not TotemPresent(fire) and {BuffPresent(bloodlust) or BuffPresent(elemental_mastery) or target.DeadIn() <=0 +10 or {TalentPoints(elemental_mastery_talent) and {SpellCooldown(elemental_mastery) ==0 or SpellCooldown(elemental_mastery) >80 } or TimeInCombat() >=60 } } Spell(fire_elemental_totem)
+		if SpellCooldown(strike) >=3 Spell(ascendance)
+		Spell(feral_spirit)
+		if not Spell(earth_elemental_totem)
+		Spell(spiritwalkers_grace)
+	}
+	if Enemies() >1
+	{
+		Spell(blood_fury)
+		Spell(ascendance)
+		if not TotemPresent(fire) Spell(fire_elemental_totem)
+		Spell(feral_spirit)
+	}
 }
-
 ]]
\ No newline at end of file
diff --git a/defaut/Chasseur.lua b/defaut/Chasseur.lua
index 4d89fec..a88d7a7 100644
--- a/defaut/Chasseur.lua
+++ b/defaut/Chasseur.lua
@@ -1,210 +1,235 @@
-Ovale.defaut["HUNTER"] =
-[[
-#Spells
-Define(AIMEDSHOT 19434)
-	SpellInfo(AIMEDSHOT resetcounter=ss mana=50)
-	SpellAddBuff(AIMEDSHOT FIRE=0)
-Define(ARCANESHOT 3044)
-	SpellInfo(ARCANESHOT resetcounter=ss mana=25)
-Define(ASPECTOFTHEFOX 82661)
-	SpellAddBuff(ASPECTOFTHEFOX ASPECTOFTHEFOX=1000)
-Define(ASPECTOFTHEHAWK 13165)
-	SpellAddBuff(ASPECTOFTHEHAWK ASPECTOFTHEHAWK=1000)
-Define(BESTIALWRATH 19574)
-	SpellInfo(BESTIALWRATH cd=120)
-	SpellAddBuff(BESTIALWRATH BESTIALWRATH=10)
-Define(BLACKARROW 3674)
-	SpellInfo(BLACKARROW cd=30 mana=35)
-	SpellAddTargetDebuff(BLACKARROW BLACKARROW=15)
-Define(CALLOFTHEWILD 53434)
-	SpellInfo(CALLOFTHEWILD cd=300)
-	SpellAddBuff(CALLOFTHEWILD CALLOFTHEWILD=20)
-Define(CHIMERASHOT 53209)
-	SpellInfo(CHIMERASHOT cd=10 resetcounter=ss mana=50)
-	SpellAddTargetDebuff(CHIMERASHOT SERPENTSTING=refresh)
-Define(COBRASHOT 77767)
-	SpellInfo(COBRASHOT mana=-9)
-	SpellAddTargetDebuff(COBRASHOT SERPENTSTING=refresh)
-Define(EXPLOSIVESHOT 53301)
-	SpellInfo(EXPLOSIVESHOT cd=6 mana=50 buffnocd=LOCKANDLOAD)
-	SpellAddTargetDebuff(EXPLOSIVESHOT EXPLOSIVESHOT=2)
-	SpellAddBuff(EXPLOSIVESHOT LOCKANDLOAD=-1)
-Define(FERVOR 82726)
-	SpellInfo(FERVOR mana=-50 cd=120)
-Define(FOCUSFIRE 82692)
-	SpellInfo(FOCUSFIRE cd=15)
-	SpellAddBuff(FOCUSFIRE FOCUSFIRE=15)
-Define(KILLCOMMAND 34026)
-	SpellInfo(KILLCOMMAND cd=6 mana=40 resetcounter=ss)
-Define(KILLSHOT 53351)
-	SpellInfo(KILLSHOT cd=10 resetcounter=ss)
-Define(HUNTERSMARK 1130)
-	SpellAddTargetDebuff(HUNTERSMARK HUNTERSMARK=300)
-Define(MULTISHOT 2643)
-	SpellInfo(MULTISHOT mana=40)
-Define(RAPIDFIRE 3045)
-	SpellAddBuff(RAPIDFIRE RAPIDFIRE=15)
-	SpellInfo(RAPIDFIRE cd=300 resetcounter=ss)
-Define(READINESS 23989)
-	SpellInfo(READINESS cd=180)
-Define(SERPENTSTING 1978)
-	SpellInfo(SERPENTSTING resetcounter=ss duration=15 mana=25)
-	SpellAddTargetDebuff(SERPENTSTING SERPENTSTING=15)
-Define(STEADYSHOT 56641)
-	SpellInfo(STEADYSHOT inccounter=ss mana=-9)
-Define(SILENCINGSHOT 34490)
-	SpellInfo(SILENCINGSHOT cd=20 resetcounter=ss)
-
-#Pet spells
-Define(GROWL 2649)
-
-#Buffs
-Define(LOCKANDLOAD 56453)
-Define(FRENZYEFFECT 19615)
-Define(MARKEDFORDEATH 88691)
-Define(FIRE 82926)
-Define(BEASTWITHIN 34692)
-
-#Glyphs
-Define(GLYPHOFARCANESHOT 56841)
-
-AddCheckBox(multi SpellName(MULTISHOT))
-ScoreSpells(FOCUSFIRE KILLCOMMAND ARCANESHOT KILLSHOT STEADYSHOT SERPENTSTING
-			CHIMERASHOT AIMEDSHOT
-			BLACKARROW EXPLOSIVESHOT)
-
-AddIcon help=main mastery=1
+Ovale.defaut["HUNTER"] = [[Define(a_murder_of_crows 131900)
+Define(aimed_shot 19434)
+  SpellInfo(aimed_shot focus=50 )
+Define(arcane_shot 3044)
+  SpellInfo(arcane_shot focus=20 )
+Define(aspect_of_the_fox 82661)
+  SpellAddBuff(aspect_of_the_fox aspect_of_the_fox=1)
+Define(aspect_of_the_hawk 13165)
+  SpellAddBuff(aspect_of_the_hawk aspect_of_the_hawk=1)
+Define(barrage 120360)
+  SpellInfo(barrage duration=3 focus=30 cd=30 )
+Define(beast_within 34692)
+Define(bestial_wrath 19574)
+  SpellInfo(bestial_wrath duration=10 cd=60 )
+  SpellAddBuff(bestial_wrath bestial_wrath=1)
+Define(black_arrow 3674)
+  SpellInfo(black_arrow duration=20 focus=35 tick=2 cd=30 )
+  SpellAddTargetDebuff(black_arrow black_arrow=1)
+Define(blink_strike 130392)
+  SpellInfo(blink_strike cd=20 )
+Define(blood_fury 20572)
+  SpellInfo(blood_fury duration=15 cd=120 )
+  SpellAddBuff(blood_fury blood_fury=1)
+Define(call_pet_1 883)
+Define(chimera_shot 53209)
+  SpellInfo(chimera_shot focus=45 cd=9 )
+Define(cobra_shot 77767)
+  SpellInfo(cobra_shot focus=-14 )
+Define(dire_beast 120679)
+  SpellInfo(dire_beast cd=30 )
+Define(explosive_shot 53301)
+  SpellInfo(explosive_shot duration=2 focus=25 tick=1 cd=6 )
+  SpellAddTargetDebuff(explosive_shot explosive_shot=1)
+Define(explosive_trap 13812)
+  SpellInfo(explosive_trap duration=20 )
+  SpellAddTargetDebuff(explosive_trap explosive_trap=1)
+Define(fervor 82726)
+  SpellInfo(fervor duration=10 focus=-50 cd=30 )
+  SpellAddBuff(fervor fervor=1)
+Define(focus_fire 82692)
+  SpellInfo(focus_fire duration=20 )
+  SpellAddBuff(focus_fire focus_fire=1)
+Define(glaive_toss 120761)
+  SpellInfo(glaive_toss duration=3 )
+  SpellAddBuff(glaive_toss glaive_toss=1)
+Define(hunters_mark 1130)
+  SpellInfo(hunters_mark duration=300 )
+  SpellAddTargetDebuff(hunters_mark hunters_mark=1)
+Define(kill_command 34026)
+  SpellInfo(kill_command focus=40 cd=6 )
+  SpellAddBuff(kill_command kill_command=1)
+Define(kill_shot 53351)
+  SpellInfo(kill_shot cd=10 )
+Define(lynx_rush 120697)
+  SpellInfo(lynx_rush duration=4 cd=90 )
+Define(master_marksman_fire 82926)
+  SpellInfo(master_marksman_fire duration=10 )
+  SpellAddBuff(master_marksman_fire master_marksman_fire=1)
+Define(multi_shot 2643)
+  SpellInfo(multi_shot focus=40 )
+Define(pet_frenzy 19615)
+  SpellInfo(pet_frenzy duration=30 )
+  SpellAddBuff(pet_frenzy pet_frenzy=1)
+Define(powershot 109259)
+  SpellInfo(powershot focus=20 cd=60 )
+Define(rapid_fire 3045)
+  SpellInfo(rapid_fire duration=15 cd=180 )
+  SpellAddBuff(rapid_fire rapid_fire=1)
+Define(readiness 23989)
+  SpellInfo(readiness cd=300 )
+Define(serpent_sting 1978)
+  SpellInfo(serpent_sting focus=25 )
+  SpellAddTargetDebuff(serpent_sting serpent_sting_aura=1)
+Define(serpent_sting_aura 118253)
+  SpellInfo(serpent_sting_aura duration=15 tick=3 )
+  SpellAddTargetDebuff(serpent_sting_aura serpent_sting_aura=1)
+Define(stampede 57386)
+  SpellInfo(stampede duration=30 cd=15 )
+  SpellAddBuff(stampede stampede=1)
+Define(steady_focus 53224)
+Define(steady_shot 56641)
+  SpellInfo(steady_shot focus=-14 )
+Define(thrill_of_the_hunt 34720)
+  SpellInfo(thrill_of_the_hunt duration=15 )
+  SpellAddBuff(thrill_of_the_hunt thrill_of_the_hunt=1)
+Define(trueshot_aura 19506)
+  SpellAddBuff(trueshot_aura trueshot_aura=1)
+AddIcon mastery=1 help=main
 {
-	if CheckBoxOn(multi)
+	if not InCombat()
 	{
-		#/multi_shot,if=target.adds>5
-		if Mana(more 56) Spell(MULTISHOT)
-		#/cobra_shot,if=target.adds>5
-		Spell(COBRASHOT)
-		Spell(STEADYSHOT)
+		if target.DeadIn() >=21 and not target.DebuffPresent(ranged_vulnerability any=1) Spell(hunters_mark)
+		Spell(call_pet_1)
 	}
-	#/serpent_sting,if=!ticking
-	if Mana(more 24) and TargetDebuffExpires(SERPENTSTING 0 mine=1) and TargetDeadIn(more 8) Spell(SERPENTSTING)
-	#/kill_shot
-	if TargetLifePercent(less 20) Spell(KILLSHOT)
-	#/kill_command
-	if TargetInRange(GROWL) and Mana(more 39) Spell(KILLCOMMAND)
-	#/fervor,if=focus<=20
-	if Mana(less 20) Spell(FERVOR)
-	#/arcane_shot,if=focus>=90|buff.beast_within.up
-	if Mana(more 90) or BuffPresent(BEASTWITHIN) Spell(ARCANESHOT)
-	#/cobra_shot
-	Spell(COBRASHOT)
-	Spell(STEADYSHOT)
+	unless Stance(1) Spell(aspect_of_the_hawk)
+	if BuffStacks(pet_frenzy any=1)>4 Spell(focus_fire)
+	if not target.DebuffPresent(serpent_sting_aura) Spell(serpent_sting)
+	if SpellUsable(fervor) and not target.DebuffPresent(fervor) and Focus() <=65 Spell(fervor)
+	if Enemies() >5 Spell(cobra_shot)
+	if target.HealthPercent(less 20) Spell(kill_shot)
+	if SpellUsable(barrage) Spell(barrage)
+	if SpellUsable(powershot) Spell(powershot)
+	if SpellUsable(blink_strike) Spell(blink_strike)
+	Spell(kill_command)
+	if SpellUsable(dire_beast) and Focus() <=80 Spell(dire_beast)
+	if BuffPresent(thrill_of_the_hunt) Spell(arcane_shot)
+	if Focus() >=69 or BuffPresent(beast_within) Spell(arcane_shot)
+	if not target.DebuffPresent(focus_fire) and not BuffPresent(beast_within) if BuffStacks(pet_frenzy any=1)>4 Spell(focus_fire)
+	Spell(cobra_shot)
 }
-
-AddIcon help=offgcd mastery=1
+AddIcon mastery=1 help=offgcd
 {
-	Spell(CALLOFTHEWILD usable=1)
-	#/focus_fire,five_stacks=1,if=!buff.beast_within.up
-	if pet.BuffPresent(FRENZYEFFECT stacks=5) and BuffExpires(BEASTWITHIN 0) Spell(FOCUSFIRE)
+	if not InCombat()
+	{
+		Spell(trueshot_aura)
+	}
+	if Focus() >60 and not BuffPresent(beast_within) Spell(bestial_wrath)
+	if SpellUsable(a_murder_of_crows) and not target.DebuffPresent(a_murder_of_crows) Spell(a_murder_of_crows)
+	Spell(stampede)
+	if SpellUsable(glaive_toss) Spell(glaive_toss)
 }
-
-AddIcon help=cd mastery=1
+AddIcon mastery=1 help=moving
 {
-	unless BuffPresent(ASPECTOFTHEHAWK) or BuffPresent(ASPECTOFTHEFOX) Spell(ASPECTOFTHEHAWK)
-	if TargetDebuffExpires(HUNTERSMARK 2) and TargetDebuffExpires(MARKEDFORDEATH 0) and TargetDeadIn(more 20) Spell(HUNTERSMARK nored=1)
-	#/bestial_wrath,if=focus>60
-	if Mana(more 60) Spell(BESTIALWRATH usable=1)
-	#/rapid_fire,if=!buff.bloodlust.up&!buff.beast_within.up
-	if BuffExpires(heroism 0) and BuffExpires(BEASTWITHIN 0) Spell(RAPIDFIRE)
-	Item(Trinket0Slot usable=1)
-	Item(Trinket1Slot usable=1)
+	unless Stance(2) Spell(aspect_of_the_fox)
 }
-
-AddIcon help=main mastery=2
+AddIcon mastery=1 help=aoe
 {
-	if CheckBoxOn(multi)
-	{
-		#/multi_shot,if=target.adds>5
-		if Mana(more 56) Spell(MULTISHOT)
-		#/cobra_shot,if=target.adds>5
-		Spell(STEADYSHOT)
-	}
-
-	#/serpent_sting,if=!ticking&target.health_pct<=90
-    if Mana(more 24) and TargetDebuffExpires(SERPENTSTING 0 mine=1) and TargetDeadIn(more 8) #and TargetLifePercent(less 90)
-			Spell(SERPENTSTING)
-	#/chimera_shot,if=target.health_pct<=90
-	if Mana(more 49) #and TargetLifePercent(less 90)
-		Spell(CHIMERASHOT)
-	#/steady_shot,if=buff.pre_improved_steady_shot.up&buff.improved_steady_shot.remains<3
-	if Mana(less 40) or Counter(ss equal 1) Spell(STEADYSHOT)
-	#/kill_shot
-	if TargetLifePercent(less 20) Spell(KILLSHOT)
-	#/aimed_shot,if=buff.master_marksman_fire.react
-	if BuffPresent(FIRE) Spell(AIMEDSHOT)
-	if Glyph(GLYPHOFARCANESHOT)
+	Spell(explosive_trap)
+	Spell(multi_shot)
+}
+AddIcon mastery=1 help=cd
+{
+	Spell(blood_fury)
+	if SpellUsable(lynx_rush) and not target.DebuffPresent(lynx_rush) Spell(lynx_rush)
+	if not BuffPresent(bloodlust) and not BuffPresent(beast_within) Spell(rapid_fire)
+	if BuffPresent(rapid_fire) Spell(readiness)
+}
+AddIcon mastery=2 help=main
+{
+	if not InCombat()
 	{
-		#/aimed_shot,if=target.health_pct>80|buff.rapid_fire.up|buff.bloodlust.up
-		if TargetLifePercent(more 90) or
-			BuffPresent(RAPIDFIRE) or BuffPresent(heroism) if Mana(more 49) Spell(AIMEDSHOT)
-        #/arcane_shot,if=(focus>=66|cooldown.chimera_shot.remains>=5)&(target.health_pct<90&!buff.rapid_fire.up&!buff.bloodlust.up)
-		if {Mana(more 65) or spell(CHIMERASHOT)>5} and {TargetLifePercent(less 90) and
-					BuffExpires(RAPIDFIRE) and BuffExpires(heroism)}
-			if Mana(more 24) Spell(ARCANESHOT)
+		if target.DeadIn() >=21 and not target.DebuffPresent(ranged_vulnerability any=1) Spell(hunters_mark)
+		Spell(call_pet_1)
 	}
-	unless Glyph(GLYPHOFARCANESHOT)
+	unless Stance(1) Spell(aspect_of_the_hawk)
+	if SpellUsable(powershot) Spell(powershot)
+	if SpellUsable(barrage) Spell(barrage)
+	if SpellUsable(blink_strike) Spell(blink_strike)
+	if Enemies() >5 Spell(steady_shot)
+	if not target.DebuffPresent(serpent_sting_aura) and target.HealthPercent() <=90 Spell(serpent_sting)
+	if target.HealthPercent() <=90 Spell(chimera_shot)
+	if SpellUsable(dire_beast) Spell(dire_beast)
+	if PreviousSpell(steady_shot) and BuffRemains(steady_focus) <3 Spell(steady_shot)
+	if target.HealthPercent(less 20) Spell(kill_shot)
+	if BuffPresent(master_marksman_fire) Spell(aimed_shot)
+	if BuffPresent(thrill_of_the_hunt) Spell(arcane_shot)
+	if target.HealthPercent() >90 or BuffPresent(rapid_fire) or BuffPresent(bloodlust) Spell(aimed_shot)
+	if {Focus() >=66 or SpellCooldown(chimera_shot) >=5 } and {target.HealthPercent() <90 and not BuffPresent(rapid_fire) and not BuffPresent(bloodlust) } Spell(arcane_shot)
+	if SpellUsable(fervor) and Focus() <=50 Spell(fervor)
+	Spell(steady_shot)
+}
+AddIcon mastery=2 help=offgcd
+{
+	if not InCombat()
 	{
-		#/aimed_shot,if=cooldown.chimera_shot.remains>5|focus>=80|buff.rapid_fire.up|buff.bloodlust.up|target.health_pct>90
-		if {spell(CHIMERASHOT)>5} or Mana(more 79) or BuffPresent(RAPIDFIRE) or BuffPresent(heroism) #or TargetLifePercent(more 90)
-			if Mana(more 49) Spell(AIMEDSHOT)
+		Spell(trueshot_aura)
 	}
-	#/steady_shot
-	Spell(STEADYSHOT)
+	if SpellUsable(glaive_toss) Spell(glaive_toss)
+	Spell(stampede)
+	if SpellUsable(a_murder_of_crows) and not target.DebuffPresent(a_murder_of_crows) Spell(a_murder_of_crows)
+}
+AddIcon mastery=2 help=moving
+{
+	unless Stance(2) Spell(aspect_of_the_fox)
+}
+AddIcon mastery=2 help=aoe
+{
+	Spell(explosive_trap)
+	Spell(multi_shot)
 }
-
-AddIcon help=cd mastery=2
+AddIcon mastery=2 help=cd
 {
-	unless BuffPresent(ASPECTOFTHEHAWK) or BuffPresent(ASPECTOFTHEFOX) Spell(ASPECTOFTHEHAWK)
-	if TargetDebuffExpires(HUNTERSMARK 2) and TargetDebuffExpires(MARKEDFORDEATH 0) and TargetDeadIn(more 20) Spell(HUNTERSMARK nored=1)
-	#/rapid_fire,if=!buff.bloodlust.up|target.time_to_die<=30
-	unless BuffPresent(heroism) or BuffPresent(RAPIDFIRE) Spell(RAPIDFIRE)
-	#/readiness,wait_for_rapid_fire=1
-	if BuffPresent(RAPIDFIRE) Spell(READINESS)
-	Spell(CALLOFTHEWILD usable=1)
-	Item(Trinket0Slot usable=1)
-	Item(Trinket1Slot usable=1)
+	Spell(blood_fury)
+	if SpellUsable(lynx_rush) and not target.DebuffPresent(lynx_rush) Spell(lynx_rush)
+	if not BuffPresent(bloodlust) or target.DeadIn() <=30 Spell(rapid_fire)
+	if BuffPresent(rapid_fire) Spell(readiness)
 }
-
-AddIcon help=main mastery=3
+AddIcon mastery=3 help=main
 {
- 	if CheckBoxOn(multi)
+	if not InCombat()
 	{
-		#/multi_shot,if=target.adds>5
-		if Mana(more 56) Spell(MULTISHOT)
-		#/cobra_shot,if=target.adds>5
-		Spell(STEADYSHOT)
+		if target.DeadIn() >=21 and not target.DebuffPresent(ranged_vulnerability any=1) Spell(hunters_mark)
+		Spell(call_pet_1)
 	}
-
-	#/serpent_sting,if=!ticking
-	if Mana(more 24) and TargetDebuffExpires(SERPENTSTING 0 mine=1) and TargetDeadIn(more 8) Spell(SERPENTSTING)
-	#/explosive_shot,if=!ticking&!in_flight
-    if TargetDebuffExpires(EXPLOSIVESHOT 0 mine=1) Spell(EXPLOSIVESHOT)
-	#/black_arrow,if=!ticking
-    if Mana(more 35) and TargetDebuffExpires(BLACKARROW 0 mine=1) Spell(BLACKARROW)
-	#/kill_shot
-    if TargetLifePercent(less 20) Spell(KILLSHOT)
-	#/arcane_shot,if=focus>=70&buff.lock_and_load.down
-    if Mana(more 69) and BuffExpires(LOCKANDLOAD) Spell(ARCANESHOT)
-	#/cobra_shot
-    Spell(COBRASHOT)
-	Spell(STEADYSHOT)
+	unless Stance(1) Spell(aspect_of_the_hawk)
+	if SpellUsable(blink_strike) Spell(blink_strike)
+	if SpellUsable(powershot) Spell(powershot)
+	if SpellUsable(barrage) Spell(barrage)
+	if Enemies() >2 Spell(cobra_shot)
+	if not target.DebuffPresent(serpent_sting_aura) and target.DeadIn() >=10 Spell(serpent_sting)
+	if {target.DebuffRemains(explosive_shot) <2.0 } Spell(explosive_shot)
+	if target.HealthPercent(less 20) Spell(kill_shot)
+	if not target.DebuffPresent(black_arrow) and target.DeadIn() >=8 Spell(black_arrow)
+	if SpellUsable(dire_beast) Spell(dire_beast)
+	if Focus() >=67 Spell(arcane_shot)
+	if SpellUsable(fervor) and Focus() <=50 Spell(fervor)
+	Spell(cobra_shot)
+}
+AddIcon mastery=3 help=offgcd
+{
+	if not InCombat()
+	{
+		Spell(trueshot_aura)
+	}
+	if SpellUsable(a_murder_of_crows) and not target.DebuffPresent(a_murder_of_crows) Spell(a_murder_of_crows)
+	if SpellUsable(glaive_toss) Spell(glaive_toss)
+	Spell(stampede)
+}
+AddIcon mastery=3 help=moving
+{
+	unless Stance(2) Spell(aspect_of_the_fox)
+}
+AddIcon mastery=3 help=aoe
+{
+	Spell(explosive_trap)
+	Spell(multi_shot)
 }
-
-
-AddIcon help=cd mastery=3
+AddIcon mastery=3 help=cd
 {
-	unless BuffPresent(ASPECTOFTHEHAWK) or BuffPresent(ASPECTOFTHEFOX) Spell(ASPECTOFTHEHAWK)
-	if TargetDebuffExpires(HUNTERSMARK 2) and TargetDebuffExpires(MARKEDFORDEATH 0) and TargetDeadIn(more 20) Spell(HUNTERSMARK nored=1)
-	Spell(CALLOFTHEWILD usable=1)
-	unless BuffPresent(heroism) Spell(RAPIDFIRE)
-	Item(Trinket0Slot usable=1)
-	Item(Trinket1Slot usable=1)
+	Spell(blood_fury)
+	if SpellUsable(lynx_rush) and not target.DebuffPresent(lynx_rush) Spell(lynx_rush)
+	Spell(rapid_fire)
+	if BuffPresent(rapid_fire) Spell(readiness)
 }
-]]
+]]
\ No newline at end of file
diff --git a/defaut/Chevalier.lua b/defaut/Chevalier.lua
index a971546..0870b01 100644
--- a/defaut/Chevalier.lua
+++ b/defaut/Chevalier.lua
@@ -1,331 +1,143 @@
-Ovale.defaut["DEATHKNIGHT"] = [[
-#Abilities
-Define(ARMYOFTHEDEAD 42650)
-	SpellInfo(ARMYOFTHEDEAD cd=600 mana=-15)
-Define(BLOODBOIL 48721)
-	SpellInfo(BLOODBOIL blood=-1 mana=-10)
-	SpellAddTargetDebuff(BLOODBOIL SCARLETFEVER=30)
-Define(BLOODPRESENCE 48263)
-Define(BLOODSTRIKE 45902)
-	SpellInfo(BLOODSTRIKE blood=-1 mana=-10)
-Define(BLOODTAP 45529)
-	SpellInfo(BLOODTAP cd=60 mana=-10)
-Define(BONESHIELD 49222) #blood
-	SpellInfo(BONESHIELD unholy=-1 mana=-10)
-	SpellAddBuff(BONESHIELD BONESHIELD=300)
-Define(DANCINGRUNEWEAPON 49028) #blood
-	SpellInfo(DANCINGRUNEWEAPON cd=90)
-Define(DARKTRANSFORMATION 63560) #unholy
-	SpellInfo(DARKTRANSFORMATION unholy=-1 cd=30 mana=-10) #fake cd
-Define(DEATHANDDECAY 43265)
-	SpellInfo(DEATHANDDECAY unholy=-1 cd=30 mana=-10)
-Define(DEATHCOIL 47541)
-	SpellInfo(DEATHCOIL mana=40)
-Define(DEATHPACT 48743)
-	SpellInfo(DEATHPACT cd=120 mana=40)
-Define(DEATHSTRIKE 49998)
-	SpellInfo(DEATHSTRIKE unholy=-1 frost=-1 mana=-15)
-Define(EMPOWERRUNEWEAPON 47568)
-	SpellInfo(EMPOWERRUNEWEAPON cd=300 unholy=1 frost=1 blood=1 mana=-25)
-Define(FESTERINGSTRIKE 85948) #1 frost 1 blood
-	SpellInfo(FESTERINGSTRIKE blood=-1 frost=-1 mana=-15)
-	SpellAddTargetDebuff(FESTERINGSTRIKE BLOODPLAGUE=refresh FROSTFEVER=refresh)
-Define(FROSTPRESENCE 48266)
-Define(FROSTSTRIKE 49143) #frost
-	SpellInfo(FROSTSTRIKE mana=40)
-Define(HEARTSTRIKE 55050) #blood
-	SpellInfo(HEARTSTRIKE blood=-1 mana=-10)
-Define(HORNOFWINTER 57330)
-	SpellInfo(HORNOFWINTER cd=20 mana=-10)
-Define(HOWLINGBLAST 49184) #frost
-	SpellInfo(HOWLINGBLAST frost=-1 mana=-10)
-	SpellAddBuff(HOWLINGBLAST FREEZINGFOG=0)
-	SpellAddTargetDebuff(HOWLINGBLAST FROSTFEVER=15 glyph=GLYPHHOWLINGBLAST)
-Define(ICEBOUNDFORTITUDE 48792)
-	SpellInfo(ICEBOUNDFORTITUDE cd=180)
-	SpellAddBuff(ICEBOUNDFORTITUDE ICEBOUNDFORTITUDE=18)
-Define(ICYTOUCH 45477)
-	SpellInfo(ICYTOUCH frost=-1 mana=-10)
-	SpellAddTargetDebuff(ICYTOUCH FROSTFEVER=15)
-	SpellAddBuff(ICYTOUCH FREEZINGFOG=0)
-Define(MINDFREEZE 47528)
-	SpellInfo(MINDFREEZE cd=10)
-Define(OBLITERATE 49020)
-	SpellInfo(OBLITERATE unholy=-1 frost=-1 mana=-15)
-Define(OUTBREAK 77575)
-	SpellInfo(OUTBREAK cd=60)
-	SpellAddTargetDebuff(OUTBREAK FROSTFEVER=15 BLOODPLAGUE=15)
-Define(PESTILENCE 50842)
-	SpellInfo(PESTILENCE blood=-1 mana=-10)
-Define(PILLAROFFROST 51271) #frost
-	SpellInfo(PILLAROFFROST frost=-1 mana=-10)
-	SpellAddBuff(PILLAROFFROST PILLAROFFROST=20)
-Define(PLAGUESTRIKE 45462)
-	SpellInfo(PLAGUESTRIKE unholy=-1 mana=-10)
-	SpellAddTargetDebuff(PLAGUESTRIKE BLOODPLAGUE=15)
-Define(RAISEDEAD 46584)
-	SpellInfo(RAISEDEAD cd=180)
-Define(RUNESTRIKE 56815)
-	SpellInfo(RUNESTRIKE mana=30 cd=6) #fake cd, not usable two times in a row
-Define(RUNETAP 48982) #blood
-	SpellInfo(RUNETAP blood=-1 cd=30 mana=-10)
-Define(SCOURGESTRIKE 55090) #unholy
-	SpellInfo(SCOURGESTRIKE unholy=-1 mana=-10)
-Define(SUMMONGARGOYLE 49206) #unholy
-	SpellInfo(SUMMONGARGOYLE cd=180 mana=60)
-Define(UNHOLYBLIGHT 49194)
-Define(UNHOLYFRENZY 49016)
-	SpellInfo(UNHOLYFRENZY cd=300)
-	SpellAddBuff(UNHOLYFRENZY UNHOLYFRENZY=30)
-Define(UNHOLYPRESENCE 48265)
-Define(VAMPIRICBLOOD 55233) #blood
-	SpellInfo(VAMPIRICBLOOD cd=60)
-	SpellAddBuff(VAMPIRICBLOOD VAMPIRICBLOOD=10)
-
-#Talents
-Define(TALENTIMPROVEDBLOODTAP 12223)
-Define(TALENTEPIDEMIC 1963)
-
-#Glyphs
-Define(GLYPHHOWLINGBLAST 63335)
-
-#Buffs and debuffs
-Define(BLOODSHIELD 77535)
-Define(BLOODSWARM 81141)
-Define(SCARLETFEVER 81130)
-Define(BLOODPLAGUE 55078)
-	SpellInfo(BLOODPLAGUE duration=15)
-Define(FREEZINGFOG 59052)
-Define(FROSTFEVER 55095)
-	SpellInfo(FROSTFEVER duration=15)
-Define(KILLINGMACHINE 51124)
-Define(SHADOWINFUSION 91342)
-Define(SUDDENDOOM 81340)
-Define(RUNICCORRUPTION 51459)
-Define(UNHOLYSTRENGTHBUFF 53365)
-
-AddCheckBox(horn SpellName(HORNOFWINTER))
-AddCheckBox(scarlet SpellName(SCARLETFEVER) mastery=1 default)
-AddCheckBox(dnd SpellName(DEATHANDDECAY) mastery=3 default)
-AddCheckBox(deathstrike SpellName(DEATHSTRIKE) mastery=2)
-AddCheckBox(deathstrike SpellName(DEATHSTRIKE) mastery=3)
-AddCheckBox(mindfreeze SpellName(MINDFREEZE))
-
-ScoreSpells(HOWLINGBLAST HEARTSTRIKE BLOODSTRIKE DEATHSTRIKE SCOURGESTRIKE OBLITERATE HEARTSTRIKE
-				PESTILENCE ICYTOUCH PLAGUESTRIKE FROSTSTRIKE DEATHCOIL)
-
-AddIcon help=main mastery=1
+Ovale.defaut["DEATHKNIGHT"] = [[Define(army_of_the_dead 42650)
+  SpellInfo(army_of_the_dead duration=4 frost=1 blood=1 unholy=1 runicpower=-300 xxx=0 cd=600 )
+  SpellAddBuff(army_of_the_dead army_of_the_dead=1)
+Define(blood_fury 20572)
+  SpellInfo(blood_fury duration=15 cd=120 )
+  SpellAddBuff(blood_fury blood_fury=1)
+Define(blood_plague 55078)
+  SpellInfo(blood_plague duration=30 tick=3 )
+  SpellAddTargetDebuff(blood_plague blood_plague=1)
+Define(blood_tap 45529)
+Define(dark_transformation 63560)
+  SpellInfo(dark_transformation duration=30 unholy=1 runicpower=-100 xxx=0 )
+  SpellAddBuff(dark_transformation dark_transformation=1)
+Define(death_coil 47541)
+  SpellInfo(death_coil runicpower=400 )
+Define(empower_rune_weapon 47568)
+  SpellInfo(empower_rune_weapon runicpower=-250 xxx=0 cd=300 )
+Define(festering_strike 85948)
+  SpellInfo(festering_strike frost=1 blood=1 runicpower=-200 xxx=0 )
+Define(frost_fever 55095)
+  SpellInfo(frost_fever duration=30 tick=3 )
+  SpellAddTargetDebuff(frost_fever frost_fever=1)
+Define(frost_presence 48266)
+  SpellAddBuff(frost_presence frost_presence=1)
+Define(frost_strike 49143)
+  SpellInfo(frost_strike runicpower=350 )
+Define(horn_of_winter 57330)
+  SpellInfo(horn_of_winter duration=300 runicpower=-100 xxx=0 cd=20 )
+  SpellAddBuff(horn_of_winter horn_of_winter=1)
+Define(howling_blast 49184)
+  SpellInfo(howling_blast frost=1 runicpower=-100 xxx=0 )
+Define(icy_touch 45477)
+  SpellInfo(icy_touch frost=1 runicpower=-100 xxx=0 )
+Define(mogu_power_potion_aura 105706)
+  SpellInfo(mogu_power_potion_aura duration=25 cd=1 )
+  SpellAddBuff(mogu_power_potion_aura mogu_power_potion_aura=1)
+Define(obliterate 49020)
+  SpellInfo(obliterate frost=1 unholy=1 runicpower=-200 xxx=0 )
+Define(outbreak 77575)
+  SpellInfo(outbreak runicpower=0 cd=60 )
+Define(pillar_of_frost 51271)
+  SpellInfo(pillar_of_frost duration=20 frost=1 runicpower=-100 xxx=0 cd=60 )
+  SpellAddBuff(pillar_of_frost pillar_of_frost=1)
+Define(plague_leech 123693)
+  SpellInfo(plague_leech cd=25 )
+Define(plague_strike 45462)
+  SpellInfo(plague_strike unholy=1 runicpower=-100 xxx=0 )
+Define(raise_dead 46584)
+  SpellInfo(raise_dead cd=120 )
+  SpellAddBuff(raise_dead raise_dead=1)
+Define(rime 59057)
+Define(scourge_strike 55090)
+  SpellInfo(scourge_strike unholy=1 runicpower=-100 xxx=0 )
+Define(soul_reaper 114867)
+Define(sudden_doom 49530)
+Define(summon_gargoyle 49206)
+  SpellInfo(summon_gargoyle duration=40 runicpower=600 cd=180 )
+  SpellAddBuff(summon_gargoyle summon_gargoyle=1)
+Define(unholy_frenzy 49016)
+  SpellInfo(unholy_frenzy duration=30 cd=180 )
+  SpellAddBuff(unholy_frenzy unholy_frenzy=1)
+Define(unholy_presence 48265)
+  SpellAddBuff(unholy_presence unholy_presence=1)
+Define(blood_tap_talent 13)
+Define(plague_leech_talent 2)
+AddIcon mastery=2 help=main
 {
-	if BuffExpires(strengthagility 2) and CheckBoxOn(horn) Spell(HORNOFWINTER)
-
-	if TargetDebuffExpires(BLOODPLAGUE 0 mine=1) and TargetDebuffExpires(FROSTFEVER 0 mine=1) Spell(OUTBREAK)
-	if TargetDebuffExpires(FROSTFEVER 0 mine=1) and Runes(frost 1) Spell(ICYTOUCH)
-	if TargetDebuffExpires(BLOODPLAGUE 0 mine=1) and Runes(unholy 1) Spell(PLAGUESTRIKE)
-	unless Spell(DANCINGRUNEWEAPON) if CheckBoxOff(mindfreeze) or Mana(more 49) Spell(RUNESTRIKE usable=1)
-	if Spell(DANCINGRUNEWEAPON) and Mana(more 59) Spell(RUNESTRIKE usable=1)
-
-	if Runes(unholy 1 frost 1) and {BuffExpires(BLOODSHIELD) or TargetTargetIsPlayer(no)} Spell(DEATHSTRIKE)
-	if Runes(blood 1) Spell(HEARTSTRIKE)
-
-	if Mana(more 69) Spell(DEATHCOIL usable=1)
-	unless Runes(blood 1) Spell(BLOODTAP usable=1 priority=2)
-	if CheckBoxOn(horn) Spell(HORNOFWINTER priority=2)
-}
-
-AddIcon help=offgcd checkboxon=mindfreeze mastery=1
-{
-	if target.IsInterruptible() Spell(MINDFREEZE)
-}
-
-AddIcon help=aoe mastery=1
-{
-	if BuffExpires(strengthagility 2) and CheckBoxOn(horn) Spell(HORNOFWINTER)
-
-	if Runes(unholy 1) Spell(DEATHANDDECAY usable=1)
-
-	if TargetDebuffExpires(BLOODPLAGUE 0 mine=1) and TargetDebuffExpires(FROSTFEVER 0 mine=1) Spell(OUTBREAK)
-	if TargetDebuffExpires(FROSTFEVER 0 mine=1) and Runes(frost 1) Spell(ICYTOUCH)
-	if TargetDebuffExpires(BLOODPLAGUE 0 mine=1) and Runes(unholy 1) Spell(PLAGUESTRIKE)
-
-	if {OtherDebuffPresent(BLOODPLAGUE) or OtherDebuffPresent(FROSTFEVER)} and {TargetDebuffPresent(BLOODPLAGUE) or TargetDebuffPresent(FROSTFEVER)}
-		if Runes(blood 1) or BuffPresent(BLOODSWARM) Spell(BLOODBOIL usable=1)
-	if TargetDebuffPresent(BLOODPLAGUE) and TargetDebuffPresent(FROSTFEVER)
+	if not InCombat()
 	{
-		if Runes(blood 1)
-			unless OtherDebuffPresent(BLOODPLAGUE) and OtherDebuffPresent(FROSTFEVER)
-				Spell(PESTILENCE usable=1)
-		if CheckBoxOff(mindfreeze) or Mana(more 49) Spell(RUNESTRIKE usable=1)
-		if Runes(unholy 1 frost 1) Spell(DEATHSTRIKE)
-		if Runes(blood 1) Spell(HEARTSTRIKE)
+		Spell(horn_of_winter)
+		unless Stance(2) Spell(frost_presence)
 	}
-	if CheckBoxOff(mindfreeze) or Mana(more 49) Spell(RUNESTRIKE usable=1)
-	if Mana(more 69) Spell(DEATHCOIL usable=1)
+	if target.DebuffRemains(frost_fever) <=0 or target.DebuffRemains(blood_plague) <=0 Spell(outbreak)
+	if not target.DebuffPresent(frost_fever) Spell(howling_blast)
+	if not target.DebuffPresent(blood_plague) Spell(plague_strike)
+	if TalentPoints(plague_leech_talent) and {{SpellCooldown(outbreak) <1 } or {BuffPresent(rime) and target.DebuffRemains(blood_plague) <3 and {RuneCount(unholy) >=1 or RuneCount(death) >=1 } } } Spell(plague_leech)
+	if BuffPresent(rime) Spell(howling_blast)
+	if RunicPower() >=76 Spell(frost_strike)
+	if RuneCount(unholy) >=1 Spell(obliterate)
+	Spell(howling_blast)
+	Spell(frost_strike)
+	Spell(obliterate)
+	Spell(horn_of_winter)
 }
-
-AddIcon help=cd mastery=1
+AddIcon mastery=2 help=offgcd
 {
-	#bone_shield,if=!buff.bone_shield.up
-	unless BuffPresent(BONESHIELD) Spell(BONESHIELD)
-	#raise_dead,time>=10
-	unless TotemPresent(ghoul) Spell(RAISEDEAD)
-	if TotemPresent(ghoul) and LifePercent(less 61) and Mana(more 39) Spell(DEATHPACT)
-	Spell(DANCINGRUNEWEAPON usable=1)
-	Spell(VAMPIRICBLOOD)
-	Spell(RUNETAP)
-	Spell(ICEBOUNDFORTITUDE usable=1)
-}
-
-AddFunction diseasesRefresh
-{
-	0
-	if TalentPoints(IMPROVEDBLOODTAP more 0) 2
-	if TalentPoints(EPIDEMIC equal 3) 1
-	if TalentPoints(EPIDEMIC equal 2) 0
-}
-
-AddIcon help=main mastery=2
-{
-	if BuffExpires(strengthagility 2) and CheckBoxOn(horn) Spell(HORNOFWINTER)
-
-	#/outbreak,if=dot.frost_fever.remains<=2|dot.blood_plague.remains<=2
-	if target.debuffExpires(BLOODPLAGUE mine=1) < diseasesRefresh()
-		or target.debuffExpires(FROSTFEVER mine=1) < diseasesRefresh()
-		Spell(OUTBREAK)
-	#/howling_blast,if=dot.frost_fever.remains<=2
-	if target.debuffExpires(FROSTFEVER mine=1) < diseasesRefresh() and Runes(frost 1) Spell(HOWLINGBLAST)
-	#/plague_strike,if=dot.blood_plague.remains<=2
-	if target.debuffExpires(BLOODPLAGUE mine=1) < diseasesRefresh() and Runes(unholy 1) Spell(PLAGUESTRIKE)
-	#obliterate,if=death>=1&frost>=1&unholy>=1
-	if Runes(death 1 frost 1 unholy 1 nodeath=1) Spell(OBLITERATE)
-	#obliterate,if=(death=2&frost=2)|(death=2&unholy=2)|(frost=2&unholy=2)
-	if Runes(death 2 frost 2 nodeath=1) or Runes(death 2 unholy 2 nodeath=1) or
-		Runes(frost 2 unholy 2 nodeath=1) Spell(OBLITERATE)
-	#frost_strike,if=runic_power>=110
-	if Mana(more 109) Spell(FROSTSTRIKE)
-    #/howling_blast,if=buff.rime.react
-	if BuffPresent(FREEZINGFOG) Spell(HOWLINGBLAST)
-	#obliterate,if=(death=2|unholy=2|frost=2)
-	if {Runes(unholy 2) or Runes(frost 2)} and Runes(unholy 1 frost 1) Spell(OBLITERATE)
-	#frost_strike,if=runic_power>=100
-	if Mana(more 99) Spell(FROSTSTRIKE)
-    #obliterate
-	if Runes(unholy 1 frost 1) Spell(OBLITERATE)
-	#frost_strike
-	if CheckBoxOff(mindfreeze) or Mana(more 59) Spell(FROSTSTRIKE usable=1)
-	#howling_blast
-	if Runes(frost 1) Spell(HOWLINGBLAST)
+	Spell(pillar_of_frost)
+	if target.HealthPercent() <=35 Spell(soul_reaper)
+	if TalentPoints(blood_tap_talent) Spell(blood_tap)
 }
-
-AddIcon help=offgcd mastery=2
+AddIcon mastery=2 help=cd
 {
-	if target.IsInterruptible() Spell(MINDFREEZE)
-    #blood_tap,if=death.cooldown_remains>2.0
-	if runes(death 1) > 2 Spell(BLOODTAP)
-	#empower_rune_weapon,if=target.time_to_die<=45
-	if TargetDeadIn(less 45) Spell(EMPOWERRUNEWEAPON)
-	#empower_rune_weapon,if=(blood.cooldown_remains+frost.cooldown_remains+unholy.cooldown_remains)>8
-	if runes(blood 1) + runes(frost 1) + runes(unholy 1) > 8
-		Spell(EMPOWERRUNEWEAPON)
-}
-
-AddIcon help=aoe mastery=2
-{
-	if Runes(unholy 1 frost 1) Spell(HOWLINGBLAST)
-	if Runes(unholy 1) Spell(DEATHANDDECAY usable=1)
-	if Runes(blood 1)
+	if not InCombat()
 	{
-		if TargetDebuffPresent(BLOODPLAGUE) and TargetDebuffPresent(FROSTFEVER)
-			unless OtherDebuffPresent(BLOODPLAGUE) and OtherDebuffPresent(FROSTFEVER)
-				Spell(PESTILENCE usable=1)
-		if {TargetDebuffPresent(BLOODPLAGUE) or TargetDebuffPresent(FROSTFEVER)}
-				and {OtherDebuffPresent(BLOODPLAGUE) or OtherDebuffPresent(FROSTFEVER)}
-			Spell(BLOODBOIL usable=1)
+		Spell(army_of_the_dead)
 	}
+	if TimeInCombat() >=10 Spell(blood_fury)
+	 { Item(Trinket0Slot usable=1) Item(Trinket1Slot usable=1) }
+	Spell(raise_dead)
+	if target.DeadIn() <=60 and BuffPresent(mogu_power_potion_aura) Spell(empower_rune_weapon)
+	Spell(empower_rune_weapon)
 }
-
-AddIcon help=cd mastery=2
-{
-	#/pillar_of_frost
-	if Runes(frost 1) Spell(PILLAROFFROST)
-	#/blood_tap,if=death!=2
-	unless Runes(death 2) Spell(BLOODTAP)
-	#/raise_dead,time>=15
-	unless TotemPresent(ghoul) if TimeInCombat(more 15) Spell(RAISEDEAD)
-    Item(Trinket0Slot usable=1)
-	Item(Trinket1Slot usable=1)
-}
-
-#Contributed by vitos
-AddIcon help=main mastery=3
+AddIcon mastery=3 help=main
 {
-	if BuffExpires(strengthagility 2) and CheckBoxOn(horn) Spell(HORNOFWINTER)
-	#/outbreak,if=dot.frost_fever.remains<=2|dot.blood_plague.remains<=2
-	if TargetDebuffExpires(BLOODPLAGUE 2 mine=1) and TargetDebuffExpires(FROSTFEVER 2 mine=1) Spell(OUTBREAK)
-	#/icy_touch,if=dot.frost_fever.remains<3
-	if TargetDebuffExpires(FROSTFEVER 3 mine=1) and Runes(frost 1) Spell(ICYTOUCH)
-	#/plague_strike,if=dot.blood_plague.remains<3
-	if TargetDebuffExpires(BLOODPLAGUE 3 mine=1) and Runes(unholy 1) Spell(PLAGUESTRIKE)
-	#/dark_transformation
-	if Runes(unholy 1) and pet.BuffPresent(SHADOWINFUSION stacks=5) Spell(DARKTRANSFORMATION)
-	#/death_and_decay,if=death=4
-	#/death_and_decay,if=unholy=2
-	if Runes(death 4) or Runes(unholy 2) if CheckBoxOn(dnd) Spell(DEATHANDDECAY)
-	#/scourge_strike,if=death=4
-    #/scourge_strike,if=unholy=2
-	if Runes(death 4) or Runes(unholy 2) Spell(SCOURGESTRIKE)
-	#/festering_strike,if=blood=2&frost=2
-	if Runes(blood 2 frost 2 nodeath=1) Spell(FESTERINGSTRIKE)
-	unless BuffPresent(RUNICCORRUPTION mine=1)
+	if not InCombat()
 	{
-		#/death_coil,if=runic_power>90
-		if Mana(more 90) Spell(DEATHCOIL usable=1)
-		#/death_coil,if=buff.sudden_doom.react
-		if BuffPresent(SUDDENDOOM) Spell(DEATHCOIL usable=1)
+		Spell(horn_of_winter)
+		unless Stance(3) Spell(unholy_presence)
 	}
-	#option to heal with deathstrike
-	if CheckBoxOn(deathstrike) and LifePercent(less 90) and Runes(unholy 1 frost 1) Spell(DEATHSTRIKE)
-	#/death_and_decay
-	if Runes(unholy 1) and CheckBoxOn(dnd) Spell(DEATHANDDECAY)
-	#/scourge_strike
-	if Runes(unholy 1) Spell(SCOURGESTRIKE)
-	#/festering_strike
-	if Runes(blood 1 frost 1 nodeath=1) Spell(FESTERINGSTRIKE)
-	#/death_coil
-	if Mana(more 59) Spell(DEATHCOIL usable=1)
-	#/horn_of_winter
-	Spell(HORNOFWINTER)
+	if target.DebuffRemains(frost_fever) <3 or target.DebuffRemains(blood_plague) <3 Spell(outbreak)
+	if not target.DebuffPresent(frost_fever) Spell(icy_touch)
+	if not target.DebuffPresent(blood_plague) Spell(plague_strike)
+	if TalentPoints(plague_leech_talent) and {SpellCooldown(outbreak) <1 } Spell(plague_leech)
+	Spell(dark_transformation)
+	if RuneCount(unholy) ==2 and RunicPower() <90 Spell(scourge_strike)
+	if RuneCount(blood) ==2 and RuneCount(frost) ==2 and RunicPower() <90 Spell(festering_strike)
+	if RunicPower() >90 Spell(death_coil)
+	if BuffPresent(sudden_doom) Spell(death_coil)
+	Spell(scourge_strike)
+	Spell(festering_strike)
+	if SpellCooldown(summon_gargoyle) >8 Spell(death_coil)
+	Spell(horn_of_winter)
 }
-
-AddIcon help=offgcd mastery=3
+AddIcon mastery=3 help=offgcd
 {
-	if target.IsInterruptible() Spell(MINDFREEZE)
-	#/blood_tap,if=unholy=0&inactive_death=1
-	unless Runes(unholy 1) Spell(BLOODTAP priority=2)
-	#/empower_rune_weapon,if=unholy=0
-	unless Runes(unholy 1) Spell(EMPOWERRUNEWEAPON priority=2)
+	if target.HealthPercent() <=35.5 Spell(soul_reaper)
+	if TalentPoints(blood_tap_talent) Spell(blood_tap)
 }
-
-AddIcon help=aoe mastery=3
+AddIcon mastery=3 help=cd
 {
-	if Runes(unholy 1) Spell(DEATHANDDECAY usable=1)
-	if Runes(blood 1)
+	if not InCombat()
 	{
-		if TargetDebuffPresent(BLOODPLAGUE) and TargetDebuffPresent(FROSTFEVER)
-			unless OtherDebuffPresent(BLOODPLAGUE) and OtherDebuffPresent(FROSTFEVER)
-				Spell(PESTILENCE usable=1)
-		if {TargetDebuffPresent(BLOODPLAGUE) or TargetDebuffPresent(FROSTFEVER)}
-				and {OtherDebuffPresent(BLOODPLAGUE) or OtherDebuffPresent(FROSTFEVER)}
-			Spell(BLOODBOIL usable=1)
+		Spell(army_of_the_dead)
+		Spell(raise_dead)
 	}
+	if TimeInCombat() >=2 Spell(blood_fury)
+	if TimeInCombat() >=4 Spell(unholy_frenzy)
+	if TimeInCombat() >=4  { Item(Trinket0Slot usable=1) Item(Trinket1Slot usable=1) }
+	Spell(summon_gargoyle)
+	if target.DeadIn() <=60 and BuffPresent(mogu_power_potion_aura) Spell(empower_rune_weapon)
+	Spell(empower_rune_weapon)
 }
-
-AddIcon help=cd mastery=3
-{
-	if PetPresent(no) Spell(RAISEDEAD)
-	Spell(SUMMONGARGOYLE)
-	Item(Trinket0Slot usable=1)
-	Item(Trinket1Slot usable=1)
-	Spell(ARMYOFTHEDEAD)
-}
-
 ]]
\ No newline at end of file
diff --git a/defaut/Demoniste.lua b/defaut/Demoniste.lua
index 63c3001..8571eb4 100644
--- a/defaut/Demoniste.lua
+++ b/defaut/Demoniste.lua
@@ -1,345 +1,297 @@
-Ovale.defaut["WARLOCK"]=
-[[
-Define(BANEOFAGONY 980)
-	Spellinfo(BANEOFAGONY duration=24)
-	SpellAddTargetDebuff(BANEOFAGONY BANEOFAGONY=24)
-Define(BANEOFDOOM 603)
-	SpellInfo(BANEOFDOOM duration=60)
-	SpellAddTargetDebuff(BANEOFDOOM BANEOFDOOM=60)
-Define(BANEOFHAVOC 80240)
-	SpellAddTargetDebuff(BANEOFHAVOC BANEOFHAVOC=300)
-Define(CHAOSBOLT 50796)
-	SpellInfo(CHAOSBOLT cd=12)
-Define(CONFLAGRATE 17962)
-	SpellInfo(CONFLAGRATE cd=10)
-Define(CORRUPTION 172)
-	SpellAddTargetDebuff(CORRUPTION CORRUPTION=18)
-Define(CURSEELEMENTS 1490)
-	SpellAddTargetDebuff(CURSEELEMENTS CURSEELEMENTS=300)
-Define(CURSETONGUES 1714)
-	SpellAddTargetDebuff(CURSETONGUES CURSETONGUES=30)
-Define(CURSEWEAKNESS 702)
-	SpellAddTargetDebuff(CURSEWEAKNESS CURSEWEAKNESS=120)
-Define(DARKINTENT 80398)
-Define(DEATHCOIL 6789)
-	SpellInfo(DEATHCOIL cd=120)
-Define(DEMONARMOR 687)
-	SpellAddBuff(DEMONARMOR DEMONARMOR=1000)
-Define(DEMONICEMPOWERMENT 47193)
-	SpellInfo(DEMONICEMPOWERMENT cd=60)
-Define(DEMONSOUL 77801)
-	SpellInfo(DEMONSOUL cd=120)
-Define(DRAINLIFE 689)
-	SpellInfo(DRAINLIFE canStopChannelling=3)
-	SpellAddTargetDebuff(DRAINLIFE DRAINLIFE=3)
-	SpellAddBuff(DRAINLIFE SOULBURN=0)
-Define(DRAINSOUL 1120)
-	SpellInfo(DRAINSOUL canStopChannelling=5)
-	SpellAddTargetDebuff(DRAINSOUL DRAINSOUL=15)
-Define(FELARMOR 28176)
-	SpellAddBuff(FELARMOR FELARMOR=1000)
-Define(FELFLAME 77799)
-	SpellAddTargetDebuff(FELFLAME IMMOLATE=refresh UNSTABLEAFFLICTION=refresh)
-Define(HANDOFGULDAN 71521)
-	SpellInfo(HANDOFGULDAN cd=12)
-	SpellAddTargetDebuff(HANDOFGULDAN IMMOLATE=refresh)
-Define(HAUNT 48181)
-	SpellInfo(HAUNT cd=8)
-	SpellAddBuff(HAUNT HAUNT=12)
-Define(IMMOLATE 348)
-	SpellInfo(IMMOLATE duration=15)
-	SpellAddTargetDebuff(IMMOLATE IMMOLATE=15)
-	SpellAddBuff(IMMOLATE MOLTENCORE=-1)
-Define(IMMOLATIONAURA 50589)
-	SpellInfo(IMMOLATIONAURA cd=30)
-	SpellAddBuff(IMMOLATIONAURA IMMOLATIONAURA=15)
-Define(INCINERATE 29722)
-	SpellAddBuff(INCINERATE MOLTENCORE=-1)
-Define(LIFETAP 1454)
-	SpellInfo(LIFETAP cd=10) #fake
-Define(METAMORPHOSIS 47241)
-	SpellInfo(METAMORPHOSIS cd=180)
-	SpellAddBuff(METAMORPHOSIS METAMORPHOSIS=30)
-Define(SEARINGPAIN 5676)
-Define(SEEDOFCORRUPTION 27243)
-	SpellAddTargetDebuff(SEEDOFCORRUPTION SEEDOFCORRUPTION=18)
-Define(SHADOWBOLT 686)
-	SpellAddTargetDebuff(SHADOWBOLT SHADOWEMBRACE=12 SHADOWANDFLAMEDEBUFF=30)
-Define(SHADOWBURN 17877)
-	SpellInfo(SHADOWBURN cd=15)
-Define(SHADOWFLAME 47897)
-	SpellInfo(SHADOWFLAME cd=12)
-Define(SOULFIRE 6353)
-	SpellAddBuff(SOULFIRE IMPROVEDSOULFIREBUFF=15 SOULBURN=0)
-Define(SOULBURN 74434)
-	SpellInfo(SOULBURN cd=45)
-	SpellAddBuff(SOULBURN SOULBURN=15)
-Define(SUMMONINFERNAL 1122)
-	SpellInfo(SUMMONINFERNAL cd=600)
-Define(SUMMONDOOMGUARD 18540)
-	SpellInfo(SUMMONDOOMGUARD cd=600)
-Define(SUMMONFELGUARD 30146)
-	SpellInfo(SUMMONFELGUARD cd=600) #fake
-Define(SUMMONFELHUNTER 691)
-	SpellInfo(SUMMONFELHUNTER cd=600) #fake
-Define(SUMMONIMP 688)
-	SpellInfo(SUMMONIMP cd=600) #fake
-Define(SUMMONSUCCUBUS 712)
-	SpellInfo(SUMMONSUCCUBUS cd=600) #fake
-Define(UNSTABLEAFFLICTION 30108)
-	SpellInfo(UNSTABLEAFFLICTION duration=15)
-	SpellAddTargetDebuff(UNSTABLEAFFLICTION UNSTABLEAFFLICTION=15)
-
-#Pet spells
-Define(FELSTORM 89751)
-
-#Buff
-Define(DECIMATION 63167)
-Define(MOLTENCORE 71165)
-Define(EMPOWEREDIMP 47283)
-Define(IMPROVEDSOULFIREBUFF 85383)
-Define(SHADOWTRANCE 17941)
-Define(SHADOWANDFLAMEDEBUFF 17800)
-Define(DEMONSOULFELGUARD 79462)
-
-#Talent
-Define(IMPROVEDSOULFIRE 10940)
-Define(SHADOWANDFLAMETALENT 10936)
-Define(BANETALENT 10938)
-Define(EMBERSTORMTALENT 11181)
-
-#Glyph
-Define(GLYPHOFLASHOFPAIN 70947)
-Define(GLYPHOFIMP 56248)
-Define(GLYPHOFCORRUPTION 56218)
-
-AddListItem(curse elements SpellName(CURSEELEMENTS))
-AddListItem(curse tongues SpellName(CURSETONGUES))
-AddListItem(curse weakness SpellName(CURSEWEAKNESS))
-AddListItem(curse none L(None) default)
-AddListItem(bane agony SpellName(BANEOFAGONY))
-AddListItem(bane doom SpellName(BANEOFDOOM) default)
-AddListItem(bane havoc SpellName(BANEOFHAVOC) mastery=3)
-AddCheckBox(shadowflame SpellName(SHADOWFLAME) default)
-AddCheckBox(petswap SpellName(SUMMONFELGUARD) mastery=2)
-
-ScoreSpells(CURSEELEMENTS SHADOWBOLT HAUNT UNSTABLEAFFLICTION IMMOLATE CONFLAGRATE CURSEWEAKNESS
-	BANEOFAGONY CORRUPTION SOULFIRE DRAINSOUL INCINERATE SHADOWBOLT CHAOSBOLT)
-
-AddIcon help=main mastery=1
+Ovale.defaut["WARLOCK"] = [[Define(agony 980)
+  SpellInfo(agony duration=24 tick=2 )
+  SpellAddTargetDebuff(agony agony=1)
+Define(backdraft 117896)
+Define(blood_fury 20572)
+  SpellInfo(blood_fury duration=15 cd=120 )
+  SpellAddBuff(blood_fury blood_fury=1)
+Define(chaos_bolt 116858)
+  SpellInfo(chaos_bolt burningembers=10 )
+Define(conflagrate 17962)
+  SpellInfo(conflagrate duration=5 )
+  SpellAddBuff(conflagrate conflagrate=1)
+Define(corruption 172)
+  SpellInfo(corruption duration=18 tick=2 )
+  SpellAddTargetDebuff(corruption corruption=1)
+Define(curse_of_the_elements 1490)
+  SpellInfo(curse_of_the_elements duration=300 )
+  SpellAddTargetDebuff(curse_of_the_elements aura_of_the_elements=1)
+Define(dark_intent 109773)
+  SpellInfo(dark_intent duration=3600 )
+  SpellAddBuff(dark_intent dark_intent=1)
+Define(dark_soul 77801)
+  SpellInfo(dark_soul cd=120 )
+Define(doom 603)
+  SpellInfo(doom duration=60 demonicfury=60 tick=15 stance=1)
+  SpellAddTargetDebuff(doom doom=1)
+Define(drain_soul 1120)
+  SpellInfo(drain_soul duration=12 tick=2 canStopChannelling=1 )
+  SpellAddTargetDebuff(drain_soul drain_soul=1)
+Define(fel_flame 77799)
+Define(felstorm 89751)
+  SpellInfo(felstorm duration=6 energy=60 cd=45 )
+  SpellAddBuff(felstorm felstorm=1)
+Define(fire_and_brimstone 108683)
+  SpellInfo(fire_and_brimstone burningembers=10 cd=1 )
+  SpellAddBuff(fire_and_brimstone fire_and_brimstone=1)
+Define(grimoire_of_sacrifice 108503)
+  SpellInfo(grimoire_of_sacrifice duration=1200 cd=120 )
+  SpellAddBuff(grimoire_of_sacrifice grimoire_of_sacrifice=1)
+Define(hand_of_guldan 105174)
+Define(harvest_life 108371)
+  SpellInfo(harvest_life duration=6 demonicfury=30 tick=1 )
+  SpellAddTargetDebuff(harvest_life harvest_life=1)
+Define(haunt 48181)
+  SpellInfo(haunt duration=8 shards=1 )
+  SpellAddBuff(haunt haunt=1)
+Define(havoc 80240)
+  SpellInfo(havoc duration=15 cd=45 )
+  SpellAddBuff(havoc havoc=1)
+Define(hellfire 1949)
+  SpellInfo(hellfire duration=14 tick=1 )
+  SpellAddTargetDebuff(hellfire hellfire=1)
+Define(immolate 348)
+  SpellInfo(immolate duration=15 tick=3 )
+  SpellAddTargetDebuff(immolate immolate=1)
+Define(immolation_aura 129476)
+Define(incinerate 29722)
+Define(life_tap 1454)
+  SpellInfo(life_tap mana=-15 )
+  SpellAddBuff(life_tap life_tap=1)
+Define(malefic_grasp 103103)
+  SpellInfo(malefic_grasp duration=4 tick=1 )
+  SpellAddTargetDebuff(malefic_grasp malefic_grasp=1)
+Define(melee 103988)
+  SpellInfo(melee stance=1)
+Define(metamorphosis 103958)
+  SpellInfo(metamorphosis demonicfury=0 cd=10 )
+  SpellAddBuff(metamorphosis metamorphosis=1)
+Define(molten_core 122355)
+  SpellInfo(molten_core duration=30 )
+  SpellAddBuff(molten_core molten_core=1)
+Define(rain_of_fire 42223)
+Define(seed_of_corruption 27243)
+  SpellInfo(seed_of_corruption duration=18 tick=3 )
+  SpellAddTargetDebuff(seed_of_corruption seed_of_corruption=1)
+Define(service_felguard 111898)
+  SpellInfo(service_felguard cd=120 )
+Define(service_succubus 111896)
+  SpellInfo(service_succubus cd=120 )
+Define(shadow_bolt 686)
+  SpellInfo(shadow_bolt demonicfury=40 )
+Define(shadowburn 17877)
+  SpellInfo(shadowburn burningembers=10 )
+Define(shadowflame 47960)
+  SpellInfo(shadowflame duration=6 tick=1 )
+  SpellAddTargetDebuff(shadowflame shadowflame=1)
+Define(soul_fire 6353)
+  SpellAddBuff(soul_fire molten_core=-1)
+Define(soul_swap 86121)
+Define(soulburn 74434)
+  SpellInfo(soulburn duration=30 shards=1 cd=1 )
+  SpellAddBuff(soulburn soulburn=1)
+Define(soulburn_seed_of_corruption 86664)
+Define(summon_doomguard 18540)
+  SpellInfo(summon_doomguard cd=600 )
+Define(summon_felguard 30146)
+  SpellInfo(summon_felguard demonicfury=0 )
+Define(summon_infernal 1122)
+  SpellInfo(summon_infernal cd=600 )
+Define(summon_succubus 712)
+  SpellInfo(summon_succubus demonicfury=0 )
+Define(touch_of_chaos 103964)
+  SpellInfo(touch_of_chaos demonicfury=40 stance=1)
+Define(unstable_affliction 30108)
+  SpellInfo(unstable_affliction duration=14 tick=2 )
+  SpellAddTargetDebuff(unstable_affliction unstable_affliction=1)
+Define(void_ray 115422)
+  SpellInfo(void_ray demonicfury=40 )
+Define(wrathstorm 115831)
+  SpellInfo(wrathstorm duration=6 energy=60 cd=45 )
+  SpellAddBuff(wrathstorm wrathstorm=1)
+Define(grimoire_of_sacrifice_talent 15)
+Define(grimoire_of_service_talent 14)
+Define(harvest_life_talent 3)
+AddIcon mastery=1 help=main
 {
-	if InCombat(no) and BuffExpires(FELARMOR 400) Spell(FELARMOR)
-
-	if List(curse elements) and TargetDebuffExpires(magicaldamagetaken 0) and TargetDeadIn(more 8) Spell(CURSEELEMENTS)
-	if List(curse weakness) and TargetDebuffExpires(CURSEWEAKNESS 2) and TargetDeadIn(more 8) Spell(CURSEWEAKNESS)
-
-	#unless Glyph(GLYPHOFLASHOFPAIN) Spell(DEMONSOUL)
-	#/corruption,if=(!ticking|remains<tick_time)&miss_reac
-	if TargetDebuffExpires(CORRUPTION 3 haste=spell mine=1) and TargetDebuffExpires(SEEDOFCORRUPTION 0 mine=1) Spell(CORRUPTION)
-	#/unstable_affliction,if=(!ticking|remains<(cast_time+tick_time))&target.time_to_die>=5&miss_react
-	if TargetDebuffExpires(UNSTABLEAFFLICTION 4.5 mine=1 haste=spell) and TargetDeadIn(more 5) Spell(UNSTABLEAFFLICTION)
-	#/bane_of_doom,if=target.time_to_die>15&!ticking&miss_react
-	if TargetDebuffExpires(BANEOFDOOM 0 mine=1) and TargetDebuffExpires(BANEOFAGONY 0 mine=1)
+	if not InCombat()
 	{
-		if List(bane doom) and TargetDeadIn(more 15) Spell(BANEOFDOOM)
-		if TargetDeadIn(more 10) Spell(BANEOFAGONY)
+		if not BuffPresent(spell_power_multiplier) Spell(dark_intent)
+		unless pet.CreatureFamily(Succubus) Spell(summon_succubus)
 	}
-	#/haunt
-	Spell(HAUNT)
-	#/fel_flame,if=buff.tier11_4pc_caster.react&dot.unstable_affliction.remains<8
-	if ArmorSetParts(T11 more 3) and TargetDebuffExpires(UNSTABLEAFFLICTION 8) Spell(FELFLAME)
-	#/drain_soul,interrupt=1,if=target.health_pct<=25
-	if TargetLifePercent(less 25) Spell(DRAINSOUL)
-	#/shadowflame
-	if CheckBoxOn(shadowflame) Spell(SHADOWFLAME)
-
-	if TalentPoints(BANETALENT more 2)
+	if target.DebuffExpires(magic_vulnerability any=1) Spell(curse_of_the_elements)
+	if TalentPoints(grimoire_of_service_talent) Spell(service_succubus)
+	if TalentPoints(grimoire_of_sacrifice_talent) and BuffExpires(grimoire_of_sacrifice) unless pet.CreatureFamily(Succubus) Spell(summon_succubus)
+	if Enemies() >3
 	{
-		#/life_tap,mana_percentage<=35
-		if ManaPercent(less 35) and LifePercent(more 75) Spell(LIFETAP)
-		if TalentPoints(EMBERSTORMTALENT more 0) and TalentPoints(IMPROVEDSOULFIRE more 0)
-		{
-			#/soul_fire,if=buff.improved_soul_fire.cooldown_remains<(cast_time+travel_time)&buff.bloodlust.down&!in_flight
-			if BuffExpires(IMPROVEDSOULFIREBUFF 4) and BuffExpires(heroism) Spell(SOULFIRE)
-		}
-		if TalentPoints(EMBERSTORMTALENT less 1) or TalentPoints(IMPROVEDSOULFIRE less 1)
-		{
-			#/soul_fire,if=buff.soulburn.up
-			if BuffPresent(SOULBURN) Spell(SOULFIRE)
-		}
-		#if Glyph(GLYPHOFLASHOFPAIN) Spell(DEMONSOUL)
-		Spell(SHADOWBOLT)
+		if {BuffExpires(soulburn) and not InFlightToTarget(seed_of_corruption) and not target.DebuffPresent(seed_of_corruption) } or {BuffPresent(soulburn) and not target.DebuffPresent(soulburn_seed_of_corruption) and not InFlightToTarget(soulburn_seed_of_corruption) } Spell(seed_of_corruption)
+		if not InFlightToTarget(haunt) and target.DebuffRemains(haunt) <CastTime(haunt) +1 and SoulShards() Spell(haunt)
+		if ManaPercent() <70 Spell(life_tap)
+		if not InFlightToTarget(fel_flame) Spell(fel_flame)
 	}
-	if TalentPoints(BANETALENT less 3)
+	if BuffPresent(soulburn) Spell(soul_swap)
+	if not InFlightToTarget(haunt) and target.DebuffRemains(haunt) <target.NextTick(haunt) +1 +CastTime(haunt) and SoulShards() Spell(haunt)
+	if Enemies() >1 and TimeInCombat() <10 Spell(soul_swap)
+	if not InFlightToTarget(haunt) and target.DebuffRemains(haunt) <target.NextTick(haunt) +1 +CastTime(haunt) and SoulShards() >1 Spell(haunt)
+	if {not target.DebuffPresent(agony) or target.DebuffRemains(agony) <=TickTime(drain_soul) *2 } and target.DeadIn() >=8 Spell(agony)
+	if {not target.DebuffPresent(corruption) or target.DebuffRemains(corruption) <target.NextTick(corruption) } and target.DeadIn() >=6 Spell(corruption)
+	if {not target.DebuffPresent(unstable_affliction) or target.DebuffRemains(unstable_affliction) <{CastTime(unstable_affliction) +target.NextTick(unstable_affliction) } } and target.DeadIn() >=5 Spell(unstable_affliction)
+	if TicksRemain(agony) <Ticks(agony) /2 and target.DeadIn() >=8 Spell(agony)
+	if TicksRemain(corruption) <Ticks(corruption) /2 and target.DeadIn() >=6 Spell(corruption)
+	if TicksRemain(unstable_affliction) <Ticks(unstable_affliction) /2 +1 and target.DeadIn() >=5 Spell(unstable_affliction)
+	if target.HealthPercent() <=20 Spell(drain_soul)
+	if ManaPercent() <35 Spell(life_tap)
+	Spell(malefic_grasp)
+	Spell(life_tap)
+}
+AddIcon mastery=1 help=offgcd
+{
+	if Enemies() >3
 	{
-		#/demon_soul,if=buff.shadow_trance.react
-		#if BuffPresent(SHADOWTRANCE) Spell(DEMONSOUL)
-		#/shadow_bolt,if=buff.shadow_trance.react
-		if BuffPresent(SHADOWTRANCE) Spell(SHADOWBOLT)
-		#/life_tap,mana_percentage<=5
-		if ManaPercent(less 5) and LifePercent(more 75) Spell(LIFETAP)
-		if TalentPoints(IMPROVEDSOULFIRE more 0)
-		{
-			#/soul_fire,if=buff.improved_soul_fire.cooldown_remains<(cast_time+travel_time)&buff.bloodlust.down&!in_flight
-			if TalentPoints(EMBERSTORMTALENT more 0) if BuffExpires(IMPROVEDSOULFIREBUFF 4) and BuffExpires(heroism) Spell(SOULFIRE)
-			#/soul_fire,if=buff.soulburn.up
-			if TalentPoints(EMBERSTORMTALENT less 1) if BuffPresent(SOULBURN) Spell(SOULFIRE)
-		}
-		#/drain_life,interrupt=1
-		Spell(DRAINLIFE)
+		if BuffExpires(soulburn) and not target.DebuffPresent(soulburn_seed_of_corruption) and not InFlightToTarget(soulburn_seed_of_corruption) and SoulShards() Spell(soulburn)
 	}
+	if BuffPresent(dark_soul) and {BuffRemains(dark_soul) >=18.5 or BuffRemains(dark_soul) <=1.5 } and SoulShards() Spell(soulburn)
 }
-
-AddIcon help=cd mastery=1
+AddIcon mastery=1 help=moving
 {
-	#/summon_infernal
-	Spell(DEMONSOUL)
-	Spell(SUMMONDOOMGUARD)
-	Item(Trinket0Slot usable=1)
-	Item(Trinket1Slot usable=1)
+	if ManaPercent() <80 and ManaPercent() <target.HealthPercent() Spell(life_tap)
+	Spell(fel_flame)
 }
-
-AddIcon help=main mastery=2
-{
-	if InCombat(no) and BuffExpires(FELARMOR 400) Spell(FELARMOR)
-
-	if List(curse elements) and TargetDebuffExpires(magicaldamagetaken 2) and TargetDeadIn(more 8) Spell(CURSEELEMENTS)
-	if List(curse weakness) and TargetDebuffExpires(CURSEWEAKNESS 2) and TargetDeadIn(more 8) Spell(CURSEWEAKNESS)
-
+AddIcon mastery=1 help=aoe
+{

-	#/immolate,if=!ticking&target.time_to_die>=4&miss_react
-	if TargetDebuffExpires(IMMOLATE 2 mine=1 haste=spell) and TargetDeadIn(more 4) Spell(IMMOLATE)
+	{
+		Spell(summon_infernal)
+	}
+}
+AddIcon mastery=1 help=cd
+{
+	 { Item(Trinket0Slot usable=1) Item(Trinket1Slot usable=1) }
+	Spell(blood_fury)
+	Spell(dark_soul)
+	if TalentPoints(grimoire_of_sacrifice_talent) Spell(grimoire_of_sacrifice)

-	#/bane_of_doom,if=(!ticking|(buff.metamorphosis.up&remains<45))&target.time_to_die>=15&miss_react
-	if {TargetDebuffExpires(BANEOFDOOM 0 mine=1) or {BuffPresent(METAMORPHOSIS) and TargetDebuffExpires(BANEOFDOOM 45 mine=1)}} and TargetDebuffExpires(BANEOFAGONY 0 mine=1)
 	{
-		if List(bane doom) and TargetDeadIn(more 15) Spell(BANEOFDOOM)
-		if TargetDeadIn(more 10) Spell(BANEOFAGONY)
+		Spell(summon_doomguard)
 	}
-	#/corruption,if=(remains<tick_time|!ticking)&target.time_to_die>=6&miss_react
-	if TargetDebuffExpires(CORRUPTION 2 mine=1 haste=spell) and TargetDebuffExpires(SEEDOFCORRUPTION 0 mine=1) and TargetDeadIn(more 6) Spell(CORRUPTION)
-	#/fel_flame,if=buff.tier11_4pc_caster.react
-	if ArmorSetParts(T11 more 3) Spell(FELFLAME)
-	#/shadowflame
-	if CheckBoxOn(shadowflame) and TargetInRange(DEATHCOIL) Spell(SHADOWFLAME)
-	#/hand_of_guldan
-	if TargetDebuffPresent(IMMOLATE) Spell(HANDOFGULDAN)
-	#/immolation,if=buff.metamorphosis.remains>10
-	if BuffPresent(METAMORPHOSIS 10) and TargetInRange(DEATHCOIL) Spell(IMMOLATIONAURA)
-	#if ( glyphs.corruption -> ok() ) action_list_str += "/shadow_bolt,if=buff.shadow_trance.react";
-	if Glyph(GLYPHOFCORRUPTION) and BuffPresent(SHADOWTRANCE) Spell(SHADOWBOLT)
-	#/incinerate,if=buff.molten_core.react
-	if BuffPresent(MOLTENCORE) Spell(INCINERATE)
-	#/soul_fire,if=buff.decimation.up
-	if BuffPresent(DECIMATION) Spell(SOULFIRE)
-	#/life_tap,if=mana_pct<=30&buff.bloodlust.down&buff.metamorphosis.down&buff.demon_soul_felguard.down
-	if ManaPercent(less 30) and BuffExpires(heroism) and BuffExpires(METAMORPHOSIS) and BuffExpires(DEMONSOULFELGUARD) and LifePercent(more 75) Spell(LIFETAP)
-	if TalentPoints(BANETALENT more 0) Spell(SHADOWBOLT)
-	Spell(INCINERATE)
+	Spell(summon_doomguard)
 }
-
-AddIcon help=cd mastery=2
+AddIcon mastery=2 help=main
 {
-	#/summon_felguard,if=cooldown.demon_soul.remains<5&cooldown.metamorphosis.remains<5&!pet.felguard.active
-	if CheckBoxOn(petswap) and {spell(DEMONSOUL)<5} and {spell(METAMORPHOSIS)<5} unless pet.CreatureFamily(Felguard) Spell(SUMMONFELGUARD)
-	#/metamorphosis,if=pet.felguard.active
-	if pet.Present() and pet.CreatureFamily(Felguard) Spell(METAMORPHOSIS)
-	#/demon_soul,if=buff.metamorphosis.up
-	if BuffPresent(METAMORPHOSIS) Spell(DEMONSOUL)
-	#/summon_doomguard,if=time>10
-	if TimeInCombat(more 10) Spell(SUMMONDOOMGUARD)
-	#/felguard:felstorm
-	if pet.Present() and pet.CreatureFamily(Felguard) Spell(FELSTORM)
-	if CheckBoxOn(petswap)
+	if not InCombat()
 	{
-		#/soulburn,if=pet.felguard.active&!pet.felguard.dot.felstorm.ticking
-		if pet.CreatureFamily(Felguard) and pet.BuffExpires(FELSTORM) Spell(SOULBURN)
-		#/summon_felhunter,if=!pet.felguard.dot.felstorm.ticking&pet.felguard.active
-		if pet.BuffExpires(FELSTORM) and pet.CreatureFamily(Felguard) Spell(SUMMONFELHUNTER)
+		if not BuffPresent(spell_power_multiplier) Spell(dark_intent)
+		unless pet.CreatureFamily(Felguard) Spell(summon_felguard)
 	}
-	Item(Trinket0Slot usable=1)
-	Item(Trinket1Slot usable=1)
+	if target.DebuffExpires(magic_vulnerability any=1) Spell(curse_of_the_elements)
+	if TalentPoints(grimoire_of_service_talent) Spell(service_felguard)
+	if TalentPoints(grimoire_of_sacrifice_talent) and BuffExpires(grimoire_of_sacrifice) unless pet.CreatureFamily(Felguard) Spell(summon_felguard)
+	if Enemies() >5
+	{
+		if {not target.DebuffPresent(corruption) or target.DebuffRemains(corruption) <target.NextTick(corruption) } and target.DeadIn() >=6 Spell(corruption)
+		Spell(hand_of_guldan)
+		if {not target.DebuffPresent(doom) or target.DebuffRemains(doom) <40 } and target.DeadIn() >30 Spell(doom)
+		if TalentPoints(harvest_life_talent) Spell(harvest_life)
+		Spell(life_tap)
+	}
+	if {not target.DebuffPresent(corruption) or target.DebuffRemains(corruption) <target.NextTick(corruption) } and target.DeadIn() >=6 Spell(corruption)
+	if {not target.DebuffPresent(doom) or target.DebuffRemains(doom) <target.NextTick(doom) or {TicksRemain(doom) +1 <{target.TicksRemain(doom) + Ticks(doom) } and BuffPresent(dark_soul) } } and target.DeadIn() >=30 Spell(doom)
+	if target.DebuffRemains(corruption) >20 and BuffExpires(dark_soul) and DemonicFury() <=750 and target.DeadIn() >30 if Stance(1) cancel.Texture(Spell_shadow_demonform)
+	if not InFlightToTarget(hand_of_guldan) and target.DebuffRemains(shadowflame) <1 +CastTime(shadow_bolt) Spell(hand_of_guldan)
+	if target.DebuffRemains(corruption) <20 Spell(touch_of_chaos)
+	if BuffPresent(molten_core) and {BuffExpires(metamorphosis) or target.HealthPercent() <25 } Spell(soul_fire)
+	Spell(touch_of_chaos)
+	if ManaPercent() <50 Spell(life_tap)
+	Spell(shadow_bolt)
+	Spell(life_tap)
 }
-
-AddIcon help=main mastery=3
+AddIcon mastery=2 help=offgcd
 {
-	if InCombat(no) and BuffExpires(FELARMOR 400) Spell(FELARMOR)
-
-	if List(curse elements) and TargetDebuffExpires(magicaldamagetaken 2) and TargetDeadIn(more 8) Spell(CURSEELEMENTS)
-	if List(curse weakness) and TargetDebuffExpires(CURSEWEAKNESS 2) and TargetDeadIn(more 8) Spell(CURSEWEAKNESS)
-
-	#/soul_fire,if=buff.soulburn.up
-	if BuffPresent(SOULBURN) Spell(SOULFIRE)
-	#/fel_flame,if=buff.tier11_4pc_caster.react&dot.immolate.remains<8
-	if ArmorSetParts(T11 more 3) and TargetDebuffExpires(IMMOLATE 8 mine=1) Spell(FELFLAME)
-	#/immolate,if=(remains<cast_time+gcd|!ticking)&target.time_to_die>=4&miss_react
-	if TargetDebuffExpires(IMMOLATE 2 mine=1 haste=spell) and TargetDeadIn(more 4) Spell(IMMOLATE)
-	#/conflagrate
-	if 1s after TargetDebuffPresent(IMMOLATE mine=1) Spell(CONFLAGRATE)
-	#/immolate,if=buff.bloodlust.react&buff.bloodlust.remains>32&cooldown.conflagrate.remains<=3&remains<12
-	if BuffPresent(heroism 32) and {spell(CONFLAGRATE)<3} and TargetDebuffExpires(IMMOLATE 12 mine=1) Spell(IMMOLATE)
-	#/bane_of_doom,if=!ticking&target.time_to_die>=15&miss_react
-	if TargetDebuffExpires(BANEOFDOOM 0 mine=1) and TargetDebuffExpires(BANEOFAGONY 0 mine=1)
+	Spell(melee)
+	Spell(felstorm)
+	Spell(wrathstorm)
+	if Enemies() >5
 	{
-		if List(bane doom) and TargetDeadIn(more 15) Spell(BANEOFDOOM)
-		if TargetDeadIn(more 10) unless List(bane havoc) Spell(BANEOFAGONY)
+		if DemonicFury() >=1000 or DemonicFury() >=31 *target.DeadIn() unless Stance(1) Spell(metamorphosis)
 	}
-	#/corruption,if=(!ticking|dot.corruption.remains<tick_time)&miss_react
-	if TargetDebuffExpires(CORRUPTION 2 mine=1 haste=spell) and TargetDebuffExpires(SEEDOFCORRUPTION 0 mine=1) and TargetDeadIn(more 9) Spell(CORRUPTION)
-	#/shadowflame
-	if CheckBoxOn(shadowflame) Spell(SHADOWFLAME)
-	#/chaos_bolt,if=cast_time>0.9
-	if {castTime(CHAOSBOLT) > 0.9} Spell(CHAOSBOLT)
-	if TalentPoints(IMPROVEDSOULFIRE more 0)
+	if BuffPresent(dark_soul) or target.DebuffRemains(corruption) <5 or DemonicFury() >=900 or DemonicFury() >=target.DeadIn() *30 unless Stance(1) Spell(metamorphosis)
+}
+AddIcon mastery=2 help=moving
+{
+	Spell(fel_flame)
+}
+AddIcon mastery=2 help=aoe
+{
+
 	{
-		#((buff.empowered_imp.react&buff.empowered_imp.remains<(buff.improved_soul_fire.remains+action.soul_fire.travel_time))
-		if BuffPresent(EMPOWEREDIMP) and {buffExpires(EMPOWEREDIMP) < {buffExpires(IMPROVEDSOULFIREBUFF) + 1}}
-			Spell(SOULFIRE)
-		#|buff.improved_soul_fire.remains<(cast_time+travel_time+action.incinerate.cast_time+gcd))
-		if buffExpires(IMPROVEDSOULFIREBUFF)< {castTime(SOULFIRE)+ 1 +castTime(INCINERATE)+timeWithHaste(1.5)}
-			Spell(SOULFIRE)
+		Spell(summon_infernal)
+		Spell(immolation_aura)
+		if target.DebuffRemains(corruption) <10 Spell(void_ray)
+		Spell(void_ray)
+		if not TalentPoints(harvest_life_talent) Spell(hellfire)
 	}
-	#/shadowburn
-	Spell(SHADOWBURN usable=1)
-    Spell(INCINERATE)
 }
-
-AddIcon help=cd mastery=3
+AddIcon mastery=2 help=cd
 {
-	Spell(DEMONSOUL)
-	if BuffPresent(heroism) Spell(SUMMONDOOMGUARD)
-	Item(Trinket0Slot usable=1)
-	Item(Trinket1Slot usable=1)
+	 { Item(Trinket0Slot usable=1) Item(Trinket1Slot usable=1) }
+	Spell(blood_fury)
+	Spell(dark_soul)
+	if TalentPoints(grimoire_of_sacrifice_talent) Spell(grimoire_of_sacrifice)
+
+	{
+		Spell(summon_doomguard)
+	}
+	Spell(summon_doomguard)
 }
-
-AddIcon size=small
+AddIcon mastery=3 help=main
 {
-	if SoulShards(more 0) Spell(SOULBURN usable=1)
+	if not InCombat()
+	{
+		if not BuffPresent(spell_power_multiplier) Spell(dark_intent)
+		unless pet.CreatureFamily(Succubus) Spell(summon_succubus)
+	}
+	if target.DebuffExpires(magic_vulnerability any=1) Spell(curse_of_the_elements)
+	if TalentPoints(grimoire_of_service_talent) Spell(service_succubus)
+	if TalentPoints(grimoire_of_sacrifice_talent) and BuffExpires(grimoire_of_sacrifice) unless pet.CreatureFamily(Succubus) Spell(summon_succubus)
+	if Enemies() >2
+	{
+		if BuffPresent(fire_and_brimstone) and not target.DebuffPresent(immolate) Spell(immolate)
+		if BurningEmbers() and BuffPresent(fire_and_brimstone) Spell(conflagrate)
+		if BuffPresent(fire_and_brimstone) Spell(incinerate)
+		if not target.DebuffPresent(immolate) Spell(immolate)
+	}
+	if Enemies() >1 focus.Spell(havoc)
+	if BurningEmbers() if target.HealthPercent(less 20) Spell(shadowburn)
+	if BurningEmbers() and {BuffStacks(backdraft) <3 or Level() <86 } Spell(chaos_bolt)
+	if BuffExpires(backdraft) Spell(conflagrate)
+	if TicksRemain(immolate) <Ticks(immolate) /2 and target.DeadIn() >=5 Spell(immolate)
+	Spell(incinerate)
 }
-
-AddIcon size=small mastery=1
+AddIcon mastery=3 help=offgcd
 {
-    unless PetPresent()
-    {
-        if Glyph(GLYPHOFLASHOFPAIN) Spell(SUMMONSUCCUBUS)
-        if Glyph(GLYPHOFIMP) Spell(SUMMONIMP)
-		Spell(SUMMONFELHUNTER)
-    }
+	if Enemies() >2
+	{
+		if not target.DebuffPresent(rain_of_fire) and not InFlightToTarget(rain_of_fire) Spell(rain_of_fire)
+		if BurningEmbers() and BuffExpires(fire_and_brimstone) Spell(fire_and_brimstone)
+	}
 }
-
-AddIcon size=small mastery=2
+AddIcon mastery=3 help=aoe
 {
-    unless PetPresent()
+
 	{
-		if Glyph(GLYPHOFLASHOFPAIN) Spell(SUMMONSUCCUBUS)
-        if Glyph(GLYPHOFIMP) Spell(SUMMONIMP)
-		Spell(SUMMONFELGUARD)
+		Spell(summon_infernal)
 	}
 }
-
-AddIcon size=small mastery=3
+AddIcon mastery=3 help=cd
 {
-    unless PetPresent() Spell(SUMMONIMP)
+	 { Item(Trinket0Slot usable=1) Item(Trinket1Slot usable=1) }
+	Spell(blood_fury)
+	Spell(dark_soul)
+	if TalentPoints(grimoire_of_sacrifice_talent) Spell(grimoire_of_sacrifice)
+
+	{
+		Spell(summon_doomguard)
+	}
+	Spell(summon_doomguard)
 }
-
-]]
+]]
\ No newline at end of file
diff --git a/defaut/Druide.lua b/defaut/Druide.lua
index 69bdf01..33e4e2c 100644
--- a/defaut/Druide.lua
+++ b/defaut/Druide.lua
@@ -1,333 +1,199 @@
-Ovale.defaut["DRUID"] =
-[[
-Define(BARKSKIN 22812)
-	SpellInfo(BARKSKIN cd=60)
-	SpellAddBuff(BARKSKIN BARKSKIN=12)
-Define(BERSERK 50334) #cat+bear cd buff
-	SpellInfo(BERSERK cd=180)
-Define(CLAW 16827) #cat no positionning
-	SpellInfo(CLAW combo=1 mana=25)
-Define(DEMOROAR 99) #bear
-	SpellAddTargetDebuff(DEMOROAR DEMOROAR=30)
-Define(ENRAGE 5229) #bear
-	SpellInfo(ENRAGE cd=60)
-Define(FAERIEFIRE 770) #moonkin
-	SpellAddTargetDebuff(FAERIEFIRE FAERIEFIREDEBUFF=300)
-Define(FAERIEFERAL 16857) #bear+cat
-	SpellAddTargetDebuff(FAERIEFERAL FAERIEFIREDEBUFF=300)
-Define(FEROCIOUSBITE 22568) #cat finish 35-70 mana
-	SpellInfo(FEROCIOUSBITE combo=-5 mana=70)
-Define(FORCEOFNATURE 33831) #moonkin cd
-	SpellInfo(FORCEOFNATURE cd=180)
-Define(FRENZIEDREGENERATION 22842) #bear
-	SpellInfo(FRENZIEDREGENERATION cd=180)
-	SpellAddBuff(FRENZIEDREGENERATION FRENZIEDREGENERATION=20)
-Define(INNERVATE 29166)
-	SpellInfo(INNERVATE cd=180)
-	SpellAddBuff(INNERVATE INNERVATE=10)
-Define(INSECTSWARM 5570) #moonkin
-	SpellAddTargetDebuff(INSECTSWARM INSECTSWARM=12)
-Define(LACERATE 33745) #bear bleed*3
-	SpellInfo(LACERATE mana=15)
-	SpellAddTargetDebuff(LACERATE LACERATE=15)
-Define(MANGLECAT 33876) #cat bleed+debuff
-	SpellInfo(MANGLECAT combo=1 mana=35)
-	SpellAddTargetDebuff(MANGLECAT MANGLECAT=60)
-Define(MANGLEBEAR 33878) #bear bleed+debuff
-	SpellInfo(MANGLEBEAR cd=6 mana=15)
-	SpellAddTargetDebuff(MANGLEBEAR MANGLEBEAR=60)
-Define(MAUL 6807) #bear
-	SpellInfo(MAUL cd=3 mana=30)
-Define(MOONFIRE 8921) #moonkin
-	SpellAddTargetDebuff(MOONFIRE MOONFIRE=12)
-Define(PULVERIZE 80313) #bear after lacerate*3
-	SpellInfo(PULVERIZE mana=15)
-	SpellAddTargetDebuff(PULVERIZE LACERATE=0)
-Define(RAKE 1822) #cat bleed
-	SpellInfo(RAKE combo=1 mana=35)
-	SpellAddTargetDebuff(RAKE RAKE=9)
-Define(RAVAGE 6785) #cat behind+(prowling or stampede)
-	SpellInfo(RAVAGE combo=1 mana=60)
-	SpellAddBuff(RAVAGE STAMPEDE=0)
-Define(RIP 1079) #cat bleed
-	SpellInfo(RIP combo=-5 duration=16 resetcounter=ripshreds)
-	SpellInfo(RIP glyph=GLYPHOFSHRED addduration=6)
-	SpellAddTargetDebuff(RIP RIP=16)
-Define(SAVAGEROAR 52610) #cat damage buff
-	SpellInfo(SAVAGEROAR combo=-5 mana=25)
-	SpellAddBuff(SAVAGEROAR SAVAGEROAR=9)
-Define(SHRED 5221) #cat behind
-	SpellInfo(SHRED mana=40 combo=1 inccounter=ripshreds)
-Define(STARFALL 48505) #moonkin cd aoe
-	SpellInfo(STARFALL cd=90)
-	SpellAddBuff(STARFALL STARFALL=10)
-Define(STARFIRE 2912) #moonkin
-	SpellInfo(STARFIRE eclipse=20)
-Define(STARSURGE 78674) #moonkin 15 lunar+solar
-	SpellInfo(STARSURGE cd=15 starsurge=15)
-	SpellAddBuff(STARSURGE SHOOTINGSTARS=0)
-Define(SUNFIRE 93402)
-	SpellAddTargetDebuff(SUNFIRE SUNFIRE=12)
-Define(SURVIVALINSTINCTS 61336) #cat+bear surv cd
-	SpellInfo(SURVIVALINSTINCTS cd=180)
-	SpellAddBuff(SURVIVALINSTINCTS SURVIVALINSTINCTS=12)
-Define(SWIPEBEAR 779) #bear aoe
-	SpellInfo(SWIPEBEAR cd=6)
-Define(SWIPECAT 62078) #cat aoe
-Define(THRASH 77758) #bear aoe bleed
-	SpellInfo(THRASH cd=6 mana=25)
-	SpellAddTargetDebuff(THRASH THRASH=6)
-Define(TIGERSFURY 5217) #cat buff
-	SpellInfo(TIGERSFURY cd=30)
-	SpellAddBuff(TIGERSFURY TIGERSFURY=6)
-Define(TYPHOON 50516)
-	SpellInfo(TYPHOON cd=20)
-Define(WILDMUSHROOM 88747)
-Define(WILDMUSHROOMDETONATE 88751)
-Define(WRATH 5176) #moonkin
-	SpellInfo(WRATH eclipse=-13)
-
-#Glyphs
-Define(GLYPHOFSHRED 54815)
-
-#Buff
-Define(CLEARCASTING 16870)
-Define(ECLIPSELUNAR 48518) #Increased by wrath
-Define(ECLIPSESOLAR 48517) #Increased by starfire
-Define(SHOOTINGSTARS 93400)
-Define(STAMPEDE 81022)
-Define(FAERIEFIREDEBUFF 91565)
-Define(STRENGTHOFTHEPANTHER 90166) #feral T11 4-pieces bonus
-Define(ASTRALALIGNMENT 90164) #balance T11 4-pieces bonus
-
-AddCheckBox(multi L(AOE))
-AddCheckBox(lucioles SpellName(FAERIEFIRE) default)
-AddCheckBox(mangle SpellName(MANGLECAT) default mastery=2)
-AddCheckBox(demo SpellName(DEMOROAR) default mastery=2)
-AddCheckBox(shred SpellName(SHRED) default mastery=2)
-
-ScoreSpells(FAERIEFERAL DEMOROAR MANGLEBEAR LACERATE SAVAGEROAR RIP
-		MANGLECAT RAKE SHRED FEROCIOUSBITE INSECTSWARM MOONFIRE
-		WRATH STARFIRE STARSURGE SUNFIRE PULVERIZE MAUL
-		CLAW)
-
-AddIcon help=main mastery=1
+Ovale.defaut["DRUID"] = [[Define(berserk 50334)
+  SpellInfo(berserk duration=10 cd=180 )
+  SpellAddBuff(berserk berserk=1)
+Define(berserking 26297)
+  SpellInfo(berserking duration=10 cd=180 )
+  SpellAddBuff(berserking berserking=1)
+Define(cat_form 768)
+  SpellAddBuff(cat_form cat_form=1)
+Define(celestial_alignment 112071)
+  SpellInfo(celestial_alignment duration=15 cd=180 )
+  SpellAddBuff(celestial_alignment celestial_alignment=1)
+Define(chosen_of_elune 122114)
+Define(dream_of_cenarius_damage 108381)
+  SpellInfo(dream_of_cenarius_damage duration=30 )
+  SpellAddBuff(dream_of_cenarius_damage dream_of_cenarius_damage=1)
+Define(faerie_fire 770)
+  SpellInfo(faerie_fire duration=300 )
+  SpellAddBuff(faerie_fire faerie_fire=1)
+Define(feral_spirit 51533)
+  SpellInfo(feral_spirit duration=30 cd=120 )
+Define(ferocious_bite 22568)
+  SpellInfo(ferocious_bite combo=0 energy=25 )
+Define(healing_touch 5185)
+Define(incarnation 106731)
+  SpellInfo(incarnation duration=30 cd=180 )
+Define(lunar_eclipse 48518)
+  SpellAddBuff(lunar_eclipse lunar_eclipse=1)
+Define(mark_of_the_wild 1126)
+  SpellInfo(mark_of_the_wild duration=3600 )
+  SpellAddBuff(mark_of_the_wild mark_of_the_wild=1)
+Define(moonfire 8921)
+  SpellInfo(moonfire duration=14 tick=2 )
+  SpellAddTargetDebuff(moonfire moonfire=1)
+Define(moonkin_form 24858)
+  SpellAddBuff(moonkin_form moonkin_form=1)
+Define(natures_grace 16886)
+  SpellInfo(natures_grace duration=15 )
+  SpellAddBuff(natures_grace natures_grace=1)
+Define(natures_swiftness 132158)
+  SpellInfo(natures_swiftness cd=60 )
+  SpellAddBuff(natures_swiftness natures_swiftness=1)
+Define(natures_vigil 124974)
+  SpellInfo(natures_vigil duration=30 cd=180 )
+  SpellAddBuff(natures_vigil natures_vigil=1)
+Define(omen_of_clarity 16864)
+  SpellAddBuff(omen_of_clarity omen_of_clarity=1)
+Define(predatory_swiftness 16974)
+Define(rake 1822)
+  SpellInfo(rake duration=15 energy=35 tick=3 combo=1 )
+  SpellAddTargetDebuff(rake rake=1)
+Define(ravage 6785)
+  SpellInfo(ravage energy=45 combo=1 )
+Define(rip 1079)
+  SpellInfo(rip duration=16 combo=0 energy=30 tick=2 )
+  SpellAddTargetDebuff(rip rip=1)
+Define(savage_roar 52610)
+  SpellInfo(savage_roar duration=12 combo=0 energy=25 )
+  SpellAddBuff(savage_roar savage_roar=1)
+Define(shooting_stars 93399)
+Define(shred 5221)
+  SpellInfo(shred energy=40 combo=1 )
+Define(skull_bash_cat 80965)
+  SpellInfo(skull_bash_cat cd=15 )
+Define(solar_eclipse 48517)
+  SpellAddBuff(solar_eclipse solar_eclipse=1)
+Define(starfall 50288)
+Define(starfire 2912)
+Define(starsurge 78674)
+  SpellInfo(starsurge cd=15 )
+Define(sunfire 93402)
+  SpellInfo(sunfire duration=14 tick=2 )
+  SpellAddTargetDebuff(sunfire sunfire=1)
+Define(symbiosis 110309)
+  SpellInfo(symbiosis duration=3600 )
+  SpellAddBuff(symbiosis symbiosis=1)
+Define(tigers_fury 5217)
+  SpellInfo(tigers_fury duration=6 energy=-60 cd=30 )
+  SpellAddBuff(tigers_fury tigers_fury=1)
+Define(treants 106737)
+  SpellInfo(treants duration=15 cd=60 )
+Define(weakened_armor 113746)
+  SpellInfo(weakened_armor duration=30 )
+  SpellAddBuff(weakened_armor weakened_armor=1)
+Define(wild_mushroom 88747)
+  SpellInfo(wild_mushroom duration=300 )
+Define(wild_mushroom_detonate 78777)
+Define(wrath 5176)
+Define(dream_of_cenarius_talent 17)
+Define(force_of_nature_talent 12)
+Define(incarnation_talent 11)
+Define(natures_swiftness_talent 4)
+Define(natures_vigil_talent 18)
+AddIcon mastery=1 help=main
 {
-	#/faerie_fire,if=debuff.faerie_fire.stack<3&!(debuff.sunder_armor.up|debuff.expose_armor.up)
-	if CheckBoxOn(lucioles) and TargetDebuffExpires(FAERIEFIREDEBUFF 3 mine=1 stacks=3) and TargetDebuffExpires(lowerarmor 2 mine=0) and TargetDeadIn(more 15)
-		Spell(FAERIEFIRE nored=1)
-
-	if Speed(more 0)
+	if not InCombat()
 	{
-		if BuffPresent(SHOOTINGSTARS) Spell(STARSURGE)
-		if TargetDebuffExpires(INSECTSWARM 4 mine=1) and TargetDeadIn(more 6)
-			Spell(INSECTSWARM)
-		if BuffPresent(ECLIPSESOLAR)
-			Spell(SUNFIRE)
-		Spell(MOONFIRE)
+		if not BuffPresent(str_agi_int) Spell(mark_of_the_wild)
+		if not BuffPresent(dream_of_cenarius_damage) and TalentPoints(dream_of_cenarius_talent) Spell(healing_touch)
+		unless Stance(5) Spell(moonkin_form)
 	}
-
-	#/insect_swarm,if=ticks_remain<2|(dot.insect_swarm.remains<10&buff.solar_eclipse.up&eclipse<15)";
-	if TargetDebuffExpires(INSECTSWARM 2 mine=1) or {TargetDebuffExpires(INSECTSWARM 10 mine=1) and
-			BuffPresent(ECLIPSESOLAR) and Eclipse(less 15)}
-			Spell(INSECTSWARM nored=1)
-
-	if BuffPresent(ASTRALALIGNMENT)
-	{
-		#/starsurge,if=buff.t11_4pc_caster.up
-		Spell(STARSURGE)
-		#/starfire,if=buff.t11_4pc_caster.up&buff.lunar_eclipse.up
-		if BuffPresent(ECLIPSELUNAR) Spell(STARFIRE)
-		#/wrath,if=buff.t11_4pc_caster.up
-		Spell(WRATH)
-	}
-
-    #action_list_str += "/wild_mushroom_detonate,moving=1,if=buff.wild_mushroom.stack=3";
-    #action_list_str += "/wild_mushroom_detonate,moving=0,if=buff.wild_mushroom.stack>0&buff.solar_eclipse.up";
-
-	if TargetDeadIn(more 6)	and BuffExpires(ASTRALALIGNMENT)
-	{
-		#/sunfire,if=(!ticking|ticks_remain<2|(dot.sunfire.remains<4&buff.solar_eclipse.up&eclipse<15))&!dot.moonfire.remains>0";
-        if BuffPresent(ECLIPSESOLAR) and {TargetDebuffExpires(SUNFIRE 2 mine=1) or {TargetDebuffExpires(SUNFIRE 4 mine=1) and Eclipse(less 15)}}
-				and TargetDebuffExpires(MOONFIRE 0 mine=1)
-			Spell(SUNFIRE nored=1)
-
-		#/moonfire,if=(!ticking|ticks_remain<2|(dot.moonfire.remains<4&buff.lunar_eclipse.up&eclipse>-20))
-		if {TargetDebuffExpires(MOONFIRE 2 mine=1) or {TargetDebuffExpires(MOONFIRE 4 mine=1) and Eclipse(more -20)}}
-				and TargetDebuffExpires(SUNFIRE 0 mine=1)
-			Spell(MOONFIRE nored=1)
-	}
-
-	#/starsurge,if=!((eclipse<=-87&eclipse_dir=-1)|(eclipse>=80&eclipse_dir=1))
-	unless {Eclipse(less -88) and BuffExpires(ECLIPSELUNAR)} or {Eclipse(more 79) and BuffExpires(ECLIPSESOLAR)}
-		Spell(STARSURGE)
-
-	#/innervate,if=mana_pct<50
-	if ManaPercent(less 50) Spell(INNERVATE)
-
-	#The following lines should not be useful for Ovale
-	#/starfire,if=eclipse_dir=1&eclipse<80
-	#/starfire,prev=wrath,if=eclipse_dir=-1&eclipse<-87
-    #/wrath,if=eclipse_dir=-1&eclipse>=-87";
-    #/wrath,prev=starfire,if=eclipse_dir=1&eclipse>=80";
-
-	#/starfire,if=eclipse_dir=1
-	if BuffPresent(ECLIPSELUNAR) or Eclipse(equal -100) Spell(STARFIRE)
-	#/wrath,if=eclipse_dir=-1
-	if BuffPresent(ECLIPSESOLAR) or Eclipse(equal 100) Spell(WRATH)
-	if Eclipse(more 0) Spell(STARFIRE)
-	if Eclipse(less 0) Spell(WRATH)
-	#/starfire
-	Spell(STARFIRE)
+	if TalentPoints(force_of_nature_talent) Spell(treants)
+	if not BuffPresent(dream_of_cenarius_damage) and TalentPoints(dream_of_cenarius_talent) Spell(healing_touch)
+	if Eclipse() <=0-70 and EclipseDir() <=0 Spell(wrath)
+	if Eclipse() >=60 and EclipseDir() >=0 Spell(starfire)
+	if BuffPresent(lunar_eclipse) and {target.DebuffRemains(moonfire) <{BuffRemains(natures_grace) -2 +2 *ArmorSetParts(T14 more 4) } } Spell(moonfire)
+	if BuffPresent(solar_eclipse) and not BuffPresent(celestial_alignment) and {target.DebuffRemains(sunfire) <{BuffRemains(natures_grace) -2 +2 *ArmorSetParts(T14 more 4) } } Spell(sunfire)
+	if not target.DebuffPresent(moonfire) and not BuffPresent(celestial_alignment) and {BuffPresent(dream_of_cenarius_damage) or not TalentPoints(dream_of_cenarius_talent) } Spell(moonfire)
+	if not target.DebuffPresent(sunfire) and not BuffPresent(celestial_alignment) and {BuffPresent(dream_of_cenarius_damage) or not TalentPoints(dream_of_cenarius_talent) } Spell(sunfire)
+	Spell(starsurge)
+	if BuffPresent(celestial_alignment) and CastTime(starfire) <BuffRemains(celestial_alignment) Spell(starfire)
+	if BuffPresent(celestial_alignment) and CastTime(wrath) <BuffRemains(celestial_alignment) Spell(wrath)
+	if EclipseDir() ==1 or {EclipseDir() ==0 and Eclipse() >0 } Spell(starfire)
+	if EclipseDir() ==0-1 or {EclipseDir() ==0 and Eclipse() <=0 } Spell(wrath)
 }
-
-AddIcon help=aoe mastery=1
+AddIcon mastery=1 help=offgcd
 {
-	if TotemPresent(1) and TotemPresent(2) and TotemPresent(3) Spell(WILDMUSHROOMDETONATE)
-	if TotemExpires(1) or TotemExpires(2) or TotemExpires(3) Spell(WILDMUSHROOM)
-	#/typhoon,moving=1
-	if Speed(more 0) Spell(TYPHOON)
+	if not BuffPresent(starfall) Spell(starfall)
+	if BuffStacks(wild_mushroom) >0 and BuffPresent(solar_eclipse) Spell(wild_mushroom_detonate)
+	if TalentPoints(dream_of_cenarius_talent) and TalentPoints(natures_swiftness_talent) Spell(natures_swiftness)
 }
-
-AddIcon help=cd mastery=1
+AddIcon mastery=1 help=moving
 {
-	#/starfall,if=buff.lunar_eclipse.up&buff.t11_4pc_caster.down
-	if BuffPresent(ECLIPSELUNAR) and BuffExpires(ASTRALALIGNMENT) Spell(STARFALL)
-	#/treants,time>=5
-	if TimeInCombat(more 5) Spell(FORCEOFNATURE)
-	Item(Trinket0Slot usable=1)
-	Item(Trinket1Slot usable=1)
+	if not target.DebuffPresent(sunfire) Spell(moonfire)
+	if not target.DebuffPresent(moonfire) Spell(sunfire)
+	if BuffStacks(wild_mushroom) <5 Spell(wild_mushroom)
+	if BuffPresent(shooting_stars) Spell(starsurge)
+	if BuffPresent(lunar_eclipse) Spell(moonfire)
+	Spell(sunfire)
 }
-
-AddFunction AddCombo
+AddIcon mastery=1 help=cd
 {
-	if CheckBoxOn(shred) Spell(SHRED)
-	if CheckBoxOff(shred) Spell(MANGLECAT)
+	Spell(berserking)
+	if TalentPoints(incarnation_talent) and {BuffPresent(lunar_eclipse) or BuffPresent(solar_eclipse) } Spell(incarnation)
+	if {{EclipseDir() ==0-1 and Eclipse() <=0 } or {EclipseDir() ==1 and Eclipse() >=0 } } and {BuffPresent(chosen_of_elune) or not TalentPoints(incarnation_talent) } Spell(celestial_alignment)
+	if {{TalentPoints(incarnation_talent) and BuffPresent(chosen_of_elune) } or {not TalentPoints(incarnation_talent) and BuffPresent(celestial_alignment) } } and TalentPoints(natures_vigil_talent) Spell(natures_vigil)
 }
-
-AddFunction	BITWHP
+AddIcon mastery=2 help=main
 {
-	if ArmorSetParts(T13 more 1) 60
-	25
-}
-
-AddIcon help=main mastery=2
-{
-	if Stance(1) # bear
-	{
-		#/mangle_bear
-		Spell(MANGLEBEAR)
-		#/demoralizing_roar,if=!debuff.demoralizing_roar.up
-		if CheckBoxOn(demo) and TargetDebuffExpires(lowerphysicaldamage 2)
-			Spell(DEMOROAR)
-		#/lacerate,if=!ticking
-		if TargetDebuffExpires(LACERATE 0) Spell(LACERATE)
-		#/thrash
-		Spell(THRASH)
-		if CheckBoxOn(multi) Spell(SWIPEBEAR)
-		#/pulverize,if=buff.lacerate.stack=3&buff.pulverize.remains<=2
-		if TargetDebuffPresent(LACERATE stacks=3) and BuffExpires(PULVERIZE 2) Spell(PULVERIZE)
-		#/lacerate,if=buff.lacerate.stack<3
-		if TargetDebuffExpires(LACERATE 4 stacks=3)	Spell(LACERATE)
-		#/faerie_fire_feral
-		if CheckBoxOn(lucioles) and TargetDebuffExpires(lowerarmor 2 mine=0) and TargetDebuffExpires(FAERIEFIREDEBUFF 3 stacks=3)
-			Spell(FAERIEFERAL)
-	}
-
-	if Stance(3) # cat
+	if not InCombat()
 	{
-		#tigers_fury,if=energy<=35&(!buff.omen_of_clarity.react)
-		if ArmorSetParts(T13 more 3)
-		{
-			if Mana(less 46) and BuffExpires(CLEARCASTING) Spell(TIGERSFURY)
-		}
-		if ArmorSetParts(T13 less 4)
-		{
-			if Mana(less 36) and BuffExpires(CLEARCASTING) Spell(TIGERSFURY)
-		}
-
-		#/berserk,if=buff.tigers_fury.up|(target.time_to_die<15&cooldown.tigers_fury.remains>6
-		if BuffPresent(TIGERSFURY) or {TargetDeadIn(less 15) and 6s before Spell(TIGERSFURY)} Spell(BERSERK)
-
-		#mangle_cat,if=set_bonus.tier11_4pc_melee&(buff.t11_4pc_melee.stack<3|buff.t11_4pc_melee.remains<3)
-		if ArmorSetParts(T11 more 3) and BuffExpires(STRENGTHOFTHEPANTHER 3 stacks=3) Spell(MANGLECAT)
-
-		#faerie_fire_feral,if=debuff.faerie_fire.stack<3|!(debuff.sunder_armor.up|debuff.expose_armor.up)
-		if CheckBoxOn(lucioles) and	TargetDebuffExpires(lowerarmor 0 mine=0) and TargetDebuffExpires(FAERIEFIREDEBUFF 2 stacks=3) and TargetDeadIn(more 15)
-			Spell(FAERIEFERAL)
-
-		#mangle_cat,if=debuff.mangle.remains<=2&(!debuff.mangle.up|debuff.mangle.remains>=0.0)
-		if TargetDebuffExpires(bleed 0) and CheckBoxOn(mangle)
-			Spell(MANGLECAT)
-
-		#ravage,if=(buff.stampede_cat.up|buff.t13_4pc_melee.up)&(buff.stampede_cat.remains<=1|buff.t13_4pc_melee.remains<=1)
-		if BuffPresent(STAMPEDE) and BuffExpires(STAMPEDE 1) Spell(RAVAGE)
-
-		#ferocious_bite,if=buff.combo_points.stack>=1&dot.rip.ticking&dot.rip.remains<=1&target.health_pct<=25
-		if ComboPoints(more 0) and TargetDebuffPresent(RIP mine=1) and TargetDebuffExpires(RIP 1 mine=1) and target.lifePercent()<BITWHP()
-			Spell(FEROCIOUSBITE)
-
-		#ferocious_bite,if=buff.combo_points.stack>=5&dot.rip.ticking&target.health_pct<=25
-		if ComboPoints(more 4) and TargetDebuffPresent(RIP mine=1) and target.lifePercent()<BITWHP()
-			Spell(FEROCIOUSBITE)
-
-		#/shred,extend_rip=1,if=dot.rip.ticking&dot.rip.remains<=4&target.health_pct>25  TODO: extend_rip=1?
-		if TargetDebuffPresent(RIP mine=1) and TargetDebuffExpires(RIP 4 mine=1) and target.lifePercent()>BITWHP() AddCombo()
-
-		#rip,if=buff.combo_points.stack>=5&target.time_to_die>=6&dot.rip.remains<2.0&(buff.berserk.up|dot.rip.remains<=cooldown.tigers_fury.remains)
-		if ComboPoints(more 4) and TargetDeadIn(more 6) and TargetDebuffExpires(RIP 2 mine=1) and
-				{BuffPresent(BERSERK) or {target.debuffExpires(RIP mine=1)<spell(TIGERSFURY)}}
-			Spell(RIP)
-
-		#/ferocious_bite,if=buff.combo_points.stack>=5&dot.rip.remains>5.0&buff.savage_roar.remains>=3.0
-		if ComboPoints(more 4) and TargetDebuffPresent(RIP 5 mine=1) and BuffPresent(SAVAGEROAR 3) Spell(FEROCIOUSBITE)
-
-		#rake,if=target.time_to_die>=8.5&buff.tigers_fury.up&dot.rake.remains<9.0&(!dot.rake.ticking|dot.rake.multiplier<multiplier)
-		#not sure what this multiplier is
-		if TargetDeadIn(more 8.5) and BuffPresent(TIGERSFURY) and TargetDebuffExpires(RAKE 0 mine=1)
-			Spell(RAKE)
-		#rake,if=target.time_to_die>=dot.rake.remains&dot.rake.remains<3.0&(buff.berserk.up|energy>=71|(cooldown.tigers_fury.remains+0.8)>=dot.rake.remains)
-		if {target.timeToDie()>target.debuffExpires(RAKE mine=1)} and TargetDebuffExpires(RAKE 3 mine=1) and {BuffPresent(BERSERK) or Mana(more 70) or
-				{{spell(TIGERSFURY)+0.8}>target.debuffExpires(RAKE mine=1)}}
-			Spell(RAKE)
-
-		#shred,if=buff.omen_of_clarity.react
-		if BuffPresent(CLEARCASTING) AddCombo()
-
-		#savage_roar,if=buff.combo_points.stack>=1&buff.savage_roar.remains<=1
-		if ComboPoints(more 0) and BuffExpires(SAVAGEROAR 1) Spell(SAVAGEROAR)
-
-		#ferocious_bite,if=(target.time_to_die<=4&buff.combo_points.stack>=5)|target.time_to_die<=1
-		if {TargetDeadIn(less 4) and ComboPoints(more 4)} or {TargetDeadIn(less 1) and ComboPoints(more 0)} Spell(FEROCIOUSBITE)
-		#/ferocious_bite,if=buff.combo_points.stack>=5&dot.rip.remains>=14.0&buff.savage_roar.remains>=10.0
-		if ComboPoints(more 4) and TargetDebuffPresent(RIP 14 mine=1) and BuffPresent(SAVAGEROAR 10) Spell(FEROCIOUSBITE)
-
-		#ravage,if=buff.stampede_cat.up&!buff.omen_of_clarity.react&buff.tigers_fury.up
-		if BuffPresent(STAMPEDE) and BuffExpires(CLEARCASTING) and BuffPresent(TIGERSFURY) Spell(RAVAGE)
-		#/shred,if=buff.tigers_fury.up|buff.berserk.up
-		if BuffPresent(TIGERSFURY) or BuffPresent(BERSERK) AddCombo()
-		#/shred,if=(buff.combo_points.stack<5&dot.rip.remains<3.0)|(buff.combo_points.stack=0&buff.savage_roar.remains<2
-		if {ComboPoints(less 5) and TargetDebuffExpires(RIP 3 mine=1)} or {ComboPoints(less 1) and BuffExpires(SAVAGEROAR 2)} AddCombo()
-		#/shred,if=cooldown.tigers_fury.remains<=3.0
-		if spell(TIGERSFURY) < 3 AddCombo()
-		#/shred,if=target.time_to_die<=8.5
-		if TargetDeadIn(less 8.5) AddCombo()
-		#/shred,if=time_to_max_energy<=1.0
-		if 1s before Mana(more 99) AddCombo()
+		if not BuffPresent(str_agi_int) Spell(mark_of_the_wild)
+		if not BuffPresent(dream_of_cenarius_damage) and TalentPoints(dream_of_cenarius_talent) Spell(healing_touch)
+		shaman.Spell(symbiosis)
+		unless Stance(3) Spell(cat_form)
+		Spell(savage_roar)
 	}
+	if target.IsInterruptible() Spell(skull_bash_cat)
+	if BuffPresent(predatory_swiftness) and BuffRemains(predatory_swiftness) <=1 and TalentPoints(dream_of_cenarius_talent) and {BuffExpires(dream_of_cenarius_damage) or {BuffStacks(dream_of_cenarius_damage) ==1 and not BuffPresent(omen_of_clarity) } } Spell(healing_touch)
+	if PreviousSpell(natures_swiftness) Spell(healing_touch)
+	if BuffRemains(savage_roar) <=1 or {BuffRemains(savage_roar) <=3 and ComboPoints() >0 and {BuffExpires(dream_of_cenarius_damage) or ComboPoints() <5 } } Spell(savage_roar)
+	if target.DebuffStacks(weakened_armor) <3 Spell(faerie_fire)
+	if BuffPresent(predatory_swiftness) and TalentPoints(dream_of_cenarius_talent) and BuffExpires(dream_of_cenarius_damage) and {{{ComboPoints() >=5 and target.DebuffRemains(rip) >SpellCooldown(healing_touch) and target.HealthPercent() <=25 } } } Spell(healing_touch)
+	if ComboPoints() >=5 and target.DebuffPresent(rip) and target.HealthPercent() <=25 Spell(ferocious_bite)
+	if ComboPoints() >=1 and target.DebuffPresent(rip) and target.DebuffRemains(rip) <=2 and target.HealthPercent() <=25 Spell(ferocious_bite)
+	if target.DebuffPresent(rip) and target.DebuffRemains(rip) <=4 Spell(ravage usable=1)
+	if target.DebuffPresent(rip) and target.DebuffRemains(rip) <=4 Spell(shred)
+	if BuffPresent(predatory_swiftness) and TalentPoints(dream_of_cenarius_talent) and BuffExpires(dream_of_cenarius_damage) and {{{ComboPoints() >=5 and target.DeadIn() >={6 +SpellCooldown(healing_touch) } and target.DebuffRemains(rip) <{2 +SpellCooldown(healing_touch) } and {BuffPresent(berserk) or target.DebuffRemains(rip) <=SpellCooldown(tigers_fury) } } } } Spell(healing_touch)
+	if ComboPoints() >=5 and target.DeadIn() >=6 and target.DebuffRemains(rip) <2.0 and {BuffPresent(berserk) or target.DebuffRemains(rip) <=SpellCooldown(tigers_fury) } Spell(rip)
+	if BuffPresent(predatory_swiftness) and TalentPoints(dream_of_cenarius_talent) and BuffExpires(dream_of_cenarius_damage) and {{{ComboPoints() >=5 and target.DebuffRemains(rip) >{5 +SpellCooldown(healing_touch) } and BuffRemains(savage_roar) >={1 +SpellCooldown(healing_touch) } and BuffRemains(berserk) >SpellCooldown(healing_touch) } } } Spell(healing_touch)
+	if ComboPoints() >=5 and target.DebuffRemains(rip) >5.0 and BuffRemains(savage_roar) >=1.0 and BuffPresent(berserk) Spell(ferocious_bite)
+	if BuffPresent(predatory_swiftness) and TalentPoints(dream_of_cenarius_talent) and BuffExpires(dream_of_cenarius_damage) and {target.HealthPercent() <=25 or {target.DebuffRemains(rip) >4 and ArmorSetParts(T14 more 4) } } and {{{target.DeadIn() >={8.5 +SpellCooldown(healing_touch) } and SpellCooldown(tigers_fury) >21 and target.DebuffRemains(rake) <{12.0 +SpellCooldown(healing_touch) } } } } Spell(healing_touch)
+	if BuffPresent(predatory_swiftness) and TalentPoints(dream_of_cenarius_talent) and BuffExpires(dream_of_cenarius_damage) and {target.HealthPercent() <=25 or {target.DebuffRemains(rip) >4 and ArmorSetParts(T14 more 4) } } and {{{target.DeadIn() >={8.5 +SpellCooldown(healing_touch) } and target.DebuffRemains(rake) <{3.0 +SpellCooldown(healing_touch) } and {BuffRemains(berserk) >SpellCooldown(healing_touch) or {SpellCooldown(tigers_fury) +0.8 } >=target.DebuffRemains(rake) } } } } Spell(healing_touch)
+	if target.DeadIn() >=8.5 and BuffPresent(dream_of_cenarius_damage) and {{LastSpellDamageMultiplier(rake) <DamageMultiplier(rake) } or {target.DebuffRemains(rake) <12.0 and {LastSpellDamageMultiplier(rake) <=DamageMultiplier(rake) } and not PreviousSpell(rake) } } Spell(rake)
+	if target.DeadIn() >=8.5 and target.DebuffRemains(rake) <9.0 and not TalentPoints(dream_of_cenarius_talent) and BuffPresent(tigers_fury) and {LastSpellDamageMultiplier(rake) <DamageMultiplier(rake) } Spell(rake)
+	if target.DeadIn() >=8.5 and target.DebuffRemains(rake) <3.0 and {BuffPresent(berserk) or {SpellCooldown(tigers_fury) +0.8 } >=target.DebuffRemains(rake) } Spell(rake)
+	if BuffPresent(omen_of_clarity) Spell(ravage usable=1)
+	if BuffPresent(omen_of_clarity) Spell(shred)
+	if {target.DeadIn() <=4 and ComboPoints() >=5 } or target.DeadIn() <=1 Spell(ferocious_bite)
+	if BuffPresent(predatory_swiftness) and TalentPoints(dream_of_cenarius_talent) and BuffExpires(dream_of_cenarius_damage) and {{{ComboPoints() >=5 and target.DebuffRemains(rip) >=6.0 and BuffPresent(savage_roar) } } } Spell(healing_touch)
+	if ComboPoints() >=5 and target.DebuffRemains(rip) >=6.0 and BuffPresent(savage_roar) Spell(ferocious_bite)
+	if {BuffPresent(tigers_fury) or BuffPresent(berserk) } Spell(ravage usable=1)
+	if {{ComboPoints() <5 and target.DebuffRemains(rip) <3.0 } or {ComboPoints() ==0 and BuffRemains(savage_roar) <2 } } Spell(ravage usable=1)
+	if SpellCooldown(tigers_fury) <=3.0 Spell(ravage usable=1)
+	if target.DeadIn() <=8.5 Spell(ravage usable=1)
+	if TimeToMaxEnergy() <=1.0 Spell(ravage usable=1)
+	if {BuffPresent(tigers_fury) or BuffPresent(berserk) } Spell(shred)
+	if {{ComboPoints() <5 and target.DebuffRemains(rip) <3.0 } or {ComboPoints() ==0 and BuffRemains(savage_roar) <2 } } Spell(shred)
+	if SpellCooldown(tigers_fury) <=3.0 Spell(shred)
+	if target.DeadIn() <=8.5 Spell(shred)
+	if TimeToMaxEnergy() <=1.0 Spell(shred)
 }
-
-AddIcon help=offgcd mastery=2
+AddIcon mastery=2 help=offgcd
 {
-	#/maul,if=rage>=75
-	if Stance(1) and Mana(more 74) Spell(MAUL)
+	if Energy() <=35 and not BuffPresent(omen_of_clarity) Spell(tigers_fury)
+	if not BuffPresent(predatory_swiftness) and TalentPoints(dream_of_cenarius_talent) and BuffExpires(dream_of_cenarius_damage) and TalentPoints(natures_swiftness_talent) and {{{ComboPoints() >=5 and target.DebuffRemains(rip) >SpellCooldown(healing_touch) and target.HealthPercent() <=25 } } } Spell(natures_swiftness)
+	if not BuffPresent(predatory_swiftness) and TalentPoints(dream_of_cenarius_talent) and BuffExpires(dream_of_cenarius_damage) and TalentPoints(natures_swiftness_talent) and target.HealthPercent() >25 and {{{ComboPoints() >=5 and target.DeadIn() >={6 +SpellCooldown(healing_touch) } and target.DebuffRemains(rip) <{2 +SpellCooldown(healing_touch) } and {BuffPresent(berserk) or target.DebuffRemains(rip) <=SpellCooldown(tigers_fury) } } } } Spell(natures_swiftness)
+	if not BuffPresent(predatory_swiftness) and TalentPoints(dream_of_cenarius_talent) and BuffExpires(dream_of_cenarius_damage) and {target.HealthPercent() <=25 or {target.DebuffRemains(rip) >4 and ArmorSetParts(T14 more 4) } } and {{{target.DeadIn() >={8.5 +SpellCooldown(healing_touch) } and BuffPresent(tigers_fury) and target.DebuffRemains(rake) <{12.0 +SpellCooldown(healing_touch) } } } } Spell(natures_swiftness)
+	if not BuffPresent(predatory_swiftness) and TalentPoints(dream_of_cenarius_talent) and BuffExpires(dream_of_cenarius_damage) and {target.HealthPercent() <=25 or {target.DebuffRemains(rip) >4 and ArmorSetParts(T14 more 4) } } and {{{target.DeadIn() >={8.5 +SpellCooldown(healing_touch) } and target.DebuffRemains(rake) <{3.0 +SpellCooldown(healing_touch) } and {BuffRemains(berserk) >SpellCooldown(healing_touch) or {SpellCooldown(tigers_fury) +0.8 } >=target.DebuffRemains(rake) } } } } Spell(natures_swiftness)
 }
-
-AddIcon help=cd mastery=2
+AddIcon mastery=2 help=cd
 {
-	#unless BuffPresent(TIGERSFURY) Spell(BERSERK)
-	Item(Trinket0Slot usable=1)
-	Item(Trinket1Slot usable=1)
+	 { Item(Trinket0Slot usable=1) Item(Trinket1Slot usable=1) }
+	if BuffPresent(tigers_fury) or {target.DeadIn() <15 and SpellCooldown(tigers_fury) >6 } Spell(berserk)
+	if BuffPresent(berserk) and TalentPoints(natures_vigil_talent) Spell(natures_vigil)
+	if BuffPresent(berserk) and TalentPoints(incarnation_talent) Spell(incarnation)
+	Spell(berserking)
+	Spell(feral_spirit)
 }
-
-]]
+]]
\ No newline at end of file
diff --git a/defaut/Guerrier.lua b/defaut/Guerrier.lua
index bcf84e0..c0bea7a 100644
--- a/defaut/Guerrier.lua
+++ b/defaut/Guerrier.lua
@@ -1,406 +1,150 @@
-Ovale.defaut["WARRIOR"] =
-[[
-#Spells
-Define(BATTLESHOUT 6673)
-	SpellInfo(BATTLESHOUT cd=30)
-	SpellAddBuff(BATTLESHOUT BATTLESHOUT=120)
-Define(BATTLESTANCE 2457)
-Define(BERSERKERRAGE 18499)
-	SpellInfo(BERSERKERRAGE cd=30)
-Define(BERSERKERSTANCE 2458)
-Define(BLADESTORM 46924)
-	SpellInfo(BLADESTORM cd=90)
-Define(BLOODTHIRST 23881)
-	SpellInfo(BLOODTHIRST cd=3)
-Define(CHARGE 100)
-	SpellInfo(CHARGE cd=15)
-Define(CLEAVE 845)
-	SpellInfo(CLEAVE cd=3)
-Define(COLOSSUSSMASH 86346)
-	SpellInfo(COLOSSUSSMASH cd=20)
-	SpellAddTargetDebuff(COLOSSUSSMASH COLOSSUSSMASH=6 SUNDERARMORDEBUFF=30)
-Define(COMMANDINGSHOUT 469)
-	SpellInfo(COMMANDINGSHOUT cd=30)
-	SpellAddBuff(COMMANDINGSHOUT COMMANDINGSHOUT=120)
-Define(CONCUSSIONBLOW 12809)
-	SpellInfo(CONCUSSIONBLOW cd=30)
-Define(DEADLYCALM 85730)
-	SpellInfo(DEADLYCALM cd=120)
-	SpellAddBuff(DEADLYCALM DEADLYCALM=10)
-Define(DEATHWISH 12292)
-	SpellInfo(DEATHWISH cd=180)
-	SpellAddBuff(DEATHWISH DEATHWISH=30)
-Define(DEFENSIVESTANCE 71)
-Define(DEMOSHOUT 1160)
-	SpellAddTargetDebuff(DEMOSHOUT DEMOSHOUT=45)
-Define(DEVASTATE 20243)
-	SpellAddTargetDebuff(DEVASTATE SUNDERARMORDEBUFF=30)
-Define(EXECUTE 5308)
-	SpellAddBuff(EXECUTE EXECUTIONER=9)
-Define(HEROICLEAP 6544)
-	SpellInfo(HEROICLEAP cd=60)
-Define(HEROICSTRIKE 78)
-	SpellInfo(HEROICSTRIKE cd=3)
-Define(HEROICTHROW 57755)
-	SpellInfo(HEROICTHROW cd=60)
-Define(HEROICFURY 60970)
-	SpellInfo(HEROICFURY cd=60)
-Define(INNERRAGE 1134)
-	SpellInfo(INNERRAGE cd=30)
-	SpellAddBuff(INNERRAGE INNERRAGE=15)
-Define(INTERCEPT 20252)
-	SpellInfo(INTERCEPT cd=30)
-Define(INTERVENE 3411)
-	SpellInfo(INTERVENE cd=30)
-Define(LASTSTAND 12975)
-	SpellInfo(LASTSTAND cd=180)
-Define(MORTALSTRIKE 12294)
-	SpellInfo(MORTALSTRIKE cd=4.5)
-Define(OVERPOWER 7384)
-	SpellInfo(OVERPOWER cd=1)
-	SpellAddBuff(OVERPOWER TASTEFORBLOOD=0)
-Define(PUMMEL 6552)
-	SpellInfo(PUMMEL cd=10)
-Define(RAGINGBLOW 85288)
-	SpellInfo(RAGINGBLOW cd=6)
-Define(RECKLESSNESS 1719)
-	SpellInfo(RECKLESSNESS cd=300)
-	SpellAddBuff(RECKLESSNESS RECKLESSNESS=12)
-Define(REND 772)
-	SpellAddTargetDebuff(REND RENDDEBUFF=15)
-Define(RETALIATION 20230)
-	SpellInfo(RETALIATION cd=300)
-	SpellAddBuff(RETALIATION RETALIATION=12)
-Define(REVENGE 6572)
-	SpellInfo(REVENGE cd=5)
-Define(SHATTERINGTHROW 64382)
-	SpellInfo(SHATTERINGTHROW cd=300)
-	SpellAddTargetDebuff(SHATTERINGTHROW SHATTERINGTHROW=10)
-Define(SHIELDBLOCK 2565)
-	SpellInfo(SHIELDBLOCK cd=60)
-	SpellAddBuff(SHIELDBLOCK SHIELDBLOCK=10)
-Define(SHIELDWALL 871)
-	SpellInfo(SHIELDWALL cd=300)
-	SpellAddBuff(SHIELDWALL SHIELDWALL=12)
-Define(SHIELDSLAM 23922)
-	SpellInfo(SHIELDSLAM cd=6)
-Define(SHOCKWAVE 46968)
-	SpellInfo(SHOCKWAVE cd=20)
-	SpellAddBuff(SHOCKWAVE THUNDERSTRUCK=0)
-Define(SLAM 1464)
-	SpellAddBuff(SLAM BLOODSURGE=-1)
-Define(STRIKE 88161)
-	SpellInfo(STRIKE cd=3)
-Define(SUNDERARMOR 7386)
-	SpellAddTargetDebuff(SUNDERARMOR SUNDERARMORDEBUFF=30)
-Define(SWEEPINGSTRIKES 12328)
-	SpellInfo(SWEEPINGSTRIKES cd=60)
-Define(THUNDERCLAP 6343)
-	SpellInfo(THUNDERCLAP cd=6)
-	SpellAddTargetDebuff(THUNDERCLAP THUNDERCLAP=30)
-Define(VICTORYRUSH 34428)
-	SpellAddBuff(VICTORYRUSH VICTORIOUS=0)
-Define(WHIRLWIND 1680)
-	SpellInfo(WHIRLWIND cd=10)
-
-#Buffs
-Define(BLOODSURGE 46916)
-Define(TASTEFORBLOOD 60503)
-Define(EXECUTIONER 90806)
-Define(SUNDERARMORDEBUFF 58567)
-Define(RENDDEBUFF 94009)
-Define(INCITE 86627)
-Define(BATTLETRANCE 12964)
-Define(SLAUGHTER 84584)
-Define(THUNDERSTRUCK 87096)
-Define(VICTORIOUS 32216)
-Define(ENRAGEWRECKINGCREW 57519)
-
-#Talents
-Define(SLAMTALENT 2233)
-Define(SUDDENDEATH 52437)
-Define(TITANSGRIPTALENT 9658)
-Define(EXECUTIONERTALENT 9644)
-
-#Glyphs
-Define(GLYPHOFBERSERKERRAGE 58096)
-
-AddCheckBox(aoe L(AOE) default)
-AddCheckBox(demo SpellName(DEMOSHOUT))
-AddCheckBox(sunder SpellName(SUNDERARMOR) default)
-AddCheckBox(dancing SpellName(BERSERKERSTANCE) default mastery=1)
-AddCheckBox(leap SpellName(HEROICLEAP) mastery=1)
-AddCheckBox(leap SpellName(HEROICLEAP) mastery=2)
-AddListItem(shout none L(None))
-AddListItem(shout battle SpellName(BATTLESHOUT) default)
-AddListItem(shout command SpellName(COMMANDINGSHOUT))
-
-ScoreSpells(DEADLYCALM COLOSSUSSMASH RAGINGBLOW OVERPOWER VICTORYRUSH BLOODTHIRST SLAM REND MORTALSTRIKE EXECUTE SHIELDSLAM REVENGE
-				DEVASTATE)
-
-AddIcon help=main mastery=1
+Ovale.defaut["WARRIOR"] = [[Define(avatar 107574)
+  SpellInfo(avatar duration=20 cd=180 )
+  SpellAddBuff(avatar avatar=1)
+Define(battle_shout 6673)
+  SpellInfo(battle_shout duration=300 cd=60 )
+  SpellAddBuff(battle_shout battle_shout=1)
+Define(battle_stance 2457)
+  SpellInfo(battle_stance cd=3 )
+Define(berserker_rage 18499)
+  SpellInfo(berserker_rage duration=6 cd=30 )
+  SpellAddBuff(berserker_rage berserker_rage=1)
+Define(bladestorm 46924)
+  SpellInfo(bladestorm duration=6 cd=90 )
+  SpellAddBuff(bladestorm bladestorm=1)
+Define(bloodbath 113344)
+  SpellInfo(bloodbath duration=6 tick=1 )
+  SpellAddTargetDebuff(bloodbath bloodbath=1)
+Define(bloodsurge 46915)
+Define(bloodthirst 23881)
+  SpellInfo(bloodthirst rage=-10 cd=4.5 )
+Define(colossus_smash 86346)
+  SpellInfo(colossus_smash duration=6.5 cd=20 )
+  SpellAddTargetDebuff(colossus_smash colossus_smash=1)
+Define(deadly_calm 85730)
+  SpellInfo(deadly_calm duration=9 cd=60 )
+  SpellAddBuff(deadly_calm deadly_calm=1)
+Define(dragon_roar 118000)
+  SpellInfo(dragon_roar cd=60 )
+Define(enrage 5229)
+  SpellInfo(enrage duration=10 rage=-20 cd=60 )
+  SpellAddBuff(enrage enrage=1)
+Define(execute 5308)
+Define(heroic_leap 6544)
+  SpellInfo(heroic_leap duration=1 cd=45 )
+  AddCheckBox(heroic_leap_check SpellName(heroic_leap))
+Define(heroic_strike 78)
+  SpellInfo(heroic_strike cd=1.5 )
+Define(heroic_throw 57755)
+  SpellInfo(heroic_throw cd=30 )
+Define(impending_victory 103840)
+  SpellInfo(impending_victory cd=30 )
+Define(mortal_strike 12294)
+  SpellInfo(mortal_strike duration=10 rage=-10 cd=6 )
+  SpellAddTargetDebuff(mortal_strike mortal_wounds=1)
+Define(overpower 7384)
+  SpellAddBuff(overpower taste_for_blood=-1)
+Define(raging_blow 85288)
+  SpellAddBuff(raging_blow raging_blow_aura=-1)
+Define(raging_blow_aura 131116)
+  SpellInfo(raging_blow_aura duration=12 )
+  SpellAddBuff(raging_blow_aura raging_blow_aura=1)
+Define(recklessness 1719)
+  SpellInfo(recklessness duration=12 cd=300 )
+  SpellAddBuff(recklessness recklessness=1)
+Define(shockwave 46968)
+  SpellInfo(shockwave cd=20 )
+  SpellAddBuff(shockwave shockwave=1)
+Define(slam 1464)
+Define(storm_bolt 107570)
+  SpellInfo(storm_bolt cd=30 )
+  SpellAddBuff(storm_bolt storm_bolt=1)
+Define(taste_for_blood 56638)
+Define(wild_strike 100130)
+  SpellAddBuff(wild_strike bloodsurge=-1)
+  SpellAddTargetDebuff(wild_strike wild_strike=1)
+Define(avatar_talent 16)
+Define(bladestorm_talent 10)
+Define(bloodbath_talent 17)
+Define(dragon_roar_talent 12)
+Define(impending_victory_talent 6)
+Define(shockwave_talent 11)
+Define(storm_bolt_talent 18)
+AddIcon mastery=1 help=main
 {
-	if List(shout command) and {Mana(less 20) or BuffExpires(stamina 3)} Spell(COMMANDINGSHOUT nored=1)
-    if List(shout battle) and {Mana(less 20) or BuffExpires(strengthagility 3)} Spell(BATTLESHOUT nored=1)
-	if TargetClassification(worldboss) and CheckBoxOn(demo) and TargetDebuffExpires(lowerphysicaldamage 2) Spell(DEMOSHOUT nored=1)
-	if TargetDebuffExpires(SUNDERARMORDEBUFF 3 stacks=2) and CheckBoxOn(sunder) and TargetDebuffExpires(lowerarmor 2 mine=0) Spell(SUNDERARMOR nored=1)
-
-	if CheckBoxOn(dancing)
+	if not InCombat()
 	{
-		#/stance,choose=berserker,if=buff.taste_for_blood.down&dot.rend.remains>0&rage<=75,use_off_gcd=1
-		if Stance(1) and BuffExpires(TASTEFORBLOOD 0) and {TargetDebuffPresent(RENDDEBUFF mine=1) or TargetDeadIn(less 15)} and Mana(less 76)
-			Spell(BERSERKERSTANCE)
-		#/stance,choose=battle,if=dot.rend.remains=0,use_off_gcd=1
-		if Stance(3) and TargetDebuffExpires(RENDDEBUFF 0 mine=1) and TargetDeadIn(more 15)
-			Spell(BATTLESTANCE)
+		unless Stance(1) Spell(battle_stance)
 	}
-
-	#/rend,if=!ticking
-	if TargetDebuffExpires(RENDDEBUFF mine=1) and TargetDeadIn(more 10) Spell(REND)
-	#/mortal_strike,if=target.health_pct>20
-	if TargetLifePercent(more 20) Spell(MORTALSTRIKE)
-	#/colossus_smash,if=buff.colossus_smash.down
-	if TargetDebuffExpires(COLOSSUSSMASH mine=1) Spell(COLOSSUSSMASH)
-	if TalentPoints(EXECUTIONERTALENT more 0)
-	{
-		#/execute,if=buff.executioner_talent.remains<1.5
-		if BuffExpires(EXECUTIONER 1.5) and TargetLifePercent(less 20) Spell(EXECUTE)
-	}
-
-	#/mortal_strike,if=target.health_pct<=20&(buff.colossus_smash.down|dot.rend.remains<3|buff.wrecking_crew.down|rage<=25|rage>=35)
-	if TargetLifePercent(less 20) and {TargetDebuffExpires(COLOSSUSSMASH mine=1) or
-		TargetDebuffExpires(REND 3 mine=1) or BuffExpires(ENRAGEWRECKINGCREW) or Mana(less 26) or Mana(more 34)}
-		Spell(MORTALSTRIKE)
-	#/execute,if=rage>90
-	if Mana(more 90) and TargetLifePercent(less 20) Spell(EXECUTE)
-
-	if CheckBoxOn(dancing)
-	{
-		#/stance,choose=battle,if=target.health_pct>20&(buff.taste_for_blood.up|buff.overpower.up)&rage<=75&cooldown.mortal_strike.remains>=1.5,use_off_gcd=1
-		if TargetLifePercent(more 20) and BuffPresent(TASTEFORBLOOD) and Mana(less 76) and {spell(MORTALSTRIKE) > 1.5}
-			Spell(BATTLESTANCE)
-	}
-	#/overpower,if=buff.taste_for_blood.up|buff.overpower.up
-	if BuffPresent(TASTEFORBLOOD) Spell(OVERPOWER)
-	#/overpower
-	Spell(OVERPOWER usable=1)
-	#/execute
-	if TargetLifePercent(less 20) Spell(EXECUTE)
-	#/colossus_smash,if=buff.colossus_smash.remains<=1.5
-	if TargetDebuffExpires(COLOSSUSSMASH 1.5 mine=1)
-		Spell(COLOSSUSSMASH)
-	#/slam,if=rage>=35|buff.battle_trance.up&buff.inner_rage.down
-	if Mana(more 34) or {BuffPresent(BATTLETRANCE) and BuffExpires(INNERRAGE)} Spell(SLAM)
-	#/battle_shout,if=rage<60
-	if Mana(less 60) Spell(BATTLESHOUT)
+	Spell(mortal_strike)
+	if target.DebuffRemains(colossus_smash) <=1.5 Spell(colossus_smash)
+	if target.HealthPercent(less 20) Spell(execute)
+	if TalentPoints(storm_bolt_talent) Spell(storm_bolt)
+	if BuffPresent(overpower) Spell(overpower usable=1)
+	if {Rage() >=70 or target.DebuffPresent(colossus_smash) } and target.HealthPercent() >=20 Spell(slam)
+	Spell(heroic_throw)
+	if Rage() <70 and not target.DebuffPresent(colossus_smash) Spell(battle_shout)
+	if target.HealthPercent() >=20 Spell(slam)
+	if TalentPoints(impending_victory_talent) and target.HealthPercent() >=20 Spell(impending_victory)
+	if Rage() <70 Spell(battle_shout)
 }
-
-AddIcon help=offgcd mastery=1
+AddIcon mastery=1 help=offgcd
 {
-	if target.IsInterruptible() Spell(PUMMEL)
-
-	#/heroic_leap,use_off_gcd=1,if=buff.colossus_smash.up
-	if CheckBoxOn(leap) and TargetDebuffPresent(COLOSSUSSMASH) Spell(HEROICLEAP)
-
-	#/berserker_rage,if=buff.deadly_calm.down&cooldown.deadly_calm.remains>1.5&rage<=95,use_off_gcd=1
-	if Glyph(GLYPHOFBERSERKERRAGE) and BuffExpires(DEADLYCALM) and {spell(DEADLYCALM)>1.5} and Mana(less 96) Spell(BERSERKERRAGE)
-	#/deadly_calm,use_off_gcd=1
-	Spell(DEADLYCALM)
-	#/inner_rage,if=buff.deadly_calm.down&cooldown.deadly_calm.remains>15,use_off_gcd=1
-	if BuffExpires(DEADLYCALM) and {spell(DEADLYCALM)>15} Spell(INNERRAGE)
-
-	#/heroic_strike,if=buff.deadly_calm.up,use_off_gcd=1
-	if BuffPresent(DEADLYCALM) Spell(HEROICSTRIKE)
-
-	if ArmorSetParts(T13 more 1)
-	{
-		#/heroic_strike,if=target.health_pct>20&rage>85,use_off_gcd=1";
-		if TargetLifePercent(more 20) and Mana(more 85) Spell(HEROICSTRIKE)
-		#/heroic_strike,if=rage>75&buff.inner_rage.up,use_off_gcd=1
-        if Mana(more 75) and BuffPresent(INNERRAGE) Spell(HEROICSTRIKE)
-		#/heroic_strike,if=buff.incite.up&(target.health_pct>20|(target.health_pct<=20&buff.battle_trance.up)),use_off_gcd=1";
-		if BuffPresent(INCITE) and {TargetLifePercent(more 20) or {TargetLifePercent(less 20) and BuffPresent(BATTLETRANCE)}}
-			Spell(HEROICSTRIKE)
-		#/heroic_strike,if=buff.inner_rage.up&target.health_pct>20&(rage>40|buff.battle_trance.up),use_off_gcd=1
-		if BuffPresent(INNERRAGE) and TargetLifePercent(more 20) and {Mana(more 40) or BuffPresent(BATTLETRANCE)}
-			Spell(HEROICSTRIKE)
-		#/heroic_strike,if=buff.inner_rage.up&target.health_pct<=20&(rage>=50|buff.battle_trance.up),use_off_gcd=1
-		if BuffPresent(INNERRAGE) and TargetLifePercent(less 20) and {Mana(more 49) or BuffPresent(BATTLETRANCE)}
-			Spell(HEROICSTRIKE)
-	}
-	if ArmorSetParts(T13 equal 0)
-	{
-		#/heroic_strike,if=target.health_pct>20&rage>95,use_off_gcd=1";
-		if TargetLifePercent(more 20) and Mana(more 95) Spell(HEROICSTRIKE)
-        #/heroic_strike,if=rage>85&buff.inner_rage.up,use_off_gcd=1";
-		if Mana(more 85) and BuffPresent(INNERRAGE) Spell(HEROICSTRIKE)
-        #/heroic_strike,if=buff.incite.up&(target.health_pct>20|(target.health_pct<=20&buff.battle_trance.up)),use_off_gcd=1";
-		if BuffPresent(INCITE) and {TargetLifePercent(more 20) or {TargetLifePercent(less 20) and BuffPresent(BATTLETRANCE)}}
-			Spell(HEROICSTRIKE)
-        #/heroic_strike,if=buff.inner_rage.up&target.health_pct>20&(rage>50|buff.battle_trance.up),use_off_gcd=1";
-		if BuffPresent(INNERRAGE) and TargetLifePercent(more 20) and {Mana(more 50) or BuffPresent(BATTLETRANCE)}
-			Spell(HEROICSTRIKE)
-        #/heroic_strike,if=buff.inner_rage.up&target.health_pct<=20&(rage>=60|buff.battle_trance.up),use_off_gcd=1";
-		if BuffPresent(INNERRAGE) and TargetLifePercent(less 20) and {Mana(more 59) or BuffPresent(BATTLETRANCE)}
-			Spell(HEROICSTRIKE)
-	}
+	if TalentPoints(bloodbath_talent) and {{{SpellCooldown(recklessness) >=10 or BuffPresent(recklessness) } or {target.HealthPercent() >=20 and {target.DeadIn() <=165 or {target.DeadIn() <=315 and not ArmorSetParts(T14 more 4) } } and target.DeadIn() >75 } } or target.DeadIn() <=19 } Spell(bloodbath)
+	if not BuffPresent(enrage) Spell(berserker_rage)
+	if target.DebuffPresent(colossus_smash) if CheckBoxOn(heroic_leap_check) Spell(heroic_leap)
+	if Rage() >=40 Spell(deadly_calm)
+	if {{BuffPresent(taste_for_blood) and BuffRemains(taste_for_blood) <=2 } or {BuffStacks(taste_for_blood) ==5 and BuffPresent(overpower) } or {BuffPresent(taste_for_blood) and target.DebuffRemains(colossus_smash) <=2 and not SpellCooldown(colossus_smash) ==0 } or BuffPresent(deadly_calm) or Rage() >110 } and target.HealthPercent() >=20 Spell(heroic_strike)
 }
-
-AddIcon help=aoe mastery=1 checkboxon=aoe
+AddIcon mastery=1 help=aoe
 {
-	#/sweeping_strikes,if=target.adds>0
-	Spell(SWEEPINGSTRIKES)
-	#/bladestorm,if=target.adds>0&!buff.deadly_calm.up&!buff.sweeping_strikes.up
-	if BuffExpires(SWEEPINGSTRIKES) and BuffExpires(DEADLYCALM) Spell(BLADESTORM)
-	if Stance(3) Spell(WHIRLWIND)
-	Spell(CLEAVE)
-	if Stance(1) Spell(THUNDERCLAP)
+	if TalentPoints(shockwave_talent) Spell(shockwave)
+	if TalentPoints(dragon_roar_talent) Spell(dragon_roar)
+	if TalentPoints(bladestorm_talent) and SpellCooldown(colossus_smash) >=5 and not target.DebuffPresent(colossus_smash) and SpellCooldown(bloodthirst) >=2 and target.HealthPercent() >=20 Spell(bladestorm)
 }
-
-AddIcon help=cd mastery=1
+AddIcon mastery=1 help=cd
 {
-	#/recklessness,if=target.health_pct>90|target.health_pct<=20,use_off_gcd=1
-	if {TargetLifePercent(more 20) and TargetDeadIn(more 320)} or TargetLifePercent(less 20)
-	{
-		#/recklessness,if=((target.health_pct>20&target.time_to_die>320)|target.health_pct<=20)
-		Spell(RECKLESSNESS)
-	}
-    Item(Trinket0Slot usable=1)
-	Item(Trinket1Slot usable=1)
+	if {{target.DebuffRemains(colossus_smash) >=5 or SpellCooldown(colossus_smash) <=4 } and {{not TalentPoints(avatar_talent) or not ArmorSetParts(T14 more 4) } and {{target.HealthPercent() <20 or target.DeadIn() >315 or {target.DeadIn() >165 and ArmorSetParts(T14 more 4) } } } or {TalentPoints(avatar_talent) and ArmorSetParts(T14 more 4) and BuffPresent(avatar) } } } or target.DeadIn() <=18 Spell(recklessness)
+	if TalentPoints(avatar_talent) and {{{SpellCooldown(recklessness) >=180 or BuffPresent(recklessness) } or {target.HealthPercent() >=20 and target.DeadIn() >195 } or {target.HealthPercent() <20 and ArmorSetParts(T14 more 4) } } or target.DeadIn() <=20 } Spell(avatar)
 }
-
-AddIcon help=main mastery=2
+AddIcon mastery=2 help=main
 {
-	if List(shout command) and {Mana(less 20) or BuffExpires(stamina 3)} Spell(COMMANDINGSHOUT nored=1)
-    if List(shout battle) and {Mana(less 20) or BuffExpires(strengthagility 3)} Spell(BATTLESHOUT nored=1)
-	if TargetClassification(worldboss) and CheckBoxOn(demo) and TargetDebuffExpires(lowerphysicaldamage 2) Spell(DEMOSHOUT nored=1)
-	if TargetDebuffExpires(SUNDERARMORDEBUFF 3 stacks=2) and CheckBoxOn(sunder) and TargetDebuffExpires(lowerarmor 2 mine=0) Spell(SUNDERARMOR nored=1)
-
-	#/execute,if=buff.executioner_talent.remains<1.5
-	if BuffExpires(EXECUTIONER 1.5) and TargetLifePercent(less 20) Spell(EXECUTE)
-	#/colossus_smash
-	Spell(COLOSSUSSMASH)
-
-	#/execute,if=buff.executioner_talent.stack<5
-	if BuffExpires(EXECUTIONER 0 stacks=5) and TargetLifePercent(less 20) Spell(EXECUTE)
-	#/bloodthirst
-	Spell(BLOODTHIRST)
-	if TalentPoints(TITANSGRIPTALENT more 0)
-	{
-		#/berserker_rage,if=!(buff.death_wish.up|buff.enrage.up|buff.unholy_frenzy.up)&rage>15&cooldown.raging_blow.remains<1
-		if BuffExpires(enrage 0) and Mana(more 15) and
-			1s before Spell(RAGINGBLOW) Spell(BERSERKERRAGE)
-		#/raging_blow
-		if BuffPresent(enrage)
-			Spell(RAGINGBLOW)
-	}
-	#/slam,if=buff.bloodsurge.react
-	if BuffPresent(BLOODSURGE) Spell(SLAM)
-	#/execute,if=rage>=50
-	if Mana(more 49) and TargetLifePercent(less 20) Spell(EXECUTE)
-	if TalentPoints(TITANSGRIPTALENT less 1)
+	if not InCombat()
 	{
-		#/berserker_rage,if=!(buff.death_wish.up|buff.enrage.up|buff.unholy_frenzy.up)&rage>15&cooldown.raging_blow.remains<1
-		if BuffExpires(enrage 0) and Mana(more 15) and
-			1s before Spell(RAGINGBLOW) Spell(BERSERKERRAGE)
-		#/raging_blow
-		if BuffPresent(enrage)
-			Spell(RAGINGBLOW)
+		unless Stance(1) Spell(battle_stance)
 	}
-
-	if BuffPresent(VICTORIOUS) Spell(VICTORYRUSH)
-	#/battle_shout,if=rage<70
-	if Mana(less 70) Spell(BATTLESHOUT priority=2)
+	if not {target.HealthPercent() <20 and target.DebuffPresent(colossus_smash) and Rage() >=30 } Spell(bloodthirst)
+	if BuffPresent(bloodsurge) and target.HealthPercent() >=20 and SpellCooldown(bloodthirst) <=1 Spell(wild_strike)
+	if not {target.HealthPercent() <20 and target.DebuffPresent(colossus_smash) and Rage() >=30 } and SpellCooldown(bloodthirst) <=1 Texture(Spell_nature_timestop)
+	Spell(colossus_smash)
+	if target.HealthPercent(less 20) Spell(execute)
+	if TalentPoints(storm_bolt_talent) Spell(storm_bolt)
+	if BuffPresent(raging_blow_aura) Spell(raging_blow)
+	if BuffPresent(bloodsurge) and target.HealthPercent() >=20 Spell(wild_strike)
+	Spell(heroic_throw)
+	if Rage() <70 and not target.DebuffPresent(colossus_smash) Spell(battle_shout)
+	if target.DebuffPresent(colossus_smash) and target.HealthPercent() >=20 Spell(wild_strike)
+	if TalentPoints(impending_victory_talent) and target.HealthPercent() >=20 Spell(impending_victory)
+	if SpellCooldown(colossus_smash) >=1 and Rage() >=60 and target.HealthPercent() >=20 Spell(wild_strike)
+	if Rage() <70 Spell(battle_shout)
 }
-
-AddIcon help=offgcd mastery=2
+AddIcon mastery=2 help=offgcd
 {
-	if target.IsInterruptible() Spell(PUMMEL)
-	#/heroic_leap,use_off_gcd=1,if=buff.colossus_smash.up
-	if CheckBoxOn(leap) and TargetDebuffPresent(COLOSSUSSMASH) Spell(HEROICLEAP)
-	#/heroic_strike,if=((rage>=85&target.health_pct>=20)|buff.battle_trance.up|((buff.incite.up|buff.colossus_smash.up)&((rage>=50&target.health_pct>=20)|(rage>=75&target.health_pct<20))))
-	if {Mana(more 84) and TargetLifePercent(more 20)} or BuffPresent(BATTLETRANCE) or
-			{{BuffPresent(INCITE) or TargetDebuffPresent(COLOSSUSSMASH mine=1)} and {{Mana(more 49) and TargetLifePercent(more 20)} or {Mana(more 74) and TargetLifePercent(less 20)}}}
-		Spell(HEROICSTRIKE)
+	if TalentPoints(bloodbath_talent) and {{{SpellCooldown(recklessness) >=10 or BuffPresent(recklessness) } or {target.HealthPercent() >=20 and {target.DeadIn() <=165 or {target.DeadIn() <=315 and not ArmorSetParts(T14 more 4) } } and target.DeadIn() >75 } } or target.DeadIn() <=19 } Spell(bloodbath)
+	if not {BuffPresent(enrage) or {BuffPresent(raging_blow_aura) ==2 and target.HealthPercent() >=20 } } Spell(berserker_rage)
+	if target.DebuffPresent(colossus_smash) if CheckBoxOn(heroic_leap_check) Spell(heroic_leap)
+	if Rage() >=40 Spell(deadly_calm)
+	if {{{target.DebuffPresent(colossus_smash) and Rage() >=40 } or {BuffPresent(deadly_calm) and Rage() >=30 } } and target.HealthPercent() >=20 } or Rage() >=110 Spell(heroic_strike)
 }
-
-AddIcon help=aoe mastery=2 checkboxon=aoe
+AddIcon mastery=2 help=aoe
 {
-	#/whirlwind,if=target.adds>0
-	Spell(WHIRLWIND)
-	#/cleave,if=target.adds>0
-	Spell(CLEAVE)
+	if TalentPoints(shockwave_talent) Spell(shockwave)
+	if TalentPoints(dragon_roar_talent) Spell(dragon_roar)
+	if TalentPoints(bladestorm_talent) and SpellCooldown(colossus_smash) >=5 and not target.DebuffPresent(colossus_smash) and SpellCooldown(bloodthirst) >=2 and target.HealthPercent() >=20 Spell(bladestorm)
 }
-
-AddIcon help=cd mastery=2
+AddIcon mastery=2 help=cd
 {
-	#/recklessness
-	Spell(RECKLESSNESS)
-	#/death_wish
-	Spell(DEATHWISH)
-    Item(Trinket0Slot usable=1)
-	Item(Trinket1Slot usable=1)
-}
-
-# Protection warrior rotation from EJ for 4.2:
-# http://elitistjerks.com/f81/t110315-cataclysm_protection_warrior/#post1813079
-AddIcon help=main mastery=3
-{
-	if Stance(3) Spell(DEFENSIVESTANCE)
-	if List(shout command) and {Mana(less 20) or BuffExpires(stamina 3)} Spell(COMMANDINGSHOUT nored=1)
-	if List(shout battle) and {Mana(less 20) or BuffExpires(strengthagility 3)} Spell(BATTLESHOUT nored=1)
-
-	if LifePercent(less 75) and BuffPresent(VICTORIOUS) Spell(VICTORYRUSH usable=1)
-
-	if CheckBoxOn(sunder) and TargetDebuffExpires(SUNDERARMORDEBUFF 3 stacks=3) and TargetDebuffExpires(lowerarmor 2 mine=0) Spell(DEVASTATE)
-
-	if 1s before Spell(SHIELDSLAM) Spell(SHIELDSLAM usable=1)
-
-	if CheckBoxOn(demo) and TargetDebuffExpires(lowerphysicaldamage 4) Spell(DEMOSHOUT)
-	if TargetDebuffExpires(meleeslow 2) Spell(THUNDERCLAP)
-
-	Spell(VICTORYRUSH usable=1)
-	Spell(REVENGE usable=1)
-
-	# A single Rend application is only worth using on a 30%-bleed debuffed single target if it ticks at
-	# least four times. Unbuffed, it must tick all six times. Never refresh an existing Rend -- always
-	# wait for it to run its full duration or else you lose the initial application tick.
-	#
-	unless TargetDebuffPresent(RENDDEBUFF mine=1) {
-		if TargetDebuffPresent(bleed) and TargetDeadIn(more 9) or TargetDeadIn(more 15) {
-			Spell(REND)
-		}
-	}
-	Spell(DEVASTATE)
-}
-
-AddIcon help=offgcd mastery=3
-{
-	if target.IsInterruptible() Spell(PUMMEL)
-	if Mana(more 44) Spell(HEROICSTRIKE)
-	if Mana(more 80) Spell(INNERRAGE)
-}
-
-AddIcon help=aoe mastery=3 checkboxon=aoe
-{
-	if TargetDebuffExpires(RENDDEBUFF mine=1) Spell(REND)
-	Spell(THUNDERCLAP)
-	Spell(SHOCKWAVE)
-	Spell(CLEAVE)
-}
-
-AddIcon help=cd mastery=3
-{
-	if Stance(2)
-	{
-		Spell(SHIELDBLOCK usable=1)
-		Spell(SHIELDWALL usable=1)
-		Spell(LASTSTAND)
-	}
-	if Stance(1) Spell(RECKLESSNESS)
-    Item(Trinket0Slot usable=1)
-	Item(Trinket1Slot usable=1)
+	if {{target.DebuffRemains(colossus_smash) >=5 or SpellCooldown(colossus_smash) <=4 } and {{not TalentPoints(avatar_talent) or not ArmorSetParts(T14 more 4) } and {{target.HealthPercent() <20 or target.DeadIn() >315 or {target.DeadIn() >165 and ArmorSetParts(T14 more 4) } } } or {TalentPoints(avatar_talent) and ArmorSetParts(T14 more 4) and BuffPresent(avatar) } } } or target.DeadIn() <=18 Spell(recklessness)
+	if TalentPoints(avatar_talent) and {{{SpellCooldown(recklessness) >=180 or BuffPresent(recklessness) } or {target.HealthPercent() >=20 and target.DeadIn() >195 } or {target.HealthPercent() <20 and ArmorSetParts(T14 more 4) } } or target.DeadIn() <=20 } Spell(avatar)
 }
-
-
-]]
+]]
\ No newline at end of file
diff --git a/defaut/Mage.lua b/defaut/Mage.lua
index 6a79e39..f0bad6b 100644
--- a/defaut/Mage.lua
+++ b/defaut/Mage.lua
@@ -1,252 +1,240 @@
-Ovale.defaut["MAGE"]=
-[[
-#Contributed by Hinalover
-#Spells
-Define(ARCANEBARRAGE 44425) #arcane instant
-	SpellInfo(ARCANEBARRAGE cd=4)
-    SpellAddDebuff(ARCANEBARRAGE ARCANEBLASTDEBUFF=0)
-Define(ARCANEBLAST 30451) #arcane stacks*4 cost increased
-    SpellAddDebuff(ARCANEBLAST ARCANEBLASTDEBUFF=10)
-Define(ARCANEMISSILES 5143) #arcane channel
-    SpellAddDebuff(ARCANEMISSILES ARCANEBLASTDEBUFF=0 ARCANEMISSILEBUFF=0)
-Define(ARCANEPOWER 12042) #arcane cd
-    SpellInfo(ARCANEPOWER cd=84)
-	SpellAddBuff(ARCANEPOWER ARCANEPOWER=15)
-Define(COLDSNAP 11958) #frost reset cd
-    SpellInfo(COLDSNAP cd=384)
-Define(COMBUSTION 11129) #fire cd consume dot
-    SpellInfo(COMBUSTION cd=120)
-Define(CONJUREMANAGEM 759)
-	SpellInfo(CONJUREMANAGEM cd=10) #fake
-Define(COUNTERSPELL 2139)
-    SpellInfo(COUNTERSPELL cd=24)
-Define(DEEPFREEZE 44572) #frost instant
-	SpellInfo(DEEPFREEZE cd=30)
-    SpellAddBuff(DEEPFREEZE FINGERSOFFROST=-1)
-Define(EVOCATION 12051)
-    SpellInfo(EVOCATION cd=240)
-Define(FIREBLAST 2136) #fire instant
-	SpellInfo(FIREBLAST cd=8)
-Define(FIREBALL 133) #fire 2.5
-Define(FLAMEORB 82731)
-    SpellInfo(FLAMEORB cd=60)
-Define(FROSTBOLT 116) #frost
-Define(FROSTFIREBOLT 44614) #frost+fire
-	SpellAddTargetDebuff(FROSTFIREBOLT FROSTFIREBOLT=9)
-    SpellAddBuff(FROSTFIREBOLT BRAINFREEZE=-1 FINGERSOFFROST=-1)
-Define(ICEARMOR 7302)
-	SpellAddBuff(ICEARMOR ICEARMOR=1800)
-Define(ICELANCE 30455) #frost instant
-    SpellAddBuff(ICELANCE FINGERSOFFROST=-1)
-Define(ICYVEINS 12472) #frost cd
-    SpellInfo(ICYVEINS cd=144)
-Define(LIVINGBOMB 44457) #fire dot
-    SpellAddTargetDebuff(LIVINGBOMB LIVINGBOMB=12)
-Define(MAGEARMOR 6117)
-	SpellAddBuff(MAGEARMOR MAGEARMOR=1800)
-Define(MIRRORIMAGE 55342)
-    SpellInfo(MIRRORIMAGE cd=180)
-Define(MOLTENARMOR 30482)
-	SpellAddBuff(MOLTENARMOR MOLTENARMOR=1800)
-Define(PYROBLAST 11366) #fire dot
-    SpellAddTargetDebuff(PYROBLAST PYROBLAST=12)
-    SpellAddBuff(PYROBLAST HOTSTREAK=0)
-Define(PYROBLASTBANG 92315)
-	SpellAddTargetDebuff(PYROBLASTBANG PYROBLASTBANG=12)
-	SpellAddBuff(PYROBLASTBANG HOTSTREAK=0)
-Define(SCORCH 2948) #fire 1.5 (cast while moving with firestarter talent)
-Define(SPELLSTEAL 30449)
-Define(SUMMONWATERELEMENTAL 31687) #frost pet
-    SpellInfo(SUMMONWATERELEMENTAL cd=180)
-
-Define(PETFREEZE 33395) #Frost pet freeze ability
-    SpellInfo(PETFREEZE cd=25)
-	SpellAddBuff(PETFREEZE FINGERSOFFROST=2)
-
-#Buff
-Define(BRAINFREEZE 57761) #frost (instant fireball/frostfire bolt)
-Define(FINGERSOFFROST 44544) #frost boost ice lance/deep freeze
-	SpellInfo(FINGERSOFFROST duration=14)
-Define(HOTSTREAK 48108) #fire instant pyroblast
-Define(ARCANEBLASTDEBUFF 36032)
-Define(ARCANEMISSILEBUFF 79683)
-Define(PRESENCEOFMIND 12043) #arcane next spell instant
-Define(CLEARCASTING 12536)
-
-#Item
-Define(MANAGEMITEM 36799)
-Define(VOLCANICPOTION 58091)
-
-#Debuff
-Define(IGNITE 12654)
-Define(CRITICALMASS 22959)
-Define(SHADOWANDFLAME 17800)
-
-#Talent
-Define(FIRESTARTERTALENT 11431)
-Define(CRITICALMASSTALENT 10541)
-Define(IMPROVEDSCORCH 10547)
-
-#Glyphs
-Define(GLYPHOFFROSTFIRE 61205)
-Define(GLYPHOFFROSTBOLT 56370)
-
-ScoreSpells(SCORCH PYROBLAST LIVINGBOMB FROSTFIREBOLT FIREBALL SUMMONWATERELEMENTAL PETFREEZE FROSTBOLT ARCANEBLAST ARCANEMISSILES ARCANEBARRAGE
-            DEEPFREEZE ICELANCE)
-
-AddIcon help=main mastery=1
+Ovale.defaut["MAGE"] = [[Define(alter_time 110909)
+  SpellInfo(alter_time duration=6 )
+  SpellAddBuff(alter_time alter_time=1)
+Define(alter_time_activate 108978)
+  SpellInfo(alter_time_activate duration=10 cd=180 )
+Define(arcane_barrage 44425)
+  SpellInfo(arcane_barrage cd=3 )
+Define(arcane_blast 30451)
+Define(arcane_brilliance 1459)
+  SpellInfo(arcane_brilliance duration=3600 )
+  SpellAddBuff(arcane_brilliance arcane_brilliance=1)
+Define(arcane_charge 36032)
+  SpellInfo(arcane_charge duration=10 )
+  SpellAddBuff(arcane_charge arcane_charge=1)
+Define(arcane_missiles 7268)
+Define(arcane_missiles_aura 79683)
+  SpellInfo(arcane_missiles_aura duration=20 )
+  SpellAddBuff(arcane_missiles_aura arcane_missiles_aura=1)
+Define(arcane_power 12042)
+  SpellInfo(arcane_power duration=15 cd=90 )
+  SpellAddBuff(arcane_power arcane_power=1)
+Define(berserking 26297)
+  SpellInfo(berserking duration=10 cd=180 )
+  SpellAddBuff(berserking berserking=1)
+Define(blood_fury 20572)
+  SpellInfo(blood_fury duration=15 cd=120 )
+  SpellAddBuff(blood_fury blood_fury=1)
+Define(brain_freeze 44549)
+Define(cold_snap 11958)
+  SpellInfo(cold_snap cd=180 )
+Define(combustion 11129)
+  SpellInfo(combustion cd=45 )
+Define(conjure_mana_gem 759)
+Define(counterspell 2139)
+  SpellInfo(counterspell duration=6 cd=24 )
+Define(evocation 12051)
+  SpellInfo(evocation duration=6 cd=120 )
+  SpellAddBuff(evocation evocation=1)
+Define(fingers_of_frost_aura 44544)
+  SpellInfo(fingers_of_frost_aura duration=15 )
+  SpellAddBuff(fingers_of_frost_aura fingers_of_frost_aura=1)
+Define(fire_blast 2136)
+  SpellInfo(fire_blast cd=8 )
+Define(fireball 133)
+Define(frost_armor 7302)
+  SpellAddBuff(frost_armor frost_armor=1)
+Define(frost_bomb 113092)
+  SpellInfo(frost_bomb duration=2 )
+  SpellAddBuff(frost_bomb frost_bomb=1)
+Define(frostbolt 116)
+  SpellInfo(frostbolt duration=15 )
+  SpellAddBuff(frostbolt frostbolt=1)
+Define(frostfire_bolt 44614)
+  SpellInfo(frostfire_bolt duration=8 )
+  SpellAddBuff(frostfire_bolt frostfire_bolt=1)
+Define(frozen_orb 84714)
+  SpellInfo(frozen_orb duration=10 cd=60 )
+Define(heating_up 48107)
+  SpellInfo(heating_up duration=10 )
+  SpellAddBuff(heating_up heating_up=1)
+Define(ice_lance 30455)
+Define(icy_veins 12472)
+  SpellInfo(icy_veins duration=20 cd=180 )
+  SpellAddBuff(icy_veins icy_veins=1)
+Define(ignite 12654)
+  SpellInfo(ignite duration=4 tick=2 )
+  SpellAddTargetDebuff(ignite ignite=1)
+Define(inferno_blast 108853)
+  SpellInfo(inferno_blast cd=8 )
+Define(invocation 114003)
+Define(mage_armor 6117)
+  SpellAddBuff(mage_armor mage_armor=1)
+Define(mana_gem 56597)
+Define(mirror_image 55342)
+  SpellInfo(mirror_image duration=30 cd=180 )
+  SpellAddBuff(mirror_image mirror_image=1)
+Define(molten_armor 30482)
+  SpellAddBuff(molten_armor molten_armor=1)
+Define(nether_tempest 114923)
+  SpellInfo(nether_tempest duration=12 tick=1 )
+  SpellAddTargetDebuff(nether_tempest nether_tempest=1)
+Define(presence_of_mind 12043)
+  SpellInfo(presence_of_mind cd=90 )
+  SpellAddBuff(presence_of_mind presence_of_mind=1)
+Define(pyroblast 11366)
+  SpellInfo(pyroblast duration=18 tick=3 )
+  SpellAddTargetDebuff(pyroblast pyroblast=1)
+Define(pyroblast_aura 48108)
+  SpellInfo(pyroblast_aura duration=15 )
+  SpellAddBuff(pyroblast_aura pyroblast_aura=1)
+Define(rune_of_power 116011)
+  SpellInfo(rune_of_power duration=60 cd=6 )
+Define(time_warp 35346)
+  SpellInfo(time_warp duration=6 cd=15 )
+  SpellAddBuff(time_warp time_warp=1)
+Define(water_elemental 63859)
+Define(water_elemental_freeze 33395)
+  SpellInfo(water_elemental_freeze duration=8 cd=25 )
+  SpellAddBuff(water_elemental_freeze water_elemental_freeze=1)
+AddIcon mastery=1 help=main
 {
-    unless InCombat() if BuffExpires(MAGEARMOR 400) and BuffExpires(MOLTENARMOR 400) and BuffExpires(ICEARMOR 400) Spell(MAGEARMOR)
-
-	#/arcane_blast,if=target.time_to_die<40&mana_pct>5
-	if TargetDeadIn(less 40) and ManaPercent(more 5) Spell(ARCANEBLAST)
-	#/arcane_blast,if=cooldown.evocation.remains<30&mana_pct>26
-	if {spell(EVOCATION)<30} and ManaPercent(more 26) Spell(ARCANEBLAST)
-	#/evocation,if=target.time_to_die>=31
-	if TargetDeadIn(more 31) Spell(EVOCATION)
-	#/sequence,name=conserve:arcane_blast:arcane_blast:arcane_blast:arcane_blast,if=!buff.bloodlust.up
-	unless DebuffPresent(ARCANEBLASTDEBUFF stacks=4) or BuffPresent(heroism) or ManaPercent(less 26)
-		Spell(ARCANEBLAST)
-	if BuffPresent(ARCANEMISSILEBUFF) Spell(ARCANEMISSILES)
-    #/arcane_barrage,if=buff.arcane_blast.stack>0; // when AM hasn't procced
-	Spell(ARCANEBARRAGE)
-    if Speed(more 0)
+	if not InCombat()
 	{
-		Spell(ARCANEBARRAGE)
-		Spell(FIREBLAST)
-		Spell(ICELANCE)
+		Spell(arcane_brilliance)
+		Spell(mage_armor)
+		Spell(rune_of_power)
 	}
-	Spell(ARCANEBLAST)
+	if ItemCharges(36799) <3 and False() Spell(conjure_mana_gem)
+	if BuffPresent(alter_time) and BuffPresent(presence_of_mind) Spell(arcane_blast)
+	if not target.DebuffPresent(nether_tempest) Spell(nether_tempest)
+	if BuffExpires(rune_of_power) and BuffExpires(alter_time) Spell(rune_of_power)
+	if not target.DebuffPresent(nether_tempest) Spell(nether_tempest)
+	if ManaPercent() >92 Spell(arcane_blast)
+	if BuffPresent(arcane_charge) and BuffExpires(arcane_power) and BuffExpires(alter_time) and target.DeadIn() >25 and {ManaPercent() <92 or SpellCooldown(mana_gem) >10 or ItemCharges(36799) ==0 } Spell(arcane_barrage)
+	if BuffStacks(arcane_charge) ==6 and BuffExpires(arcane_missiles_aura) and target.DeadIn() >25 Spell(arcane_barrage)
+	Spell(arcane_blast)
 }
-
-AddIcon help=cd mastery=1
+AddIcon mastery=1 help=offgcd
 {
-    if TargetBuffStealable(yes) Spell(SPELLSTEAL)
-    if TargetIsInterruptible(yes) Spell(COUNTERSPELL)
-
-	#/conjure_mana_gem,if=cooldown.evocation.remains<44&target.time_to_die>20&mana_gem_charges=0
-	if ItemCount(MANAGEMITEM less 1 charges=1) and {spell(EVOCATION)<44} and TargetDeadIn(more 20)
-		Spell(CONJUREMANAGEM)
-	#if=(cooldown.evocation.remains<30&buff.arcane_blast.stack=4)|cooldown.evocation.remains>90|target.time_to_die<40
-	if {{spell(EVOCATION)<30} and DebuffPresent(ARCANEBLASTDEBUFF stacks=4)} or {spell(EVOCATION)>90} or TargetDeadIn(less 40)
-	{
-		Item(Trinket0Slot usable=1)
-		Item(Trinket1Slot usable=1)
-		#if ItemCount(VOLCANICPOTION more 0) Item(VOLCANICPOTION)
-	}
-
-	if {{spell(EVOCATION)<30} and DebuffPresent(ARCANEBLASTDEBUFF stacks=4)} or TargetDeadIn(less 40)
+	if target.IsInterruptible() if target.IsInterruptible() Spell(counterspell)
+	if target.HealthPercent() <25 or TimeInCombat() >5 Spell(time_warp)
+	if BuffExpires(alter_time) and BuffPresent(arcane_power) and BuffStacks(arcane_missiles_aura) ==2 and BuffStacks(arcane_charge) >3 and BuffRemains(rune_of_power) >6 Spell(alter_time)
+	if BuffPresent(alter_time) or BuffStacks(arcane_missiles_aura) ==2 Spell(arcane_missiles)
+	if ManaPercent() <84 and BuffExpires(alter_time) Spell(mana_gem)
+	if BuffPresent(arcane_missiles_aura) and {SpellCooldown(alter_time_activate) >4 or target.DeadIn() <10 } Spell(arcane_missiles)
+}
+AddIcon mastery=1 help=moving
+{
+	Spell(arcane_barrage)
+	Spell(fire_blast)
+	Spell(ice_lance)
+}
+AddIcon mastery=1 help=cd
+{
+	if target.DeadIn() <18 Spell(arcane_power)
+	if target.DeadIn() <18 Spell(berserking)
+	Spell(mirror_image)
+	if BuffRemains(rune_of_power) >15 and BuffExpires(alter_time) and BuffStacks(arcane_charge) >1 Spell(arcane_power)
+	if BuffRemains(rune_of_power) >10 and BuffExpires(alter_time) and BuffStacks(arcane_charge) >2 Spell(berserking)
+	if BuffExpires(alter_time) Spell(presence_of_mind)
+}
+AddIcon mastery=2 help=main
+{
+	if not InCombat()
 	{
-		#action_list_str += "/arcane_power,if=(cooldown.evocation.remains<30&buff.arcane_blast.stack=4)|target.time_to_die<40";
-		Spell(ARCANEPOWER)
-		#action_list_str += "/mana_gem,if=(cooldown.evocation.remains<30&buff.arcane_blast.stack=4)|target.time_to_die<40";
-		if ManaPercent(less 85) Item(MANAGEMITEM)
+		Spell(arcane_brilliance)
+		Spell(molten_armor)
 	}
-
-	if ManaPercent(less 10) Item(MANAGEMITEM)
-
-    #action_list_str += "/mirror_image,if=buff.arcane_power.up|(cooldown.arcane_power.remains>20&target.time_to_die>15)";
-    if BuffPresent(ARCANEPOWER) or {{spell(ARCANEPOWER)>0} and TargetDeadIn(more 15)} Spell(MIRRORIMAGE)
-	#/flame_orb,if=target.time_to_die>=10
-    if TargetDeadIn(more 10) Spell(FLAMEORB)
-	#/presence_of_mind,arcane_blast
-    Spell(PRESENCEOFMIND)
+	if ItemCharges(36799) <3 and False() Spell(conjure_mana_gem)
+	if BuffPresent(pyroblast_aura) and {SpellCooldown(alter_time_activate) >4 or BuffPresent(heating_up) } Spell(pyroblast)
+	if BuffPresent(presence_of_mind) and SpellCooldown(alter_time_activate) >4 Spell(pyroblast)
+	if BuffPresent(heating_up) and BuffExpires(pyroblast_aura) Spell(inferno_blast)
+	if not target.DebuffPresent(nether_tempest) Spell(nether_tempest)
+	Spell(fireball)
+}
+AddIcon mastery=2 help=offgcd
+{
+	if target.IsInterruptible() if target.IsInterruptible() Spell(counterspell)
+	if target.HealthPercent() <25 or TimeInCombat() >5 Spell(time_warp)
+	if target.DeadIn() <12 Spell(combustion)
+	if ArmorSetParts(T14 more 4) and target.DebuffPresent(ignite) and target.DebuffPresent(pyroblast_aura) Spell(combustion)
+	if not ArmorSetParts(T14 more 4) and LastSpellDamage(ignite) >=12000 and target.DebuffPresent(pyroblast_aura) Spell(combustion)
+	if ManaPercent() <84 and BuffExpires(alter_time) Spell(mana_gem)
+	if BuffExpires(alter_time) and BuffPresent(pyroblast_aura) and BuffRemains(invocation) >6 Spell(alter_time)
 }
-
-AddIcon help=main mastery=2
+AddIcon mastery=2 help=moving
 {
-    unless InCombat() if BuffExpires(MAGEARMOR 400) and BuffExpires(MOLTENARMOR 400) and BuffExpires(ICEARMOR 400) Spell(MOLTENARMOR)
-	#/scorch,debuff=1
-    if TalentPoints(CRITICALMASSTALENT more 0) and TargetDebuffExpires(magicalcrittaken 0) Spell(SCORCH)
-	#/combustion,if=dot.living_bomb.ticking&dot.ignite.ticking&dot.pyroblast.ticking
-    if TargetDebuffPresent(LIVINGBOMB mine=1) and TargetDebuffPresent(IGNITE mine=1) and
-		{TargetDebuffPresent(PYROBLAST mine=1) or TargetDebuffPresent(PYROBLASTBANG mine=1)}
-        Spell(COMBUSTION)
-	#/living_bomb,if=!ticking
-    if TargetDebuffExpires(LIVINGBOMB 0 mine=1) and TargetDeadIn(more 12) Spell(LIVINGBOMB)
-	#/pyroblast_hs,if=buff.hot_streak.react
-    if BuffPresent(HOTSTREAK) Spell(PYROBLAST)
-	#/mage_armor,if=mana_pct<5
-	if BuffExpires(MAGEARMOR 0) and ManaPercent(less 5) Spell(MAGEARMOR)
-    if TalentPoints(FIRESTARTERTALENT more 0) and Speed(more 0) Spell(SCORCH)
-	#/frostfire_bolt
-    if Glyph(GLYPHOFFROSTFIRE) Spell(FROSTFIREBOLT usable=1)
-	#/fireball
-	Spell(FIREBALL usable=1)
-    Spell(SCORCH)
+	Spell(inferno_blast)
+	Spell(ice_lance)
 }
-
-AddIcon help=cd mastery=2
+AddIcon mastery=2 help=cd
 {
-	if TargetBuffStealable(yes) Spell(SPELLSTEAL)
-    if TargetIsInterruptible(yes) Spell(COUNTERSPELL)
-
-	#if BuffPresent(heroism) or TargetDeadIn(less 40) Item(VOLCANICPOTION)
-    #/mana_gem,if=mana_deficit>12500
-    if ManaPercent(less 85) Item(MANAGEMITEM)
-	#/mirror_image,if=target.time_to_die>=25
-	if TargetDeadIn(more 24) Spell(MIRRORIMAGE)
-    #/flame_orb,if=target.time_to_die>=12
-    if TargetDeadIn(more 11) Spell(FLAMEORB)
-    Item(Trinket0Slot usable=1)
-    Item(Trinket1Slot usable=1)
+	if not InCombat()
+	{
+		Spell(evocation)
+	}
+	if BuffRemains(invocation) >10 and BuffExpires(alter_time) and ManaPercent() >28 Spell(berserking)
+	if BuffExpires(invocation) and BuffExpires(alter_time) Spell(evocation)
+	if target.DeadIn() <18 Spell(berserking)
+	if ManaPercent() <10 and target.DeadIn() >=30 Spell(evocation)
+	Spell(mirror_image)
+	if BuffExpires(alter_time) Spell(presence_of_mind)
+}
+AddIcon mastery=3 help=main
+{
+	if not InCombat()
+	{
+		Spell(arcane_brilliance)
+		Spell(frost_armor)
+	}
+	if ItemCharges(36799) <3 and False() Spell(conjure_mana_gem)
+	if BuffPresent(alter_time) and BuffPresent(brain_freeze) Spell(frostfire_bolt)
+	if BuffPresent(alter_time) and BuffPresent(fingers_of_frost_aura) Spell(ice_lance)
+	if BuffPresent(alter_time) and BuffPresent(presence_of_mind) Spell(frostbolt)
+	if BuffPresent(fingers_of_frost_aura) and BuffRemains(fingers_of_frost_aura) <5 Spell(ice_lance)
+	if target.DeadIn() >=4 and BuffStacks(fingers_of_frost_aura) <2 and SpellCooldown(icy_veins) <GCD() and BuffRemains(invocation) >20 and BuffExpires(alter_time) Spell(frozen_orb)
+	if BuffPresent(fingers_of_frost_aura) and BuffRemains(fingers_of_frost_aura) <2 Spell(ice_lance)
+	if BuffPresent(brain_freeze) and {BuffPresent(alter_time) or SpellCooldown(alter_time_activate) >4 } Spell(frostfire_bolt)
+	if BuffPresent(brain_freeze) and {BuffPresent(alter_time) or SpellCooldown(alter_time_activate) >4 } Spell(ice_lance)
+	if BuffPresent(fingers_of_frost_aura) Spell(ice_lance)
+	if target.DeadIn() >=4 and BuffStacks(fingers_of_frost_aura) <2 Spell(frozen_orb)
+	Spell(frostbolt)
 }
-
-AddIcon help=main mastery=3
+AddIcon mastery=3 help=offgcd
 {
-    unless InCombat() if BuffExpires(MAGEARMOR 400) and BuffExpires(MOLTENARMOR 400) and BuffExpires(ICEARMOR 400) Spell(MOLTENARMOR)
-	if BuffPresent(MAGEARMOR) and ManaPercent(more 45) Spell(MOLTENARMOR)
-
-    if PetPresent(no) Spell(SUMMONWATERELEMENTAL)
-
-	#/deep_freeze
-    Spell(DEEPFREEZE usable=1)
-	#/frostfire_bolt,if=buff.brain_freeze.react
-    if BuffPresent(BRAINFREEZE) {Spell(FROSTFIREBOLT) Spell(FIREBALL)}
-	#/ice_lance,if=buff.fingers_of_frost.stack>1
-    if BuffPresent(FINGERSOFFROST stacks=2) Spell(ICELANCE)
-	#/ice_lance,if=buff.fingers_of_frost.react&pet.water_elemental.cooldown.freeze.remains<gcd
-    unless BuffPresent(FINGERSOFFROST) Spell(PETFREEZE)
-	#/mage_armor,if=(mana_pct*12)<target.time_to_die
-    if Glyph(GLYPHOFFROSTBOLT) and BuffPresent(MOLTENARMOR) and {{manaPercent()*12} < target.timeToDie()} Spell(MAGEARMOR)
-	#/mage_armor,if=(mana_pct*15)<target.time_to_die
-	if Glyph(GLYPHOFFROSTBOLT no) and BuffPresent(MOLTENARMOR) and {{manaPercent()*15} < target.timeToDie()} Spell(MAGEARMOR)
-	#/evocation,if=mana_pct<5&target.time_to_die>60
-    if ManaPercent(less 5) and TargetDeadIn(more 60) Spell(EVOCATION)
-	#/ice_lance,moving=1
-    if Speed(more 0) Spell(ICELANCE)
-	#/fire_blast,moving=1
-    if Speed(more 0) Spell(FIREBLAST)
-	#/frostbolt
-	if Glyph(GLYPHOFFROSTBOLT) Spell(FROSTBOLT)
-    if Glyph(GLYPHOFFROSTBOLT no)
+	if not InCombat()
 	{
-		#/frostbolt,if=!cooldown.early_frost.remains
-		if castTime(FROSTBOLT) < timeWithHaste(1.5) Spell(FROSTBOLT)
-		#/frostfire_bolt
-		Spell(FROSTFIREBOLT)
-		Spell(FROSTBOLT)
+		Spell(water_elemental)
 	}
+	if target.IsInterruptible() if target.IsInterruptible() Spell(counterspell)
+	if target.HealthPercent() <25 or TimeInCombat() >5 Spell(time_warp)
+	if BuffExpires(alter_time) and BuffStacks(fingers_of_frost_aura) <2 Spell(water_elemental_freeze)
+	if not target.DebuffPresent(frost_bomb) Spell(frost_bomb)
+	if BuffExpires(alter_time) and BuffPresent(brain_freeze) and BuffPresent(fingers_of_frost_aura) and BuffRemains(invocation) >6 Spell(alter_time)
+	if BuffExpires(alter_time) and BuffPresent(brain_freeze) and BuffPresent(fingers_of_frost_aura) Spell(alter_time)
+	if ManaPercent() <84 and BuffExpires(alter_time) Spell(mana_gem)
+}
+AddIcon mastery=3 help=moving
+{
+	Spell(fire_blast)
+	Spell(ice_lance)
 }
-
-AddIcon help=cd mastery=3
+AddIcon mastery=3 help=cd
 {
-    #if BuffPresent(heroism) or TargetDeadIn(less 40) Item(VOLCANICPOTION)
-    if TargetBuffStealable(yes) Spell(SPELLSTEAL)
-    if TargetIsInterruptible(yes) Spell(COUNTERSPELL)
-
-	#/mana_gem,if=mana_deficit>12500
-    if ManaPercent(less 85) Item(MANAGEMITEM)
-	#/cold_snap,if=cooldown.deep_freeze.remains>15&cooldown.frostfire_orb.remains>30&cooldown.icy_veins.remains>30
-    unless 15s before Spell(DEEPFREEZE) or 30s before Spell(FLAMEORB) or 30s before Spell(ICYVEINS) Spell(COLDSNAP)
-	#/frostfire_orb,if=target.time_to_die>=12
-    if TargetDeadIn(more 11) Spell(FLAMEORB)
-	#/mirror_image,if=target.time_to_die>=25
-    if TargetDeadIn(more 24) Spell(MIRRORIMAGE)
-	#/icy_veins,if=buff.icy_veins.down&buff.bloodlust.down
-    if BuffExpires(ICYVEINS 0) and BuffExpires(heroism 0) Spell(ICYVEINS)
-    Item(Trinket0Slot usable=1)
-    Item(Trinket1Slot usable=1)
+	if not InCombat()
+	{
+		Spell(evocation)
+	}
+	if Health() <30 Spell(cold_snap)
+	if BuffExpires(alter_time) Spell(presence_of_mind)
+	if target.DeadIn() <22 Spell(icy_veins)
+	if target.DeadIn() <12 Spell(blood_fury)
+	if ArmorSetParts(T14 more 4) and BuffRemains(invocation) >20 and BuffExpires(alter_time) Spell(icy_veins)
+	if not ArmorSetParts(T14 more 4) and target.DebuffPresent(frozen_orb) Spell(icy_veins)
+	if target.DebuffPresent(frozen_orb) and BuffExpires(alter_time) Spell(icy_veins)
+	Spell(mirror_image)
+	if BuffExpires(invocation) and BuffExpires(alter_time) Spell(evocation)
+	if BuffRemains(invocation) >15 and BuffExpires(alter_time) and ManaPercent() >28 Spell(blood_fury)
 }
-
 ]]
\ No newline at end of file
diff --git a/defaut/Moine.lua b/defaut/Moine.lua
new file mode 100644
index 0000000..412aced
--- /dev/null
+++ b/defaut/Moine.lua
@@ -0,0 +1,96 @@
+Ovale.defaut["MONK"] = [[Define(berserking 26297)
+  SpellInfo(berserking duration=10 cd=180 )
+  SpellAddBuff(berserking berserking=1)
+Define(blackout_kick 100784)
+  SpellInfo(blackout_kick chi=2 )
+Define(chi_burst 123986)
+  SpellInfo(chi_burst chi=2 )
+Define(chi_sphere 121286)
+  SpellInfo(chi_sphere duration=120 )
+Define(combo_breaker_bok 116768)
+  SpellInfo(combo_breaker_bok duration=15 )
+  SpellAddBuff(combo_breaker_bok combo_breaker_bok=1)
+Define(combo_breaker_tp 118864)
+  SpellInfo(combo_breaker_tp duration=15 )
+  SpellAddBuff(combo_breaker_tp combo_breaker_tp=1)
+Define(energizing_brew 115288)
+  SpellInfo(energizing_brew duration=6 cd=60 )
+  SpellAddBuff(energizing_brew energizing_brew=1)
+Define(fists_of_fury 117418)
+  SpellAddBuff(fists_of_fury fists_of_fury=1)
+Define(invoke_xuen 123904)
+  SpellInfo(invoke_xuen duration=45 cd=180 )
+Define(jab 100780)
+  SpellInfo(jab energy=40 chi=-1 )
+Define(power_strikes 121817)
+Define(rising_sun_kick 107428)
+  SpellInfo(rising_sun_kick chi=2 cd=8 )
+Define(rushing_jade_wind 116847)
+  SpellInfo(rushing_jade_wind duration=8 chi=2 cd=30 )
+  SpellAddBuff(rushing_jade_wind rushing_jade_wind=1)
+Define(spinning_crane_kick 117640)
+Define(tiger_palm 100787)
+  SpellInfo(tiger_palm chi=1 )
+Define(tiger_power 125359)
+  SpellInfo(tiger_power duration=20 )
+  SpellAddBuff(tiger_power tiger_power=1)
+Define(tigereye_brew 125195)
+  SpellInfo(tigereye_brew duration=120 )
+  SpellAddBuff(tigereye_brew tigereye_brew=1)
+Define(tigereye_brew_use 116740)
+  SpellInfo(tigereye_brew_use duration=15 cd=1 )
+  SpellAddBuff(tigereye_brew_use tigereye_brew_use=1)
+Define(invoke_xuen_the_white_tiger_talent 17)
+Define(power_strikes_talent 7)
+Define(rushing_jade_wind_talent 16)
+AddIcon mastery=3 help=main
+{
+	if not InCombat()
+	{
+		False()
+	}
+	if not target.DebuffRemains(rising_sun_kick) or target.DebuffRemains(rising_sun_kick) <=3 Spell(rising_sun_kick)
+	if Enemies() >5
+	{
+		if TalentPoints(rushing_jade_wind_talent) Spell(rushing_jade_wind)
+		if Chi() ==4 Spell(chi_burst)
+	}
+
+	{
+		if BuffStacks(tiger_power) <3 or BuffRemains(tiger_power) <=3 or {BuffRemains(tiger_power) <=6 and SpellCooldown(fists_of_fury) <=1 } Spell(tiger_palm)
+		Spell(rising_sun_kick)
+		if BuffPresent(combo_breaker_bok) Spell(blackout_kick)
+		if BuffPresent(combo_breaker_tp) and {Energy() <=90 or {BuffPresent(energizing_brew) and Energy() <=80 } or {BuffPresent(combo_breaker_tp) and BuffRemains(combo_breaker_tp) <=3 } } Spell(tiger_palm)
+		if {Chi() <=2 and SpellCooldown(power_strikes) } or {Chi() <=1 and not SpellCooldown(power_strikes) } Spell(jab)
+		if {BuffPresent(energizing_brew) and Energy() >=20 } or Energy() >=30 Spell(blackout_kick)
+	}
+}
+AddIcon mastery=3 help=offgcd
+{
+	if TalentPoints(power_strikes_talent) and BuffPresent(chi_sphere) and Chi() <4 Spell(chi_sphere)
+	if Enemies() >5
+	{
+		if not BuffPresent(tigereye_brew_use) and BuffPresent(tigereye_brew) ==10 Spell(tigereye_brew_use)
+		if not BuffPresent(tigereye_brew_use) and {BuffPresent(tigereye_brew) >=7 and {SpellCooldown(energizing_brew) <=2 or BuffPresent(energizing_brew) } } Spell(tigereye_brew_use)
+		if Energy() <=35 Spell(energizing_brew)
+		Spell(spinning_crane_kick)
+	}
+
+	{
+		if not BuffPresent(tigereye_brew_use) and BuffPresent(tigereye_brew) ==10 Spell(tigereye_brew_use)
+		if not BuffPresent(tigereye_brew_use) and {BuffPresent(tigereye_brew) >=7 and {SpellCooldown(energizing_brew) <=2 or BuffPresent(energizing_brew) } } Spell(tigereye_brew_use)
+		if not BuffPresent(tigereye_brew_use) and SpellCooldown(energizing_brew) >=45 and SpellCooldown(energizing_brew) <=48 Spell(tigereye_brew_use)
+		if Energy() <=35 Spell(energizing_brew)
+		if not BuffPresent(energizing_brew) and Energy() <=65 and BuffRemains(tiger_power) >=6.5 Spell(fists_of_fury)
+	}
+}
+AddIcon mastery=3 help=cd
+{
+	Spell(berserking)
+	 { Item(Trinket0Slot usable=1) Item(Trinket1Slot usable=1) }
+
+	{
+		if TalentPoints(invoke_xuen_talent) Spell(invoke_xuen)
+	}
+}
+]]
\ No newline at end of file
diff --git a/defaut/Paladin.lua b/defaut/Paladin.lua
index fc83010..a2cb015 100644
--- a/defaut/Paladin.lua
+++ b/defaut/Paladin.lua
@@ -1,238 +1,69 @@
-Ovale.defaut["PALADIN"] =
-[[
-Define(AVENGERSSHIELD 31935)
-	SpellInfo(AVENGERSSHIELD cd=15)
-Define(AVENGINGWRATH 31884)
-	SpellInfo(AVENGINGWRATH cd=180)
-	SpellAddBuff(AVENGINGWRATH AVENGINGWRATH=20)
-Define(CONSECRATE 26573)
-	SpellInfo(CONSECRATE cd=8)
-Define(CRUSADERSTRIKE 35395)
-	SpellInfo(CRUSADERSTRIKE cd=4 holy=1)
-Define(DIVINEFAVOR 31842)
-	SpellInfo(DIVINEFAVOR cd=180)
-	SpellAddBuff(DIVINEFAVOR DIVINEFAVOR=20)
-Define(DIVINEPLEA 54428)
-	SpellInfo(DIVINEPLEA cd=120)
-	SpellAddBuff(DIVINEPLEA DIVINEPLEA=9)
-Define(DIVINEPROTECTION 498)
-	SpellInfo(DIVINEPROTECTION cd=60)
-	SpellAddBuff(DIVINEPROTECTION DIVINEPROTECTION=10)
-Define(DIVINESTORM 53385)
-	SpellInfo(DIVINESTORM cd=4.5)
-Define(EXORCISM 879)
-	SpellAddBuff(EXORCISM THEARTOFWAR=0)
-Define(FLASHOFLIGHT 19750)
-Define(GUARDIANOFANCIENTKINGS 86150)
-	SpellInfo(GUARDIANOFANCIENTKINGS cd=300)
-Define(HAMMEROFWRATH 24275)
-	SpellInfo(HAMMEROFWRATH cd=6)
-Define(HAMMEROFTHERIGHTEOUS 53595)
-	SpellInfo(HAMMEROFTHERIGHTEOUS cd=4.5 holy=1)
-Define(HOLYLIGHT 635)
-Define(HOLYRADIANCE 82327)
-	SpellInfo(HOLYRADIANCE holy=1)
-Define(HOLYSHIELD 20925)
-	SpellInfo(HOLYSHIELD  cd=30)
-	SpellAddBuff(HOLYSHIELD HOLYSHIELD=10)
-Define(HOLYSHOCK 20473)
-	SpellInfo(HOLYSHOCK cd=6)
-Define(HOLYWRATH 2812)
-	SpellInfo(HOLYWRATH cd=15)
-Define(INQUISITION 84963)
-	SpellInfo(INQUISITION holy=-3)
-	SpellAddBuff(INQUISITION INQUISITION=12 DIVINEPURPOSE=0)
-Define(JUDGEMENT 20271)
-	SpellInfo(JUDGEMENT cd=8)
-	SpellInfo(JUDGEMENT holy=1 itemset=T13 itemcount=2)
-	SpellAddBuff(JUDGEMENT 53657 talent=TALENTJUDGEMENTSOFTHEPURE)
-Define(LIGHTOFDAWN 85222)
-	SpellInfo(LIGHTOFDAWN holy=-3)
-Define(REBUKE 96231)
-	SpellInfo(REBUKE cd=10)
-Define(RIGHTEOUSFURY 25780)
-Define(SEALOFINSIGHT 20165)
-	SpellAddBuff(SEALOFINSIGHT SEALOFINSIGHT=1800)
-Define(SEALRIGHTEOUSNESS 20154)
-	SpellAddBuff(SEALRIGHTEOUSNESS SEALRIGHTEOUSNESS=1800)
-Define(SEALOFTRUTH 31801)
-	SpellAddBuff(SEALOFTRUTH SEALOFTRUTH=1800)
-Define(SHIELDOFTHERIGHTEOUS 53600)
-	SpellInfo(SHIELDOFTHERIGHTEOUS cd=6 holy=-3)
-	SpellAddBuff(SHIELDOFTHERIGHTEOUS DIVINEPURPOSE=0)
-Define(TEMPLARSVERDICT 85256)
-	SpellInfo(TEMPLARSVERDICT holy=-3)
-	SpellAddBuff(TEMPLARSVERDICT DIVINEPURPOSE=0)
-Define(WORDOFGLORY 85673)
-	SpellInfo(WORDOFGLORY holy=-3)
-Define(ZEALOTRY 85696)
-	SpellInfo(ZEALOTRY cd=120)
-	SpellAddBuff(ZEALOTRY ZEALOTRY=20)
-
-#Buff
-Define(THEARTOFWAR 59578)
-Define(DIVINEPURPOSE 90174)
-Define(INFUSIONOFLIGHT 54149)
-Define(SACREDDUTY 85433)
-Define(GRANDCRUSADER 85416)
-SpellList(JUDGEMENTSOFTHEPURE 53655 53656 53657)
-
-Define(TALENTJUDGEMENTSOFTHEPURE 10127)
-
-ScoreSpells(SHIELDOFTHERIGHTEOUS JUDGEMENT AVENGERSSHIELD HAMMEROFTHERIGHTEOUS CONSECRATE HOLYWRATH
-	ZEALOTRY  INQUISITION TEMPLARSVERDICT DIVINESTORM EXORCISM HAMMEROFWRATH JUDGEMENT CRUSADERSTRIKE)
-
-AddCheckBox(aoe L(AOE))
-
-AddIcon help=main mastery=1
+Ovale.defaut["PALADIN"] = [[Define(avenging_wrath 31884)
+  SpellInfo(avenging_wrath duration=20 cd=180 )
+  SpellAddBuff(avenging_wrath avenging_wrath=1)
+Define(blessing_of_kings 20217)
+  SpellInfo(blessing_of_kings duration=3600 )
+  SpellAddBuff(blessing_of_kings blessing_of_kings=1)
+Define(blessing_of_might 19740)
+  SpellInfo(blessing_of_might duration=3600 )
+  SpellAddBuff(blessing_of_might blessing_of_might=1)
+Define(crusader_strike 35395)
+  SpellInfo(crusader_strike holy=-1 cd=4.5 )
+Define(execution_sentence 114916)
+  SpellInfo(execution_sentence duration=10 tick=1 )
+  SpellAddTargetDebuff(execution_sentence execution_sentence=1)
+Define(exorcism 879)
+  SpellInfo(exorcism holy=-1 cd=15 )
+Define(glyph_word_of_glory 115522)
+  SpellInfo(glyph_word_of_glory duration=6 )
+  SpellAddBuff(glyph_word_of_glory glyph_word_of_glory=1)
+Define(guardian_of_ancient_kings 86659)
+  SpellInfo(guardian_of_ancient_kings duration=12 cd=180 )
+  SpellAddBuff(guardian_of_ancient_kings guardian_of_ancient_kings=1)
+Define(hammer_of_wrath 24275)
+  SpellInfo(hammer_of_wrath holy=-0 cd=6 )
+Define(harsh_word 130552)
+Define(inquisition 84963)
+  SpellInfo(inquisition duration=10 holy=1 )
+  SpellAddBuff(inquisition inquisition=1)
+Define(judgment 20271)
+  SpellInfo(judgment cd=6 )
+Define(rebuke 96231)
+  SpellInfo(rebuke duration=4 cd=15 )
+Define(seal_of_insight 20165)
+  SpellAddBuff(seal_of_insight seal_of_insight=1)
+Define(seal_of_truth 31801)
+  SpellAddBuff(seal_of_truth seal_of_truth=1)
+Define(templars_verdict 85256)
+  SpellInfo(templars_verdict holy=3 )
+AddIcon mastery=3 help=main
 {
-	unless InCombat()
+	if not InCombat()
 	{
-		if BuffExpires(SEALOFINSIGHT 400) Spell(SEALOFINSIGHT)
+		if not BuffPresent(str_agi_int) Spell(blessing_of_kings)
+		if not BuffPresent(mastery) and not BuffPresent(str_agi_int) Spell(blessing_of_might)
+		unless Stance(1) Spell(seal_of_truth)
 	}
-
-	if HolyPower(more 2) Spell(WORDOFGLORY)
-	Spell(HOLYSHOCK)
-	Spell(JUDGEMENT)
-	if TargetInRange(CRUSADERSTRIKE) Spell(CRUSADERSTRIKE)
-	if BuffPresent(INFUSIONOFLIGHT) Spell(FLASHOFLIGHT)
-	Spell(HOLYLIGHT priority=2)
+	if ManaPercent() >=90 or Stance(0) unless Stance(1) Spell(seal_of_truth)
+	if ManaPercent() <=20 unless Stance(4) Spell(seal_of_insight)
+	if {BuffExpires(inquisition) or BuffRemains(inquisition) <=2 } and {HolyPower() >=3 } Spell(inquisition)
+	if HolyPower() ==5 Spell(templars_verdict)
+	Spell(hammer_of_wrath usable=1)
+	Spell(exorcism)
+	Spell(crusader_strike)
+	Spell(judgment)
+	if HolyPower() >=3 Spell(templars_verdict)
 }
-
-AddIcon help=aoe mastery=1
+AddIcon mastery=3 help=offgcd
 {
-	if HolyPower(more 2) Spell(LIGHTOFDAWN)
-	Spell(HOLYRADIANCE)
+	if target.IsInterruptible() Spell(rebuke)
+	if {BuffExpires(glyph_word_of_glory) } and {HolyPower() >=3 } Spell(harsh_word)
+	if BuffPresent(inquisition) Spell(execution_sentence)
 }
-
-AddIcon help=cd mastery=1
+AddIcon mastery=3 help=cd
 {
-	Spell(AVENGINGWRATH)
-	Spell(DIVINEFAVOR)
-	Item(Trinket0Slot usable=1)
-    Item(Trinket1Slot usable=1)
-	Spell(GUARDIANOFANCIENTKINGS)
+	if BuffPresent(inquisition) Spell(avenging_wrath)
+	if BuffPresent(inquisition) and BuffPresent(avenging_wrath) Spell(guardian_of_ancient_kings)
+	if BuffPresent(inquisition)  { Item(Trinket0Slot usable=1) Item(Trinket1Slot usable=1) }
 }
-
-AddIcon help=mana size=small mastery=1
-{
-	if ManaPercent(less 88) Spell(DIVINEPLEA priority=2)
-}
-
-AddIcon help=main mastery=2
-{
-	if BuffExpires(RIGHTEOUSFURY) Spell(RIGHTEOUSFURY)
-	unless InCombat() if BuffExpires(SEALRIGHTEOUSNESS 400) and BuffExpires(SEALOFTRUTH 400) Spell(SEALOFTRUTH)
-
-	#shield_of_the_righteous,if=holy_power=3&(buff.sacred_duty.up|buff.inquisition.up)
-	if HolyPower(more 2) and {BuffPresent(SACREDDUTY) or BuffPresent(INQUISITION)} Spell(SHIELDOFTHERIGHTEOUS)
-	#judgement,if=holy_power=3
-	if HolyPower(more 2) Spell(JUDGEMENT)
-	#inquisition,if=holy_power=3&(buff.inquisition.down|buff.inquisition.remains<5)
-	if HolyPower(more 2) and BuffExpires(INQUISITION 5) Spell(INQUISITION)
-	#divine_plea,if=holy_power<2
-	if HolyPower(less 2) Spell(DIVINEPLEA)
-	#avengers_shield,if=buff.grand_crusader.up&holy_power<3
-	if BuffPresent(GRANDCRUSADER) and HolyPower(less 3) Spell(AVENGERSSHIELD)
-	#judgement,if=buff.judgements_of_the_pure.down
-	if BuffExpires(JUDGEMENTSOFTHEPURE) Spell(JUDGEMENT)
-	#crusader_strike,if=holy_power<3
-	if HolyPower(less 3) Spell(CRUSADERSTRIKE)
-	#hammer_of_wrath
-	if TargetLifePercent(less 20) Spell(HAMMEROFWRATH)
-	#avengers_shield,if=cooldown.crusader_strike.remains>=0.2
-	if spell(CRUSADERSTRIKE)>0.2 Spell(AVENGERSSHIELD)
-	#judgement
-	Spell(JUDGEMENT)
-	#consecration
-	Spell(CONSECRATE)
-	#holy_wrath
-	Spell(HOLYWRATH)
-	#divine_plea,if=holy_power<1
-	if HolyPower(less 1) Spell(DIVINEPLEA)
-}
-
-AddIcon help=offgcd mastery=2
-{
-	if target.IsInterruptible() Spell(REBUKE)
-}
-
-AddIcon help=aoe mastery=2
-{
-	if HolyPower(more 0) and BuffExpires(INQUISITION 0) Spell(INQUISITION)
-	Spell(HAMMEROFTHERIGHTEOUS)
-	Spell(CONSECRATE)
-	Spell(HOLYWRATH)
-}
-
-AddIcon help=cd mastery=2
-{
-	if HolyPower(more 2) Spell(WORDOFGLORY)
-	Spell(HOLYSHIELD)
-	Spell(GUARDIANOFANCIENTKINGS)
-	Spell(AVENGINGWRATH)
-	Spell(DIVINEPROTECTION)
-    Item(Trinket0Slot usable=1)
-    Item(Trinket1Slot usable=1)
-}
-
-AddIcon help=main mastery=3
-{
-	unless InCombat()
-	{
-		if BuffExpires(SEALRIGHTEOUSNESS 400) and BuffExpires(SEALOFTRUTH 400) Spell(SEALOFTRUTH)
-	}
-
-	#judgement,if=buff.judgements_of_the_pure.down
-	if BuffExpires(JUDGEMENTSOFTHEPURE 0) Spell(JUDGEMENT)
-	#crusader_strike,if=holy_power<3
-	if HolyPower(less 3) Spell(CRUSADERSTRIKE)
-	#judgement,if=buff.zealotry.down&holy_power<3
-	if BuffExpires(ZEALOTRY) and HolyPower(less 3) Spell(JUDGEMENT)
-	#inquisition,if=(buff.inquisition.down|buff.inquisition.remains<=2)&(holy_power>=3|buff.divine_purpose.react)
-	if BuffExpires(INQUISITION 2) and {HolyPower(equal 3) or BuffPresent(DIVINEPURPOSE)} Spell(INQUISITION)
-	#templars_verdict,if=buff.divine_purpose.react
-	if BuffPresent(DIVINEPURPOSE) Spell(TEMPLARSVERDICT)
-	#templars_verdict,if=holy_power=3
-	if HolyPower(more 2) Spell(TEMPLARSVERDICT)
-	#exorcism,if=buff.the_art_of_war.react
-	if BuffPresent(THEARTOFWAR) Spell(EXORCISM)
-	#hammer_of_wrath
-	if TargetLifePercent(less 20) or BuffPresent(AVENGINGWRATH) Spell(HAMMEROFWRATH)
-	#judgement,if=set_bonus.tier13_2pc_melee&buff.zealotry.up&holy_power<3
-	if ArmorSetParts(T13 more 1) and BuffPresent(ZEALOTRY) and HolyPower(less 3) Spell(JUDGEMENT)
-	#wait,sec=0.1,if=cooldown.crusader_strike.remains<0.5
-	if spell(CRUSADERSTRIKE) > 0.5
-	{
-		#holy_wrath
-		Spell(HOLYWRATH)
-		#divine_plea
-		Spell(DIVINEPLEA)
-	}
-}
-
-AddIcon help=offgcd mastery=3
-{
-	if target.IsInterruptible() Spell(REBUKE)
-}
-
-AddIcon help=aoe mastery=3 checkboxon=aoe
-{
-	Spell(DIVINESTORM)
-	#consecration
-	Spell(CONSECRATE)
-}
-
-AddIcon help=cd mastery=3
-{
-    #/guardian_of_ancient_kings,if=cooldown.zealotry.remains<10
-	if spell(ZEALOTRY)<10 Spell(GUARDIANOFANCIENTKINGS)
-	#/zealotry,if=cooldown.guardian_of_ancient_kings.remains>0&cooldown.guardian_of_ancient_kings.remains<292
-	if {spell(GUARDIANOFANCIENTKINGS)>0} and {spell(GUARDIANOFANCIENTKINGS)<292} Spell(ZEALOTRY)
-	#/avenging_wrath,if=buff.zealotry.up
-	if BuffPresent(ZEALOTRY)
-		Spell(AVENGINGWRATH)
-	Item(Trinket0Slot usable=1)
-    Item(Trinket1Slot usable=1)
-}
-]]
+]]
\ No newline at end of file
diff --git a/defaut/Pretre.lua b/defaut/Pretre.lua
index f3742b9..7ac280d 100644
--- a/defaut/Pretre.lua
+++ b/defaut/Pretre.lua
@@ -1,129 +1,83 @@
-Ovale.defaut["PRIEST"] =
-[[
-#Spells
-Define(ARCHANGEL 87151) #Archangel
-    SpellInfo(ARCHANGEL cd=90)
-    SpellAddBuff(ARCHANGEL DARKARCHANGEL=18)
-Define(DEVOURINGPLAGUE 2944) # Devouring Plague
-    SpellInfo(DEVOURINGPLAGUE duration=24 durationhaste=spell)
-    SpellAddTargetDebuff(DEVOURINGPLAGUE DEVOURINGPLAGUE=24)
-Define(DISPERSION 47585)
-    SpellInfo(DISPERSION cd=120)
-    SpellInfo(DISPERSION addcd=-45 glyph=63229)
-Define(INNERFIRE 588) # Inner Fire
-    SpellAddBuff(INNERFIRE INNERFIRE=1800)
-Define(INNERWILL 73413) # Inner Will
-    SpellAddBuff(INNERWILL INNERWILL=1800)
-Define(MINDBLAST 8092) # Mind Blast
-    SpellInfo(MINDBLAST cd=6.5)
-    SpellAddBuff(MINDBLAST SHADOW_ORBS=0)
-    SpellAddBuff(MINDBLAST EMPOWEREDSHADOW=15)
-Define(MINDFLAY 15407) # Mind Flay
-Define(MINDSPIKE 73510) # Mind Spike
-    # TODO : add talent condition for MIND_MELT
-    SpellAddBuff(MINDSPIKE MINDSPIKEEFFECT=12 MINDMELT=6)
-Define(SHADOWFIEND 34433)
-    SpellInfo(SHADOWFIEND cd=300)
-Define(SHADOWFORM 15473) # Shadowform
-Define(SHADOWWORDDEATH 32379) # Shadow Word : Death
-Define(SHADOWWORDPAIN 589) # Shadow Word: Pain
-    SpellInfo(SHADOWWORDPAIN duration=18)
-    SpellAddTargetDebuff(SHADOWWORDPAIN SHADOWWORDPAIN=18)
-Define(VAMPIRICEMBRACE 15286) # Vampiric Embrace
-Define(VAMPIRICTOUCH 34914) # Vampiric Touch
-    SpellInfo(VAMPIRICTOUCH duration=15 durationhaste=spell)
-    SpellAddTargetDebuff(VAMPIRICTOUCH VAMPIRICTOUCH=15)
-
-#Buff
-Define(SHADOWORBS 77487)
-Define(MINDSPIKEEFFECT 87178)
-Define(EVANGELISM 87118)
-Define(DARKARCHANGEL 87153)
-Define(MINDMELT 81292)
-Define(EMPOWEREDSHADOW 95799)
-
-ScoreSpells(MINDBLAST SHADOWWORDPAIN VAMPIRICTOUCH DEVOURINGPLAGUE MINDFLAY SHADOWWORDDEATH MINDSPIKE)
-
-# Add main monitor
-AddIcon help=main mastery=3
+Ovale.defaut["PRIEST"] = [[Define(berserking 26297)
+  SpellInfo(berserking duration=10 cd=180 )
+  SpellAddBuff(berserking berserking=1)
+Define(devouring_plague 2944)
+  SpellInfo(devouring_plague duration=6 shadoworbs=1 )
+  SpellAddTargetDebuff(devouring_plague devouring_plague=1)
+Define(dispersion 47585)
+  SpellInfo(dispersion duration=6 cd=120 )
+  SpellAddBuff(dispersion dispersion=1)
+Define(divine_insight_shadow 124430)
+  SpellInfo(divine_insight_shadow duration=12 )
+  SpellAddBuff(divine_insight_shadow divine_insight_shadow=1)
+Define(halo_damage 120517)
+  SpellInfo(halo_damage cd=40 )
+Define(inner_fire 588)
+  SpellAddBuff(inner_fire inner_fire=1)
+Define(inner_will 73413)
+  SpellAddBuff(inner_will inner_will=1)
+Define(mind_blast 8092)
+  SpellInfo(mind_blast shadoworbs=-1 cd=8 test)
+Define(mind_flay 15407)
+  SpellInfo(mind_flay duration=3 canStopChannelling=1 )
+  SpellAddTargetDebuff(mind_flay mind_flay=1)
+Define(mind_sear 49821)
+  SpellInfo(mind_sear canStopChannelling=1 )
+  SpellAddBuff(mind_sear mind_sear=1)
+Define(mind_spike 73510)
+Define(power_word_fortitude 21562)
+  SpellInfo(power_word_fortitude duration=3600 )
+  SpellAddBuff(power_word_fortitude power_word_fortitude=1)
+Define(shadow_word_death 32379)
+  SpellInfo(shadow_word_death cd=8 )
+Define(shadow_word_pain 589)
+  SpellInfo(shadow_word_pain duration=18 )
+  SpellAddTargetDebuff(shadow_word_pain shadow_word_pain=1)
+Define(shadowfiend 34433)
+  SpellInfo(shadowfiend duration=12 cd=180 )
+Define(shadowform 15473)
+  SpellInfo(shadowform cd=1.5 )
+  SpellAddBuff(shadowform shadowform=1)
+Define(surge_of_darkness 87160)
+  SpellInfo(surge_of_darkness duration=10 )
+  SpellAddBuff(surge_of_darkness surge_of_darkness=1)
+Define(vampiric_touch 34914)
+  SpellInfo(vampiric_touch duration=15 )
+  SpellAddTargetDebuff(vampiric_touch vampiric_touch=1)
+AddIcon mastery=3 help=main
 {
-    #shadow_form
-    unless BuffPresent(SHADOWFORM) Spell(SHADOWFORM)
-
-    unless InCombat()
-    {
-        #inner_fire
-        if BuffExpires(INNERFIRE 300) unless BuffPresent(INNERWILL) Spell(INNERFIRE)
-        if BuffExpires(INNERWILL 300) unless BuffPresent(INNERFIRE) Spell(INNERWILL)
-		#vampiric_embrace
-        if BuffExpires(VAMPIRICEMBRACE 300) Spell(VAMPIRICEMBRACE)
-    }
-
-    # Refresh inner fire and vampiric embrace if they drop during the fight
-    if BuffExpires(INNERFIRE 5) unless BuffPresent(INNERWILL) Spell(INNERFIRE)
-    if BuffExpires(INNERWILL 5) unless BuffPresent(INNERFIRE) Spell(INNERWILL)
-
-	#if your rotation isn't set up and the target has few seconds to live, use MIND_SPIKE instead of normal rotation
-	if TargetDebuffExpires(SHADOWWORDPAIN 0 mine=1) and TargetDeadIn(less 10)
+	if not InCombat()
 	{
-		if BuffPresent(MINDSPIKEEFFECT stacks=3) or BuffPresent(MINDMELT stacks=2) Spell(MINDBLAST)
-		Spell(MINDSPIKE)
+		if not BuffPresent(stamina) Spell(power_word_fortitude)
+		if BuffExpires(inner_fire) and BuffExpires(inner_will) Spell(inner_fire)
+		Spell(shadowform)
 	}
-
-	#mind_blast
-	Spell(MINDBLAST)
-	#shadow_word_pain,if=(!ticking|dot.shadow_word_pain.remains<gcd+0.5)&miss_react
-	if TargetDebuffExpires(SHADOWWORDPAIN 2 haste=spell mine=1) and TargetDeadIn(more 10)
-		Spell(SHADOWWORDPAIN)
-
-	#devouring_plague,if=(!ticking|dot.devouring_plague.remains<gcd+1.0)&miss_react
-	if OtherDebuffExpires(DEVOURINGPLAGUE) and TargetDebuffExpires(DEVOURINGPLAGUE 2.5 haste=spell mine=1) and TargetDeadIn(more 8)
-		Spell(DEVOURINGPLAGUE)
-
-	#vampiric_touch,if=(!ticking|dot.vampiric_touch.remains<cast_time+2.5)&miss_react
-	if TargetDebuffExpires(VAMPIRICTOUCH 3 mine=1 haste=spell) and TargetDeadIn(more 8)
-		Spell(VAMPIRICTOUCH)
-
-	#shadow_word_death,health_percentage<=25
-	if TargetLifePercent(less 25) and LifePercent(more 20) Spell(SHADOWWORDDEATH)
-
-	#shadow_word_death,if=mana_pct<10
-	if ManaPercent(less 10) Spell(SHADOWWORDDEATH)
-
-	#mind_flay
-	Spell(MINDFLAY)
+	Spell(shadowform)
+	if BuffPresent(surge_of_darkness) and PreviousSpell(mind_blast) >=1 Spell(mind_spike)
+	if ShadowOrbs() ==3 Spell(devouring_plague)
+	if SpellCooldown(mind_blast) Spell(mind_blast)
+	if BuffPresent(surge_of_darkness) Spell(mind_spike)
+	if {not target.DebuffPresent(shadow_word_pain) or target.DebuffRemains(shadow_word_pain) <target.NextTick(shadow_word_pain) } Spell(shadow_word_pain)
+	if target.HealthPercent(less 20) Spell(shadow_word_death)
+	if {not target.DebuffPresent(vampiric_touch) or target.DebuffRemains(vampiric_touch) <CastTime(vampiric_touch) +target.NextTick(vampiric_touch) } Spell(vampiric_touch)
+	Spell(halo_damage)
+	Spell(mind_flay)
 }
-
-AddIcon help=cd
+AddIcon mastery=3 help=moving
 {
-    #archangel,if=buff.dark_evangelism.stack>=5&dot.vampiric_touch.remains>5&dot.devouring_plague.remains>5
-    if BuffPresent(EVANGELISM stacks=5) and TargetDebuffPresent(VAMPIRICTOUCH 5 mine=1) and TargetDebuffPresent(DEVOURINGPLAGUE 5 mine=1)
-		Spell(ARCHANGEL)
-	#shadow_fiend
- 	Spell(SHADOWFIEND)
-    Item(Trinket0Slot usable=1)
-    Item(Trinket1Slot usable=1)
+	if target.HealthPercent(less 20) Spell(shadow_word_death)
+	if BuffPresent(divine_insight_shadow) and SpellCooldown(mind_blast) Spell(mind_blast)
+	Spell(shadow_word_pain)
 }
-
-# Add mana monitor
-AddIcon help=mana mastery=3
+AddIcon mastery=3 help=aoe
 {
-    if LifePercent(less 10)
-    {
-        Item(36892) #Health stone
-        Spell(DISPERSION)
-    }
-    if ManaPercent(less 25)
-    {
-        Spell(DISPERSION)
-    }
+	Spell(mind_sear)
 }
-
-#    Add Focus Target Monitor for Multi Dotting
-AddIcon mastery=3 target=focus
+AddIcon mastery=3 help=cd
 {
-        if TargetDebuffExpires(SHADOWWORDPAIN 1.5 mine=1) and TargetDeadIn(more 10) Spell(SHADOWWORDPAIN)
-        if TargetDebuffExpires(VAMPIRICTOUCH 3 mine=1 haste=spell) and TargetDeadIn(more 8) Spell(VAMPIRICTOUCH)
+	 { Item(Trinket0Slot usable=1) Item(Trinket1Slot usable=1) }
+	Spell(berserking)
+	if SpellCooldown(shadowfiend) Spell(shadowfiend)
+	Spell(dispersion)
 }
-
-]]
+]]
\ No newline at end of file
diff --git a/defaut/Voleur.lua b/defaut/Voleur.lua
index a7d90db..9548aeb 100644
--- a/defaut/Voleur.lua
+++ b/defaut/Voleur.lua
@@ -1,266 +1,177 @@
-Ovale.defaut["ROGUE"] =
-[[
-#Abilities
-Define(ADRENALINERUSH 13750)
-	SpellInfo(ADRENALINERUSH cd=180)
-	SpellAddBuff(ADRENALINERUSH ADRENALINERUSH=15)
-Define(AMBUSH 8676)
-	SpellInfo(AMBUSH combo=2 mana=60)
-Define(BACKSTAB 53)
-	SpellInfo(BACKSTAB combo=1 mana=60)
-Define(BLADEFLURRY 13877)
-	SpellAddBuff(BLADEFLURRY BLADEFLURRY=1000 cd=10)
-Define(CLOACKOFSHADOWS 31224)
-	SpellInfo(CLOACKOFSHADOWS cd=90)
-Define(COLDBLOOD 14177)
-	SpellInfo(COLDBLOOD cd=120)
-	SpellAddBuff(COLDBLOOD COLDBLOOD=100)
-Define(ENVENOM 32645)
-	SpellInfo(ENVENOM combo=-5)
-	SpellAddBuff(ENVENOM ENVENOM=5 mana=35)
-Define(EVISCERATE 2098)
-	SpellInfo(EVISCERATE combo=-5 mana=35)
-Define(HEMORRHAGE 16511)
-	SpellInfo(HEMORRHAGE combo=1 mana=35)
-	SpellAddTargetDebuff(HEMORRHAGE HEMORRHAGE=60)
-Define(KICK 1766)
-Define(KILLINGSPREE 51690)
-	SpellInfo(KILLINGSPREE cd=120)
-	SpellAddBuff(KILLINGSPREE KILLINGSPREE=2)
-Define(GARROTE 703)
-	SpellInfo(GARROTE combo=1 mana=45)
-	SpellAddTargetDebuff(GARROTE GARROTE=18)
-Define(MUTILATE 1329)
-	SpellInfo(MUTILATE combo=1 mana=60)
-Define(PREMEDITATION 14183)
-	SpellInfo(PREMEDITATION cd=20 combo=2)
-Define(PREPARATION 14185)
-	SpellInfo(PREPARATION cd=300)
-Define(RECUPERATE 73651)
-	SpellInfo(RECUPERATE combo=-5 mana=30)
-	SpellAddBuff(RECUPERATE RECUPERATE=30)
-Define(REVEALINGSTRIKE 84617)
-	SpellInfo(REVEALINGSTRIKE combo=1 mana=40)
-	SpellAddTargetDebuff(REVEALINGSTRIKE REVEALINGSTRIKE=15)
-Define(RUPTURE 1943)
-	SpellInfo(RUPTURE combo=-5 mana=25)
-	SpellAddTargetDebuff(RUPTURE RUPTURE=8)
-Define(SINISTERSTRIKE 1752)
-	SpellInfo(SINISTERSTRIKE combo=1 mana=45)
-Define(SHADOWDANCE 51713)
-	SpellInfo(SHADOWDANCE cd=60)
-	SpellAddBuff(SHADOWDANCE SHADOWDANCE=6)
-Define(SHADOWSTEP 36554)
-	SpellInfo(SHADOWSTEP cd=20)
-	SpellAddBuff(SHADOWSTEP SHADOWSTEPBUFF=10)
-Define(SLICEANDDICE 5171)
-	SpellInfo(SLICEANDDICE combo=-5 mana=25)
-	SpellAddBuff(SLICEANDDICE SLICEANDDICE=10)
-Define(STEALTH 1784)
-Define(TRICKSOFTHETRADE 57934)
-	SpellInfo(TRICKSOFTHETRADE cd=30)
-Define(VANISH 1856)
-	SpellInfo(VANISH cd=180)
-	SpellAddBuff(VANISH VANISHBUFF=3)
-Define(VENDETTA 79140)
-	SpellInfo(VENDETTA cd=120)
-	SpellAddTargetDebuff(VENDETTA VENDETTA=30)
-
-#Buffs
-Define(SHADOWSTEPBUFF 36563)
-Define(VANISHBUFF 11327)
-Define(SHALLOWINSIGHT 84745)
-Define(MODERATEINSIGHT 84746)
-Define(OVERKILL 58426)
-Define(MASTEROFSUBTLETY 31223)
-Define(FINDWEAKNESS 91023)
-SpellList(DEEPINSIGHT 84745 84746 84747)
-
-#Items
-Define(INSTANTPOISON 6947)
-Define(DEADLYPOISON 2892)
-
-#Talents
-Define(TALENTCUTTOTHECHASE 2070)
-Define(TALENTENERGETICRECOVERY 11665)
-Define(TALENTHEMORRHAGE 681)
-
-
-ScoreSpells(SLICEANDDICE HUNGERFORBLOOD ENVENOM RUPTURE EVISCERATE MUTILATE SINISTERSTRIKE)
-
-AddIcon help=main mastery=1
+Ovale.defaut["ROGUE"] = [[Define(adrenaline_rush 13750)
+  SpellInfo(adrenaline_rush duration=15 cd=180 )
+  SpellAddBuff(adrenaline_rush adrenaline_rush=1)
+Define(ambush 8676)
+  SpellInfo(ambush energy=60 combo=2 )
+Define(anticipation 114015)
+Define(backstab 53)
+  SpellInfo(backstab energy=35 combo=1 )
+Define(berserking 26297)
+  SpellInfo(berserking duration=10 cd=180 )
+  SpellAddBuff(berserking berserking=1)
+Define(deep_insight 84747)
+  SpellInfo(deep_insight duration=15 )
+  SpellAddBuff(deep_insight deep_insight=1)
+Define(dispatch 111240)
+  SpellInfo(dispatch energy=30 combo=1 )
+Define(envenom 32645)
+  SpellInfo(envenom duration=1 combo=0 energy=35 )
+  SpellAddBuff(envenom envenom=1)
+Define(eviscerate 2098)
+  SpellInfo(eviscerate combo=0 energy=35 )
+Define(find_weakness 91021)
+  SpellInfo(find_weakness duration=10 )
+  SpellAddBuff(find_weakness find_weakness=1)
+Define(hemorrhage 16511)
+  SpellInfo(hemorrhage energy=30 combo=1 )
+Define(honor_among_thieves 51701)
+Define(kick 1766)
+  SpellInfo(kick duration=5 energy=15 cd=15 )
+Define(killing_spree 51690)
+  SpellInfo(killing_spree duration=3 cd=120 )
+  SpellAddBuff(killing_spree killing_spree=1)
+Define(master_of_subtlety 31223)
+Define(mutilate 1329)
+  SpellInfo(mutilate energy=55 combo=2 )
+Define(premeditation 14183)
+  SpellInfo(premeditation duration=20 combo=2 cd=20 )
+Define(preparation 14185)
+  SpellInfo(preparation cd=300 )
+Define(revealing_strike 84617)
+  SpellInfo(revealing_strike duration=18 energy=40 combo=1 )
+  SpellAddBuff(revealing_strike revealing_strike=1)
+Define(rupture 1943)
+  SpellInfo(rupture duration=4 combo=0 energy=25 )
+  SpellAddTargetDebuff(rupture rupture=1)
+Define(shadow_blades 121471)
+  SpellInfo(shadow_blades duration=12 cd=180 )
+  SpellAddBuff(shadow_blades shadow_blades=1)
+Define(shadow_dance 51713)
+  SpellInfo(shadow_dance duration=8 cd=60 )
+  SpellAddBuff(shadow_dance shadow_dance=1)
+Define(sinister_strike 1752)
+  SpellInfo(sinister_strike energy=40 combo=0 )
+Define(slice_and_dice 5171)
+  SpellInfo(slice_and_dice duration=6 combo=0 energy=25 )
+  SpellAddBuff(slice_and_dice slice_and_dice=1)
+Define(stealth 63880)
+Define(stealthed 1784)
+  SpellInfo(stealthed cd=6 )
+  SpellAddBuff(stealthed stealthed=1)
+Define(tricks_of_the_trade 57933)
+  SpellInfo(tricks_of_the_trade duration=6 )
+  SpellAddBuff(tricks_of_the_trade tricks_of_the_trade=1)
+Define(vanish 1856)
+  SpellInfo(vanish cd=180 )
+  SpellAddBuff(vanish vanish=1)
+Define(vendetta 79140)
+  SpellInfo(vendetta duration=20 cd=120 )
+  SpellAddBuff(vendetta vendetta=1)
+Define(preparation_talent 10)
+AddIcon mastery=1 help=main
 {
-	unless InCombat()
+	if not InCombat()
 	{
-		if WeaponEnchantExpires(mainhand 300) Item(INSTANTPOISON)
-		if WeaponEnchantExpires(offhand 300) Item(DEADLYPOISON)
+		if WeaponEnchantExpires(mainhand 300) Item(6497)
 	}
-
-	#actions+=/garrote
-	if BuffPresent(STEALTH) Spell(GARROTE)
-
-	#actions+=/slice_and_dice,if=buff.slice_and_dice.down
-	unless BuffPresent(SLICEANDDICE) if ComboPoints(more 0)	Spell(SLICEANDDICE)
-
-	#/rupture,if=!ticking&time<6
-	if TargetDebuffExpires(RUPTURE mine=1) and TimeInCombat(less 6) and ComboPoints(more 0) Spell(RUPTURE)
-	#/vendetta
-	if TargetDebuffExpires(VENDETTA) and TargetDeadIn(more 20) Spell(VENDETTA)
-
-	#actions+=/rupture,if=!ticking&buff.slice_and_dice.remains>6
-	if TargetDebuffExpires(RUPTURE 0 mine=1) and BuffPresent(SLICEANDDICE 6) and ComboPoints(more 0)
-		Spell(RUPTURE)
-
-	#actions+=/cold_blood,sync=envenom ??
-	#if ComboPoints(more 4) and BuffPresent(SLICEANDDICE 6) and TargedDebuffPresent(RUPTURE 5)
-	#	Spell(COLDBLOOD)
-
-	#/envenom,if=combo_points>=4&buff.envenom.down
-	#/envenom,if=combo_points>=4&energy>90
-	if ComboPoints(more 3) and {BuffExpires(ENVENOM) or Mana(more 89)} Spell(ENVENOM)
-	#/envenom,if=combo_points>=2&buff.slice_and_dice.remains<3
-	if TalentPoints(TALENTCUTTOTHECHASE more 0) and ComboPoints(more 1) and BuffExpires(SLICEANDDICE 3) Spell(ENVENOM)
-
-	#/backstab,if=combo_points<5&target.health_pct<35
-	if ComboPoints(less 5) and TargetLifePercent(less 35) Spell(BACKSTAB)
-	#/mutilate,if=combo_points<4&target.health_pct>=35
-	if ComboPoints(less 4) and TargetLifePercent(more 35) Spell(MUTILATE)
-
+	Spell(ambush usable=1)
+	if BuffExpires(slice_and_dice) Spell(slice_and_dice)
+	if target.TicksRemain(rupture) <2 and Energy() >90 Spell(dispatch usable=1)
+	if target.TicksRemain(rupture) <2 and Energy() >90 Spell(mutilate)
+	if TicksRemain(rupture) <2 or {ComboPoints() ==5 and TicksRemain(rupture) <3 } Spell(rupture)
+	if ComboPoints() >=4 and TicksRemain(envenom) <2 Spell(envenom)
+	if ComboPoints() >4 Spell(envenom)
+	if ComboPoints() >=2 and BuffRemains(slice_and_dice) <3 Spell(envenom)
+	if ComboPoints() <5 Spell(dispatch usable=1)
+	Spell(mutilate)
 }
-
-AddIcon help=cd mastery=1
+AddIcon mastery=1 help=offgcd
 {
-	#actions+=/kick
-	if TargetIsInterruptible(yes) and TargetInRange(KICK) Spell(KICK)
-	if Mana(less 70) Spell(COLDBLOOD)
-	#actions+=/vanish,if=time>30&energy>50
-	if {spell(VANISH)>30} and Mana(more 50) unless BuffPresent(OVERKILL) Spell(VANISH)
-	Item(Trinket0Slot usable=1)
-	Item(Trinket1Slot usable=1)
+	if not InCombat()
+	{
+		Spell(stealth)
+	}
+	if target.IsInterruptible() Spell(kick)
+	Spell(tricks_of_the_trade)
+}
+AddIcon mastery=1 help=cd
+{
+	if TalentPoints(preparation_talent) and not BuffPresent(vanish) and SpellCooldown(vanish) >60 Spell(preparation)
+	 { Item(Trinket0Slot usable=1) Item(Trinket1Slot usable=1) }
+	Spell(berserking)
+	if TimeInCombat() >10 and not BuffPresent(stealthed) Spell(vanish)
+	if {BuffPresent(bloodlust) or TimeInCombat() >60 } and BuffRemains(slice_and_dice) >=12000 Spell(shadow_blades)
+	Spell(vendetta)
 }
-
-AddIcon help=main mastery=2
+AddIcon mastery=2 help=main
 {
-	unless InCombat()
+	if not InCombat()
 	{
-		if WeaponEnchantExpires(mainhand 300) Item(INSTANTPOISON)
-		if WeaponEnchantExpires(offhand 300) Item(DEADLYPOISON)
+		if WeaponEnchantExpires(mainhand 300) Item(6497)
 	}
-
-	#slice_and_dice,if=buff.slice_and_dice.down
-	#slice_and_dice,if=buff.slice_and_dice.remains<2
-	if BuffExpires(SLICEANDDICE 2) and ComboPoints(more 0)
-		Spell(SLICEANDDICE)
-
-	#killing_spree,if=energy<35&buff.slice_and_dice.remains>4&buff.adrenaline_rush.down
-	if Mana(less 35) and BuffPresent(SLICEANDDICE 4) and BuffExpires(ADRENALINERUSH)
-		Spell(KILLINGSPREE)
-
-	#adrenaline_rush,if=energy<35
-	unless BuffPresent(KILLINGSPREE) if Mana(less 35) Spell(ADRENALINERUSH)
-
-	#eviscerate,if=combo_points=5&buff.bandits_guile.stack>=12
-	if ComboPoints(more 4) and BuffPresent(SLICEANDDICE 4) and BuffPresent(DEEPINSIGHT 12)
-		Spell(EVISCERATE)
-
-	#rupture,if=!ticking&combo_points=5&target.time_to_die>10
-	if TargetDebuffExpires(RUPTURE 0 mine=1) and ComboPoints(more 4) and TargetDeadIn(more 10)
-		Spell(RUPTURE)
-
-	#eviscerate,if=combo_points=5
-	if ComboPoints(equal 5) Spell(EVISCERATE)
-
-	#revealing_strike,if=combo_points=4&buff.revealing_strike.down
-	if ComboPoints(equal 4) and TargetDebuffExpires(REVEALINGSTRIKE 0 mine=1) Spell(REVEALINGSTRIKE)
-
-	#sinister_strike,if=combo_points<5
-	if ComboPoints(less 5) Spell(SINISTERSTRIKE)
+	Spell(ambush usable=1)
+	if BuffRemains(slice_and_dice) <2 Spell(slice_and_dice)
+	if TicksRemain(rupture) <2 and ComboPoints() ==5 and BuffPresent(deep_insight) and target.DeadIn() >10 Spell(rupture)
+	if ComboPoints() ==5 and BuffPresent(deep_insight) Spell(eviscerate)
+	if TicksRemain(rupture) <2 and ComboPoints() ==5 and target.DeadIn() >10 Spell(rupture)
+	if ComboPoints() ==5 Spell(eviscerate)
+	if ComboPoints() <5 and TicksRemain(revealing_strike) <2 Spell(revealing_strike)
+	if ComboPoints() <5 Spell(sinister_strike)
 }
-
-AddIcon help=aoe mastery=2
+AddIcon mastery=2 help=offgcd
 {
-	unless BuffPresent(BLADEFLURRY) Spell(BLADEFLURRY)
-	if BuffPresent(DEEPINSIGHT)
+	if not InCombat()
 	{
-		unless BuffPresent(ADRENALINERUSH) Spell(KILLINGSPREE)
+		Spell(stealth)
 	}
+	if target.IsInterruptible() Spell(kick)
+	Spell(tricks_of_the_trade)
 }
-
-AddIcon help=cd mastery=2
+AddIcon mastery=2 help=cd
 {
-	#actions+=/kick
-	if TargetIsInterruptible(yes) and TargetInRange(KICK) Spell(KICK)
-	Item(Trinket0Slot usable=1)
-	Item(Trinket1Slot usable=1)
+	if TalentPoints(preparation_talent) and not BuffPresent(vanish) and SpellCooldown(vanish) >60 Spell(preparation)
+	 { Item(Trinket0Slot usable=1) Item(Trinket1Slot usable=1) }
+	Spell(berserking)
+	if TimeInCombat() >10 and not BuffPresent(stealthed) Spell(vanish)
+	if {BuffPresent(bloodlust) or TimeInCombat() >60 } and BuffRemains(slice_and_dice) >=12000 Spell(shadow_blades)
+	if Energy() <35 and BuffRemains(slice_and_dice) >4 and BuffExpires(adrenaline_rush) Spell(killing_spree)
+	if Energy() <35 Spell(adrenaline_rush)
 }
-
-AddIcon help=main mastery=3
+AddIcon mastery=3 help=main
 {
-	unless InCombat()
-	{
-		if WeaponEnchantExpires(mainhand 400) Item(INSTANTPOISON)
-		if WeaponEnchantExpires(offhand 400) Item(DEADLYPOISON)
-	}
-
-	if BuffPresent(STEALTH) or BuffPresent(VANISHBUFF)
+	if not InCombat()
 	{
-		#/premeditation,if=(combo_points<=3&cooldown.honor_among_thieves.remains>1.75)|combo_points<=2
-		if ComboPoints(less 3) Spell(PREMEDITATION)
-		#Spell(GARROTE)
-		#/ambush,if=combo_points<=4
-		if ComboPoints(less 5) Spell(AMBUSH)
+		if WeaponEnchantExpires(mainhand 300) Item(6497)
+		Spell(slice_and_dice)
 	}
-
-	#/slice_and_dice,if=buff.slice_and_dice.remains<3&combo_points=5
-	if BuffExpires(SLICEANDDICE 3) and ComboPoints(more 4) Spell(SLICEANDDICE)
-	#/rupture,if=combo_points=5&!ticking
-	if ComboPoints(more 4) and TargetDebuffExpires(RUPTURE 0 mine=1) Spell(RUPTURE)
-	#/recuperate,if=combo_points=5&remains<3
-	if TalentPoints(TALENTENERGETICRECOVERY more 2) and ComboPoints(more 4) and BuffExpires(RECUPERATE 3) Spell(RECUPERATE)
-	#/eviscerate,if=combo_points=5&dot.rupture.remains>1
-	if ComboPoints(more 4) and TargetDebuffPresent(RUPTURE 1 mine=1) Spell(EVISCERATE)
-
-	if TalentPoints(TALENTHEMORRHAGE more 0)
-	{
-		#/hemorrhage,if=combo_points<4&energy>40&dot.hemorrhage.remains<4";
-		if ComboPoints(less 4) and Mana(more 40) and TargetDebuffExpires(HEMORRHAGE 4 mine=1) Spell(HEMORRHAGE)
-        #/hemorrhage,if=combo_points<5&energy>80&dot.hemorrhage.remains<4";
-		if ComboPoints(less 5) and Mana(more 80) and TargetDebuffExpires(HEMORRHAGE 4 mine=1) Spell(HEMORRHAGE)
-	}
-
-	#/backstab,if=combo_points<4&energy>40&energy<80";
-	if ComboPoints(less 4) and Mana(more 40) Spell(BACKSTAB)
-	#/backstab,if=combo_points<5&energy>80
-	if ComboPoints(less 5) and Mana(more 80) Spell(BACKSTAB)
-}
-
-AddIcon help=cd mastery=3
-{
-	#actions+=/kick
-	if TargetIsInterruptible(yes) and TargetInRange(KICK) Spell(KICK)
-
-	#/shadow_dance,if=energy>85&combo_points<5&buff.stealthed.down
-	if Mana(more 84) and ComboPoints(less 5) and BuffExpires(STEALTH) Spell(SHADOWDANCE)
-	#/vanish,if=time>10&energy>60&combo_points<=1&cooldown.shadowstep.remains<=0&!buff.shadow_dance.up
-	#/vanish,if=time>10&energy>60&combo_points<=1&cooldown.shadowstep.remains<=0&!buff.shadow_dance.up&!buff.master_of_subtlety.up&!buff.find_weakness.up
-	if TimeInCombat(more 10) and Mana(more 60) and ComboPoints(less 2) and Spell(SHADOWSTEP) and BuffExpires(SHADOWDANCE) and BuffExpires(MASTEROFSUBTLETY) and TargetDebuffExpires(FINDWEAKNESS mine=1)
-			Spell(VANISH)
-	#/shadowstep,if=buff.stealthed.up|buff.shadow_dance.up
-	if BuffPresent(STEALTH) or BuffPresent(SHADOWDANCE) or BuffPresent(VANISHBUFF) Spell(SHADOWSTEP)
-	#/preparation,if=cooldown.vanish.remains>60
-	unless 60s before Spell(VANISH) Spell(PREPARATION)
-	Item(Trinket0Slot usable=1)
-	Item(Trinket1Slot usable=1)
+	if ComboPoints() <=5 and BuffStacks(anticipation) ==0 Spell(ambush usable=1)
+	if BuffRemains(slice_and_dice) <3 and ComboPoints() ==5 Spell(slice_and_dice)
+	if ComboPoints() ==5 and target.DebuffRemains(rupture) <5 Spell(rupture)
+	if BuffStacks(anticipation) <3 and BuffRemains(shadow_dance) <=2 Spell(ambush usable=1)
+	if ComboPoints() ==5 Spell(eviscerate)
+	if ComboPoints() <4 and {target.DebuffRemains(hemorrhage) <4 or target.TargetIsPlayer() } Spell(hemorrhage)
+	if ComboPoints() <5 and Energy() >80 and {target.DebuffRemains(hemorrhage) <4 or target.TargetIsPlayer() } Spell(hemorrhage)
+	if ComboPoints() <4 and {SpellCooldown(shadow_dance) >7 or {SpellCooldown(shadow_dance) ==0 and TimeInCombat() <=9 } } Spell(backstab)
+	if ComboPoints() <5 and Energy() >80 and SpellCooldown(shadow_dance) >=2 Spell(backstab)
 }
-
-AddIcon size=small
+AddIcon mastery=3 help=offgcd
 {
-	Spell(TRICKSOFTHETRADE)
+	if not InCombat()
+	{
+		Spell(stealth)
+		Spell(premeditation)
+	}
+	if target.IsInterruptible() Spell(kick)
+	if Energy() >=75 and BuffExpires(stealthed) and not target.DebuffPresent(find_weakness) Spell(shadow_dance)
+	if {ComboPoints() <=3 and SpellCooldown(honor_among_thieves) >1.75 } or ComboPoints() <=2 Spell(premeditation)
+	Spell(tricks_of_the_trade)
 }
-
-AddIcon size=small
+AddIcon mastery=3 help=cd
 {
-	Spell(CLOACKOFSHADOWS)
+	if TalentPoints(preparation_talent) and not BuffPresent(vanish) and SpellCooldown(vanish) >60 Spell(preparation)
+	Spell(shadow_blades)
+	if BuffPresent(shadow_dance)  { Item(Trinket0Slot usable=1) Item(Trinket1Slot usable=1) }
+	if BuffPresent(shadow_dance) Spell(berserking)
+	if TimeInCombat() >10 and Energy() >=45 and Energy() <=75 and ComboPoints() <=3 and not BuffPresent(shadow_dance) and not BuffPresent(master_of_subtlety) and not target.DebuffPresent(find_weakness) Spell(vanish)
 }
-
 ]]
\ No newline at end of file