Advertisement
Khakhan

Cinderstorm code fixed

Sep 23rd, 2016
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.45 KB | None | 0 0
  1. function( event, time, subevent, _, sourceGUID, sourceName, _, _, 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.         e.cinder_count = e.cinder_count + 1
  12.        
  13.         if not e.mob_table[ destGUID ] then
  14.             e.mob_table[ destGUID ] = true
  15.             e.mob_count = e.mob_count + 1  
  16.         end
  17.        
  18.         e.timer_hide = now + 4
  19.     end
  20.    
  21.     -- hide total after 4 seconds, starting after the last count+1
  22.    
  23.     if (e.timer_hide - now) > 0 then
  24.         e.cinder_display = e.cinder_count
  25.     else
  26.         e.cinder_display = 0
  27.     end
  28.    
  29.     return true
  30. end
  31.  
  32.  
  33. --[[
  34. The goal here, count how many instances of cinderstorm hit with each cast of the spell.
  35.  
  36. cinder_timer = time when you start casting cinderstorm + 5sec
  37.  
  38. All of these must be true to add a counter:
  39.    the time frame is within 6sec of starting to cast Cinderstorm
  40.    the combat log sub event is "SPELL DAMAGE"
  41.    the source is the player
  42.    the spellID is 198928 aka "Cinderstorm"
  43.  
  44. Also counts the number of targets hit by cinderstorm. funny to have such short code after spending so long working on it.
  45.  
  46. timer_hide exists to hide the cinderstorm total after X seconds
  47.  
  48.  
  49. --]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement