From 5eefd055946052ec47420a4176bb1dbed3e69a62 Mon Sep 17 00:00:00 2001 From: Sidoine De Wispelaere Date: Sat, 5 Feb 2011 16:21:06 +0000 Subject: [PATCH] fix for RelativeLevel git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@353 d5049fe3-3747-40f7-a4b5-f36d6801af5f --- Condition.lua | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/Condition.lua b/Condition.lua index 9c7cc29..7db56c5 100644 --- a/Condition.lua +++ b/Condition.lua @@ -623,19 +623,6 @@ Ovale.conditions= buildStunSpellList() return testbool(not HasFullControl() and isDebuffInList(stunSpellList), condition[1]) end, - -- Test the target level difference with the player - -- 1 : "less" or "more" - -- 2 : [target level]-[player level] limit - TargetRelativeLevel = function(condition) - local difference - if (UnitLevel("target") == -1) then - difference = 3 - else - difference = UnitLevel("target") - UnitLevel("player") - end - - return compare(difference, condition[1], condition[2]) - end, LastSpellDamage = function(condition) local spellId = condition[1] if not Ovale.spellDamage[spellId] then @@ -822,6 +809,20 @@ Ovale.conditions= end return maxCD end, + -- Test the target level difference with the player + -- 1 : "less" or "more" + -- 2 : [target level]-[player level] limit + RelativeLevel = function(condition) + local difference + local target = getTarget(condition.target) + if (UnitLeveltarget) == -1) then + difference = 3 + else + difference = UnitLevel(target) - UnitLevel("player") + end + + return compare(difference, condition[1], condition[2]) + end, SoulShards = function(condition) return compare(Ovale.state.shard, condition[1], condition[2]) end, -- 1.7.9.5