Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Cork.lua
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,10 @@ end)
-- Shared functions --
--------------------------------

function Cork.UnitAura(unit, spellname, filter)
return AuraUtil.FindAuraByName(spellname, unit, filter)
end

function Cork.IsSpellInRange(spell, unit)
return IsSpellInRange(spell, unit) == 1
end
Expand Down
2 changes: 1 addition & 1 deletion Cork.toc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Interface: 70100
## Interface: 80000

## Title: Cork
## Notes: Buff reminders and more
Expand Down
2 changes: 1 addition & 1 deletion modules/BonusEvents.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ 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 UnitAura = ns.UnitAura or UnitAura
local ldb, ae = LibStub:GetLibrary("LibDataBroker-1.1"), LibStub("AceEvent-3.0")


Expand Down
17 changes: 15 additions & 2 deletions modules/DarkmoonExp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,22 @@ local hatspell = GetSpellInfo(136583)
local dataobj = ns:GenerateSelfBuffer(itemname, icon, spellname, hatspell)
ns.defaultspc[itemname.."-enabled"] = true

local localizedNames = {
["deDE"] = "Dunkelmond-Jahrmarkt",
["esES"] = "Feria de la Luna Negra",
["esMX"] = "Feria de la Luna Negra",
["frFR"] = "Foire de Sombrelune",
["itIT"] = "Fiera di Lunacupa",
["koKR"] = "다크문 축제",
["ptBR"] = "Feira de Negraluna",
["ruRU"] = "Ярмарка Новолуния",
["zhCN"] = "暗月马戏团",
["zhTW"] = "暗月马戏团",
}
local holidayName = localizedNames[GetLocale()] or "Darkmoon Faire"

local function DarkmoonToday()
return ns.IsHolidayActive("Darkmoon Faire")
return ns.IsHolidayActive(holidayName)
end


Expand All @@ -23,7 +36,7 @@ end


function dataobj:Init()
if UnitLevel("player") < maxlevel then OpenCalendar() end
if UnitLevel("player") < maxlevel then C_Calendar.OpenCalendar() end
end


Expand Down
17 changes: 8 additions & 9 deletions modules/GarrisonBodyguardMinifier.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,15 @@ end


local zoneids = {}
local function ParseSubzones(id, name, ...)
zoneids[name] = true
if select("#", ...) > 0 then return ParseSubzones(...) end
end
local function ParseZones(id, name, ...)
zoneids[name] = true
ParseSubzones(GetMapSubzones(id))
if select("#", ...) > 0 then return ParseZones(...) end
-- Get all Draenor (sub)zones where we might use the follower.
local zones = C_Map.GetMapChildrenInfo(572, Enum.UIMapType.Zone, true)
for _, zone in ipairs(zones) do
zoneids[zone.name] = true
local subzones = C_Map.GetMapChildrenInfo(zone.mapID, Enum.UIMapType.Micro, true)
for _, subzone in ipairs(subzones) do
zoneids[subzone.name] = true
end
end
ParseZones(GetMapZones(7))


local orig2 = dataobj.TestWithoutResting
Expand Down
7 changes: 4 additions & 3 deletions modules/Paladin.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

local myname, Cork = ...
if Cork.MYCLASS ~= "PALADIN" then return end
local UnitAura = Cork.UnitAura or UnitAura
local ldb, ae = LibStub:GetLibrary("LibDataBroker-1.1"), LibStub("AceEvent-3.0")

-- Righteous Fury
Expand Down Expand Up @@ -30,7 +31,7 @@ function dataobj:Test(unit)
or (not raidunits[unit] and not partyunits[unit] and not otherunits[unit]) then return 0 end
local count = 0
for _, spellname in ipairs(spellnames) do
if UnitAura(unit, spellname, nil, "PLAYER") then
if UnitAura(unit, spellname, "PLAYER") then
count = count + 1
end
end
Expand Down Expand Up @@ -66,12 +67,12 @@ function dataobj:CorkIt(frame)
-- prioritize the first spell based on our role
local role = GetSpecializationRole(GetSpecialization())
local rolespell = rolespells[role]
if role and not UnitAura("player", spellnames[rolespell], nil, "PLAYER") then -- should this be player-only?
if role and not UnitAura("player", spellnames[rolespell], "PLAYER") then -- should this be player-only?
return frame:SetManyAttributes("type1", "spell", "spell", spellnames[rolespell], "unit", "player")
end
-- otherwise just do the spells in order
for _, spellname in ipairs(spellnames) do
if not UnitAura("player", spellname, nil, "PLAYER") then -- should this be player-only?
if not UnitAura("player", spellname, "PLAYER") then -- should this be player-only?
return frame:SetManyAttributes("type1", "spell", "spell", spellname, "unit", "player")
end
end
Expand Down
2 changes: 1 addition & 1 deletion modules/PaladinSeal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ if Cork.MYCLASS ~= "PALADIN" then return end


local myname, Cork = ...
local UnitAura = UnitAura
local UnitAura = Cork.UnitAura or UnitAura
local SpellCastableOnUnit = Cork.SpellCastableOnUnit
local ldb, ae = LibStub:GetLibrary("LibDataBroker-1.1"), LibStub("AceEvent-3.0")

Expand Down
17 changes: 15 additions & 2 deletions modules/PilgrimsBountyRep.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,22 @@ local spellname, _, icon = GetSpellInfo(61849)
local dataobj = ns:GenerateSelfBuffer(itemname, icon, spellname)
ns.defaultspc[itemname.."-enabled"] = true

local localizedNames = {
["deDE"] = "Pilgerfreudenfest",
["esES"] = "Generosidad del Peregrino",
["esMX"] = "Generosidad del Peregrino",
["frFR"] = "Les Bienfaits du pèlerin",
["itIT"] = "Ringraziamento del Pellegrino",
["koKR"] = "순례자의 감사절",
["ptBR"] = "Festa da Fartura",
["ruRU"] = "Пиршество странников",
["zhCN"] = "感恩节",
["zhTW"] = "感恩节",
}
local holidayName = localizedNames[GetLocale()] or "Pilgrim's Bounty"

local function BountyToday()
return ns.IsHolidayActive("Pilgrim's Bounty")
return ns.IsHolidayActive(holidayName)
end


Expand All @@ -22,7 +35,7 @@ end


function dataobj:Init()
if UnitLevel("player") == maxlevel then OpenCalendar() end
if UnitLevel("player") == maxlevel then C_Calendar.OpenCalendar() end
end


Expand Down
2 changes: 1 addition & 1 deletion modules/WarlockSoulLink.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ local myname, Cork = ...
if Cork.MYCLASS ~= "WARLOCK" then return end

local myname, Cork = ...
local UnitAura = UnitAura
local UnitAura = Cork.UnitAura or UnitAura
local ldb, ae = LibStub:GetLibrary("LibDataBroker-1.1"), LibStub("AceEvent-3.0")


Expand Down
2 changes: 1 addition & 1 deletion modules/WellFed.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

local myname, Cork = ...
local UnitAura = UnitAura
local UnitAura = Cork.UnitAura or UnitAura
local ldb, ae = LibStub:GetLibrary("LibDataBroker-1.1"), LibStub("AceEvent-3.0")


Expand Down
4 changes: 2 additions & 2 deletions services/holiday_active.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ local myname, ns = ...


function ns.IsHolidayActive(name)
local _, _, day = CalendarGetDate()
local day = C_Calendar.GetDate().monthDay
local title, hour, sequenceType
local i = 1
repeat
title, hour, _, _, sequenceType = CalendarGetDayEvent(0, day, i)
title, hour, _, _, sequenceType = C_Calendar.GetDayEvent(0, day, i)
if title == name then
if sequenceType == "START" then
return GetGameTime() >= hour
Expand Down