-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
|
||
local myname, ns = ... | ||
|
||
|
||
local WQ_QUEST_ID = 44175 | ||
local WQ_BUFF, _, WQ_BUFF_ICON = GetSpellInfo(186404) | ||
local WQ_ICONLINE = ns.IconLine(WQ_BUFF_ICON, "Bonus event quest") | ||
|
||
|
||
-- You have to be 110 to get the weekly bonus events | ||
if UnitLevel("player") < 110 then return end | ||
|
||
|
||
local ldb, ae = LibStub:GetLibrary("LibDataBroker-1.1"), LibStub("AceEvent-3.0") | ||
|
||
|
||
local dataobj = ns:New("Bonus Events") | ||
dataobj.tiptext = "Notify you when there is a weekly Bonus Event quest to accept" | ||
dataobj.priority = 15 | ||
|
||
|
||
function dataobj:Init() | ||
ns.defaultspc[self.name.."-enabled"] = true | ||
end | ||
|
||
|
||
local function Test() | ||
if not UnitAura("player", WQ_BUFF) then return end | ||
if IsQuestComplete(WQ_QUEST_ID) then return end | ||
if GetQuestLogIndexByID(WQ_QUEST_ID) ~= 0 then return end | ||
return WQ_ICONLINE | ||
end | ||
|
||
|
||
local lastid | ||
function dataobj:Scan() | ||
if not ns.dbpc[self.name.."-enabled"] then | ||
self.player = nil | ||
return | ||
end | ||
|
||
self.player = Test() | ||
end | ||
|
||
|
||
ae.RegisterEvent(dataobj, "QUEST_LOG_UPDATE", "Scan") |