Originally Posted by
ipass
Hi I was wondering if this is possible? and what code could be added?
The Shadow Priest Profile I use ,auto targets mobs..which is good.
But it also target yellow mobs along with the red if range is available.
I was wondering what code could be added to this code to just target red mobs?
Auto target
SpellId:0
Action/startattck
Code:
if not healinit then
function CalculateHP(t)
local incomingheal = 0
if UnitGetIncomingHeals(t) then incomingheal = UnitGetIncomingHeals(t) end
return 100 * ( UnitHealth(t) + incomingheal ) / UnitHealthMax(t)
end
function SafeTarget(t)
if IsSpellInRange(tostring(GetSpellInfo(2050)),t) == 1
and UnitIsCharmed(t) == nil
and UnitIsDeadOrGhost(t) == nil
and UnitCanCooperate("player",t)
and PQR_IsOutOfSight(t) == false
then return true end
end
function DontDispel(t)
local buff = { 96328, 96325, 96326, 86788, 30108 }
for _,v in ipairs(buff) do if UnitDebuffID(t,v) then return true end end
end
function DangerousMagic(t)
local buff = { 5782, 118, 122, 339, 1499, 6358, 605, 20066, 8122, 853, 5484, 71757, 104601, 107629, 99567 }
for _,v in ipairs(buff) do if UnitDebuffID(t,v) then return true end end
end
healinit = true
end
lowhpmembers = 0
missingfortitude = false
missingshadow = false
havemending = false
priodispel = nil
if SafeTarget("target") then
PQR_CustomTarget = "target"
PQR_CustomTargetHP = CalculateHP("target")
elseif SafeTarget("mouseover") and GetMouseFocus() ~= WorldFrame then
PQR_CustomTarget = "mouseover"
PQR_CustomTargetHP = CalculateHP("mouseover")
else
PQR_CustomTarget = "player"
PQR_CustomTargetHP = CalculateHP("player")
local group = "party"
local members = GetNumPartyMembers()
if GetNumRaidMembers() > 0 then group = "raid" members = GetNumRaidMembers() end
for i = 1, members, 1 do
local member = group..tostring(i)
local memberhp = CalculateHP(member)
if SafeTarget(member) then
if UnitBuffID(member,41635) then havemending = true end
if not UnitBuffID(member,79107) then missingshadow = true end
if not UnitBuffID(member,79105) and not UnitBuffID(member,90364) and not UnitBuffID(member,469)
and not UnitBuffID(member,6307) then missingfortitude = true end
if UnitGroupRolesAssigned(member) == "TANK" then memberhp = memberhp - 1 end
if UnitThreatSituation(member) == 3 then memberhp = memberhp - 3 end
if memberhp < 90 then lowhpmembers = lowhpmembers +1 end
if memberhp < PQR_CustomTargetHP then
PQR_CustomTarget = member
PQR_CustomTargetHP = memberhp
end
if DangerousMagic(member) and not DontDispel(member) then priodispel = member end
end
end
if SafeTarget("pet") and DangerousMagic("pet") and not DontDispel("pet") then priodispel = "pet" end
if priodispel then PQR_CustomTarget = priodispel end
end
any help much Appreciated:P
thanks
ipass