i try to make dispel ability, but it doenst dispel anything and i dont know why. no lua error
ability: dispel any friendly player in range and line of sight without "dont-dispel-debuffs". if there are more of these in range, dispel the one with most dispellable debuffs.
Code:
local group = "solo"
if IsInRaid() then
group = "raid"
elseif IsInGroup() then
group = "party"
end
if group ~= "solo" then
local max = GetNumGroupMembers()
local count = 0
local maxCount = 0
local maxTar = "player"
for num = 1, max do
local mem = group..num
if IsSpellInRange("Läuterung",mem) == 1
and not PQR_IsOutOfSight(mem)
and UnitDebuffID(mem, 33786) == nil
and UnitDebuffID(mem, 131736) == nil
and UnitDebuffID(mem, 30108) == nil
and UnitDebuffID(mem, 30108) == nil
and UnitDebuffID(mem, 124465) == nil
and UnitDebuffID(mem, 34914) == nil
then
count = 0
for k = 1, 40 do
local name, rank, icon, count, type = UnitDebuff(mem,k)
if type == "Poison"
or type == "Disease"
or type == "Magic"
then
count = count + 1
end
end
if count > maxCount then
maxTar = mem
maxCount = count
end
end
end
if maxCount > 0 then
PQR_CustomTarget = maxTar
return true
end
end
where is the problem?
PS: is there any faster way to get just dispellable debuffs?
PPS: in group or solo (means not raid) this code doesnt dispel the player self, i know it is not finished yet