Advertisement
Khakhan

Cinderstorm code

Sep 22nd, 2016
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. function( event, time, subevent, _, sourceGUID, sourceName, sourceFlags, _, destGUID, destName, _, _, spellID, spellName, _, amount, _, _, _, crit )
  2.  
  3. local e = aura_env
  4. local now = GetTime()
  5.  
  6. if (e.cinder_timer - now) < 0 then return end
  7. if subevent ~= "SPELL_DAMAGE" then return end
  8. if sourceGUID ~= UnitGUID('player') then return end
  9.  
  10. if spellID == 198928 then
  11. table.insert(e.mob_table,destGUID)
  12.  
  13. e.cinder_count = e.cinder_count + 1
  14.  
  15. local i = e.mob_count
  16. for _, i in pairs(e.mob_table) do
  17. if e.mob_guid ~= destGUID then
  18. e.mob_count = e.mob_count + 1
  19. e.mob_guid = destGUID
  20. break
  21. end
  22. end
  23. e.timer_hide = now + 4
  24. end
  25.  
  26. -- hide total after 4 seconds, starting after the last count+1
  27.  
  28. if (e.timer_hide - now) > 0 then
  29. e.cinder_display = e.cinder_count
  30. else
  31. e.cinder_display = 0
  32. end
  33.  
  34. return true
  35. end
  36.  
  37. --[[
  38. The goal here, count how many instances of cinderstorm hit with each cast of the spell.
  39.  
  40. cinder_timer = time when you start casting cinderstorm + 5sec
  41.  
  42. All of these must be true to add a counter:
  43. the time frame is within 5sec of starting to cast Cinderstorm
  44. the combat log sub event is "SPELL DAMAGE"
  45. the source is the player
  46. the spellID is 198928 aka "Cinderstorm"
  47.  
  48. timer_hide exists to hide the cinderstorm total after X seconds
  49.  
  50. also tries to count # of mobs but it isn't too great at it right now.
  51. --]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement