Advertisement
Translit

Untitled

Mar 24th, 2016
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.87 KB | None | 0 0
  1. TRIGGER1(COMBAT_LOG_EVENT_UNFILTERED)
  2.  
  3. function(event, timestamp, message, hideCaster, srcGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags, ...)
  4.     if event=="COMBAT_LOG_EVENT_UNFILTERED" and message == "SPELL_CAST_SUCCESS" then
  5.         local spellId, spellName, spellSchool = ...
  6.         if spellId == 50842 then -- bloood boil
  7.             startTime = GetTime()
  8.             aura_env.testtable = {}
  9.             return true
  10.         end
  11.     end
  12. end
  13.  
  14. TRIGGER2(EVERY FRAME)
  15.  
  16. function()
  17.     startTime = startTime or nil
  18.     if startTime then
  19.         local SpellName = select(1, GetSpellInfo(17)) -- Pw:S
  20.         for i=1, GetNumGroupMembers() do
  21.             local raider = "raid"..i        
  22.             local BUFF = UnitBuff(raider, SpellName)
  23.             if BUFF then
  24.                 local name = UnitName(raider)
  25.                 table.insert(aura_env.testtable, {name, startTime})
  26.                 startTime = nil
  27.                 return true
  28.             end
  29.         end
  30.     end
  31.     return false
  32. end
  33.  
  34. TRIGGER3(COMBAT_LOG_EVENT_UNFILTERED)
  35.  
  36. function(event, timestamp, message, hideCaster, srcGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags, ...)
  37.     if event=="COMBAT_LOG_EVENT_UNFILTERED" and message == "SPELL_AURA_APPLIED" then
  38.         local spellId, spellName, spellSchool = ...
  39.         if spellId == 17 then -- Pw:S
  40.             table.insert(aura_env.testtable, {destName, GetTime()})
  41.             return true
  42.         end
  43.     end
  44. end
  45.  
  46. TRIGGER4((COMBAT_LOG_EVENT_UNFILTERED)
  47.  
  48. function(event, timestamp, message, hideCaster, srcGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags, ...)
  49.     if event=="COMBAT_LOG_EVENT_UNFILTERED" and message == "SPELL_AURA_REMOVED" then
  50.         local spellId, spellName, spellSchool = ...
  51.         if spellId == 17 then -- Pw:S
  52.             endBuff = destName
  53.             return true
  54.         end
  55.     end
  56. end
  57.  
  58. DISPLAY(EVERY FRAME)
  59.  
  60. function()
  61.     local i=1
  62.     local cur = GetTime()
  63.     local total = ""
  64.     endBuff = endBuff or nil
  65.     while aura_env.testtable[i] do
  66.         local name = aura_env.testtable[i][1]
  67.         local time = aura_env.testtable[i][2]
  68.        
  69.         if endBuff then
  70.             for j=1,#aura_env.testtable do
  71.                 if aura_env.testtable[j][1] == endBuff then
  72.                     aura_env.testtable[j][3] = GetTime()
  73.                    
  74.                     endBuff = nil
  75.                     break
  76.                 end
  77.             end
  78.         end
  79.         local sec = ""
  80.         if aura_env.testtable[i][3] then
  81.             sec = aura_env.testtable[i][3] - aura_env.testtable[i][2]
  82.         else
  83.             sec = cur - aura_env.testtable[i][2]
  84.         end
  85.         total = total..name..sec.."|n"
  86.         i=i+1
  87.     end
  88.     return total
  89. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement