SHARE
TWEET

Untitled

a guest May 19th, 2017 41 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.  
  18. local frame = CreateFrame("FRAME", "ShamDeathFrame");
  19. frame:RegisterEvent("PLAYER_DEAD");
  20. local function eventHandler(self, event, ...)
  21.     if (enabled == true) then
  22.         SendChatMessage(msgVar ,"RAID")
  23.     end
  24. end
  25. frame:SetScript("OnEvent", eventHandler);
RAW Paste Data
Top