Quantcast

added Counter() function and inccounter/resetcounter parameters to SpellInfo

Sidoine De Wispelaere [01-02-10 - 17:21]
added Counter() function and inccounter/resetcounter parameters to SpellInfo

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@186 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
Condition.lua
Ovale.lua
Ovale.toc
diff --git a/Condition.lua b/Condition.lua
index c531e47..5972f98 100644
--- a/Condition.lua
+++ b/Condition.lua
@@ -402,6 +402,9 @@ Ovale.conditions=
 		local points = Ovale.state.combo
 		return compare(points, condition[1], condition[2])
 	end,
+	Counter = function(condition)
+		return compare(Ovale.counter[condition[1]], condition[2], condition[3])
+	end,
 	DebuffExpires = function(condition)
 		local start, ending = GetTargetAura(condition, "HARMFUL", "player")
 		local tempsMax = avecHate(condition[2], condition.haste)
diff --git a/Ovale.lua b/Ovale.lua
index 3aef017..027f064 100644
--- a/Ovale.lua
+++ b/Ovale.lua
@@ -35,6 +35,7 @@ Ovale.otherDebuffs = {}
 Ovale.score = 0
 Ovale.maxScore = 0
 Ovale.serial = 0
+Ovale.counter = {}

 Ovale.arbre = {}

@@ -545,6 +546,18 @@ function Ovale:UNIT_SPELLCAST_SENT(event,unit,name,rank,target)
 	-- self:Print("UNIT_SPELLCAST_SENT"..event.." unit="..unit.." name="..name.." tank="..rank.." target="..target)
 	if unit=="player" and self.enCombat then
 		-- self.lastSpellCast=name
+		if self.spellInfo[name] then
+			if self.spellInfo[name].resetcounter then
+				self.counter[self.spellInfo[name].resetcounter] = 0
+			end
+			if self.spellInfo[name].inccounter then
+				local cname = self.spellInfo[name].inccounter
+				if not self.counter[cname] then
+					self.counter[cname] = 0
+				end
+				self.counter[cname] = self.counter[cname] + 1
+			end
+		end
 		if (not self.spellInfo[name] or not self.spellInfo[name].toggle) and self.scoreSpell[name] then
 			local scored = self.frame:GetScore(name)
 			if scored~=nil then
diff --git a/Ovale.toc b/Ovale.toc
index 7b0c8af..fd151f7 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.10
+## Version: 3.3.11
 ## OptionalDeps: Ace3, ButtonFacade, Recount, LibBabble-CreatureType-3.0
 ## SavedVariables: OvaleDB
 ## SavedVariablesPerCharacter: OvaleDBPC