Advertisement
Arborus

Living Bomb Trigger

Jun 24th, 2016
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.85 KB | None | 0 0
  1. function( _, timestamp, subtype, _, sourceGUID, sourceName, _, _, destGUID, destName, _, _, spellID )
  2.  
  3. WA_FlameShocks = WA_FlameShocks or {}
  4. WA_FSCount = WA_FSCount or 0
  5.  
  6. WA_MyGUID = WA_MyGUID or UnitGUID('player')
  7.  
  8. WA_ActiveEvents = WA_ActiveEvents or { SPELL_AURA_APPLIED = true,
  9. SPELL_AURA_REFRESH = true,
  10. SPELL_AURA_APPLIED_DOSE = true,
  11. SPELL_PERIODIC_DAMAGE = true,
  12. SPELL_PERIODIC_MISSED = true,
  13. SPELL_DAMAGE = true}
  14.  
  15. WA_InactiveEvents = WA_InactiveEvents or { SPELL_AURA_REMOVED = true,
  16. SPELL_AURA_BROKEN = true,
  17. SPELL_AURA_BROKEN_SPELL = true }
  18.  
  19. WA_DeathEvents = WA_DeathEvents or { UNIT_DIED = true,
  20. UNIT_DESTROYED = true }
  21.  
  22. local now = GetTime()
  23.  
  24. if WA_DeathEvents[ subtype ] then
  25. if WA_FlameShocks[ destGUID ] then
  26. WA_FSCount = WA_FSCount - 1
  27. WA_FlameShocks[ destGUID ] = nil
  28. end
  29.  
  30.  
  31. elseif sourceGUID == WA_MyGUID and spellID == 217694 then
  32. if WA_ActiveEvents[ subtype ] then
  33. if not WA_FlameShocks[ destGUID ] then WA_FSCount = WA_FSCount + 1 end
  34. WA_FlameShocks[ destGUID ] = now
  35.  
  36.  
  37. elseif WA_InactiveEvents[ subtype ] then
  38. if WA_FlameShocks[ destGUID ] then
  39. WA_FSCount = WA_FSCount - 1
  40. WA_FlameShocks[ destGUID ] = nil
  41. end
  42.  
  43. end
  44.  
  45. end
  46.  
  47. WA_FlameShockAuditor = WA_FlameShockAuditor or now
  48.  
  49. if now - WA_FlameShockAuditor >= 2.5 then
  50. for i, last in pairs( WA_FlameShocks ) do
  51. if now - last >= 5 then
  52. WA_FlameShocks[ i ] = nil
  53. WA_FSCount = WA_FSCount - 1
  54. end
  55. end
  56. end
  57.  
  58.  
  59.  
  60. return WA_FSCount >= 1
  61. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement