Quantcast

- added the nored=1 option to Spell function: force the use of the spell cooldown

Sidoine De Wispelaere [11-15-09 - 12:46]
- added the nored=1 option to Spell function: force the use of the spell cooldown
- experimental: added sync for Recount (not tested)
- some changes to protection paladin and fury warrior scripts

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@129 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
Ovale.lua
Ovale.toc
OvaleFrame.lua
OvaleIcone.lua
defaut/Guerrier.lua
defaut/Paladin.lua
diff --git a/Ovale.lua b/Ovale.lua
index d5c9c64..52731c8 100644
--- a/Ovale.lua
+++ b/Ovale.lua
@@ -33,6 +33,8 @@ Ovale.className = nil
 Ovale.state = {rune={}, cd = {}}
 Ovale.scoreSpell = {}
 Ovale.otherDebuffs = {}
+Ovale.score = 0
+Ovale.maxScore = 0

 Ovale.arbre = {}

@@ -494,6 +496,7 @@ function Ovale:OnEnable()
     self:RegisterEvent("UNIT_SPELLCAST_SENT")
     self:RegisterEvent("PLAYER_TARGET_CHANGED")
 	self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
+	self:RegisterEvent("CHAT_MSG_ADDON")

 	if (not self.firstInit) then
 		self:FirstInit()
@@ -508,7 +511,8 @@ function Ovale:UNIT_SPELLCAST_SENT(event,unit,name,rank,target)
 		-- self.lastSpellCast=name
 		if (not self.spellInfo[name] or not self.spellInfo[name].toggle) and self.scoreSpell[name] then
 			local scored = self.frame:GetScore(name)
-			-- self:Print(scored .. " for "..name)
+			self.score = self.score + scored
+			self.maxScore = self.maxScore + 1
 			if Recount then
 				local source =Recount.db2.combatants[UnitName("player")]
 				if source then
@@ -520,6 +524,15 @@ function Ovale:UNIT_SPELLCAST_SENT(event,unit,name,rank,target)
 	end
 end

+function Ovale:CHAT_MSG_ADDON(prefix, msg, type, author)
+	if prefix ~= "Ovale" then return end
+	if type ~= "RAID" and type~= "PARTY" then return end
+
+    local value, max = strsplit(";", msg)
+    Recount:AddAmount(author, "Ovale", value)
+    Recount:AddAmount(author, "Ovale", max)
+end
+
 function Ovale:PLAYER_REGEN_ENABLED()
 	self.enCombat = false
 	self:UpdateVisibility()
@@ -529,6 +542,9 @@ function Ovale:PLAYER_REGEN_ENABLED()
 end

 function Ovale:PLAYER_REGEN_DISABLED()
+	if self.maxScore>0 then
+		SendAddonMessage("Ovale", self.score..";"..self.maxScore, "RAID")
+	end
 	self.enCombat = true
 	self.score = 0
 	self.maxScore = 0
@@ -550,6 +566,7 @@ function Ovale:OnDisable()
     self:UnregisterEvent("UNIT_SPELLCAST_SENT")
     self:UnregisterEvent("PLAYER_TARGET_CHANGED")
     self:UnregisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
+    self:UnregisterEvent("CHAT_MSG_ADDON")
     self.frame:Hide()
 end

@@ -956,7 +973,7 @@ function Ovale:GetActionInfo(element)
 	end

 	return actionTexture, actionInRange, actionCooldownStart, actionCooldownDuration,
-					actionUsable, actionShortcut, actionIsCurrent, actionEnable, spellName, target
+					actionUsable, actionShortcut, actionIsCurrent, actionEnable, spellName, target, element.params.nored
 end

 function Ovale:CalculerMeilleureAction(element)
@@ -1162,7 +1179,7 @@ function Ovale:CalculerMeilleureAction(element)
 					elseif (priorite and priorite < meilleurePrioriteFils) then
 						-- A l'inverse, si il est moins prioritaire que le précédent, on ne le lance
 						-- que si il se lance au moins 1,5s avant
-						maxEcart = -self.gcd
+						maxEcart = -self.gcd*0.75
 					else
 						maxEcart = -0.01
 					end
diff --git a/Ovale.toc b/Ovale.toc
index 3ad39bf..abe4f91 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.2.14
+## Version: 3.2.15
 ## OptionalDeps: Ace3, ButtonFacade, Recount
 ## SavedVariables: OvaleDB
 ## SavedVariablesPerCharacter: OvaleDBPC
diff --git a/OvaleFrame.lua b/OvaleFrame.lua
index 7ec51cb..2267816 100644
--- a/OvaleFrame.lua
+++ b/OvaleFrame.lua
@@ -137,13 +137,13 @@ do
 			local action = self.actions[k]

 			local actionTexture, actionInRange, actionCooldownStart, actionCooldownDuration,
-					actionUsable, actionShortcut, actionIsCurrent, actionEnable, spellName, actionTarget = Ovale:GetActionInfo(element)
+					actionUsable, actionShortcut, actionIsCurrent, actionEnable, spellName, actionTarget, noRed = Ovale:GetActionInfo(element)

 			if (node.params.nocd and node.params.nocd == 1 and minAttente~=nil and minAttente>1.5) then
 				action.icons[1]:Update(nil)
 			else
 				action.icons[1]:Update(minAttente, actionTexture, actionInRange, actionCooldownStart, actionCooldownDuration,
-					actionUsable, actionShortcut, actionIsCurrent, actionEnable, spellName, actionTarget)
+					actionUsable, actionShortcut, actionIsCurrent, actionEnable, spellName, actionTarget, noRed)
 			end

 			action.spellName = spellName
diff --git a/OvaleIcone.lua b/OvaleIcone.lua
index 46661ec..20f54d6 100644
--- a/OvaleIcone.lua
+++ b/OvaleIcone.lua
@@ -2,7 +2,7 @@
 local L = LibStub("AceLocale-3.0"):GetLocale("Ovale")

 local function Update(self, minAttente, actionTexture, actionInRange, actionCooldownStart, actionCooldownDuration,
-				actionUsable, actionShortcut, actionIsCurrent, actionEnable, spellName, actionTarget)
+				actionUsable, actionShortcut, actionIsCurrent, actionEnable, spellName, actionTarget, noRed)

 	if (not Ovale.bug) then
 		Ovale.traced = false
@@ -16,6 +16,10 @@ local function Update(self, minAttente, actionTexture, actionInRange, actionCool
 	if (Ovale.bug and not Ovale.traced) then
 		Ovale.trace = true
 	end
+
+	if noRed then
+		minAttente = actionCooldownStart + actionCooldownDuration - Ovale.maintenant
+	end

 	if (minAttente~=nil and actionTexture) then

diff --git a/defaut/Guerrier.lua b/defaut/Guerrier.lua
index 07255d6..1024c34 100644
--- a/defaut/Guerrier.lua
+++ b/defaut/Guerrier.lua
@@ -59,24 +59,24 @@ AddIcon help=main
 {
      if List(shout command) and
        BuffExpires(COMMANDSHOUT 3)
-          Spell(COMMANDSHOUT)
+          Spell(COMMANDSHOUT nored=1)

      if List(shout battle) and BuffExpires(BATTLESHOUT 3)
-          Spell(BATTLESHOUT)
+          Spell(BATTLESHOUT nored=1)

      if TargetClassification(worldboss)
             and CheckBoxOn(demo)
             and TargetDebuffExpires(DEMOSHOUT 2)
             and TargetDebuffExpires(DEMORALIZINGROAR 0)
             and TargetDebuffExpires(CURSEOFWEAKNESS 0)
-          Spell(DEMOSHOUT)
+          Spell(DEMOSHOUT nored=1)

      if Stance(2) #Defense
      {
         if TargetClassification(worldboss)
         {
             if TargetDebuffExpires(THUNDERCLAP 2)
-				Spell(THUNDERCLAP)
+				Spell(THUNDERCLAP nored=1)
 			Spell(CONCUSSIONBLOW)
 			Spell(SHOCKWAVE)
 		}
@@ -114,10 +114,10 @@ AddIcon help=main
         if BuffPresent(SLAMBUFF)
         {
 			if BuffExpires(SLAMBUFF 2)
-				Spell(SLAM)
-			Spell(SLAM priority=2)
-		}
-
+      			Spell(SLAM nored=1)
+      		Spell(SLAM priority=2)
+      	}
+
         Spell(MORTALSTRIKE)

         if TalentPoints(SLAMTALENT more 1)
@@ -145,10 +145,15 @@ AddIcon help=main
         Spell(DEVASTATE)
      }

-     if CheckBoxOn(sunder) and TargetDebuffExpires(SUNDER 5 stacks=5)
+     if CheckBoxOn(sunder) and TargetDebuffExpires(SUNDER 5 stacks=5)
      {
-		Spell(DEVASTATE)
-        Spell(SUNDER)
+		if TargetDebuffPresent(SUNDER)
+		{
+			Spell(DEVASTATE)
+			Spell(SUNDER)
+		}
+	    Spell(DEVASTATE priority=2)
+		Spell(SUNDER priority=2)
      }
 }

diff --git a/defaut/Paladin.lua b/defaut/Paladin.lua
index fcae93b..dddd396 100644
--- a/defaut/Paladin.lua
+++ b/defaut/Paladin.lua
@@ -19,6 +19,8 @@ Define(SHIELDOFRIGHTEOUSNESS 53600)
 Define(HOLYSHIELD 20925)
 Define(HAMMEROFTHERIGHTEOUS 53595)
 Define(HOLYWRATH 2812)
+Define(TALENTGUARDEDBYTHELIGHT 2194)
+Define(DIVINEPLEA 54428)

 AddListItem(sceau piete SpellName(SEALRIGHTEOUSNESS))
 AddListItem(sceau autorite SpellName(SEALCOMMAND))
@@ -48,12 +50,13 @@ AddIcon help=main
      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 HasShield() Spell(SHIELDOFRIGHTEOUSNESS)
      if BuffPresent(THEARTOFWAR) Spell(FLASHOFLIGHT priority=2)
 }