Quantcast

Add IsAggroed() function.

Johnny C. Lam [09-18-12 - 03:07]
Add IsAggroed() function.

TargetIsAggroed() can be used to check if the target's primary target is
the player, regardless of if the target is momentarily targeting another
toon.

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@529 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
OvaleCondition.lua
diff --git a/OvaleCondition.lua b/OvaleCondition.lua
index 95f3e0b..57d1fdf 100644
--- a/OvaleCondition.lua
+++ b/OvaleCondition.lua
@@ -817,6 +817,11 @@ OvaleCondition.conditions=
 	itemcharges = function(condition)
 		return compare(GetItemCount(condition[1], false, true), condition[2], condition[3])
 	end,
+	-- Check if the target is aggroed to the player
+	-- returns: bool
+	isaggroed = function(condition)
+		return testbool(UnitDetailedThreatSituation("player", getTarget(condition.target)), condition[1])
+	end,
 	-- Check if the player is feared
 	-- returns: bool
 	isfeared = function(condition)