Quantcast

added Threat function

Sidoine De Wispelaere [05-24-10 - 11:44]
added Threat function

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@251 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
Condition.lua
Ovale.lua
diff --git a/Condition.lua b/Condition.lua
index a9db9a5..da44aa7 100644
--- a/Condition.lua
+++ b/Condition.lua
@@ -783,6 +783,10 @@ Ovale.conditions=
 	TargetTargetIsPlayer = function(condition)
 		return testbool(UnitIsUnit("player","targettarget"), condition[1])
 	end,
+	Threat = function(condition)
+		local isTanking, status, threatpct = UnitDetailedThreatSituation("player", getTarget(condition.target))
+		return compare(threatpct, condition[1], condition[2])
+	end,
 	TimeInCombat = function(condition)
 		if condition[1] == "more" then
 			return Ovale.combatStartTime + condition[2]
diff --git a/Ovale.lua b/Ovale.lua
index 4300d3a..14dc36f 100644
--- a/Ovale.lua
+++ b/Ovale.lua
@@ -386,7 +386,7 @@ end

 function Ovale:COMBAT_LOG_EVENT_UNFILTERED(event, ...)
 	local time, event, sourceGUID, sourceName, sourceFlags, destGUID, destName, destFlags = select(1, ...)
-	self:Print("event="..event.." source="..nilstring(sourceName).." destName="..nilstring(destName).." " ..GetTime())
+	--self:Print("event="..event.." source="..nilstring(sourceName).." destName="..nilstring(destName).." " ..GetTime())
 	if sourceName == UnitName("player") then
 		if string.find(event, "SPELL_CAST_SUCCESS") == 1 or string.find(event, "SPELL_DAMAGE")==1
 				or string.find(event, "SPELL_MISSED") == 1