Quantcast

added debuffTick function

Sidoine De Wispelaere [02-19-12 - 11:48]
added debuffTick function

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@479 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
Condition.lua
Ovale.toc
diff --git a/Condition.lua b/Condition.lua
index 026297d..e976bd0 100644
--- a/Condition.lua
+++ b/Condition.lua
@@ -688,6 +688,23 @@ Ovale.conditions=
 		local timeBefore = avecHate(condition[2], condition.haste)
 		return start, addTime(ending, -timeBefore)
 	end,
+	debuffTick = function(condition)
+		local start, ending = GetTargetAura(condition, "HARMFUL", getTarget(condition.target))
+		local si = Ovale.spellInfo[condition[1]]
+		if not si or not si.duration then
+			return nil
+		end
+		local ticks = floor(Ovale.spellHaste * (si.duration/(si.tick or 3)) + 0.5)
+		local tickLength = (ending - start) / ticks
+		local tickTime = start + tickLength
+		for i=1,ticks do
+			if Ovale.currentTime<=tickTime then
+				break
+			end
+			tickTime = tickTime + tickLength
+		end
+		return tickTime, 0, -1
+	end,
 	Distance = function(condition)
 		if LRC then
 			local target = getTarget(condition.target)
diff --git a/Ovale.toc b/Ovale.toc
index d9aedb4..c825668 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: 4.3.9
+## Version: 4.3.10
 ## OptionalDeps: Ace3, Masque, Recount, Skada, LibBabble-CreatureType-3.0, LibRangeCheck-2.0
 ## SavedVariables: OvaleDB
 ## SavedVariablesPerCharacter: OvaleDBPC