Originally Posted by
Viral Fly-by
Yea I know but in a party you as the player don't appear...so you have player,party1-4....but in raid everyone is raid1-N...plus the switching of party vs raid.
It just makes the lines a long longer to deal with... I do the full logic in my actual macros I was just giving an example of a simple party one whether than an even longer line that does the whole thing.
For the curious...here's the Cleanse macro for paladins that handles all situations (solo, parties of 2 to 5, raids of any size). It cleanses the person whoever has the debuff with most duration remaining:
Code:
/run t="raid"; nps=1; npe=GetNumRaidMembers(); if npe==0 then t="party"; nps=0; npe=GetNumPartyMembers() end; w=nil; m=0; for i=nps,npe do if i==0 then tt="player" else tt=t..i end; if UnitExists(tt) and UnitInRange(tt)==1 and UnitIsDeadOrGhost(tt)~=1 then for j=1,40 do d={UnitDebuff(tt,j)}; if d~=nil and (d[5]=="Magic" or d[5]=="Poison" or d[5]=="Disease") and d[7]>m then w=tt; m=d[7] end end end end; if w~=nil then RunMacroText("/cast [@"..w.."] Cleanse") end;
Resto Shaman version for Cleanse Spirit:
Code:
/run t="raid"; nps=1; npe=GetNumRaidMembers(); if npe==0 then t="party"; nps=0; npe=GetNumPartyMembers() end; w=nil; m=0; for i=nps,npe do if i==0 then tt="player" else tt=t..i end; if UnitExists(tt) and UnitInRange(tt)==1 and UnitIsDeadOrGhost(tt)~=1 then for j=1,40 do d={UnitDebuff(tt,j)}; if d~=nil and (d[5]=="Curse" or d[5]=="Poison" or d[5]=="Disease") and d[7]>m then w=tt; m=d[7] end end end end; if w~=nil then RunMacroText("/cast [@"..w.."] Cleanse Spirit") end;
Priest version (Dispel Magic only):
Code:
/run t="raid"; nps=1; npe=GetNumRaidMembers(); if npe==0 then t="party"; nps=0; npe=GetNumPartyMembers() end; w=nil; m=0; for i=nps,npe do if i==0 then tt="player" else tt=t..i end; if UnitExists(tt) and UnitInRange(tt)==1 and UnitIsDeadOrGhost(tt)~=1 then for j=1,40 do d={UnitDebuff(tt,j)}; if d~=nil and d[5]=="Magic" and d[7]>m then w=tt; m=d[7] end end end end; if w~=nil then RunMacroText("/cast [@"..w.."] Dispel Magic") end;
Priest version (does Dispel Magic or Abolish Disease appropriately)(will apply Abolish even if already present):
Code:
/run t="raid"; nps=1; npe=GetNumRaidMembers(); if npe==0 then t="party"; nps=0; npe=GetNumPartyMembers() end; w=nil; m=0; for i=nps,npe do if i==0 then tt="player" else tt=t..i end; if UnitExists(tt) and UnitInRange(tt)==1 and UnitIsDeadOrGhost(tt)~=1 then for j=1,40 do d={UnitDebuff(tt,j)}; if d~=nil and (d[5]=="Magic" or d[5]=="Disease") and d[7]>m then w=tt; m=d[7]; if d[5]=="Magic" then s="Dispel Magic" else s="Abolish Disease" end end end end end; if w~=nil then RunMacroText("/cast [@"..w.."] "..s) end;
Druid version (Remove Curse only) (works for Mages as well):
Code:
/run t="raid"; nps=1; npe=GetNumRaidMembers(); if npe==0 then t="party"; nps=0; npe=GetNumPartyMembers() end; w=nil; m=0; for i=nps,npe do if i==0 then tt="player" else tt=t..i end; if UnitExists(tt) and UnitInRange(tt)==1 and UnitIsDeadOrGhost(tt)~=1 then for j=1,40 do d={UnitDebuff(tt,j)}; if d~=nil and d[5]=="Curse" and d[7]>m then w=tt; m=d[7] end end end end; if w~=nil then RunMacroText("/cast [@"..w.."] Remove Curse") end;
Druid version (does Remove Curse or Abolish Poison appropriately)(will apply Abolish even if already present):
Code:
/run t="raid"; nps=1; npe=GetNumRaidMembers(); if npe==0 then t="party"; nps=0; npe=GetNumPartyMembers() end; w=nil; m=0; for i=nps,npe do if i==0 then tt="player" else tt=t..i end; if UnitExists(tt) and UnitInRange(tt)==1 and UnitIsDeadOrGhost(tt)~=1 then for j=1,40 do d={UnitDebuff(tt,j)}; if d~=nil and (d[5]=="Curse" or d[5]=="Poison") and d[7]>m then w=tt; m=d[7]; if d[5]=="Curse" then s="Remove Curse" else s="Abolish Poison" end end end end end; if w~=nil then RunMacroText("/cast [@"..w.."] "..s) end;