Advertisement
Hekili

Untitled

Jun 29th, 2016
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.68 KB | None | 0 0
  1. -- MINIONS
  2. local minions = {}
  3.  
  4. ns.updateMinion = function( id, time )
  5.   minions[ id ] = time
  6. end
  7.  
  8. ns.isMinion = function( id ) return minions[ id ] ~= nil end
  9.  
  10. RegisterEvent( "COMBAT_LOG_EVENT_UNFILTERED", function( event, _, subtype, _, sourceGUID, sourceName, _, _, destGUID, destName, destFlags, _, spellID, spellName, _, amount, interrupt, a, b, c, d, offhand, multistrike, ... )
  11.  
  12.     local time = GetTime()
  13.  
  14.     if subtype == 'UNIT_DIED' or subtype == 'UNIT_DESTROYED' then
  15.       ns.updateMinion( destGUID )
  16.       return
  17.     end
  18.  
  19.     if subtype == 'SPELL_SUMMON' and sourceGUID == UnitGUID('player') then
  20.       ns.updateMinion( destGUID, time )
  21.       return
  22.     end
  23. end )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement