-
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
4 changed files
with
60 additions
and
19 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
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,31 @@ | ||
|
||
local myname, ns = ... | ||
local ae = LibStub("AceEvent-3.0") | ||
|
||
|
||
local maxlevel = GetMaxPlayerLevel() | ||
local itemname = "Pilgrim's Bounty Rep Buff" | ||
local spellname, _, icon = GetSpellInfo(61849) | ||
local dataobj = ns:GenerateSelfBuffer(itemname, icon, spellname) | ||
ns.defaultspc[itemname.."-enabled"] = true | ||
|
||
|
||
local function BountyToday() | ||
return ns.IsHolidayActive("Pilgrim's Bounty") | ||
end | ||
|
||
|
||
function dataobj:Test() | ||
if UnitLevel("player") < maxlevel then return false end | ||
return BountyToday() and self:TestWithoutResting() | ||
end | ||
|
||
|
||
function dataobj:Init() | ||
if UnitLevel("player") == maxlevel then OpenCalendar() end | ||
end | ||
|
||
|
||
ae.RegisterEvent(dataobj, "CALENDAR_UPDATE_EVENT_LIST", "Scan") | ||
dataobj.tiplink = "spell:61849" | ||
dataobj.CorkIt = nil |
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,22 @@ | ||
|
||
local myname, ns = ... | ||
|
||
|
||
function ns.IsHolidayActive(name) | ||
local _, _, day = CalendarGetDate() | ||
local title, hour, sequenceType | ||
local i = 1 | ||
repeat | ||
title, hour, _, _, sequenceType = CalendarGetDayEvent(0, day, i) | ||
if title == name then | ||
if sequenceType == "START" then | ||
return GetGameTime() >= hour | ||
elseif sequenceType == "END" then | ||
return GetGameTime() < hour | ||
else | ||
return true | ||
end | ||
end | ||
i = i + 1 | ||
until not title | ||
end |