function ArchiDecurser_OnLoad() |
localizedClass, englishClass = UnitClass("player") |
DEFAULT_CHAT_FRAME:AddMessage("Archimonde Decurser for " .. localizedClass .. " loaded."); |
end |
|
|
local frame = CreateFrame("Frame"); |
|
frame:SetScript("OnEvent", onEvent); |
|
|
function frame:COMBAT_LOG_EVENT_UNFILTERED(event, ...) |
local playerCursed = false |
|
local timestamp, type, sourceGUID, sourceName, sourceFlags, destGUID, destName, destFlags = select(1, ...) |
|
if (type == "SPELL_AURA_APPLIED") then |
|
local spellId, spellName, spellSchool = select(9, ...) |
local auraType = select (12) |
|
if (spellName == "Grip of the Legion") then |
|
if (destName == UnitName("player")) then |
RaidNotice_AddMessage(RaidBossEmoteFrame, ("You are cursed!"), ChatTypeInfo["RAID_WARNING"]) |
playerCursed = true |
end |
|
if (englishClass == "MAGE") then |
if (not playerCursed) then |
RaidNotice_AddMessage(RaidBossEmoteFrame, (destName .. " is cursed!"), ChatTypeInfo["RAID_WARNING"]) |
end |
if (IsSpellInRange("Remove Lesser Curse",destName) and not playerCursed) then |
RaidNotice_AddMessage(RaidBossEmoteFrame, ("You are in range to remove it!"), ChatTypeInfo["RAID_WARNING"]) |
end |
elseif (englishClass == "DRUID") then |
if (not playerCursed) then |
RaidNotice_AddMessage(RaidBossEmoteFrame, (destName .. " is cursed!"), ChatTypeInfo["RAID_WARNING"]) |
end |
if (IsSpellInRange("Remove Curse",destName) and not playerCursed) then |
RaidNotice_AddMessage(RaidBossEmoteFrame, ("You are in range to remove it!"), ChatTypeInfo["RAID_WARNING"]) |
end |
end |
|
end |
|
elseif (type == "SPELL_AURA_REMOVED") then |
|
local spellId, spellName, spellSchool = select(9, ...) |
local auraType = select(12) |
|
if (spellName == "Grip of the Legion") then |
RaidNotice_AddMessage(RaidBossEmoteFrame, ("Curse has been removed from " .. destName .. "."), ChatTypeInfo["RAID_WARNING"]) |
end |
|
end |
end |
|
local onEvent = function(self, event, ...) |
self[event](self,event, ...); |
end |
|
|
ArchiDecurser_OnLoad() |
frame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED"); |