WoW:BuffId: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 1: Line 1:
Handling player buffs and debuffs are a tad different than unit buffs/debuffs.  [[API GetPlayerBuff|GetPlayerBuff(buffId, buffFilter)]] will return a value for buffIndex, which is used for all the player buff functions and GameTooltip:SetPlayerBuff(buffIndex).  It is easy to get the two values confused because often they are the same.
Handling player buffs and debuffs are a tad different than unit buffs/debuffs.  [[API GetPlayerBuff|GetPlayerBuff(buffId, buffFilter)]] will return a value for buffIndex, which is used for all the player buff functions and GameTooltip:SetPlayerBuff(buffIndex).  It is easy to get the two values confused because often they are the same.


buffId directly correlates to the buff frames in the top right are of the screen.  When a buff wears all buffs to the right of it are shifted over, both buffId and buffIndex can change at this time!  Here are the ID's and filters for each frame as seen by the user (TempEnchant frames aren't shown as they don't have ID's)
buffId directly correlates to the buff frames in the top right are of the screen.  When a buff wears off all buffs to the right of it are shifted over, both buffId and buffIndex can change at this time!  Here are the ID's and filters for each frame as seen by the user (TempEnchant frames aren't shown as they don't have ID's)


<table border="1" cellpadding="2" cellspacing="0">
<table border="1" cellpadding="2" cellspacing="0">

Revision as of 17:08, 11 May 2006

Handling player buffs and debuffs are a tad different than unit buffs/debuffs. GetPlayerBuff(buffId, buffFilter) will return a value for buffIndex, which is used for all the player buff functions and GameTooltip:SetPlayerBuff(buffIndex). It is easy to get the two values confused because often they are the same.

buffId directly correlates to the buff frames in the top right are of the screen. When a buff wears off all buffs to the right of it are shifted over, both buffId and buffIndex can change at this time! Here are the ID's and filters for each frame as seen by the user (TempEnchant frames aren't shown as they don't have ID's)

HELPFUL76543210
HELPFUL15141312111098
HARMFUL76543210

buffIndex works in a similar way, but there is no distinction between buffs and debuffs, they're all indexed together. This is the whole reason GetPlayerBuff(buffId, buffFilter) is provided.

Remember that both buffId and buffIndex can change when auras change. Both values are indexed sequentially starting at 0 at all times, you won't encounter a "gap" if a buff has warn off in the middle of the list.