I was having a problem with decursive dispels interrupting my pally healing in a 5 man. So i removed the addon and modified the decurse party function. Check this out and feel free to provide feedback. It isn't finished yet and just works for mages and pallys but you should get the idea:
function DecurseParty()
if MyMana()<220 then return end
if ImBusy() then return end
local y,x
for x=1,40 do
local name,count,debuffType=UnitDebuff("player",x)
if debuffType=="Curse" then
if SpellExists("Remove Lesser Curse") then TargetUnit(PartyID(UnitName("player"))) cast("Remove Lesser Curse") end
return
end
if debuffType=="Magic" then
if SpellExists("Cleanse") then TargetUnit(PartyID(UnitName("player"))) cast("Cleanse") end
return
end
if debuffType=="Disease" then
if SpellExists("Cleanse") then TargetUnit(PartyID(UnitName("player"))) cast("Cleanse") end
return
end
if debuffType=="Poison" then
if SpellExists("Cleanse") then TargetUnit(PartyID(UnitName("player"))) cast("Cleanse") end
return
end
end
for y=1,4 do
for x=1,16 do
local name,count,debuffType=UnitDebuff("party"..y,x)
if debuffType=="Curse" then
if SpellExists("Remove Lesser Curse") then TargetUnit(PartyID(UnitName("party"..y))) cast("Remove Lesser Curse") end
return
end
if debuffType=="Magic" then
if SpellExists("Cleanse") then TargetUnit(PartyID(UnitName("party"..y))) cast("Cleanse") end
return
end
if debuffType=="Disease" then
if SpellExists("Cleanse") then TargetUnit(PartyID(UnitName("party"..y))) cast("Cleanse") end
return
end
if debuffType=="Poison" then
if SpellExists("Cleanse") then TargetUnit(PartyID(UnitName("party"..y))) cast("Cleanse") end
return
end
end
end
TargetUnit("playertarget")
end
Also, you never need to use PartyID--its job is only to return a UnitName ("party1", "raid23","player", etc.) when given a toon name.
You don't need that, you already have the UnitName.
Looks pretty good. I will add that raid decurse function to my sm_extend.
I love it!
I'm stealing it right now! I hate Decursive and its spell-cancelling deadliness.
This looks like it works. Not a lot of testing in yet tho. DECURSIVE UNINSTALLED!
function Decurse()
if MyMana()<220 then return end
if ImBusy() then return end
local y,x
if UnitInRaid("player") then
for x=1,GetNumRaidMembers() do
for y=1,16 do
local name,count,debuffType=UnitDebuff("raid"..x,y)
if debuffType=="Curse" then
if SpellExists("Remove Curse") then TargetUnit("raid"..x) cast("Remove Curse") end
if SpellExists("Remove Lesser Curse") then TargetUnit("raid"..x) cast("Remove Lesser Curse") end
return
end
if debuffType=="Magic" then
if SpellExists("Cleanse") then TargetUnit("raid"..x) cast("Cleanse") end
if SpellExists("Dispel Magic") then TargetUnit("raid"..x) cast("Dispel Magic") end
return
end
if debuffType=="Disease" then
if SpellExists("Cleanse") then TargetUnit("raid"..x) cast("Cleanse") end
if SpellExists("Abolish Disease") then TargetUnit("raid"..x) cast("Abolish Disease") end
if SpellExists("Cure Disease") then TargetUnit("raid"..x) cast("Cure Disease") end
return
end
if debuffType=="Poison" then
if SpellExists("Cleanse") then TargetUnit("raid"..x) cast("Cleanse") end
if SpellExists("Abolish Poison") then TargetUnit("raid"..x) cast("Abolish Poison") end
if SpellExists("Cure Poison") then TargetUnit("raid"..x) cast("Cure Poison") end
return
end
end end
else
for x=1,16 do
local name,count,debuffType=UnitDebuff("player",x)
if debuffType=="Curse" then
if SpellExists("Remove Curse") then cast("Remove Curse",1) end
if SpellExists("Remove Lesser Curse") then cast("Remove Lesser Curse",1) end
return
end
if debuffType=="Magic" then
if SpellExists("Cleanse") then cast("Cleanse",1) end
if SpellExists("Dispel Magic") then cast("Dispel Magic",1) end
return
end
if debuffType=="Disease" then
if SpellExists("Cleanse") then cast("Cleanse",1) end
if SpellExists("Abolish Disease") then cast("Abolish Disease",1) end
if SpellExists("Cure Disease") then cast("Cure Disease",1) end
return
end
if debuffType=="Poison" then
if SpellExists("Cleanse") then cast("Cleanse",1) end
if SpellExists("Abolish Poison") then cast("Abolish Poison",1) end
if SpellExists("Cure Poison") then cast("Cure Poison",1) end
return
end
end
for y=1,GetNumPartyMembers() do
for x=1,16 do
local name,count,debuffType=UnitDebuff("party"..y,x)
if debuffType=="Curse" then
if SpellExists("Remove Curse") then TargetUnit("party"..y) cast("Remove Curse") end
if SpellExists("Remove Lesser Curse") then TargetUnit("party"..y) cast("Remove Lesser Curse") end
return
end
if debuffType=="Magic" then
if SpellExists("Cleanse") then TargetUnit("party"..y) cast("Cleanse") end
if SpellExists("Dispel Magic") then TargetUnit("party"..y) cast("Dispel Magic") end
return
end
if debuffType=="Disease" then
if SpellExists("Cleanse") then TargetUnit("party"..y) cast("Cleanse") end
if SpellExists("Abolish Disease") then TargetUnit("party"..y) cast("Abolish Disease") end
if SpellExists("Cure Disease") then TargetUnit("party"..y) cast("Cure Disease") end
return
end
if debuffType=="Poison" then
if SpellExists("Cleanse") then TargetUnit("party"..y) cast("Cleanse") end
if SpellExists("Abolish Poison") then TargetUnit("party"..y) cast("Abolish Poison") end
if SpellExists("Cure Poison") then TargetUnit("party"..y) cast("Cure Poison") end
return
end
end end
end
TargetUnit("playertarget")
end