local Anub_Enabled = false;
local Anub_Announce = false;
function Anub_OnLoad()
this:RegisterEvent("CHAT_MSG_SPELL_PERIODIC_SELF_DAMAGE");
this:RegisterEvent("CHAT_MSG_SPELL_PERIODIC_PARTY_DAMAGE");
this:RegisterEvent("CHAT_MSG_SPELL_PERIODIC_FRIENDLYPLAYER_DAMAGE");
DEFAULT_CHAT_FRAME:AddMessage("Anubisath Defender 0.2 Initialized! /Anub on|off|announce");
SLASH_ANUB1 = "/anub";
SlashCmdList["ANUB"] = Anub_Command;
end
function Anub_Command(msg)
if (string.lower(msg) == "on") then
Anub_Enabled = true;
Anub_Announce = false;
DEFAULT_CHAT_FRAME:AddMessage("Anubisath Defender Plague Effect warning on!");
elseif (string.lower(msg) == "off") then
Anub_Enabled = false;
Anub_Announce = false;
DEFAULT_CHAT_FRAME:AddMessage("Anubisath Defender Plague Effect warning off!");
elseif (string.lower(msg) == "announce") then
Anub_Enabled = true;
Anub_Announce = true;
DEFAULT_CHAT_FRAME:AddMessage("Anubisath Defender Plague Effect warning on! Announcing to Raid!");
else
DEFAULT_CHAT_FRAME:AddMessage("Usage: /Anub on|off|announce");
end
end
function Anub_OnEvent(event)
local _, _, player = string.find(arg1, "^(%w+) %w+ afflicted by Plague");
if (player == "You") then
PlaySoundFile("Sound\\Doodad\\BellTollAlliance.wav");
DEFAULT_CHAT_FRAME:AddMessage("** YOU HAVE PLAGUE EFFECT **");
DEFAULT_CHAT_FRAME:AddMessage("** RUN NOW! **");
return;
end
if (player and Anub_Announce) then
SendChatMessage("** YOU HAVE PLAGUE EFFECT!", "WHISPER", this.language, player);
SendChatMessage("** " .. player .. " HAS PLAGUE EFFECT - GET CLEAR **", "RAID");
end
end