Quantcast

- added InCombat,EndCastSpell functions

Sidoine De Wispelaere [03-02-10 - 20:57]
- added InCombat,EndCastSpell functions
- changes in arcane mage
- every class uses InCombat to know if it should buff itself
- corruption has a higher priority than agony
- do not cast a curse if another curse is present

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@236 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
Condition.lua
Locale-enUS.lua
Locale-frFR.lua
Ovale.lua
Ovale.toc
OvaleCompile.lua
defaut/Chaman.lua
defaut/Demoniste.lua
defaut/Mage.lua
defaut/Paladin.lua
defaut/Pretre.lua
diff --git a/Condition.lua b/Condition.lua
index e29d0da..3e91dcf 100644
--- a/Condition.lua
+++ b/Condition.lua
@@ -464,6 +464,15 @@ Ovale.conditions=
 			return 0,limit
 		end
 	end,
+	EndCastTime = function(condition)
+		local name, rank, icon, cost, isFunnel, powerType, castTime = Ovale:GetSpellInfoOrNil(condition[1])
+		local actionCooldownStart, actionCooldownDuration, actionEnable = Ovale:GetComputedSpellCD(name)
+		local startCast = actionCooldownStart + actionCooldownDuration
+		if startCast<Ovale.currentTime then
+			startCast = Ovale.currentTime
+		end
+		return startCast + castTime/1000
+	end,
 	Glyph = function(condition)
 		local present = false
 		for i = 1, GetNumGlyphSockets() do
@@ -487,6 +496,9 @@ Ovale.conditions=
 		local _,_,_,_,_,_,_,_,itemLoc = GetItemInfo(id)
 		return testbool(itemLoc=="INVTYPE_SHIELD", condition[1])
 	end,
+	InCombat = function(condition)
+		return testbool(Ovale.enCombat, condition[1])
+	end,
 	ItemCount = function(condition)
 		return compare(GetItemCount(condition[1]), condition[2], condition[3])
 	end,
diff --git a/Locale-enUS.lua b/Locale-enUS.lua
index 8705657..0b82619 100644
--- a/Locale-enUS.lua
+++ b/Locale-enUS.lua
@@ -45,4 +45,5 @@ L["multidot"] = "Damage Over Time on multiple targets"
 L["buff"] = "Buffs"
 L["Inverser la boîte à cocher "] = "Toggle check box"
 L["Ignorer les clics souris"] = "Ignore mouse clicks"
-L["Correction de la latence"] = "Latency correction"
\ No newline at end of file
+L["Correction de la latence"] = "Latency correction"
+L["Cacher dans les véhicules"] = "Hide in vehicles"
\ No newline at end of file
diff --git a/Locale-frFR.lua b/Locale-frFR.lua
index 6a5e5a3..14bc11c 100644
--- a/Locale-frFR.lua
+++ b/Locale-frFR.lua
@@ -45,4 +45,5 @@ L["multidot"] = "Multicible pour DoTs"
 L["buff"] = "Améliorations"
 L["Inverser la boîte à cocher "] = true
 L["Ignorer les clics souris"] = true
-L["Correction de la latence"] = true
\ No newline at end of file
+L["Correction de la latence"] = true
+L["Cacher dans les véhicules"] = true
\ No newline at end of file
diff --git a/Ovale.lua b/Ovale.lua
index 41d170f..bba7c26 100644
--- a/Ovale.lua
+++ b/Ovale.lua
@@ -231,6 +231,14 @@ local options =
 					name = L["Correction de la latence"],
 					get = function(info) return Ovale.db.profile.apparence.latencyCorrection end,
 					set = function(info, value) Ovale.db.profile.apparence.latencyCorrection = value end
+				},
+				hideVehicule =
+				{
+					order = 17,
+					type = "toggle",
+					name = L["Cacher dans les véhicules"],
+					get = function(info) return Ovale.db.profile.apparence.hideVehicule end,
+					set = function(info, value) Ovale.db.profile.apparence.hideVehicule = value end
 				}
 			}
 		},
@@ -247,7 +255,7 @@ local options =
 					multiline = 15,
 					name = L["Code"],
 					get = function(info)
-						return Ovale.db.profile.code
+						return string.gsub(Ovale.db.profile.code, "\t", "    ")
 					end,
 					set = function(info,v)
 						Ovale.db.profile.code = v
@@ -1230,7 +1238,32 @@ function Ovale:GetGCD(spellName)
 	end
 end

-
+function Ovale:GetComputedSpellCD(spellName)
+	local actionCooldownStart, actionCooldownDuration, actionEnable
+	local cd = self:GetCD(spellName)
+	if cd and cd.start then
+		actionCooldownStart = cd.start
+		actionCooldownDuration = cd.duration
+		actionEnable = cd.enable
+	else
+		actionCooldownStart, actionCooldownDuration, actionEnable = GetSpellCooldown(spellName)
+		-- 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
+		if self.className=="DEATHKNIGHT" and actionCooldownDuration==10 and
+				(not self.spellInfo[spellName] or self.spellInfo[spellName].cd~=10) then
+			local impie = GetSpellInfo(48265)
+			if impie and UnitBuff("player", impie) then
+				actionCooldownDuration=1
+			else
+				actionCooldownDuration=1.5
+			end
+		end
+		if self.spellInfo[spellName] and self.spellInfo[spellName].forcecd then
+			actionCooldownStart, actionCooldownDuration = GetSpellCooldown(GetSpellInfo(self.spellInfo[spellName].forcecd))
+		end
+	end
+	return actionCooldownStart, actionCooldownDuration, actionEnable
+end

 function Ovale:GetActionInfo(element)
 	if not element then
@@ -1253,28 +1286,7 @@ function Ovale:GetActionInfo(element)
 			return nil
 		end
 		action = self.actionSort[spellName]
-		local cd = self:GetCD(spellName)
-		if cd and cd.start then
-			actionCooldownStart = cd.start
-			actionCooldownDuration = cd.duration
-			actionEnable = cd.enable
-		else
-			actionCooldownStart, actionCooldownDuration, actionEnable = GetSpellCooldown(spellName)
-			-- 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
-			if self.className=="DEATHKNIGHT" and actionCooldownDuration==10 and
-					(not self.spellInfo[spellName] or self.spellInfo[spellName].cd~=10) then
-				local impie = GetSpellInfo(48265)
-				if impie and UnitBuff("player", impie) then
-					actionCooldownDuration=1
-				else
-					actionCooldownDuration=1.5
-				end
-			end
-			if self.spellInfo[spellName] and self.spellInfo[spellName].forcecd then
-				actionCooldownStart, actionCooldownDuration = GetSpellCooldown(GetSpellInfo(self.spellInfo[spellName].forcecd))
-			end
-		end
+		actionCooldownStart, actionCooldownDuration, actionEnable = self:GetComputedSpellCD(spellName)

 		if (not action or not GetActionTexture(action)) then
 			actionTexture = GetSpellTexture(spellName)
@@ -1470,12 +1482,15 @@ function Ovale:CalculerMeilleureAction(element)

 			return start, ending
 		end
+	elseif element.type == "time" then
+		return element.value
 	elseif (element.type == "before") then
 		if (Ovale.trace) then
 			self:Print(element.time.."s before ["..element.nodeId.."]")
 		end
+		local timeA = Ovale:CalculerMeilleurAction(element.time)
 		local startA, endA = Ovale:CalculerMeilleureAction(element.a)
-		return addTime(startA, -element.time), addTime(endA, -element.time)
+		return addTime(startA, -timeA), addTime(endA, -timeA)
 	elseif (element.type == "between") then
 		self:Log("between")
 		local tempsA = Ovale:CalculerMeilleureAction(element.a)
@@ -1509,20 +1524,23 @@ function Ovale:CalculerMeilleureAction(element)
 			if Ovale.trace then Ovale:Print(element.type.." return nil") end
 			return nil
 		end
+		Ovale:Log("fromuntil returns "..(tempsB - tempsA))
 		return tempsB - tempsA
 	elseif element.type == "compare" then
-		self:Log("compare "..element.comparison.." "..element.time)
+		self:Log("compare "..element.comparison)
 		local tempsA = Ovale:CalculerMeilleureAction(element.a)
-		if element.comparison == "more" and (not tempsA or tempsA>element.time) then
+		local timeB = Ovale:CalculerMeilleureAction(element.time)
+		self:Log(tempsA.." "..element.comparison.." "..timeB)
+		if element.comparison == "more" and (not tempsA or tempsA>timeB) then
 			if Ovale.trace then Ovale:Print(element.type.." return 0") end
 			return 0
-		elseif element.comparison == "less" and tempsA and tempsA<element.time then
+		elseif element.comparison == "less" and tempsA and tempsA<timeB then
 			if Ovale.trace then Ovale:Print(element.type.." return 0") end
 			return 0
-		elseif element.comparison == "at most" and tempsA and tempsA<=element.time then
+		elseif element.comparison == "at most" and tempsA and tempsA<=timeB then
 			if Ovale.trace then Ovale:Print(element.type.." return 0") end
 			return 0
-		elseif element.comparison == "at least" and (not tempsA or tempsA>=element.time) then
+		elseif element.comparison == "at least" and (not tempsA or tempsA>=timeB) then
 			if Ovale.trace then Ovale:Print(element.type.." return 0") end
 			return 0
 		end
@@ -1705,7 +1723,7 @@ function Ovale:ChargerDefaut()
 			list = {},
 			apparence = {enCombat=false, iconWidth = 64, iconHeight = 64, margin = 4,
 				smallIconWidth=28, smallIconHeight=28, raccourcis=true, numeric=false, avecCible = false,
-				verrouille = false, vertical = false, predictif=false, highlightIcon = true, clickThru = false, latencyCorrection=true},
+				verrouille = false, vertical = false, predictif=false, highlightIcon = true, clickThru = false, latencyCorrection=true, hideVehicule=true},
 			skin = {SkinID="Blizzard", Backdrop = true, Gloss = false, Colors = {}}
 		}
 	})
@@ -1740,12 +1758,16 @@ function Ovale:UpdateVisibility()
 	end

 	self.frame:Show()
+
+	if Ovale.db.profile.apparence.hideVehicule and UnitInVehicle("player") then
+		self.frame:Hide()
+	end

-	if (Ovale.db.profile.apparence.avecCible and not UnitExists("target")) then
+	if Ovale.db.profile.apparence.avecCible and not UnitExists("target") then
 		self.frame:Hide()
 	end

-	if (Ovale.db.profile.apparence.enCombat and not Ovale.enCombat) then
+	if Ovale.db.profile.apparence.enCombat and not Ovale.enCombat then
 		self.frame:Hide()
 	end

diff --git a/Ovale.toc b/Ovale.toc
index 010a079..271b0f6 100644
--- a/Ovale.toc
+++ b/Ovale.toc
@@ -3,7 +3,7 @@
 ## Notes: Show the icon of the next spell to cast
 ## Notes-frFR: Affiche l'icône du prochain sort à lancer
 ## Author: Sidoine
-## Version: 3.3.27
+## Version: 3.3.28
 ## OptionalDeps: Ace3, ButtonFacade, Recount, LibBabble-CreatureType-3.0
 ## SavedVariables: OvaleDB
 ## SavedVariablesPerCharacter: OvaleDBPC
diff --git a/OvaleCompile.lua b/OvaleCompile.lua
index 2e5e06e..783cf6d 100644
--- a/OvaleCompile.lua
+++ b/OvaleCompile.lua
@@ -35,6 +35,10 @@ local function ParseParameters(params)
 	return paramList
 end

+local function ParseTime(value)
+	return AddNode({type="time", value=tonumber(value)})
+end
+
 local function ParseFunction(func, params)
 	local paramList = ParseParameters(params)
 	local newNode = { type="function", func=func, params=paramList}
@@ -142,7 +146,7 @@ local function ParseAnd(a,b)
 end

 local function ParseBefore(a,b)
-	local newNode = {type="before", time=tonumber(a), a=node[tonumber(b)]}
+	local newNode = {type="before", time=node[tonumber(a)], a=node[tonumber(b)]}
 	return AddNode(newNode)
 end

@@ -162,7 +166,7 @@ local function ParseOr(a,b)
 end

 local function ParseCompare(comp,t,a)
-	local newNode = {type="compare", comparison=comp, time=tonumber(t), a=node[tonumber(a)]}
+	local newNode = {type="compare", comparison=comp, time=node[tonumber(t)], a=node[tonumber(a)]}
 	return AddNode(newNode)
 end

@@ -234,18 +238,19 @@ local function ParseAddIcon(params, text)
 	while (1==1) do
 		local was = text
 		text = string.gsub(text, "(%w+)%s*%((.-)%)", ParseFunction)
+		text = string.gsub(text, "(%d+%.?%d*)s", ParseTime)
 		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, "node(%d+)%s+and%s+node(%d+)", ParseAnd)
 		text = string.gsub(text, "node(%d+)%s+or%s+node(%d+)", ParseOr)
-		text = string.gsub(text, "(%d+%.?%d*)s%s+before%s+node(%d+)", ParseBefore)
+		text = string.gsub(text, "node(%d+)%s+before%s+node(%d+)", ParseBefore)
 		text = string.gsub(text, "if%s+node(%d+)%s+node(%d+)",ParseIf)
 		text = string.gsub(text, "unless%s+node(%d+)%s+node(%d+)",ParseUnless)
 		text = string.gsub(text, "{([node%d ]*)}", ParseGroup)
-		text = string.gsub(text, "(more)%s+than%s+(%d+%.?%d*)s%s+node(%d+)", ParseCompare)
-		text = string.gsub(text, "(less)%s+than%s+(%d+%.?%d*)s%s+node(%d+)", ParseCompare)
-		text = string.gsub(text, "(at least)%s+(%d+%.?%d*)s%s+node(%d+)", ParseCompare)
-		text = string.gsub(text, "(at most)%s+(%d+%.?%d*)s%s+node(%d+)", ParseCompare)
+		text = string.gsub(text, "(more)%s+than%s+node(%d+)%s+node(%d+)", ParseCompare)
+		text = string.gsub(text, "(less)%s+than%s+node(%d+)%s+node(%d+)", ParseCompare)
+		text = string.gsub(text, "(at least)%s+node(%d+)%s+node(%d+)", ParseCompare)
+		text = string.gsub(text, "(at most)%s+node(%d+)%s+node(%d+)", ParseCompare)

 		if (was == text) then
 			break
@@ -382,13 +387,15 @@ function Ovale:DebugNode(node)
 	elseif (node.type == "or") then
 		text = self:DebugNode(node.a).." or "..self:DebugNode(node.b)
 	elseif (node.type == "before") then
-		text = node.time .. "s before "..self:DebugNode(node.a)
+		text = self:DebugNode(node.time) .. " before "..self:DebugNode(node.a)
 	elseif (node.type == "between") then
 		text = "between "..self:DebugNode(node.a).." and "..self:DebugNode(node.b)
 	elseif (node.type == "fromuntil") then
 		text = "from "..self:DebugNode(node.a).." until "..self:DebugNode(node.b)
 	elseif (node.type == "compare") then
-		text = node.comparison.." than "..node.time.."s "..self:DebugNode(node.a)
+		text = node.comparison.." than "..self:DebugNode(node.time).." "..self:DebugNode(node.a)
+	elseif (node.type == "time") then
+		text = node.value.."s"
 	else
 		text = "#unknown node type#"
 	end
diff --git a/defaut/Chaman.lua b/defaut/Chaman.lua
index b10b802..22426dc 100644
--- a/defaut/Chaman.lua
+++ b/defaut/Chaman.lua
@@ -68,7 +68,10 @@ AddIcon help=main
 {
 	unless TalentPoints(TALENTFLURRY more 0)
 	{
-		if WeaponEnchantExpires(mainhand 2) Spell(FLAMETHONG)
+		unless InCombat()
+		{
+			if WeaponEnchantExpires(mainhand 400) Spell(FLAMETHONG)
+		}
 		if BuffExpires(WATERSHIELD 2) Spell(WATERSHIELD)
 		if CheckBoxOn(firenova)
 		{
@@ -80,14 +83,17 @@ AddIcon help=main
 		if TargetDebuffExpires(FLAMESHOCK 0 mine=1) Spell(FLAMESHOCK)
 		unless TargetDebuffExpires(FLAMESHOCK 1.6 haste=spell mine=1) Spell(LAVABURST)

-		if CheckBoxOn(chain) and 1.4s before Spell(LAVABURST) and CastTime(LIGHTNINGBOLT more 1.5)
+		if CheckBoxOn(chain) and CastTime(LIGHTNINGBOLT more 1.5) and at least 0s from Spell(LAVABURST) until EndCastTime(CHAINLIGHTNING)
 				Spell(CHAINLIGHTNING)
 		Spell(LIGHTNINGBOLT)
 	}
 	if TalentPoints(TALENTFLURRY more 0)
 	{
-		if WeaponEnchantExpires(mainhand 2) Spell(WINDFURYWEAPON)
-		if WeaponEnchantExpires(offhand 2) Spell(FLAMETHONG)
+		unless InCombat()
+		{
+			if WeaponEnchantExpires(mainhand 400) Spell(WINDFURYWEAPON)
+			if WeaponEnchantExpires(offhand 400) Spell(FLAMETHONG)
+		}

 		if CheckBoxOn(aoe) and BuffPresent(MAELSTROMWEAPON stacks=5) Spell(CHAINLIGHTNING)
 		if BuffPresent(MAELSTROMWEAPON stacks=5) Spell(LIGHTNINGBOLT)
diff --git a/defaut/Demoniste.lua b/defaut/Demoniste.lua
index f28ddd9..62ed14a 100644
--- a/defaut/Demoniste.lua
+++ b/defaut/Demoniste.lua
@@ -63,13 +63,18 @@ ScoreSpells(CURSEELEMENTS SHADOWBOLT HAUNT UNSTABLEAFFLICTION IMMOLATE CONFLAGRA

 AddIcon help=main
 {
-if BuffExpires(FELARMOR) Spell(FELARMOR)
-if WeaponEnchantExpires(mainhand 5)
+
+unless InCombat()
 {
-	if TalentPoints(TALENTEMBERSTORM more 0) Spell(FIRESTONE)
-	Spell(SPELLSTONE)
-	Spell(FIRESTONE)
+	if BuffExpires(FELARMOR 400) Spell(FELARMOR)
+	if WeaponEnchantExpires(mainhand 400)
+	{
+		if TalentPoints(TALENTEMBERSTORM more 0) Spell(FIRESTONE)
+		Spell(SPELLSTONE)
+		Spell(FIRESTONE)
+	}
 }
+
 if Glyph(GLYPHLIFETAP) and BuffExpires(LIFETAP 0) Spell(LIFETAP)
 if List(curse elements) and TargetDebuffExpires(CURSEELEMENTS 2) and TargetDeadIn(more 8) Spell(CURSEELEMENTS)
 if TalentPoints(TALENTSHADOWEMBRACE more 0) and TargetDebuffExpires(SHADOWEMBRACE 0) Spell(SHADOWBOLT)
@@ -84,16 +89,18 @@ if TalentPoints(TALENTBACKDRAFT more 0) and TargetDebuffPresent(IMMOLATE mine=1)
 if TargetDebuffExpires(IMMOLATE 1.5 mine=1 haste=spell) and TargetDebuffExpires(UNSTABLEAFFLICTION 0 mine=1) and
 		{TargetLifePercent(more 25) or TalentPoints(TALENTDECIMATION more 0)} and TargetDeadIn(more 8)
 			Spell(IMMOLATE)
-if List(curse doom) and TargetDebuffExpires(CURSEDOOM 0 mine=1)
-{
-	if TargetDeadIn(more 60) Spell(CURSEDOOM)
-	if TargetDebuffExpires(CURSEAGONY 0 mine=1) Spell(CURSEAGONY)
-}
-if List(curse tongues) and TargetDebuffExpires(CURSETONGUES 2) Spell(CURSETONGUES)
-if List(curse weakness) and TargetDebuffExpires(CURSEWEAKNESS 2) Spell(CURSEWEAKNESS)
-if List(curse agony) and TargetDebuffExpires(CURSEAGONY 0 mine=1) and TargetDeadIn(more 10) Spell(CURSEAGONY)
+
 if TargetDebuffExpires(CORRUPTION 0 mine=1) and TargetDebuffExpires(SEEDOFCORRUPTION 0 mine=1)
 	and TargetDeadIn(more 9) and TalentPoints(TALENTEMBERSTORM less 1) Spell(CORRUPTION)
+
+if TargetDebuffExpires(CURSEDOOM 0) and TargetDebuffExpires(CURSETONGUES 2) and TargetDebuffExpires(CURSEWEAKNESS 2)
+	and TargetDebuffExpires(CURSEAGONY 0 mine=1) and TargetDebuffExpires(CURSEELEMENTS 2)
+{
+	if List(curse doom) and TargetDeadIn(more 60) Spell(CURSEDOOM)
+	if List(curse tongues) Spell(CURSETONGUES)
+	if List(curse weakness) Spell(CURSEWEAKNESS)
+	if TargetDeadIn(more 10) Spell(CURSEAGONY)
+}

 if BuffPresent(DECIMATION) Spell(SOULFIRE)

diff --git a/defaut/Mage.lua b/defaut/Mage.lua
index 8474d49..013f727 100644
--- a/defaut/Mage.lua
+++ b/defaut/Mage.lua
@@ -30,6 +30,10 @@ Define(MIRRORIMAGE 55342)
 Define(SUMMONWATERELEMENTAL 31687)
 Define(PRESENCEOFMIND 12043)

+Define(MAGEARMOR 6117)
+Define(MOLTENARMOR 30482)
+Define(ICEARMOR 7302)
+
 AddCheckBox(scorch SpellName(SCORCH) default talent=TALENTIMPROVEDSCORSH)
 AddCheckBox(abarr SpellName(ARCANEBARRAGE) default talent=TALENTARCANEBARRAGE)

@@ -48,6 +52,12 @@ ScoreSpells(SCORCH PYROBLAST LIVINGBOMB FROSTFIREBOLT FIREBALL SUMMONWATERELEMEN

 AddIcon help=main
 {
+		unless InCombat()
+		{
+			if BuffExpires(MAGEARMOR 400) or BuffExpires(MOLTENARMOR 400) or BuffExpires(ICEARMOR 400)
+				Spell(MOLTENARMOR)
+		}
+
        if TalentPoints(TALENTLIVINGBOMB more 0)
        {
               #Fire spec
@@ -71,7 +81,7 @@ AddIcon help=main
        if TalentPoints(TALENTARCANEBARRAGE more 0)
        {
 				#Arcane spec
-				unless DebuffPresent(ARCANEBLAST stacks=3)
+				unless DebuffPresent(ARCANEBLAST stacks=4)
 					Spell(ARCANEBLAST)
 				if BuffPresent(MISSILEBARRAGE)
 					Spell(ARCANEMISSILES)
diff --git a/defaut/Paladin.lua b/defaut/Paladin.lua
index 7078a3e..7fd9a49 100644
--- a/defaut/Paladin.lua
+++ b/defaut/Paladin.lua
@@ -57,29 +57,33 @@ SpellInfo(AVENGINGWRATH cd=180)

 AddIcon help=main
 {
-     if List(sceau piete) and BuffExpires(SEALRIGHTEOUSNESS 3) Spell(SEALRIGHTEOUSNESS)
-     if List(sceau autorite) and BuffExpires(SEALCOMMAND 3) Spell(SEALCOMMAND)
-     if List(sceau vengeance)
-     {
-          if BuffExpires(SEALVENGEANCE 3) Spell(SEALVENGEANCE)
-          if BuffExpires(SEALCORRUPTION 3) Spell(SEALCORRUPTION)
-     }
-     if TargetTargetIsPlayer(yes) Spell(HOLYSHIELD)
-     Spell(HAMMEROFTHERIGHTEOUS)
+	unless InCombat()
+	{
+		if List(sceau piete) and BuffExpires(SEALRIGHTEOUSNESS 400) Spell(SEALRIGHTEOUSNESS)
+		if List(sceau autorite) and BuffExpires(SEALCOMMAND 400) Spell(SEALCOMMAND)
+		if List(sceau vengeance)
+		{
+			if BuffExpires(SEALVENGEANCE 400) Spell(SEALVENGEANCE)
+			if BuffExpires(SEALCORRUPTION 400) Spell(SEALCORRUPTION)
+		}
+	}

-     Spell(CRUSADERSTRIKE)
-     Spell(HAMMEROFWRATH usable=1)
-     if List(jugement lumiere) Spell(JUDGELIGHT)
-     if List(jugement sagesse) Spell(JUDGEWISDOM)
-     if CheckBoxOn(tempete) Spell(DIVINESTORM)
-     if HasShield() Spell(SHIELDOFRIGHTEOUSNESS)
-     if TalentPoints(TALENTGUARDEDBYTHELIGHT more 0) and BuffExpires(DIVINEPLEA 0) Spell(DIVINEPLEA)
-     if CheckBoxOn(consecration) Spell(CONSECRATE)
-     if BuffPresent(THEARTOFWAR) Spell(EXORCISM)
-     if CheckBoxOn(coleredivine) Spell(HOLYWRATH)
+	if TargetTargetIsPlayer(yes) Spell(HOLYSHIELD)
+    Spell(HAMMEROFTHERIGHTEOUS)

-     Spell(HOLYSHOCK)
-     if BuffPresent(THEARTOFWAR) Spell(FLASHOFLIGHT priority=2)
+	Spell(CRUSADERSTRIKE)
+	Spell(HAMMEROFWRATH usable=1)
+	if List(jugement lumiere) Spell(JUDGELIGHT)
+	if List(jugement sagesse) Spell(JUDGEWISDOM)
+	if CheckBoxOn(tempete) Spell(DIVINESTORM)
+	if HasShield() Spell(SHIELDOFRIGHTEOUSNESS)
+	if TalentPoints(TALENTGUARDEDBYTHELIGHT more 0) and BuffExpires(DIVINEPLEA 0) Spell(DIVINEPLEA)
+	if CheckBoxOn(consecration) Spell(CONSECRATE)
+	if BuffPresent(THEARTOFWAR) Spell(EXORCISM)
+	if CheckBoxOn(coleredivine) Spell(HOLYWRATH)
+
+	Spell(HOLYSHOCK)
+	if BuffPresent(THEARTOFWAR) Spell(FLASHOFLIGHT priority=2)
 }

 AddIcon help=cd
diff --git a/defaut/Pretre.lua b/defaut/Pretre.lua
index 6cb005d..c1615b2 100644
--- a/defaut/Pretre.lua
+++ b/defaut/Pretre.lua
@@ -40,17 +40,19 @@ ScoreSpells(MB SWP VT DP MF)
 # Add main monitor
 AddIcon help=main
 {
-
-#Check shadowform is up
-unless BuffPresent(SF)
-    Spell(SF)
-
-# Refresh inner fire
-if BuffExpires(IF 60)
-    Spell(IF)
-
-if BuffExpires(VE 60)
-	Spell(VE)
+unless InCombat()
+{
+	#Check shadowform is up
+	unless BuffPresent(SF)
+		Spell(SF)
+
+	# Refresh inner fire
+	if BuffExpires(IF 400)
+		Spell(IF)
+
+	if BuffExpires(VE 400)
+		Spell(VE)
+}

 #if inner focus is active, cast mind blast
 if BuffPresent(Focus)