From ca62efec2a4036786506452be84a5c9b27661038 Mon Sep 17 00:00:00 2001 From: Jrc13245 Date: Sat, 8 Nov 2025 11:11:26 -0500 Subject: [PATCH] fix cooldown conditional with no argument --- .gitignore | 1 + Conditionals.lua | 21 ++++++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1f9bf51 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +wow-api-type-definitions/ diff --git a/Conditionals.lua b/Conditionals.lua index 8c31541..f3b3071 100644 --- a/Conditionals.lua +++ b/Conditionals.lua @@ -567,7 +567,7 @@ function CleveRoids.ValidateCooldown(args, ignoreGCD) local expires = CleveRoids.GetCooldown(args.name, ignoreGCD) if not args.operator and not args.amount then - return expires > 0 + return expires > GetTime() elseif CleveRoids.operators[args.operator] then return CleveRoids.comparators[args.operator](expires - GetTime(), args.amount) end @@ -952,6 +952,21 @@ function CleveRoids.GetItemCooldown(item) return 0, 0, 0 end +function CleveRoids.ValidatePlayerAuraCount(bigger, amount) + local aura_ix = -1 + local num = 0 + while true do + aura_ix = GetPlayerBuff(num,"HELPFUL|PASSIVE") + if aura_ix == -1 then break end + num = num + 1 + end + if bigger == 0 then + return num < tonumber(amount) + else + return num > tonumber(amount) + end +end + function CleveRoids.IsReactive(name) return CleveRoids.reactiveSpells[spellName] ~= nil end @@ -1604,5 +1619,9 @@ CleveRoids.Keywords = { noswimming = function(conditionals) -- Check if "Aquatic Form" is NOT usable return not CleveRoids.IsReactiveUsable("Aquatic Form") + end, + + mybuffcount = function(conditionals) + return And(conditionals.mybuffcount,function (v) return CleveRoids.ValidatePlayerAuraCount(v.bigger, v.amount) end) end }