mirror of
https://github.com/brues-code/SuperCleveRoidMacros.git
synced 2026-09-16 03:38:00 +00:00
New conditionals level and mylevel
This commit is contained in:
@@ -300,6 +300,17 @@ function CleveRoids.ValidateComboPoints(operator, amount)
|
||||
return false
|
||||
end
|
||||
|
||||
function CleveRoids.ValidateLevel(unit, operator, amount)
|
||||
if not unit or not operator or not amount then return false end
|
||||
local level = UnitLevel(unit)
|
||||
|
||||
if level and CleveRoids.operators[operator] then
|
||||
return CleveRoids.comparators[operator](level, amount)
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
function CleveRoids.ValidateKnown(args)
|
||||
if not args then
|
||||
return false
|
||||
@@ -1162,6 +1173,20 @@ CleveRoids.Keywords = {
|
||||
end)
|
||||
end,
|
||||
|
||||
level = function(conditionals)
|
||||
return And(conditionals.level, function(args)
|
||||
if type(args) ~= "table" then return false end
|
||||
return CleveRoids.ValidateLevel(conditionals.target, args.operator, args.amount)
|
||||
end)
|
||||
end,
|
||||
|
||||
mylevel = function(conditionals)
|
||||
return And(conditionals.mylevel, function(args)
|
||||
if type(args) ~= "table" then return false end
|
||||
return CleveRoids.ValidateLevel("player", args.operator, args.amount)
|
||||
end)
|
||||
end,
|
||||
|
||||
myhp = function(conditionals)
|
||||
return And(conditionals.myhp, function(args)
|
||||
if type(args) ~= "table" then return false end
|
||||
|
||||
Reference in New Issue
Block a user