Skip to content

Commit

Permalink
Add module for WQ bonus event quest
Browse files Browse the repository at this point in the history
  • Loading branch information
tekkub committed Nov 24, 2016
1 parent 5e3415e commit 2b07d3d
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cork.toc
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ modules\Warrior.lua

modules\ArtifactPowerItems.lua
modules\BattleStandard.lua
modules\BonusEvents.lua
modules\BuffItems.lua
modules\ClassHallWorkOrders.lua
modules\Capsules.lua
Expand Down
46 changes: 46 additions & 0 deletions modules/BonusEvents.lua
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")

0 comments on commit 2b07d3d

Please sign in to comment.