Originally Posted by
onya
ah good point, i should be checking that someone else doesn't need a big heal before wasting a GCD refreshing on a tank, and i should also be checking the focus.
so try this.
Code:
local _,lcd = GetSpellCooldown(61295)
if lcd == 0 and IsUsableSpell(61295) then
if (member[lowest].health > ghwhealth ) then
if UnitExists("focus") then
local _,_,_,_,_,_,ah = UnitBuffID("focus") <<<<<<<< id of the buff missing ?
local _,_,_,_,_,_,rt = UnitBuffID("focus") <<<<<<<<
if isvalidhealtarget("focus") and ah < 6 and rt < 6 then
SilentCast(61295,"focus")
return true
end
else
for k,v in ipairs(tanks) do
local _,_,_,_,_,_,ah = UnitBuffID(member[v].name, 105284)
local _,_,_,_,_,_,rt = UnitBuffID(member[v].name, 61295)
if ah == nil then ah = 0 end
if rt == nil then rt = 0 end
if isvalidhealtarget(member[v].name) and ah < 6 and rt < 6 then
SilentCast(61295,member[v].name)
return true
end
end
end
end
if rttarget == nil then rttarget = 0 end
if member[rttarget].health < rthealth then
if isvalidhealtarget(member[rttarget].name) then
SilentCast(61295,member[rttarget].name)
return true
end
end
end
Thank you for your answer, i dont see a improvement in the code you posted sorry.
The local _,_,_,_,_,_,expirationTime do not work, the script refresh the riptide only at 0 (nil) its what i need to make it work (pqr bug ? )
Nevermind here the codes for riptide i try.
Code:
local cdriptide = PQR_SpellAvailable(61295)
--rt on raid if valid rt target (less than 90%)
if cdriptide and mana >= 2202 and rttarget ~= nil then
if member[rttarget].health <= rthealth then
if isvalidhealtarget(member[rttarget].name) then
SilentCast(61295,member[rttarget].name)
return true
end
end
end
--rt & ancestral vigor on focus if less than 6sec
if cdriptide and mana >= 2202 and (member[lowest].health >= 45 ) then
local _,_,_,_,_,_,ah = UnitBuffID("focus", 105284)
local _,_,_,_,_,_,rt = UnitBuffID("focus", 61295)
if ah == nil then ah = 0 end
if rt == nil then rt = 0 end
if UnitExists("focus") and isvalidhealtarget("focus") and ah < 6 and rt < 6 then
SilentCast(61295,"focus")
return true
end
end
--rt for tidal waves if less than 2sec (or 1)
local _,_,_,_,_,_,tw = UnitBuffID("player", 53390)
if tw == nil then tw = 0 end
if cdriptide and mana >= 2202 and rttarget ~= nil then
if member[rttarget].health >= rttwhealth then
if isvalidhealtarget(member[rttarget].name) and tw < 2 then
SilentCast(61295,member[rttarget].name)
return true
end
end
end
--rt for trinket spirit from spine (for not lose the 10stacks)
if cdriptide and mana >= 2202 and rttarget ~= nil then
local _,_,_,_,_,_,_,_,em = UnitBuffID("player", 107962)
if em == nil then em = 0 end
if member[lowest].health >= rttwhealth then
if isvalidhealtarget(member[rttarget].name) and em < 3 then
SilentCast(61295,member[rttarget].name)
return true
end
end
end
and here the old but good one:
Code:
local cdriptide = PQR_SpellAvailable(61295)
---rt on raid
if cdriptide and mana >= 2202 and rttarget ~= nil then
if member[rttarget].health <= rthealth then
if isvalidhealtarget(member[rttarget].name) then
SilentCast(61295,member[rttarget].name)
return true
end
end
end
---rt on focus
if cdriptide and mana >= 2202 and (member[lowest].health >= ghwhealth ) then
if UnitExists("focus") and isvalidhealtarget("focus") and not UnitBuffID("focus", 61295) then
SilentCast(61295,"focus")
return true
end
end
---rt for tidal waves
if cdriptide and mana >= 2202 and UnitBuffID("player", 53390) == nil and rttarget ~= nil then
if member[rttarget].health >= rttwhealth then
if isvalidhealtarget(member[rttarget].name) then
SilentCast(61295,member[rttarget].name)
return true
end
end
end