from retail

This commit is contained in:
NoM0Re
2025-02-11 20:18:57 +01:00
parent eee4c23026
commit f94aff6a9d
6 changed files with 95 additions and 28 deletions
+20 -1
View File
@@ -4032,7 +4032,22 @@ local commonConditions = {
name = {
display = L["Name"],
type = "string",
}
},
itemInRange = {
display = WeakAuras.newFeatureString .. L["Item in Range"],
hidden = true,
type = "bool",
test = function(state, needle)
if not state or not state.itemId or not state.show or not UnitExists('target') then
return false
end
if InCombatLockdown() and not UnitCanAttack('player', 'target') then
return false
end
return C_Item.IsItemInRange(state.itemId, 'target') == (needle == 1)
end,
events = { "PLAYER_TARGET_CHANGED", "WA_SPELL_RANGECHECK", }
},
}
function Private.ExpandCustomVariables(variables)
@@ -4108,6 +4123,10 @@ function GenericTrigger.GetTriggerConditions(data, triggernum)
result.name = commonConditions.name;
end
if prototype.hasItemID then
result.itemInRange = commonConditions.itemInRange
end
for _, v in pairs(prototype.args) do
if (v.conditionType and v.name and v.display) then
local enable = true;