SHARE
TWEET

Untitled

a guest May 19th, 2017 40 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- addon to announce to chat when shamballa dies
  2.  
  3.  
  4. local enabled = true
  5. local msgVar = "Shamballa has died!"
  6.  
  7.  
  8. SLASH_SHAMDEATH1 = '/shamdeath';
  9. local function handler(msg, editbox)
  10.     local argument, data = msg:match("^(%S*)%s*(.-)$");
  11.     if (argument == "toggle") then
  12.         enabled = not enabled
  13.     elseif (argument == "set") then
  14.         msgVar = data
  15.     end
  16. end
  17. SlashCmdList["SHAMDEATH"] = handler
  18.  
  19. local frame = CreateFrame("FRAME", "ShamDeathFrame");
  20. frame:RegisterEvent("PLAYER_DEAD");
  21. local function eventHandler(self, event, ...)
  22.     if (enabled == true) then
  23.         SendChatMessage(msgVar ,"RAID")
  24.     end
  25. end
  26. frame:SetScript("OnEvent", eventHandler);
RAW Paste Data
Challenge yourself this year...
Learn something new in 2017
Top