Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.19 KB | None | 0 0
  1. local inter = CreateFrame("Frame", "Interruptor", UIParent)
  2.  
  3. function inter:UNIT_SPELLCAST_START(event, unitID, spell, rank, lineID, spellID)
  4.    --print("Spell cast start for "..spell)
  5. end
  6.  
  7. function inter:UNIT_SPELLCAST_INTERRUPTED(unitID, spell, rank, lineID, spellID)
  8.   --print("You have been interrupted")
  9. end
  10.  
  11. function inter:COMBAT_LOG_EVENT_UNFILTERED(event, timeStamp, event1, hideCaster, sourceGUID, sourceName, sourceFlags, destGUID, destName, destFlags, spellId, ...)
  12.   if (event1 == "SPELL_INTERRUPT") then
  13.     print("Interrupter: "..sourceName) -- who interrupted
  14.     print("Interruptee: "..destName)      -- who has been interrupted
  15.     SendChatMessage(destName.."'s ..' has been interrupted with "..GetSpellLink(spellId).." by "..sourceName.."!", "GUILD", nil, nil)
  16.   end
  17. end
  18.  
  19. inter:SetScript("OnEvent",
  20.                     function(self, event, ...)
  21.                             if self[event] then
  22.                                     return self[event] (self, event, ...)
  23.                             end
  24.                     end)
  25.  
  26. inter:RegisterEvent("UNIT_SPELLCAST_START")  
  27. inter:RegisterEvent("UNIT_SPELLCAST_INTERRUPTED")
  28. inter:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement