riptide can't really blanket like pw:s, so casts have to be a little more direct.
I wanted to make it cast on the target with the lowest health that doesn't have riptide. so the idea was to make a second raid list, one that was made up of people without the riptide buff, by copying the PE function canHeal, but adding a check for the riptide buff:
Code:
local function missingRiptide(unit)
if UnitExists(unit)
and UnitCanAssist('player', unit)
and UnitIsFriend('player', unit)
and UnitIsConnected(unit)
and not UnitIsDeadOrGhost(unit)
and not UnitUsingVehicle(unit) then
if UnitInParty(unit) and not UnitInRange(unit) then
return false
end
if UnitBuff("unit", GetSpellInfo(61295)) then
return false
end
return true
end
return false
end
then, the theory was to isolate the lowest person on that list the same way as ProbablyEngine.raid.lowestHP, which targets the lowest person on the canHeal list:
Code:
needRiptide = function ()
local lowestUnit = 'player'
if missingRiptide('focus') then lowestUnit = 'focus' end
local lowest = 100
for _, unit in pairs(ProbablyEngine.raid.roster) do
if missingRiptide(unit.unit) and unit.health and unit.health < lowest then
lowest = unit.health
lowestUnit = unit.unit
end
end
return lowestUnit
end
Then, PE seems to create a "target" and creates "lowest" for use in rotations, which is what I copied here:
Code:
if target == "shouldRiptide" then
target = needRiptide()
if target == false then return end
elseif target == "tank" then
if UnitExists("focus") then
target = "focus"
else
target = ProbablyEngine.raid.tank()
end
end
that was the thought process i had, at least. I don't know if it's something I can put together, but I suppose there could be a number of functions at different health thresholds, to kind of mimic that process.