Advertisement
Translit

buffdebuff

Mar 23rd, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.21 KB | None | 0 0
  1. TRIGGER1
  2.  
  3. function()
  4.     iskarbuff = iskarbuff or ""
  5.     local SpellName = select(1, GetSpellInfo(155347)) -- Eye of Anzu
  6.     for i=1, GetNumGroupMembers() do
  7.         local raider = "raid"..i        
  8.         local BUFF = UnitBuff(raider, SpellName)
  9.         if BUFF then
  10.             local name = UnitName(raider)
  11.             iskarbuff = name
  12.             return true
  13.         end
  14.     end
  15.     iskarbuff = nil
  16.     return false
  17. end
  18.  
  19. =========================================================================
  20.  
  21. TRIGGER2
  22.  
  23. function(event, timestamp, message, hideCaster, srcGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags, ...)  
  24.     iskarbuff = iskarbuff or nil
  25.     if iskarbuff then
  26.         if event=="COMBAT_LOG_EVENT_UNFILTERED" and message == "SPELL_CAST_SUCCESS" then
  27.             local spellId, spellName, spellSchool = ...
  28.             if spellId == 48263 then
  29.                 local name = sourceName
  30.                 local _,class = UnitClass(sourceName)
  31.                 local colorText = RAID_CLASS_COLORS[class] and RAID_CLASS_COLORS[class].colorStr or "ffbbbbbb"
  32.                 table.insert(aura_env.testtable, {GetTime(), iskarbuff, colorText})
  33.                 return true
  34.             elseif spellId == 50842 then
  35.                 local name = sourceName
  36.                 local _,class = UnitClass(sourceName)
  37.                 local colorText = RAID_CLASS_COLORS[class] and RAID_CLASS_COLORS[class].colorStr or "ffbbbbbb"
  38.                 table.insert(aura_env.testtable, {GetTime(), sourceName, colorText})
  39.             end
  40.             return true
  41.         end
  42.     end
  43. end
  44.  
  45. =========================================================================
  46.  
  47. DISPLAY
  48.  
  49. function()
  50.     local i = 1
  51.     local cur = GetTime()
  52.     local total = ""
  53.    
  54.     while aura_env.testtable[i] do
  55.         local time = aura_env.testtable[i][1]
  56.         local name = aura_env.testtable[i][2]
  57.         local color = aura_env.testtable[i][3]
  58.         if i > 6 then
  59.             table.remove(aura_env.testtable, 1)
  60.         else
  61.             local sec = cur - time
  62.             total = total.."|c"..color..name.."|r"..sec.."|n"
  63.             i = i + 1
  64.         end
  65.     end
  66.     return total
  67. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement