Thank you for replying. Given what I am trying to accomplish, checking LoS might be overkill then - so I won't bother. As for finding the efficiency comparison info between a UnitBuff loop and AuraUtil - I could not. So for now I'm still using AuraUtil; but I am definitely interested in seeing those results. If you could point me in that general direction, that'd be great!
As for comparing unit instance info, that's a good idea! As such, I have updated my code to look like this:
Code:
function()
-- cycle through group members
for unit in WA_IterateGroupMembers() do
-- check if unit exists and is not dead
if UnitExists(unit) and not UnitIsDead(unit) then
-- determine player and unit instanceID
local playerInstance = select(4, UnitPosition("player"))
local unitInstance = select(4, UnitPosition(unit))
-- determine if unit and player are in the same instance
if unitInstance == playerInstance then
-- check if unit is in range of spell
if IsSpellInRange("Power Word: Fortitude", unit) then
-- check to see if unit has the aura from the spell
local spellID = select(10, AuraUtil.FindAuraByName("Power Word: Fortitude", unit))
-- if unit does not have the buff, display this weakaura (return true)
if spellID == nil then
return true
end
end
end
end
end
end