Code:
local a = CreateFrame("Frame")
a:Hide()
a:SetScript("OnUpdate", function(self, elapsed)
local lastTime = self.time
self.time=self.time-elapsed
if lastTime>10 and self.time<=10 then
SendChatMessage("10 sec left, blow EVERYTHING","YELL")
return
end
if lastTime>20 and self.time <=20 then
SendChatMessage("Half way mark reached","YELL")
return
end
if lastTime>30 and self.time <=30 then
SendChatMessage("10 sec passed","YELL")
return
end
if self.time <= 0 then
SendChatMessage("Bloodlist has ended - have a nice day", "YELL")
self:Hide()
end
end)
a:SetScript("OnEvent", function(self, event, ...)
local arg = {...}
self.guid = self.guid or UnitGUID("player")
if (arg[2] == "SPELL_CAST_SUCCESS") and (arg[3] == self.guid) and (arg[9] == 2825) then
self.time = 40
self:Show()
SendChatMessage("BLOODLUST has started, 40 sec of fun time!","YELL")
end
end)
a:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
How to use. Untested. Report back with issues.