WoW API: CancelUnitBuff

From AddOn Studio
Revision as of 21:14, 26 September 2009 by WoWWiki>Egingell (→‎Notes)
Jump to navigation Jump to search

WoW API < CancelUnitBuff

Removes a specific buff from the unit.

CancelUnitBuff(unit, buffIndex or "spell" [,"filter" or "rank"]);

Arguments
unit
The unitID of the unit. In the case of this function, the unit must be "player" (or, possibly, "pet", I have not confirmed) since you cannot cancel other player's buffs.
buffIndex or "spell"
buffIndex starts at 1 ends at 40 or "spell" is the name of the spell.
"filter" or "rank"
"filter" is any of "HELPFUL|HARMFUL|PLAYER|RAID|CANCELABLE|NOT_CANCELABLE" or "rank" is "Rank 1, 2, etc"
Not sure exactly what the point of the "filter" option is since you can't cancel a buff that is "HARMFUL" or "NOT_CANCELABLE".

Example
CancelUnitBuff("player", 1)
Result

Cancels the buff at index 1 assuming it can be canceled by the player.

See Also

Notes

  • This function is not protected nor limited in any way to hardware event restriction Blizzard used so far. This function can be called freely from an AddOn to auto-remove a given buff.
  • This function replaced CancelPlayerBuff in 3.0.
  • This function does not work for canceling druid forms, rogue Stealth, death knight presences, or priest Shadowform.