WoW:API CancelPlayerBuff: Difference between revisions

move removedapi band higher
mNo edit summary
(move removedapi band higher)
Line 1: Line 1:
{{removedapi|3.0|Replaced by {{api|CancelUnitBuff}}("unit", buffIndex[, filter]) or ("unit", "spell"[, "rank"])}}
{{wowapi}}
{{wowapi}}


Line 5: Line 6:
  CancelPlayerBuff(buffIndex);
  CancelPlayerBuff(buffIndex);


----
==Arguments==
;''Arguments''
;buffIndex : The index of the buff to remove. Can be obtained with [[API GetPlayerBuff|GetPlayerBuff]]. Can also use buff name since the 2.3 patch.


:;buffIndex : The index of the buff to remove. Can be obtained with [[API GetPlayerBuff|GetPlayerBuff]]. Can also use buff name since the 2.3 patch.
==Example==
 
----
;''Example''
  CancelPlayerBuff(GetPlayerBuff(0,"HELPFUL"))
  CancelPlayerBuff(GetPlayerBuff(0,"HELPFUL"))


;''Result''
;Result : Removes the first (right-most in the default UI) buff from the player.
 
Removes the first (right-most in the default UI) buff from the player.
 
;''See Also''
 
:* [[API UnitBuff|UnitBuff]]


====Notes====
====Notes====
Line 26: Line 18:
(tested on live servers 2.0)
(tested on live servers 2.0)
* This function uses a zero-based index, while UnitBuff() does not.
* This function uses a zero-based index, while UnitBuff() does not.
** '''The Burning Crusades:''' [[API GetPlayerBuff|GetPlayerBuff]]() returns ''0'' if the buff doesn't exist. It stands to reason that this function would then be 1-based in TBC.
* '''The Burning Crusade:''' [[API GetPlayerBuff|GetPlayerBuff]]() returns 0 if the buff doesn't exist. It stands to reason that this function would then be 1-based in TBC.
* This function was replaced in 3.0 by [[API CancelUnitBuff|CancelUnitBuff]].