Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
b064e97
Solve artifacts when you pick up enough pieces, often in the garrison…
hughescr Mar 31, 2015
46ba881
Better Archeology artifact icon
hughescr Mar 31, 2015
fa59fda
Use bag update event rather than loot closed to catch more sources li…
hughescr Jun 10, 2015
849f374
Get correct garrison cache size based on quest completions
hughescr Sep 1, 2015
67cc28c
Six point one is well out now
hughescr Sep 9, 2015
2591551
Apparently, improved logistics does not increase cache size
hughescr Sep 22, 2015
728b302
Do loot window closed trigger too
hughescr Sep 22, 2015
6c7b7d7
Garrison cache check date is same no matter what spec you happen to b…
hughescr Sep 23, 2015
bec69b4
Move dbcrosspec setting to outside the if where it belongs
hughescr Sep 30, 2015
b9d7701
Use bag update event rather than loot closed to catch more sources li…
hughescr Jun 10, 2015
faa3108
Get correct garrison cache size based on quest completions
hughescr Sep 1, 2015
d9b0c6d
Check cache size in a more sensible place
hughescr Sep 1, 2015
a97c14a
Do loot window closed trigger too
hughescr Sep 22, 2015
ab02673
Garrison cache check date is same no matter what spec you happen to b…
hughescr Sep 23, 2015
6927792
Move dbcrosspec setting to outside the if where it belongs
hughescr Sep 30, 2015
cc45aec
No more dark intent
hughescr Jul 25, 2016
8acb458
Fix GetPlots for follower type arg
hughescr Jul 25, 2016
4e7f797
No more hunter buffs in 7.0
hughescr Jul 26, 2016
474045d
No warlock soul link activation any more in 7.0
hughescr Jul 26, 2016
cebc29b
Bodyguard miniaturization device is now a toy
hughescr Jul 26, 2016
8c050a9
Revert "Bodyguard miniaturization device is now a toy"
hughescr Jul 26, 2016
2fab973
Clean up class buffs that no longer exist
hughescr Jul 26, 2016
fc72ce5
No more monk buffs
hughescr Jul 28, 2016
13fff4d
Add ancient mana capsules
hughescr Jan 28, 2017
ec4f5c5
Just use Tekkub's version
hughescr Jan 28, 2017
75fb918
Use Tekkub's .toc too
hughescr Jan 28, 2017
6e194a7
Get correct garrison cache size based on quest completions
hughescr Sep 1, 2015
add528b
Apparently, improved logistics does not increase cache size
hughescr Sep 22, 2015
d4280af
Garrison cache check date is same no matter what spec you happen to b…
hughescr Sep 23, 2015
4569bbb
Move dbcrosspec setting to outside the if where it belongs
hughescr Sep 30, 2015
3d9cf60
Use bag update event rather than loot closed to catch more sources li…
hughescr Jun 10, 2015
becb3c6
Get correct garrison cache size based on quest completions
hughescr Sep 1, 2015
ff87a9d
Check cache size in a more sensible place
hughescr Sep 1, 2015
c13d31e
Do loot window closed trigger too
hughescr Sep 22, 2015
670323d
Garrison cache check date is same no matter what spec you happen to b…
hughescr Sep 23, 2015
ec63d79
Move dbcrosspec setting to outside the if where it belongs
hughescr Sep 30, 2015
dbc6b9a
Fix GetPlots for follower type arg
hughescr Jul 25, 2016
bc6ec16
No more hunter buffs in 7.0
hughescr Jul 26, 2016
b25c989
No warlock soul link activation any more in 7.0
hughescr Jul 26, 2016
6e7d596
Bodyguard miniaturization device is now a toy
hughescr Jul 26, 2016
3b695fc
Revert "Bodyguard miniaturization device is now a toy"
hughescr Jul 26, 2016
3bf5190
Clean up class buffs that no longer exist
hughescr Jul 26, 2016
8cbae98
Just use Tekkub's version
hughescr Jan 28, 2017
2420119
Use Tekkub's .toc too
hughescr Jan 28, 2017
4c604ce
Restore BufferItems to tekkub version
hughescr Feb 4, 2017
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
26 changes: 15 additions & 11 deletions Cork.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ local _

_, Cork.MYCLASS = UnitClass("player")

Cork.corks, Cork.db, Cork.dbpc, Cork.defaultspc = {}, {}, {}, {}
Cork.corks, Cork.db, Cork.dbpc, Cork.dbcrossspec, Cork.defaultspc = {}, {}, {}, {}, {}
Cork.sortedcorks = {}

local defaults = {point = "TOP", x = 0, y = -100, showanchor = true, debug = false, bindwheel = false}
Expand All @@ -22,12 +22,16 @@ ae.RegisterEvent("Cork", "ADDON_LOADED", function(event, addon)
if addon:lower() ~= "cork" then return end

CorkDB = setmetatable(CorkDB or {}, {__index = defaults})
CorkDBPC = CorkDBPC or {{},{},{},{}}
if not CorkDBPC[1] then CorkDBPC = {CorkDBPC, {}, {}, {}} end
for _, i in ipairs({2,3,4}) do
if not CorkDBPC[i] then CorkDBPC[i] = {} end
end
CorkDBPC = CorkDBPC or {{},{},{}} -- Third group is cross-spec
if not CorkDBPC[1] then CorkDBPC = {CorkDBPC, {}, {}} end
if not CorkDBPC[3] then
CorkDBPC[3] = { ['Garrison cache-lastopen'] = math.max(CorkDBPC[1]['Garrison cache-lastopen'] or 0,
CorkDBPC[2]['Garrison cache-lastopen'] or 0) }
CorkDBPC[1]['Garrison cache-lastopen'] = nil
CorkDBPC[2]['Garrison cache-lastopen'] = nil
end
Cork.db = CorkDB
Cork.dbcrossspec = CorkDBPC[3]

anchor:SetPoint(Cork.db.point, Cork.db.x, Cork.db.y)
if not Cork.db.showanchor then anchor:Hide() end
Expand All @@ -38,19 +42,19 @@ end)

local meta = {__index = Cork.defaultspc}
ae.RegisterEvent("Cork", "PLAYER_LOGIN", function()
local lastspec = GetSpecialization()
Cork.dbpc = setmetatable(CorkDBPC[lastspec], meta)
local lastgroup = GetActiveSpecGroup()
Cork.dbpc = setmetatable(CorkDBPC[lastgroup], meta)

for _,dataobj in pairs(Cork.sortedcorks) do if dataobj.Init then dataobj:Init() end end
for _,dataobj in pairs(Cork.sortedcorks) do dataobj:Scan() end

ae.RegisterEvent("Cork", "ZONE_CHANGED_NEW_AREA", Cork.Update)
ae.RegisterEvent("Cork", "PLAYER_TALENT_UPDATE", function()
if lastspec == GetSpecialization() then return end
if lastgroup == GetActiveSpecGroup() then return end

lastspec = GetSpecialization()
lastgroup = GetActiveSpecGroup()
for i,v in pairs(Cork.defaultspc) do if Cork.dbpc[i] == v then Cork.dbpc[i] = nil end end
Cork.dbpc = setmetatable(CorkDBPC[lastspec], meta)
Cork.dbpc = setmetatable(CorkDBPC[lastgroup], meta)

if Cork.config.Update then Cork.config:Update() end
for name,dataobj in pairs(Cork.corks) do if dataobj.Init then dataobj:Init() end end
Expand Down
11 changes: 11 additions & 0 deletions modules/Capsules.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,17 @@ local OPENABLE_IDS = {
[141990] = true, -- Greater Highmountain Tribe Insignia
[141991] = true, -- Greater Wardens Insignia
[141992] = true, -- Greater Nightfallen Insignia
[129036] = true, -- Ancient Mana Fragment
[129097] = true, -- Ancient Mana Gem
[129098] = true, -- Ancient Mana Stone
[139786] = true, -- Ancient Mana Crystal
[139884] = true, -- Ancient Mana Fragments
[139890] = true, -- Ancient Mana Gem
[141655] = true, -- Shimmering Ancient Mana Cluster
[143733] = true, -- Ancient Mana Shards
[143734] = true, -- Ancient Mana Crystal Cluster
[143735] = true, -- Ancient Mana Shards
[143748] = true, -- Leyscale Koi
}


Expand Down
6 changes: 0 additions & 6 deletions modules/DeathKnight.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,3 @@ if Cork.MYCLASS ~= "DEATHKNIGHT" then return end
-- Path of Frost
local spellname, _, icon = GetSpellInfo(3714)
Cork:GenerateSelfBuffer(spellname, icon)


-- Horn of Winter
local spellname, _, icon = GetSpellInfo(57330)
local str_earth = GetSpellInfo(58646) -- Strength of Earth
Cork:GenerateSelfBuffer(spellname, icon, str_earth)
52 changes: 52 additions & 0 deletions modules/Dig.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@

local myname, Cork = ...

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

Cork.defaultspc["Archaeology solve-enabled"] = true

local dataobj2 = ldb:NewDataObject("Cork Archaeology Solving", {
type = "cork",
tiptext = "Warn when you can solve archeology artifacts"
})

local solveRace = nil

function dataobj2:Scan()
if not Cork.dbpc["Archaeology solve-enabled"] then
dataobj2.player = nil
solveRace = nil
return
end

local raceCount = GetNumArchaeologyRaces()

for race = 1, raceCount do
local name,_,_,have,need,max=GetArchaeologyRaceInfo(race)

if(have>need) then
SetSelectedArtifact(race)
local _1,_2,_3,_4,_5,_6,_7 = GetSelectedArtifactInfo()
dataobj2.player = IconLine(_4, name.."Artifact ("..have.."/"..need..")")
solveRace = race
return
end
end

dataobj2.player = nil
solveRace = nil
end

ae.RegisterEvent("Cork Archaeology Solving", "ARCHAEOLOGY_FIND_COMPLETE", dataobj2.Scan)
ae.RegisterEvent("Cork Archaeology Solving", "ARTIFACT_COMPLETE", dataobj2.Scan)
ae.RegisterEvent("Cork Archaeology Solving", "ARTIFACT_UPDATE", dataobj2.Scan)
ae.RegisterEvent("Cork Archaeology Solving", "BAG_UPDATE_DELAYED", dataobj2.Scan)
ae.RegisterEvent("Cork Archaeology Solving", "LOOT_CLOSED", dataobj2.Scan)

function dataobj2:CorkIt(frame)
if dataobj2.player and solveRace then
local macro = "/script SetSelectedArtifact("..solveRace..") SolveArtifact()"
return frame:SetManyAttributes("type1", "macro", "macrotext1", macro)
end
end
3 changes: 0 additions & 3 deletions modules/Hunter.lua

This file was deleted.

1 change: 1 addition & 0 deletions modules/Monk.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
local myname, Cork = ...
if Cork.MYCLASS ~= "MONK" then return end


-- Enlightenment (EXP boost buff)
local UnitAura = Cork.UnitAura or UnitAura
local ldb, ae = LibStub:GetLibrary("LibDataBroker-1.1"), LibStub("AceEvent-3.0")
Expand Down
84 changes: 2 additions & 82 deletions modules/Paladin.lua
Original file line number Diff line number Diff line change
@@ -1,93 +1,13 @@

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



-- Righteous Fury
local spellname, _, icon = GetSpellInfo(25780)
Cork:GenerateSelfBuffer(spellname, icon)

-- Greater Blessings are any combination of 2 blessings across the whole raid.
local spellnames = {(GetSpellInfo(203538)), (GetSpellInfo(203539))}
local _, _, icon = GetSpellInfo(203538)
local rolespells = {TANK=1, DAMAGER=2, HEALER=3}
local dataobj = ldb:NewDataObject("Cork Greater Blessings", {
type = "cork",
corktype = "buff",
tiplink = GetSpellLink(203538)
})

function dataobj:Init()
Cork.defaultspc["Greater Blessings-enabled"] = GetSpellInfo(spellnames[1]) ~= nil
end

local raidunits, partyunits, otherunits = {}, {}, { ["player"] = true }
for i=1,40 do raidunits["raid"..i] = i end
for i=1,4 do partyunits["party"..i] = i end
function dataobj:Test(unit)
if not UnitExists(unit) or (unit ~= "player" and UnitIsUnit(unit, "player"))
or (IsInRaid() and partyunits[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
count = count + 1
end
end
return count
end
function dataobj:Scan(enteringcombat)
if not Cork.dbpc["Greater Blessings-enabled"] or (IsResting() and not Cork.db.debug) or (enteringcombat or InCombatLockdown()) then
self.player = nil
return
end
local count = self:Test("player")
-- We can't scan the same unit twice or we'll get inaccurate results
if IsInRaid() then
for k, _ in pairs(raidunits) do
count = count + self:Test(k)
if count >= 2 then break end
end
elseif IsInGroup() then
for k, _ in pairs(partyunits) do
count = count + self:Test(k)
if count >= 2 then break end
end
end
if count < 2 then
self.player = Cork.IconLine(icon, string.format("Greater Blessings (%d)", 2 - count))
else
self.player = nil
end
end
function dataobj:CorkIt(frame)
if self.player and Cork.SpellCastableOnUnit(spellnames[1], "player") then
-- figure out which spell in the list we don't have
-- 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?
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?
return frame:SetManyAttributes("type1", "spell", "spell", spellname, "unit", "player")
end
end
end
end
local function isScanUnit(unit)
return not not (raidunits[unit] or partyunits[unit] or otherunits[unit])
end
function dataobj:TestUnit(event, unit)
if isScanUnit(unit) then self:Scan() end
end
ae.RegisterEvent(dataobj, "UNIT_AURA", "TestUnit")
ae.RegisterEvent(dataobj, "GROUP_ROSTER_UPDATE", "TestUnit")
ae.RegisterEvent(dataobj, "PLAYER_UPDATE_RESTING", function () dataobj:Scan() end)
ae.RegisterEvent(dataobj, "PLAYER_REGEN_DISABLED", function () dataobj:Scan(true) end)
ae.RegisterEvent(dataobj, "PLAYER_REGEN_ENABLED", function () dataobj:Scan() end)

-- Beacon of Light
local spellname, _, icon = GetSpellInfo(53563)
Expand Down
3 changes: 0 additions & 3 deletions modules/Priest.lua

This file was deleted.

3 changes: 0 additions & 3 deletions modules/Shaman.lua

This file was deleted.

1 change: 0 additions & 1 deletion modules/Warlock.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ if Cork.MYCLASS ~= "WARLOCK" then return end
local spellname, _, icon = GetSpellInfo(108503)
Cork:GenerateSelfBuffer(spellname, icon)


-- Soulstone
local spellname, _, icon = GetSpellInfo(20707)
local dataobj = Cork:GenerateLastBuffedBuffer(spellname, icon)
Expand Down
33 changes: 0 additions & 33 deletions modules/WarlockSoulLink.lua

This file was deleted.

3 changes: 0 additions & 3 deletions modules/Warrior.lua

This file was deleted.