View Single Post
12-13-14, 11:56 AM   #2
Choonstertwo
A Chromatic Dragonspawn
 
Choonstertwo's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2011
Posts: 194
UnitAura(unit, spellName) returns information for the first aura with the specified name, so it's unreliable when you need to distinguish between two auras with the same name. You'll need to iterate through the unit's auras using UnitAura(unit, index) until you find the one with the right spellID and then return the appropriate string for that aura.

Lua Code:
  1. oUF.Tags.Methods['SS'] = function(u)
  2.     local i = 0
  3.  
  4.     local name, _, expirationTime, unitCaster, spellID = ""
  5.  
  6.     while name and i <= 40 do
  7.         i = i + 1
  8.         name, _, _, _, _, _, expirationTime, unitCaster, _, _, spellID = UnitBuff(u, i, "PLAYER|CANCELABLE") -- Only look at cancelable buffs cast by the player
  9.  
  10.         if spellID == 148039 then
  11.             local spellTimer = (expirationTime-GetTime())
  12.             if spellTimer > 0 then
  13.                 return "|cffFFAB00" .. numberize(spellTimer) .. "|r"
  14.             end
  15.         end
  16.     end
  17. end
  18. oUF.Tags.Events['SS'] = "UNIT_AURA"

Last edited by Choonstertwo : 12-13-14 at 12:00 PM.
  Reply With Quote