<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3AGetBuffs</id>
	<title>API:GetBuffs - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3AGetBuffs"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:GetBuffs&amp;action=history"/>
	<updated>2026-10-18T04:54:10Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.returnofreckoning.com/index.php?title=API:GetBuffs&amp;diff=30350&amp;oldid=prev</id>
		<title>Maintenance script: UI Lua API import (WAR 1.4.8)</title>
		<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:GetBuffs&amp;diff=30350&amp;oldid=prev"/>
		<updated>2026-10-16T19:43:10Z</updated>

		<summary type="html">&lt;p&gt;UI Lua API import (WAR 1.4.8)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{LuaApi|group=Effect}}&lt;br /&gt;
Returns the effects (buffs and debuffs) on the player, a target or a group member.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
effects = GetBuffs(buffTargetType)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
;buffTargetType : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Whose effects to return, a &amp;lt;code&amp;gt;GameData.BuffTargetType&amp;lt;/code&amp;gt; value (for example &amp;lt;code&amp;gt;SELF&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TARGET_HOSTILE&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TARGET_FRIENDLY&amp;lt;/code&amp;gt;, or a group member between &amp;lt;code&amp;gt;GROUP_MEMBER_START&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;GROUP_MEMBER_END&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
;effects : &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; – Table of effect tables keyed by effect index. Nothing is returned if there is no player object or no effect holder for that value.&lt;br /&gt;
&lt;br /&gt;
Each effect table has these fields:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key !! Type !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;effectIndex&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Index of the effect; also the key of the entry.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;wstring&amp;lt;/code&amp;gt; || Name of the ability that applied the effect, from the &amp;lt;code&amp;gt;AbilityNames&amp;lt;/code&amp;gt; string table.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;abilityId&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Id of the ability that applied the effect.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;iconNum&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Icon id for [[API:GetIconData|GetIconData]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;duration&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Duration in whole seconds.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;effectText&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;wstring&amp;lt;/code&amp;gt; || Description of the effect.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;stackCount&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Number of stacks.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;permanentUntilDispelled&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;boolean&amp;lt;/code&amp;gt; || –&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;isCasterDispellable&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;boolean&amp;lt;/code&amp;gt; || –&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;castByPlayer&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;boolean&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the player applied the effect.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;trackerPriority&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Sort priority. The stock buff tracker shows effects with a higher priority first.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;isBuff&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;isDebuff&amp;lt;/code&amp;gt;, … || &amp;lt;code&amp;gt;boolean&amp;lt;/code&amp;gt; || The effect type flags described for the [[API:GetAbilityData#Ability data table|ability data table]] (&amp;lt;code&amp;gt;isHex&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;isCurse&amp;lt;/code&amp;gt;, …, and the &amp;lt;code&amp;gt;typeColor&amp;lt;/code&amp;gt; fields).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* Effects are left out when their ability has no effect entry or has a particular ability flag set. An effect without a duration is only listed when &amp;lt;code&amp;gt;permanentUntilDispelled&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;.&lt;br /&gt;
* The effect type flags are filled by the same code as for the ability data table, from the ability that applied the effect.&lt;br /&gt;
* The table is keyed by effect index, not an array; use &amp;lt;code&amp;gt;pairs()&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Pass only &amp;lt;code&amp;gt;GameData.BuffTargetType&amp;lt;/code&amp;gt; values; the value is used as an index into the client&amp;#039;s list of effect holders.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
None besides the generic &amp;#039;&amp;#039;Invalid Parameters&amp;#039;&amp;#039; message when the argument is missing or not a number.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
From &amp;lt;code&amp;gt;eatemplate_unitframes/source/bufftracker.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function BuffTracker:Refresh()&lt;br /&gt;
    -- Get the full list of buffs from native code.&lt;br /&gt;
    local allBuffs = GetBuffs( self.m_targetType )&lt;br /&gt;
    if ( allBuffs ~= nil )&lt;br /&gt;
    then&lt;br /&gt;
        self.m_buffData = allBuffs&lt;br /&gt;
    else&lt;br /&gt;
        self.m_buffData = {}&lt;br /&gt;
    end&lt;br /&gt;
    self:OnBuffsChanged()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:RemoveEffect|RemoveEffect]]&lt;br /&gt;
* [[API:RemoveTargetEffect|RemoveTargetEffect]]&lt;br /&gt;
* [[API:GetAbilityData|GetAbilityData]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>