From 654b47c0f24bf13c12e6f1245c07a705d01a909f Mon Sep 17 00:00:00 2001 From: "Johnny C. Lam" Date: Sun, 31 Mar 2013 10:22:50 +0000 Subject: [PATCH] Add new condition IsPVP() to check for PvP-flagged units. git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@874 d5049fe3-3747-40f7-a4b5-f36d6801af5f --- OvaleCondition.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/OvaleCondition.lua b/OvaleCondition.lua index 2516c74..d25267d 100644 --- a/OvaleCondition.lua +++ b/OvaleCondition.lua @@ -60,6 +60,7 @@ local API_UnitHealth = UnitHealth local API_UnitHealthMax = UnitHealthMax local API_UnitIsDead = UnitIsDead local API_UnitIsFriend = UnitIsFriend +local API_UnitIsPVP = UnitIsPVP local API_UnitIsUnit = UnitIsUnit local API_UnitLevel = UnitLevel local API_UnitPower = UnitPower @@ -1607,6 +1608,23 @@ OvaleCondition.conditions.isfriend = function(condition) return TestBoolean(API_UnitIsFriend("player", GetTarget(condition)), condition[1]) end +--- Test if the target is flagged for PvP activity. +-- @name IsPVP +-- @paramsig boolean +-- @param yesno Optional. If yes, then return true if the target is flagged for PvP activity. If no, then return true if it isn't PvP-flagged. +-- Default is yes. +-- Valid values: yes, no. +-- @param target Optional. Sets the target to check. The target may also be given as a prefix to the condition. +-- Defaults to target=player. +-- Valid values: player, target, focus, pet. +-- @return A boolean value. +-- @usage +-- if not target.IsFriend() and target.IsPVP() Spell(sap) + +OvaleCondition.conditions.isfriend = function(condition) + return TestBoolean(API_UnitIsPVP(GetTarget(condition)), condition[1]) +end + --- Test if the player is incapacitated. -- @name IsIncapacitated -- @paramsig boolean -- 1.7.9.5