From b064e97fd7b52c84061e00d9f99f34d2cbd490fd Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Mon, 30 Mar 2015 17:01:18 -0700 Subject: [PATCH 01/45] Solve artifacts when you pick up enough pieces, often in the garrison mines --- modules/Dig.lua | 51 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 modules/Dig.lua diff --git a/modules/Dig.lua b/modules/Dig.lua new file mode 100644 index 0000000..a58153b --- /dev/null +++ b/modules/Dig.lua @@ -0,0 +1,51 @@ + +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,icon,id,have,need,max=GetArchaeologyRaceInfo(race) + + if(have>need) then + dataobj2.player = IconLine(icon, name.."Artifact") + 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", "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 From 46ba881be679554829d54f9c97b3a222f598d136 Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Mon, 30 Mar 2015 17:19:36 -0700 Subject: [PATCH 02/45] Better Archeology artifact icon --- modules/Dig.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/Dig.lua b/modules/Dig.lua index a58153b..f30269c 100644 --- a/modules/Dig.lua +++ b/modules/Dig.lua @@ -23,10 +23,12 @@ function dataobj2:Scan() local raceCount = GetNumArchaeologyRaces() for race = 1, raceCount do - local name,icon,id,have,need,max=GetArchaeologyRaceInfo(race) + local name,_,_,have,need,max=GetArchaeologyRaceInfo(race) if(have>need) then - dataobj2.player = IconLine(icon, name.."Artifact") + SetSelectedArtifact(race) + local _1,_2,_3,_4,_5,_6,_7 = GetSelectedArtifactInfo() + dataobj2.player = IconLine(_4, name.."Artifact ("..have.."/"..need..")") solveRace = race return end From fa59fda9642325ac98736a68b33eaf8e11febf4f Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Wed, 10 Jun 2015 01:47:23 -0700 Subject: [PATCH 03/45] Use bag update event rather than loot closed to catch more sources like mission rewards --- modules/Dig.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/Dig.lua b/modules/Dig.lua index f30269c..c2e1d85 100644 --- a/modules/Dig.lua +++ b/modules/Dig.lua @@ -42,8 +42,7 @@ 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", "LOOT_CLOSED", dataobj2.Scan) - +ae.RegisterEvent("Cork Archaeology Solving", "BAG_UPDATE_DELAYED", dataobj2.Scan) function dataobj2:CorkIt(frame) if dataobj2.player and solveRace then From 849f37434ff4605b63fd8b3f22a7ddcca02b763b Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Mon, 31 Aug 2015 23:00:19 -0700 Subject: [PATCH 04/45] Get correct garrison cache size based on quest completions --- modules/GarrisonCache.lua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/GarrisonCache.lua b/modules/GarrisonCache.lua index 73df39b..f7e9cf5 100644 --- a/modules/GarrisonCache.lua +++ b/modules/GarrisonCache.lua @@ -23,8 +23,8 @@ ns.defaultspc[name.."-enabled"] = true local function SecondsSinceLastOpened() - local lasttime = ns.dbpc[name.."-lastopen"] or 0 - return time() - lasttime + local lasttime = ns.dbpc[name.."-lastopen"] or 0 + return time() - lasttime end @@ -63,10 +63,10 @@ end ae.RegisterEvent(dataobj, "ZONE_CHANGED", "Scan") ae.RegisterEvent("Cork "..name, "SHOW_LOOT_TOAST", function(event, ...) - local _, _, _, _, _, _, lootSource = ... - if lootSource == 10 then - ns.dbpc[name.."-lastopen"] = time() - end + local _, _, _, _, _, _, lootSource = ... + if lootSource == 10 then + ns.dbpc[name.."-lastopen"] = time() + end - dataobj:Scan() + dataobj:Scan() end) From 67cc28ce52b96d3098147bea88af99ba103d92d6 Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Wed, 9 Sep 2015 01:17:23 -0700 Subject: [PATCH 05/45] Six point one is well out now --- modules/BuffItems.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/modules/BuffItems.lua b/modules/BuffItems.lua index dbd063d..8e5d462 100644 --- a/modules/BuffItems.lua +++ b/modules/BuffItems.lua @@ -8,6 +8,15 @@ local ae = LibStub("AceEvent-3.0") if level < 80 then return end +-- Drums of Forgotten Kings +Cork:GenerateItemBuffer({PALADIN = true, DRUID = true, MONK = true}, 49633, 69378, 20217) + + +-- Runescroll of Fortitude +local id = level < 85 and 49632 or level < 90 and 62251 or 79257 +Cork:GenerateItemBuffer("PRIEST", id, 69377, 21562) + + -- Only available to alchys local itemname = GetItemInfo(75525) or "Alchemist's Flask" local dataobj = Cork:GenerateSelfBuffer(itemname, GetItemIcon(75525), @@ -42,3 +51,8 @@ local dataobj = Cork:GenerateItemSelfBuffer(120182, 178119) function dataobj:Init() Cork.defaultspc[self.name.."-enabled"] = level < 100 and GetItemCount(120182) > 0 end + + +-- Bodyguard Miniaturization Device +local dataobj = Cork:GenerateItemSelfBuffer(122298) +dataobj.Test = dataobj.TestWithoutResting From 2591551a31b277546a4dc4a707b1e5525d7058ae Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Mon, 21 Sep 2015 17:03:09 -0700 Subject: [PATCH 06/45] Apparently, improved logistics does not increase cache size --- modules/GarrisonCache.lua | 53 +++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 30 deletions(-) diff --git a/modules/GarrisonCache.lua b/modules/GarrisonCache.lua index f7e9cf5..7707975 100644 --- a/modules/GarrisonCache.lua +++ b/modules/GarrisonCache.lua @@ -7,11 +7,9 @@ local ae = LibStub("AceEvent-3.0") -- Items only available when you have a garrison if level < 90 then return end - -function ns.InGarrison() - return C_Garrison.IsOnGarrisonMap() or C_Garrison.IsOnShipyardMap() -end - +local cacheSizeQuestId = { + { questId=37485, size=1000 }, +} local name = "Garrison cache" @@ -28,36 +26,31 @@ local function SecondsSinceLastOpened() end -local function MaxSize() - return IsQuestFlaggedCompleted(37485) and 1000 or 500 -end - - -local function AmountPending() - local size = SecondsSinceLastOpened() / 60 / 10 - return math.min(size, MaxSize()) -end - - local function Test() - if not ns.InGarrison() then return end - return AmountPending() >= (MaxSize() - (24*60/10)) + if not C_Garrison.IsOnGarrisonMap() then return end + return SecondsSinceLastOpened() > (60*10*5) end function dataobj:Scan() - if ns.dbpc[self.name.."-enabled"] and Test() then - if not ns.dbpc[name.."-lastopen"] then - self.player = ns.IconLine("Interface\\ICONS\\inv_garrison_resource", name) - return - end - - local size = AmountPending() - local title = string.format("%s (%d)", name, size) - self.player = ns.IconLine("Interface\\ICONS\\inv_garrison_resource", title) - else - self.player = nil - end + if ns.dbpc[self.name.."-enabled"] and Test() then + local myCacheSize = 500 + for _, cacheSize in pairs(cacheSizeQuestId) do + if(_G.IsQuestFlaggedCompleted(cacheSize.questId)) then + myCacheSize = cacheSize.size; + end + end + local size = math.min(myCacheSize, math.floor(SecondsSinceLastOpened() / 60 / 10)) + if not ns.dbpc[name.."-lastopen"] then + self.player = ns.IconLine("Interface\\ICONS\\inv_garrison_resource", name) + return + end + + local title = string.format("%s (%d/%d)", name, size, myCacheSize) + self.player = ns.IconLine("Interface\\ICONS\\inv_garrison_resource", title) + else + self.player = nil + end end From 728b302ca2c4933c8faf4eb770a9a0b316605b75 Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Mon, 21 Sep 2015 17:04:30 -0700 Subject: [PATCH 07/45] Do loot window closed trigger too --- modules/Dig.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Dig.lua b/modules/Dig.lua index c2e1d85..53b6c87 100644 --- a/modules/Dig.lua +++ b/modules/Dig.lua @@ -38,11 +38,11 @@ function dataobj2:Scan() 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 From 6c7b7d724bed0963e48a3b792099fca840102a1a Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Wed, 23 Sep 2015 14:49:16 -0700 Subject: [PATCH 08/45] Garrison cache check date is same no matter what spec you happen to be in --- Cork.lua | 26 +++++++++++++++----------- modules/GarrisonCache.lua | 6 +++--- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/Cork.lua b/Cork.lua index 75bc6dd..c37fe32 100644 --- a/Cork.lua +++ b/Cork.lua @@ -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} @@ -22,11 +22,15 @@ 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 + Cork.dbcrossspec = CorkDBPC[3] + end Cork.db = CorkDB anchor:SetPoint(Cork.db.point, Cork.db.x, Cork.db.y) @@ -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 diff --git a/modules/GarrisonCache.lua b/modules/GarrisonCache.lua index 7707975..9db7bf9 100644 --- a/modules/GarrisonCache.lua +++ b/modules/GarrisonCache.lua @@ -21,7 +21,7 @@ ns.defaultspc[name.."-enabled"] = true local function SecondsSinceLastOpened() - local lasttime = ns.dbpc[name.."-lastopen"] or 0 + local lasttime = ns.dbcrossspec[name.."-lastopen"] or 0 return time() - lasttime end @@ -41,7 +41,7 @@ function dataobj:Scan() end end local size = math.min(myCacheSize, math.floor(SecondsSinceLastOpened() / 60 / 10)) - if not ns.dbpc[name.."-lastopen"] then + if not ns.dbcrossspec[name.."-lastopen"] then self.player = ns.IconLine("Interface\\ICONS\\inv_garrison_resource", name) return end @@ -58,7 +58,7 @@ ae.RegisterEvent(dataobj, "ZONE_CHANGED", "Scan") ae.RegisterEvent("Cork "..name, "SHOW_LOOT_TOAST", function(event, ...) local _, _, _, _, _, _, lootSource = ... if lootSource == 10 then - ns.dbpc[name.."-lastopen"] = time() + ns.dbcrossspec[name.."-lastopen"] = time() end dataobj:Scan() From bec69b428e241c18b20fc7ea79537e60845e7a4f Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Tue, 29 Sep 2015 22:14:49 -0700 Subject: [PATCH 09/45] Move dbcrosspec setting to outside the if where it belongs --- Cork.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cork.lua b/Cork.lua index c37fe32..4c3df26 100644 --- a/Cork.lua +++ b/Cork.lua @@ -29,9 +29,9 @@ ae.RegisterEvent("Cork", "ADDON_LOADED", function(event, addon) CorkDBPC[2]['Garrison cache-lastopen'] or 0) } CorkDBPC[1]['Garrison cache-lastopen'] = nil CorkDBPC[2]['Garrison cache-lastopen'] = nil - Cork.dbcrossspec = CorkDBPC[3] 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 From b9d7701319c8a5bc5b4d14864949cb179023ded0 Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Wed, 10 Jun 2015 01:47:23 -0700 Subject: [PATCH 10/45] Use bag update event rather than loot closed to catch more sources like mission rewards --- modules/Dig.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/Dig.lua b/modules/Dig.lua index 53b6c87..e428409 100644 --- a/modules/Dig.lua +++ b/modules/Dig.lua @@ -38,6 +38,7 @@ function dataobj2:Scan() 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) From faa3108cd59fa5d4809ef5b9f18f68b310b49a75 Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Mon, 31 Aug 2015 23:00:19 -0700 Subject: [PATCH 11/45] Get correct garrison cache size based on quest completions --- modules/GarrisonCache.lua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/GarrisonCache.lua b/modules/GarrisonCache.lua index 9db7bf9..e4765b1 100644 --- a/modules/GarrisonCache.lua +++ b/modules/GarrisonCache.lua @@ -11,6 +11,12 @@ local cacheSizeQuestId = { { questId=37485, size=1000 }, } +for _, cacheSize in pairs(cacheSizeQuestId) do + if(_G.IsQuestFlaggedCompleted(cacheSize[1])) then + myCacheSize = cacheSize[2]; + end +end + local name = "Garrison cache" @@ -34,14 +40,8 @@ end function dataobj:Scan() if ns.dbpc[self.name.."-enabled"] and Test() then - local myCacheSize = 500 - for _, cacheSize in pairs(cacheSizeQuestId) do - if(_G.IsQuestFlaggedCompleted(cacheSize.questId)) then - myCacheSize = cacheSize.size; - end - end local size = math.min(myCacheSize, math.floor(SecondsSinceLastOpened() / 60 / 10)) - if not ns.dbcrossspec[name.."-lastopen"] then + if not ns.crossspec[name.."-lastopen"] then self.player = ns.IconLine("Interface\\ICONS\\inv_garrison_resource", name) return end From d9b0c6d54812eaeb728cbebb85f6d0adad341bd3 Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Tue, 1 Sep 2015 01:51:14 -0700 Subject: [PATCH 12/45] Check cache size in a more sensible place --- modules/GarrisonCache.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/GarrisonCache.lua b/modules/GarrisonCache.lua index e4765b1..223d0f0 100644 --- a/modules/GarrisonCache.lua +++ b/modules/GarrisonCache.lua @@ -11,12 +11,6 @@ local cacheSizeQuestId = { { questId=37485, size=1000 }, } -for _, cacheSize in pairs(cacheSizeQuestId) do - if(_G.IsQuestFlaggedCompleted(cacheSize[1])) then - myCacheSize = cacheSize[2]; - end -end - local name = "Garrison cache" @@ -40,6 +34,12 @@ end function dataobj:Scan() if ns.dbpc[self.name.."-enabled"] and Test() then + local myCacheSize = 500 + for _, cacheSize in pairs(cacheSizeQuestId) do + if(_G.IsQuestFlaggedCompleted(cacheSize.questId)) then + myCacheSize = cacheSize.size; + end + end local size = math.min(myCacheSize, math.floor(SecondsSinceLastOpened() / 60 / 10)) if not ns.crossspec[name.."-lastopen"] then self.player = ns.IconLine("Interface\\ICONS\\inv_garrison_resource", name) From a97c14a6828a075c6a615c4d5c35d921502e19ac Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Mon, 21 Sep 2015 17:04:30 -0700 Subject: [PATCH 13/45] Do loot window closed trigger too --- modules/Dig.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/Dig.lua b/modules/Dig.lua index e428409..53b6c87 100644 --- a/modules/Dig.lua +++ b/modules/Dig.lua @@ -38,7 +38,6 @@ function dataobj2:Scan() 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) From ab026735ea7d1fdd4f7dde1cecfd966ae3020940 Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Wed, 23 Sep 2015 14:49:16 -0700 Subject: [PATCH 14/45] Garrison cache check date is same no matter what spec you happen to be in --- Cork.lua | 2 +- modules/GarrisonCache.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cork.lua b/Cork.lua index 4c3df26..c37fe32 100644 --- a/Cork.lua +++ b/Cork.lua @@ -29,9 +29,9 @@ ae.RegisterEvent("Cork", "ADDON_LOADED", function(event, addon) CorkDBPC[2]['Garrison cache-lastopen'] or 0) } CorkDBPC[1]['Garrison cache-lastopen'] = nil CorkDBPC[2]['Garrison cache-lastopen'] = nil + Cork.dbcrossspec = CorkDBPC[3] 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 diff --git a/modules/GarrisonCache.lua b/modules/GarrisonCache.lua index 223d0f0..9db7bf9 100644 --- a/modules/GarrisonCache.lua +++ b/modules/GarrisonCache.lua @@ -41,7 +41,7 @@ function dataobj:Scan() end end local size = math.min(myCacheSize, math.floor(SecondsSinceLastOpened() / 60 / 10)) - if not ns.crossspec[name.."-lastopen"] then + if not ns.dbcrossspec[name.."-lastopen"] then self.player = ns.IconLine("Interface\\ICONS\\inv_garrison_resource", name) return end From 69277922c38be827ab548e0ca9ac89897ab658a1 Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Tue, 29 Sep 2015 22:14:49 -0700 Subject: [PATCH 15/45] Move dbcrosspec setting to outside the if where it belongs --- Cork.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cork.lua b/Cork.lua index c37fe32..4c3df26 100644 --- a/Cork.lua +++ b/Cork.lua @@ -29,9 +29,9 @@ ae.RegisterEvent("Cork", "ADDON_LOADED", function(event, addon) CorkDBPC[2]['Garrison cache-lastopen'] or 0) } CorkDBPC[1]['Garrison cache-lastopen'] = nil CorkDBPC[2]['Garrison cache-lastopen'] = nil - Cork.dbcrossspec = CorkDBPC[3] 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 From cc45aece064b3b73852a622beb99f124db3a377e Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Sun, 24 Jul 2016 23:13:36 -0700 Subject: [PATCH 16/45] No more dark intent --- modules/Warlock.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/Warlock.lua b/modules/Warlock.lua index c3622f8..94944d4 100644 --- a/modules/Warlock.lua +++ b/modules/Warlock.lua @@ -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) From 8acb4587eba5a7de45678e5356a3c90fd9f36d8c Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Sun, 24 Jul 2016 23:19:29 -0700 Subject: [PATCH 17/45] Fix GetPlots for follower type arg --- modules/GarrisonFreeFood.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/GarrisonFreeFood.lua b/modules/GarrisonFreeFood.lua index 7d93de5..9bc3e47 100644 --- a/modules/GarrisonFreeFood.lua +++ b/modules/GarrisonFreeFood.lua @@ -23,7 +23,6 @@ ns.defaultspc[name.."-enabled"] = true local function ScanPlots() local plots = C_Garrison.GetPlots(LE_FOLLOWER_TYPE_GARRISON_6_0) - if not plots then return end for i,plot in ipairs(plots) do local id, _, _, _, rank = C_Garrison.GetOwnedBuildingInfoAbbrev(plot.id) if id == 137 and rank == 3 then return true end @@ -40,7 +39,7 @@ end local function Test(self) - if not ns.InGarrison() or not HasTree() then return end + if not C_Garrison.IsOnGarrisonMap() or not HasTree() then return end for id in pairs(foods) do if GetItemCount(id) > 0 then return end From 4e7f79745fa911190c6262eb94ed2e7e327e301e Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Mon, 25 Jul 2016 23:01:29 -0700 Subject: [PATCH 18/45] No more hunter buffs in 7.0 --- Cork.toc | 1 - modules/Hunter.lua | 3 --- 2 files changed, 4 deletions(-) delete mode 100644 modules/Hunter.lua diff --git a/Cork.toc b/Cork.toc index 22c8add..5c1fd61 100644 --- a/Cork.toc +++ b/Cork.toc @@ -41,7 +41,6 @@ templates\TempEnchant.lua modules\DeathKnight.lua modules\Druid.lua -modules\Hunter.lua modules\Mage.lua modules\Monk.lua modules\Paladin.lua diff --git a/modules/Hunter.lua b/modules/Hunter.lua deleted file mode 100644 index f3ae016..0000000 --- a/modules/Hunter.lua +++ /dev/null @@ -1,3 +0,0 @@ - -local myname, Cork = ... -if Cork.MYCLASS ~= "HUNTER" then return end From 474045dfb79371a5bec6bb297c8c08921c91ec9d Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Mon, 25 Jul 2016 23:16:46 -0700 Subject: [PATCH 19/45] No warlock soul link activation any more in 7.0 --- Cork.toc | 1 - modules/WarlockSoulLink.lua | 33 --------------------------------- 2 files changed, 34 deletions(-) delete mode 100644 modules/WarlockSoulLink.lua diff --git a/Cork.toc b/Cork.toc index 5c1fd61..dba0e17 100644 --- a/Cork.toc +++ b/Cork.toc @@ -50,7 +50,6 @@ modules\Shaman.lua modules\Warlock.lua modules\WarlockHealthstone.lua modules\WarlockPets.lua -modules\WarlockSoulLink.lua modules\Warrior.lua modules\ArtifactPowerItems.lua diff --git a/modules/WarlockSoulLink.lua b/modules/WarlockSoulLink.lua deleted file mode 100644 index 56063c4..0000000 --- a/modules/WarlockSoulLink.lua +++ /dev/null @@ -1,33 +0,0 @@ - -local myname, Cork = ... -if Cork.MYCLASS ~= "WARLOCK" then return end - -local myname, Cork = ... -local UnitAura = UnitAura -local ldb, ae = LibStub:GetLibrary("LibDataBroker-1.1"), LibStub("AceEvent-3.0") - - -local soul_link_enabled = select(5, GetTalentInfo(3,1,GetActiveSpecGroup())) -if soul_link_enabled then - local spellname, _, icon = GetSpellInfo(108415) - local IconLine = Cork.IconLine(icon, spellname) - - local dataobj = LibStub:GetLibrary("LibDataBroker-1.1"):NewDataObject("Cork "..spellname, {type = "cork", tiplink = GetSpellLink(spellname)}) - - function dataobj:Init() Cork.defaultspc[spellname.."-enabled"] = GetSpellInfo(spellname) ~= nil end - - local function Test(unit) - if Cork.dbpc[spellname.."-enabled"] and UnitExists("pet") and not UnitIsDead("pet") and not UnitAura("pet", spellname) and UnitName("pet") ~= UNKNOWN and not IsMounted() then - return IconLine - end - end - - ae.RegisterEvent("Cork "..spellname, "UNIT_PET", function(event, unit) if unit == "player" then dataobj.pet = Test() end end) - ae.RegisterEvent("Cork "..spellname, "UNIT_AURA", function(event, unit) if unit == "pet" then dataobj.pet = Test() end end) - - function dataobj:Scan() self.pet = Test() end - - function dataobj:CorkIt(frame) - if self.pet then return frame:SetManyAttributes("type1", "spell", "spell", spellname) end - end -end From cebc29b7a2fe4ddf1f958cdaa0c3dfe919a8dfd0 Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Mon, 25 Jul 2016 23:45:02 -0700 Subject: [PATCH 20/45] Bodyguard miniaturization device is now a toy --- Cork.toc | 18 ++++++++---------- modules/Bodyguard.lua | 35 +++++++++++++++++++++++++++++++++++ modules/BuffItems.lua | 5 ----- 3 files changed, 43 insertions(+), 15 deletions(-) create mode 100644 modules/Bodyguard.lua diff --git a/Cork.toc b/Cork.toc index dba0e17..6ac52e0 100644 --- a/Cork.toc +++ b/Cork.toc @@ -1,8 +1,11 @@ -## Interface: 70100 +## Interface: 60000 ## Title: Cork ## Notes: Buff reminders and more ## Author: Tekkub Stoutwrithe +## Version: Alpha +## X-Website: http://www.tekkub.net/ +## X-Email: tekkub-wow@googlegroups.com ## X-Credits: Thiana (Warlock modules), Gnancy (Soullink module) ## X-Category: Buffs ## X-Icon: Interface\Icons\INV_Drink_11 @@ -12,6 +15,7 @@ ## OptionalDeps: tekErr +externals\ptr.lua externals\timer.lua externals\tooltip_scanner.lua externals\ui-tab.lua @@ -21,8 +25,6 @@ CallbackHandler-1.0.lua LibDataBroker-1.1\LibDataBroker-1.1.lua AceEvent-3.0\AceEvent-3.0.xml -services\holiday_active.lua - Locale.lua KeyBlacklist.lua @@ -44,6 +46,7 @@ modules\Druid.lua modules\Mage.lua modules\Monk.lua modules\Paladin.lua +modules\PaladinBlessings.lua modules\Priest.lua modules\RogueWeapon.lua modules\Shaman.lua @@ -52,17 +55,13 @@ modules\WarlockHealthstone.lua modules\WarlockPets.lua modules\Warrior.lua -modules\ArtifactPowerItems.lua modules\BattleStandard.lua -modules\BonusEvents.lua +modules\Bodyguard.lua modules\BuffItems.lua -modules\ClassHallWorkOrders.lua -modules\Capsules.lua modules\Combine.lua modules\DarkmoonExp.lua +modules\Dig.lua modules\FishingHat.lua -modules\GarrisonBodyguardMinifier.lua -modules\GarrisonBuildings.lua modules\GarrisonCache.lua modules\GarrisonFreeFood.lua modules\GarrisonMineItems.lua @@ -72,7 +71,6 @@ modules\LancePole.lua modules\Lures.lua modules\Minipet.lua modules\OpenableItems.lua -modules\PilgrimsBountyRep.lua modules\QuestStartingItems.lua modules\Repairs.lua modules\Salvage.lua diff --git a/modules/Bodyguard.lua b/modules/Bodyguard.lua new file mode 100644 index 0000000..cd8efc9 --- /dev/null +++ b/modules/Bodyguard.lua @@ -0,0 +1,35 @@ +local name, Cork = ... +local ae = LibStub("AceEvent-3.0") + +local name, _, icon = GetSpellInfo(181642) + +local dataobj = Cork:GenerateSelfBuffer(name, icon) + +function dataobj:Test() + -- Need to have the toy + local _, _, _, collected = C_ToyBox.GetToyInfo(122298) + if not collected then return end + + -- Need to have a bodyguard assigned to a Barracks + local found = false + local buildings = C_Garrison.GetBuildings(LE_GARRISON_TYPE_6_0) + for i = 1, #buildings do + local buildingId = buildings[i].buildingID + if buildingId >= 26 and buildingId <= 28 then -- Barracks + if C_Garrison.GetFollowerInfoForBuilding(buildings[i].plotID) then found = true end + end + end + if not found then return end + + return self:TestWithoutResting() +end + +function dataobj:CorkIt(frame) + if self.player then + local macro = '/use ' .. name + return frame:SetManyAttributes("type1", "macro", "macrotext1", macro) + end +end + +ae.RegisterEvent(dataobj, "ZONE_CHANGED", "Scan") +ae.RegisterEvent(dataobj, "GARRISON_UPDATE", "Scan") diff --git a/modules/BuffItems.lua b/modules/BuffItems.lua index 8e5d462..23c3c68 100644 --- a/modules/BuffItems.lua +++ b/modules/BuffItems.lua @@ -51,8 +51,3 @@ local dataobj = Cork:GenerateItemSelfBuffer(120182, 178119) function dataobj:Init() Cork.defaultspc[self.name.."-enabled"] = level < 100 and GetItemCount(120182) > 0 end - - --- Bodyguard Miniaturization Device -local dataobj = Cork:GenerateItemSelfBuffer(122298) -dataobj.Test = dataobj.TestWithoutResting From 8c050a9dcee5a3f0bda75e253249cb41f797f500 Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Tue, 26 Jul 2016 16:29:49 -0700 Subject: [PATCH 21/45] Revert "Bodyguard miniaturization device is now a toy" This reverts commit bcee929b99a359846984eb6560b91e2c35409d8c. --- Cork.toc | 1 - modules/Bodyguard.lua | 35 ----------------------------------- modules/BuffItems.lua | 5 +++++ 3 files changed, 5 insertions(+), 36 deletions(-) delete mode 100644 modules/Bodyguard.lua diff --git a/Cork.toc b/Cork.toc index 6ac52e0..cce3213 100644 --- a/Cork.toc +++ b/Cork.toc @@ -56,7 +56,6 @@ modules\WarlockPets.lua modules\Warrior.lua modules\BattleStandard.lua -modules\Bodyguard.lua modules\BuffItems.lua modules\Combine.lua modules\DarkmoonExp.lua diff --git a/modules/Bodyguard.lua b/modules/Bodyguard.lua deleted file mode 100644 index cd8efc9..0000000 --- a/modules/Bodyguard.lua +++ /dev/null @@ -1,35 +0,0 @@ -local name, Cork = ... -local ae = LibStub("AceEvent-3.0") - -local name, _, icon = GetSpellInfo(181642) - -local dataobj = Cork:GenerateSelfBuffer(name, icon) - -function dataobj:Test() - -- Need to have the toy - local _, _, _, collected = C_ToyBox.GetToyInfo(122298) - if not collected then return end - - -- Need to have a bodyguard assigned to a Barracks - local found = false - local buildings = C_Garrison.GetBuildings(LE_GARRISON_TYPE_6_0) - for i = 1, #buildings do - local buildingId = buildings[i].buildingID - if buildingId >= 26 and buildingId <= 28 then -- Barracks - if C_Garrison.GetFollowerInfoForBuilding(buildings[i].plotID) then found = true end - end - end - if not found then return end - - return self:TestWithoutResting() -end - -function dataobj:CorkIt(frame) - if self.player then - local macro = '/use ' .. name - return frame:SetManyAttributes("type1", "macro", "macrotext1", macro) - end -end - -ae.RegisterEvent(dataobj, "ZONE_CHANGED", "Scan") -ae.RegisterEvent(dataobj, "GARRISON_UPDATE", "Scan") diff --git a/modules/BuffItems.lua b/modules/BuffItems.lua index 23c3c68..8e5d462 100644 --- a/modules/BuffItems.lua +++ b/modules/BuffItems.lua @@ -51,3 +51,8 @@ local dataobj = Cork:GenerateItemSelfBuffer(120182, 178119) function dataobj:Init() Cork.defaultspc[self.name.."-enabled"] = level < 100 and GetItemCount(120182) > 0 end + + +-- Bodyguard Miniaturization Device +local dataobj = Cork:GenerateItemSelfBuffer(122298) +dataobj.Test = dataobj.TestWithoutResting From 2fab9737ff7dca6ea2882b0edb2f9c14fd02e4c2 Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Tue, 26 Jul 2016 16:38:06 -0700 Subject: [PATCH 22/45] Clean up class buffs that no longer exist --- Cork.toc | 5 ----- modules/DeathKnight.lua | 6 ------ modules/Paladin.lua | 1 + modules/Priest.lua | 3 --- modules/Shaman.lua | 3 --- 5 files changed, 1 insertion(+), 17 deletions(-) delete mode 100644 modules/Priest.lua delete mode 100644 modules/Shaman.lua diff --git a/Cork.toc b/Cork.toc index cce3213..237c509 100644 --- a/Cork.toc +++ b/Cork.toc @@ -15,7 +15,6 @@ ## OptionalDeps: tekErr -externals\ptr.lua externals\timer.lua externals\tooltip_scanner.lua externals\ui-tab.lua @@ -46,14 +45,10 @@ modules\Druid.lua modules\Mage.lua modules\Monk.lua modules\Paladin.lua -modules\PaladinBlessings.lua -modules\Priest.lua modules\RogueWeapon.lua -modules\Shaman.lua modules\Warlock.lua modules\WarlockHealthstone.lua modules\WarlockPets.lua -modules\Warrior.lua modules\BattleStandard.lua modules\BuffItems.lua diff --git a/modules/DeathKnight.lua b/modules/DeathKnight.lua index 5a7f279..7a11597 100644 --- a/modules/DeathKnight.lua +++ b/modules/DeathKnight.lua @@ -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) diff --git a/modules/Paladin.lua b/modules/Paladin.lua index 77c205e..56824b3 100644 --- a/modules/Paladin.lua +++ b/modules/Paladin.lua @@ -3,6 +3,7 @@ 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) diff --git a/modules/Priest.lua b/modules/Priest.lua deleted file mode 100644 index dfb19f6..0000000 --- a/modules/Priest.lua +++ /dev/null @@ -1,3 +0,0 @@ - -local myname, Cork = ... -if Cork.MYCLASS ~= "PRIEST" then return end diff --git a/modules/Shaman.lua b/modules/Shaman.lua deleted file mode 100644 index a86ff6f..0000000 --- a/modules/Shaman.lua +++ /dev/null @@ -1,3 +0,0 @@ - -local myname, Cork = ... -if Cork.MYCLASS ~= "SHAMAN" then return end From fc72ce5ed1bd5498282262c54c4b4e5f3a71a279 Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Thu, 28 Jul 2016 16:59:27 -0700 Subject: [PATCH 23/45] No more monk buffs --- modules/Monk.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/Monk.lua b/modules/Monk.lua index b2f5f87..e7a46e2 100644 --- a/modules/Monk.lua +++ b/modules/Monk.lua @@ -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") From 13fff4dcbb5f303cbdb2fe841b8e4364fb19a75f Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Sat, 28 Jan 2017 11:30:31 -0800 Subject: [PATCH 24/45] Add ancient mana capsules --- modules/Capsules.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/Capsules.lua b/modules/Capsules.lua index c63e7cb..50b9bba 100644 --- a/modules/Capsules.lua +++ b/modules/Capsules.lua @@ -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 } From ec4f5c57acc66af7cb0aedf86747a1da4203f883 Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Sat, 28 Jan 2017 12:33:12 -0800 Subject: [PATCH 25/45] Just use Tekkub's version --- modules/GarrisonCache.lua | 67 ++++++++++++++++++++---------------- modules/GarrisonFreeFood.lua | 3 +- 2 files changed, 39 insertions(+), 31 deletions(-) diff --git a/modules/GarrisonCache.lua b/modules/GarrisonCache.lua index 9db7bf9..73df39b 100644 --- a/modules/GarrisonCache.lua +++ b/modules/GarrisonCache.lua @@ -7,9 +7,11 @@ local ae = LibStub("AceEvent-3.0") -- Items only available when you have a garrison if level < 90 then return end -local cacheSizeQuestId = { - { questId=37485, size=1000 }, -} + +function ns.InGarrison() + return C_Garrison.IsOnGarrisonMap() or C_Garrison.IsOnShipyardMap() +end + local name = "Garrison cache" @@ -21,45 +23,50 @@ ns.defaultspc[name.."-enabled"] = true local function SecondsSinceLastOpened() - local lasttime = ns.dbcrossspec[name.."-lastopen"] or 0 - return time() - lasttime + local lasttime = ns.dbpc[name.."-lastopen"] or 0 + return time() - lasttime +end + + +local function MaxSize() + return IsQuestFlaggedCompleted(37485) and 1000 or 500 +end + + +local function AmountPending() + local size = SecondsSinceLastOpened() / 60 / 10 + return math.min(size, MaxSize()) end local function Test() - if not C_Garrison.IsOnGarrisonMap() then return end - return SecondsSinceLastOpened() > (60*10*5) + if not ns.InGarrison() then return end + return AmountPending() >= (MaxSize() - (24*60/10)) end function dataobj:Scan() - if ns.dbpc[self.name.."-enabled"] and Test() then - local myCacheSize = 500 - for _, cacheSize in pairs(cacheSizeQuestId) do - if(_G.IsQuestFlaggedCompleted(cacheSize.questId)) then - myCacheSize = cacheSize.size; - end - end - local size = math.min(myCacheSize, math.floor(SecondsSinceLastOpened() / 60 / 10)) - if not ns.dbcrossspec[name.."-lastopen"] then - self.player = ns.IconLine("Interface\\ICONS\\inv_garrison_resource", name) - return - end - - local title = string.format("%s (%d/%d)", name, size, myCacheSize) - self.player = ns.IconLine("Interface\\ICONS\\inv_garrison_resource", title) - else - self.player = nil - end + if ns.dbpc[self.name.."-enabled"] and Test() then + if not ns.dbpc[name.."-lastopen"] then + self.player = ns.IconLine("Interface\\ICONS\\inv_garrison_resource", name) + return + end + + local size = AmountPending() + local title = string.format("%s (%d)", name, size) + self.player = ns.IconLine("Interface\\ICONS\\inv_garrison_resource", title) + else + self.player = nil + end end ae.RegisterEvent(dataobj, "ZONE_CHANGED", "Scan") ae.RegisterEvent("Cork "..name, "SHOW_LOOT_TOAST", function(event, ...) - local _, _, _, _, _, _, lootSource = ... - if lootSource == 10 then - ns.dbcrossspec[name.."-lastopen"] = time() - end + local _, _, _, _, _, _, lootSource = ... + if lootSource == 10 then + ns.dbpc[name.."-lastopen"] = time() + end - dataobj:Scan() + dataobj:Scan() end) diff --git a/modules/GarrisonFreeFood.lua b/modules/GarrisonFreeFood.lua index 9bc3e47..7d93de5 100644 --- a/modules/GarrisonFreeFood.lua +++ b/modules/GarrisonFreeFood.lua @@ -23,6 +23,7 @@ ns.defaultspc[name.."-enabled"] = true local function ScanPlots() local plots = C_Garrison.GetPlots(LE_FOLLOWER_TYPE_GARRISON_6_0) + if not plots then return end for i,plot in ipairs(plots) do local id, _, _, _, rank = C_Garrison.GetOwnedBuildingInfoAbbrev(plot.id) if id == 137 and rank == 3 then return true end @@ -39,7 +40,7 @@ end local function Test(self) - if not C_Garrison.IsOnGarrisonMap() or not HasTree() then return end + if not ns.InGarrison() or not HasTree() then return end for id in pairs(foods) do if GetItemCount(id) > 0 then return end From 75fb9187e7d283fda3682caf4ff7a45300d1530f Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Sat, 28 Jan 2017 12:36:10 -0800 Subject: [PATCH 26/45] Use Tekkub's .toc too --- Cork.toc | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/Cork.toc b/Cork.toc index 237c509..22c8add 100644 --- a/Cork.toc +++ b/Cork.toc @@ -1,11 +1,8 @@ -## Interface: 60000 +## Interface: 70100 ## Title: Cork ## Notes: Buff reminders and more ## Author: Tekkub Stoutwrithe -## Version: Alpha -## X-Website: http://www.tekkub.net/ -## X-Email: tekkub-wow@googlegroups.com ## X-Credits: Thiana (Warlock modules), Gnancy (Soullink module) ## X-Category: Buffs ## X-Icon: Interface\Icons\INV_Drink_11 @@ -24,6 +21,8 @@ CallbackHandler-1.0.lua LibDataBroker-1.1\LibDataBroker-1.1.lua AceEvent-3.0\AceEvent-3.0.xml +services\holiday_active.lua + Locale.lua KeyBlacklist.lua @@ -42,20 +41,30 @@ templates\TempEnchant.lua modules\DeathKnight.lua modules\Druid.lua +modules\Hunter.lua modules\Mage.lua modules\Monk.lua modules\Paladin.lua +modules\Priest.lua modules\RogueWeapon.lua +modules\Shaman.lua modules\Warlock.lua modules\WarlockHealthstone.lua modules\WarlockPets.lua +modules\WarlockSoulLink.lua +modules\Warrior.lua +modules\ArtifactPowerItems.lua modules\BattleStandard.lua +modules\BonusEvents.lua modules\BuffItems.lua +modules\ClassHallWorkOrders.lua +modules\Capsules.lua modules\Combine.lua modules\DarkmoonExp.lua -modules\Dig.lua modules\FishingHat.lua +modules\GarrisonBodyguardMinifier.lua +modules\GarrisonBuildings.lua modules\GarrisonCache.lua modules\GarrisonFreeFood.lua modules\GarrisonMineItems.lua @@ -65,6 +74,7 @@ modules\LancePole.lua modules\Lures.lua modules\Minipet.lua modules\OpenableItems.lua +modules\PilgrimsBountyRep.lua modules\QuestStartingItems.lua modules\Repairs.lua modules\Salvage.lua From 6e194a7f704a4c2213104db07cb47499523c8cf6 Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Mon, 31 Aug 2015 23:00:19 -0700 Subject: [PATCH 27/45] Get correct garrison cache size based on quest completions --- modules/GarrisonCache.lua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/GarrisonCache.lua b/modules/GarrisonCache.lua index 73df39b..f7e9cf5 100644 --- a/modules/GarrisonCache.lua +++ b/modules/GarrisonCache.lua @@ -23,8 +23,8 @@ ns.defaultspc[name.."-enabled"] = true local function SecondsSinceLastOpened() - local lasttime = ns.dbpc[name.."-lastopen"] or 0 - return time() - lasttime + local lasttime = ns.dbpc[name.."-lastopen"] or 0 + return time() - lasttime end @@ -63,10 +63,10 @@ end ae.RegisterEvent(dataobj, "ZONE_CHANGED", "Scan") ae.RegisterEvent("Cork "..name, "SHOW_LOOT_TOAST", function(event, ...) - local _, _, _, _, _, _, lootSource = ... - if lootSource == 10 then - ns.dbpc[name.."-lastopen"] = time() - end + local _, _, _, _, _, _, lootSource = ... + if lootSource == 10 then + ns.dbpc[name.."-lastopen"] = time() + end - dataobj:Scan() + dataobj:Scan() end) From add528bae8a3ab5e894b6f37f881b68eb7b277ad Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Mon, 21 Sep 2015 17:03:09 -0700 Subject: [PATCH 28/45] Apparently, improved logistics does not increase cache size --- modules/GarrisonCache.lua | 53 +++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 30 deletions(-) diff --git a/modules/GarrisonCache.lua b/modules/GarrisonCache.lua index f7e9cf5..7707975 100644 --- a/modules/GarrisonCache.lua +++ b/modules/GarrisonCache.lua @@ -7,11 +7,9 @@ local ae = LibStub("AceEvent-3.0") -- Items only available when you have a garrison if level < 90 then return end - -function ns.InGarrison() - return C_Garrison.IsOnGarrisonMap() or C_Garrison.IsOnShipyardMap() -end - +local cacheSizeQuestId = { + { questId=37485, size=1000 }, +} local name = "Garrison cache" @@ -28,36 +26,31 @@ local function SecondsSinceLastOpened() end -local function MaxSize() - return IsQuestFlaggedCompleted(37485) and 1000 or 500 -end - - -local function AmountPending() - local size = SecondsSinceLastOpened() / 60 / 10 - return math.min(size, MaxSize()) -end - - local function Test() - if not ns.InGarrison() then return end - return AmountPending() >= (MaxSize() - (24*60/10)) + if not C_Garrison.IsOnGarrisonMap() then return end + return SecondsSinceLastOpened() > (60*10*5) end function dataobj:Scan() - if ns.dbpc[self.name.."-enabled"] and Test() then - if not ns.dbpc[name.."-lastopen"] then - self.player = ns.IconLine("Interface\\ICONS\\inv_garrison_resource", name) - return - end - - local size = AmountPending() - local title = string.format("%s (%d)", name, size) - self.player = ns.IconLine("Interface\\ICONS\\inv_garrison_resource", title) - else - self.player = nil - end + if ns.dbpc[self.name.."-enabled"] and Test() then + local myCacheSize = 500 + for _, cacheSize in pairs(cacheSizeQuestId) do + if(_G.IsQuestFlaggedCompleted(cacheSize.questId)) then + myCacheSize = cacheSize.size; + end + end + local size = math.min(myCacheSize, math.floor(SecondsSinceLastOpened() / 60 / 10)) + if not ns.dbpc[name.."-lastopen"] then + self.player = ns.IconLine("Interface\\ICONS\\inv_garrison_resource", name) + return + end + + local title = string.format("%s (%d/%d)", name, size, myCacheSize) + self.player = ns.IconLine("Interface\\ICONS\\inv_garrison_resource", title) + else + self.player = nil + end end From d4280af2d0105e7971d9b3f1a9dafe915538bf14 Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Wed, 23 Sep 2015 14:49:16 -0700 Subject: [PATCH 29/45] Garrison cache check date is same no matter what spec you happen to be in --- Cork.lua | 2 +- modules/GarrisonCache.lua | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cork.lua b/Cork.lua index 4c3df26..c37fe32 100644 --- a/Cork.lua +++ b/Cork.lua @@ -29,9 +29,9 @@ ae.RegisterEvent("Cork", "ADDON_LOADED", function(event, addon) CorkDBPC[2]['Garrison cache-lastopen'] or 0) } CorkDBPC[1]['Garrison cache-lastopen'] = nil CorkDBPC[2]['Garrison cache-lastopen'] = nil + Cork.dbcrossspec = CorkDBPC[3] 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 diff --git a/modules/GarrisonCache.lua b/modules/GarrisonCache.lua index 7707975..9db7bf9 100644 --- a/modules/GarrisonCache.lua +++ b/modules/GarrisonCache.lua @@ -21,7 +21,7 @@ ns.defaultspc[name.."-enabled"] = true local function SecondsSinceLastOpened() - local lasttime = ns.dbpc[name.."-lastopen"] or 0 + local lasttime = ns.dbcrossspec[name.."-lastopen"] or 0 return time() - lasttime end @@ -41,7 +41,7 @@ function dataobj:Scan() end end local size = math.min(myCacheSize, math.floor(SecondsSinceLastOpened() / 60 / 10)) - if not ns.dbpc[name.."-lastopen"] then + if not ns.dbcrossspec[name.."-lastopen"] then self.player = ns.IconLine("Interface\\ICONS\\inv_garrison_resource", name) return end @@ -58,7 +58,7 @@ ae.RegisterEvent(dataobj, "ZONE_CHANGED", "Scan") ae.RegisterEvent("Cork "..name, "SHOW_LOOT_TOAST", function(event, ...) local _, _, _, _, _, _, lootSource = ... if lootSource == 10 then - ns.dbpc[name.."-lastopen"] = time() + ns.dbcrossspec[name.."-lastopen"] = time() end dataobj:Scan() From 4569bbb676de9e47d63310bbf09561bfa2d086e9 Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Tue, 29 Sep 2015 22:14:49 -0700 Subject: [PATCH 30/45] Move dbcrosspec setting to outside the if where it belongs --- Cork.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cork.lua b/Cork.lua index c37fe32..4c3df26 100644 --- a/Cork.lua +++ b/Cork.lua @@ -29,9 +29,9 @@ ae.RegisterEvent("Cork", "ADDON_LOADED", function(event, addon) CorkDBPC[2]['Garrison cache-lastopen'] or 0) } CorkDBPC[1]['Garrison cache-lastopen'] = nil CorkDBPC[2]['Garrison cache-lastopen'] = nil - Cork.dbcrossspec = CorkDBPC[3] 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 From 3d9cf60943ab8b88c085bcd868265f4fbe1d78f3 Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Wed, 10 Jun 2015 01:47:23 -0700 Subject: [PATCH 31/45] Use bag update event rather than loot closed to catch more sources like mission rewards --- modules/Dig.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/Dig.lua b/modules/Dig.lua index 53b6c87..e428409 100644 --- a/modules/Dig.lua +++ b/modules/Dig.lua @@ -38,6 +38,7 @@ function dataobj2:Scan() 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) From becb3c6a13db3744d870e8e5bbee0ee4b9ec3637 Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Mon, 31 Aug 2015 23:00:19 -0700 Subject: [PATCH 32/45] Get correct garrison cache size based on quest completions --- modules/GarrisonCache.lua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/GarrisonCache.lua b/modules/GarrisonCache.lua index 9db7bf9..e4765b1 100644 --- a/modules/GarrisonCache.lua +++ b/modules/GarrisonCache.lua @@ -11,6 +11,12 @@ local cacheSizeQuestId = { { questId=37485, size=1000 }, } +for _, cacheSize in pairs(cacheSizeQuestId) do + if(_G.IsQuestFlaggedCompleted(cacheSize[1])) then + myCacheSize = cacheSize[2]; + end +end + local name = "Garrison cache" @@ -34,14 +40,8 @@ end function dataobj:Scan() if ns.dbpc[self.name.."-enabled"] and Test() then - local myCacheSize = 500 - for _, cacheSize in pairs(cacheSizeQuestId) do - if(_G.IsQuestFlaggedCompleted(cacheSize.questId)) then - myCacheSize = cacheSize.size; - end - end local size = math.min(myCacheSize, math.floor(SecondsSinceLastOpened() / 60 / 10)) - if not ns.dbcrossspec[name.."-lastopen"] then + if not ns.crossspec[name.."-lastopen"] then self.player = ns.IconLine("Interface\\ICONS\\inv_garrison_resource", name) return end From ff87a9db88e172f5347f4b654f60a4dbea7e3714 Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Tue, 1 Sep 2015 01:51:14 -0700 Subject: [PATCH 33/45] Check cache size in a more sensible place --- modules/GarrisonCache.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/GarrisonCache.lua b/modules/GarrisonCache.lua index e4765b1..223d0f0 100644 --- a/modules/GarrisonCache.lua +++ b/modules/GarrisonCache.lua @@ -11,12 +11,6 @@ local cacheSizeQuestId = { { questId=37485, size=1000 }, } -for _, cacheSize in pairs(cacheSizeQuestId) do - if(_G.IsQuestFlaggedCompleted(cacheSize[1])) then - myCacheSize = cacheSize[2]; - end -end - local name = "Garrison cache" @@ -40,6 +34,12 @@ end function dataobj:Scan() if ns.dbpc[self.name.."-enabled"] and Test() then + local myCacheSize = 500 + for _, cacheSize in pairs(cacheSizeQuestId) do + if(_G.IsQuestFlaggedCompleted(cacheSize.questId)) then + myCacheSize = cacheSize.size; + end + end local size = math.min(myCacheSize, math.floor(SecondsSinceLastOpened() / 60 / 10)) if not ns.crossspec[name.."-lastopen"] then self.player = ns.IconLine("Interface\\ICONS\\inv_garrison_resource", name) From c13d31e469edcfdb11436cf942692de1d6992362 Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Mon, 21 Sep 2015 17:04:30 -0700 Subject: [PATCH 34/45] Do loot window closed trigger too --- modules/Dig.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/Dig.lua b/modules/Dig.lua index e428409..53b6c87 100644 --- a/modules/Dig.lua +++ b/modules/Dig.lua @@ -38,7 +38,6 @@ function dataobj2:Scan() 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) From 670323d1e280ec5505f3ce1ea16717f4c58ec22f Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Wed, 23 Sep 2015 14:49:16 -0700 Subject: [PATCH 35/45] Garrison cache check date is same no matter what spec you happen to be in --- Cork.lua | 2 +- modules/GarrisonCache.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cork.lua b/Cork.lua index 4c3df26..c37fe32 100644 --- a/Cork.lua +++ b/Cork.lua @@ -29,9 +29,9 @@ ae.RegisterEvent("Cork", "ADDON_LOADED", function(event, addon) CorkDBPC[2]['Garrison cache-lastopen'] or 0) } CorkDBPC[1]['Garrison cache-lastopen'] = nil CorkDBPC[2]['Garrison cache-lastopen'] = nil + Cork.dbcrossspec = CorkDBPC[3] 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 diff --git a/modules/GarrisonCache.lua b/modules/GarrisonCache.lua index 223d0f0..9db7bf9 100644 --- a/modules/GarrisonCache.lua +++ b/modules/GarrisonCache.lua @@ -41,7 +41,7 @@ function dataobj:Scan() end end local size = math.min(myCacheSize, math.floor(SecondsSinceLastOpened() / 60 / 10)) - if not ns.crossspec[name.."-lastopen"] then + if not ns.dbcrossspec[name.."-lastopen"] then self.player = ns.IconLine("Interface\\ICONS\\inv_garrison_resource", name) return end From ec63d7967f0bc4199894b73c6607bbe059f8c953 Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Tue, 29 Sep 2015 22:14:49 -0700 Subject: [PATCH 36/45] Move dbcrosspec setting to outside the if where it belongs --- Cork.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cork.lua b/Cork.lua index c37fe32..4c3df26 100644 --- a/Cork.lua +++ b/Cork.lua @@ -29,9 +29,9 @@ ae.RegisterEvent("Cork", "ADDON_LOADED", function(event, addon) CorkDBPC[2]['Garrison cache-lastopen'] or 0) } CorkDBPC[1]['Garrison cache-lastopen'] = nil CorkDBPC[2]['Garrison cache-lastopen'] = nil - Cork.dbcrossspec = CorkDBPC[3] 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 From dbc6b9a71075aa97ed5e8120061b65a6fb4b0d5f Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Sun, 24 Jul 2016 23:19:29 -0700 Subject: [PATCH 37/45] Fix GetPlots for follower type arg --- modules/GarrisonFreeFood.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/GarrisonFreeFood.lua b/modules/GarrisonFreeFood.lua index 7d93de5..9bc3e47 100644 --- a/modules/GarrisonFreeFood.lua +++ b/modules/GarrisonFreeFood.lua @@ -23,7 +23,6 @@ ns.defaultspc[name.."-enabled"] = true local function ScanPlots() local plots = C_Garrison.GetPlots(LE_FOLLOWER_TYPE_GARRISON_6_0) - if not plots then return end for i,plot in ipairs(plots) do local id, _, _, _, rank = C_Garrison.GetOwnedBuildingInfoAbbrev(plot.id) if id == 137 and rank == 3 then return true end @@ -40,7 +39,7 @@ end local function Test(self) - if not ns.InGarrison() or not HasTree() then return end + if not C_Garrison.IsOnGarrisonMap() or not HasTree() then return end for id in pairs(foods) do if GetItemCount(id) > 0 then return end From bc6ec16e2090844b5d4ab56ef356d378c7f737fc Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Mon, 25 Jul 2016 23:01:29 -0700 Subject: [PATCH 38/45] No more hunter buffs in 7.0 --- Cork.toc | 1 - 1 file changed, 1 deletion(-) diff --git a/Cork.toc b/Cork.toc index 22c8add..5c1fd61 100644 --- a/Cork.toc +++ b/Cork.toc @@ -41,7 +41,6 @@ templates\TempEnchant.lua modules\DeathKnight.lua modules\Druid.lua -modules\Hunter.lua modules\Mage.lua modules\Monk.lua modules\Paladin.lua From b25c989078e0683798a3c61ae596ee44aa507d7d Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Mon, 25 Jul 2016 23:16:46 -0700 Subject: [PATCH 39/45] No warlock soul link activation any more in 7.0 --- Cork.toc | 1 - 1 file changed, 1 deletion(-) diff --git a/Cork.toc b/Cork.toc index 5c1fd61..dba0e17 100644 --- a/Cork.toc +++ b/Cork.toc @@ -50,7 +50,6 @@ modules\Shaman.lua modules\Warlock.lua modules\WarlockHealthstone.lua modules\WarlockPets.lua -modules\WarlockSoulLink.lua modules\Warrior.lua modules\ArtifactPowerItems.lua From 6e7d596485d48ebed6e516f280c87efbb24c9f71 Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Mon, 25 Jul 2016 23:45:02 -0700 Subject: [PATCH 40/45] Bodyguard miniaturization device is now a toy --- Cork.toc | 18 ++++++++---------- modules/Bodyguard.lua | 35 +++++++++++++++++++++++++++++++++++ modules/BuffItems.lua | 5 ----- 3 files changed, 43 insertions(+), 15 deletions(-) create mode 100644 modules/Bodyguard.lua diff --git a/Cork.toc b/Cork.toc index dba0e17..6ac52e0 100644 --- a/Cork.toc +++ b/Cork.toc @@ -1,8 +1,11 @@ -## Interface: 70100 +## Interface: 60000 ## Title: Cork ## Notes: Buff reminders and more ## Author: Tekkub Stoutwrithe +## Version: Alpha +## X-Website: http://www.tekkub.net/ +## X-Email: tekkub-wow@googlegroups.com ## X-Credits: Thiana (Warlock modules), Gnancy (Soullink module) ## X-Category: Buffs ## X-Icon: Interface\Icons\INV_Drink_11 @@ -12,6 +15,7 @@ ## OptionalDeps: tekErr +externals\ptr.lua externals\timer.lua externals\tooltip_scanner.lua externals\ui-tab.lua @@ -21,8 +25,6 @@ CallbackHandler-1.0.lua LibDataBroker-1.1\LibDataBroker-1.1.lua AceEvent-3.0\AceEvent-3.0.xml -services\holiday_active.lua - Locale.lua KeyBlacklist.lua @@ -44,6 +46,7 @@ modules\Druid.lua modules\Mage.lua modules\Monk.lua modules\Paladin.lua +modules\PaladinBlessings.lua modules\Priest.lua modules\RogueWeapon.lua modules\Shaman.lua @@ -52,17 +55,13 @@ modules\WarlockHealthstone.lua modules\WarlockPets.lua modules\Warrior.lua -modules\ArtifactPowerItems.lua modules\BattleStandard.lua -modules\BonusEvents.lua +modules\Bodyguard.lua modules\BuffItems.lua -modules\ClassHallWorkOrders.lua -modules\Capsules.lua modules\Combine.lua modules\DarkmoonExp.lua +modules\Dig.lua modules\FishingHat.lua -modules\GarrisonBodyguardMinifier.lua -modules\GarrisonBuildings.lua modules\GarrisonCache.lua modules\GarrisonFreeFood.lua modules\GarrisonMineItems.lua @@ -72,7 +71,6 @@ modules\LancePole.lua modules\Lures.lua modules\Minipet.lua modules\OpenableItems.lua -modules\PilgrimsBountyRep.lua modules\QuestStartingItems.lua modules\Repairs.lua modules\Salvage.lua diff --git a/modules/Bodyguard.lua b/modules/Bodyguard.lua new file mode 100644 index 0000000..cd8efc9 --- /dev/null +++ b/modules/Bodyguard.lua @@ -0,0 +1,35 @@ +local name, Cork = ... +local ae = LibStub("AceEvent-3.0") + +local name, _, icon = GetSpellInfo(181642) + +local dataobj = Cork:GenerateSelfBuffer(name, icon) + +function dataobj:Test() + -- Need to have the toy + local _, _, _, collected = C_ToyBox.GetToyInfo(122298) + if not collected then return end + + -- Need to have a bodyguard assigned to a Barracks + local found = false + local buildings = C_Garrison.GetBuildings(LE_GARRISON_TYPE_6_0) + for i = 1, #buildings do + local buildingId = buildings[i].buildingID + if buildingId >= 26 and buildingId <= 28 then -- Barracks + if C_Garrison.GetFollowerInfoForBuilding(buildings[i].plotID) then found = true end + end + end + if not found then return end + + return self:TestWithoutResting() +end + +function dataobj:CorkIt(frame) + if self.player then + local macro = '/use ' .. name + return frame:SetManyAttributes("type1", "macro", "macrotext1", macro) + end +end + +ae.RegisterEvent(dataobj, "ZONE_CHANGED", "Scan") +ae.RegisterEvent(dataobj, "GARRISON_UPDATE", "Scan") diff --git a/modules/BuffItems.lua b/modules/BuffItems.lua index 8e5d462..23c3c68 100644 --- a/modules/BuffItems.lua +++ b/modules/BuffItems.lua @@ -51,8 +51,3 @@ local dataobj = Cork:GenerateItemSelfBuffer(120182, 178119) function dataobj:Init() Cork.defaultspc[self.name.."-enabled"] = level < 100 and GetItemCount(120182) > 0 end - - --- Bodyguard Miniaturization Device -local dataobj = Cork:GenerateItemSelfBuffer(122298) -dataobj.Test = dataobj.TestWithoutResting From 3b695fc3503d2546f9a3cdbd2b6a8e5edbbb8bdb Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Tue, 26 Jul 2016 16:29:49 -0700 Subject: [PATCH 41/45] Revert "Bodyguard miniaturization device is now a toy" This reverts commit bcee929b99a359846984eb6560b91e2c35409d8c. --- Cork.toc | 1 - modules/Bodyguard.lua | 35 ----------------------------------- modules/BuffItems.lua | 5 +++++ 3 files changed, 5 insertions(+), 36 deletions(-) delete mode 100644 modules/Bodyguard.lua diff --git a/Cork.toc b/Cork.toc index 6ac52e0..cce3213 100644 --- a/Cork.toc +++ b/Cork.toc @@ -56,7 +56,6 @@ modules\WarlockPets.lua modules\Warrior.lua modules\BattleStandard.lua -modules\Bodyguard.lua modules\BuffItems.lua modules\Combine.lua modules\DarkmoonExp.lua diff --git a/modules/Bodyguard.lua b/modules/Bodyguard.lua deleted file mode 100644 index cd8efc9..0000000 --- a/modules/Bodyguard.lua +++ /dev/null @@ -1,35 +0,0 @@ -local name, Cork = ... -local ae = LibStub("AceEvent-3.0") - -local name, _, icon = GetSpellInfo(181642) - -local dataobj = Cork:GenerateSelfBuffer(name, icon) - -function dataobj:Test() - -- Need to have the toy - local _, _, _, collected = C_ToyBox.GetToyInfo(122298) - if not collected then return end - - -- Need to have a bodyguard assigned to a Barracks - local found = false - local buildings = C_Garrison.GetBuildings(LE_GARRISON_TYPE_6_0) - for i = 1, #buildings do - local buildingId = buildings[i].buildingID - if buildingId >= 26 and buildingId <= 28 then -- Barracks - if C_Garrison.GetFollowerInfoForBuilding(buildings[i].plotID) then found = true end - end - end - if not found then return end - - return self:TestWithoutResting() -end - -function dataobj:CorkIt(frame) - if self.player then - local macro = '/use ' .. name - return frame:SetManyAttributes("type1", "macro", "macrotext1", macro) - end -end - -ae.RegisterEvent(dataobj, "ZONE_CHANGED", "Scan") -ae.RegisterEvent(dataobj, "GARRISON_UPDATE", "Scan") diff --git a/modules/BuffItems.lua b/modules/BuffItems.lua index 23c3c68..8e5d462 100644 --- a/modules/BuffItems.lua +++ b/modules/BuffItems.lua @@ -51,3 +51,8 @@ local dataobj = Cork:GenerateItemSelfBuffer(120182, 178119) function dataobj:Init() Cork.defaultspc[self.name.."-enabled"] = level < 100 and GetItemCount(120182) > 0 end + + +-- Bodyguard Miniaturization Device +local dataobj = Cork:GenerateItemSelfBuffer(122298) +dataobj.Test = dataobj.TestWithoutResting From 3bf519045c79bd1340fbe928eaea2882ecf48fad Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Tue, 26 Jul 2016 16:38:06 -0700 Subject: [PATCH 42/45] Clean up class buffs that no longer exist --- Cork.toc | 5 --- modules/Paladin.lua | 83 +-------------------------------------------- modules/Warrior.lua | 3 -- 3 files changed, 1 insertion(+), 90 deletions(-) delete mode 100644 modules/Warrior.lua diff --git a/Cork.toc b/Cork.toc index cce3213..237c509 100644 --- a/Cork.toc +++ b/Cork.toc @@ -15,7 +15,6 @@ ## OptionalDeps: tekErr -externals\ptr.lua externals\timer.lua externals\tooltip_scanner.lua externals\ui-tab.lua @@ -46,14 +45,10 @@ modules\Druid.lua modules\Mage.lua modules\Monk.lua modules\Paladin.lua -modules\PaladinBlessings.lua -modules\Priest.lua modules\RogueWeapon.lua -modules\Shaman.lua modules\Warlock.lua modules\WarlockHealthstone.lua modules\WarlockPets.lua -modules\Warrior.lua modules\BattleStandard.lua modules\BuffItems.lua diff --git a/modules/Paladin.lua b/modules/Paladin.lua index 56824b3..c1b9e9e 100644 --- a/modules/Paladin.lua +++ b/modules/Paladin.lua @@ -1,94 +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) diff --git a/modules/Warrior.lua b/modules/Warrior.lua deleted file mode 100644 index e139784..0000000 --- a/modules/Warrior.lua +++ /dev/null @@ -1,3 +0,0 @@ - -local myname, Cork = ... -if Cork.MYCLASS ~= "WARRIOR" then return end From 8cbae985fc34555d59291dd90b5b88f7448f18ef Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Sat, 28 Jan 2017 12:33:12 -0800 Subject: [PATCH 43/45] Just use Tekkub's version --- modules/GarrisonCache.lua | 67 ++++++++++++++++++++---------------- modules/GarrisonFreeFood.lua | 3 +- 2 files changed, 39 insertions(+), 31 deletions(-) diff --git a/modules/GarrisonCache.lua b/modules/GarrisonCache.lua index 9db7bf9..73df39b 100644 --- a/modules/GarrisonCache.lua +++ b/modules/GarrisonCache.lua @@ -7,9 +7,11 @@ local ae = LibStub("AceEvent-3.0") -- Items only available when you have a garrison if level < 90 then return end -local cacheSizeQuestId = { - { questId=37485, size=1000 }, -} + +function ns.InGarrison() + return C_Garrison.IsOnGarrisonMap() or C_Garrison.IsOnShipyardMap() +end + local name = "Garrison cache" @@ -21,45 +23,50 @@ ns.defaultspc[name.."-enabled"] = true local function SecondsSinceLastOpened() - local lasttime = ns.dbcrossspec[name.."-lastopen"] or 0 - return time() - lasttime + local lasttime = ns.dbpc[name.."-lastopen"] or 0 + return time() - lasttime +end + + +local function MaxSize() + return IsQuestFlaggedCompleted(37485) and 1000 or 500 +end + + +local function AmountPending() + local size = SecondsSinceLastOpened() / 60 / 10 + return math.min(size, MaxSize()) end local function Test() - if not C_Garrison.IsOnGarrisonMap() then return end - return SecondsSinceLastOpened() > (60*10*5) + if not ns.InGarrison() then return end + return AmountPending() >= (MaxSize() - (24*60/10)) end function dataobj:Scan() - if ns.dbpc[self.name.."-enabled"] and Test() then - local myCacheSize = 500 - for _, cacheSize in pairs(cacheSizeQuestId) do - if(_G.IsQuestFlaggedCompleted(cacheSize.questId)) then - myCacheSize = cacheSize.size; - end - end - local size = math.min(myCacheSize, math.floor(SecondsSinceLastOpened() / 60 / 10)) - if not ns.dbcrossspec[name.."-lastopen"] then - self.player = ns.IconLine("Interface\\ICONS\\inv_garrison_resource", name) - return - end - - local title = string.format("%s (%d/%d)", name, size, myCacheSize) - self.player = ns.IconLine("Interface\\ICONS\\inv_garrison_resource", title) - else - self.player = nil - end + if ns.dbpc[self.name.."-enabled"] and Test() then + if not ns.dbpc[name.."-lastopen"] then + self.player = ns.IconLine("Interface\\ICONS\\inv_garrison_resource", name) + return + end + + local size = AmountPending() + local title = string.format("%s (%d)", name, size) + self.player = ns.IconLine("Interface\\ICONS\\inv_garrison_resource", title) + else + self.player = nil + end end ae.RegisterEvent(dataobj, "ZONE_CHANGED", "Scan") ae.RegisterEvent("Cork "..name, "SHOW_LOOT_TOAST", function(event, ...) - local _, _, _, _, _, _, lootSource = ... - if lootSource == 10 then - ns.dbcrossspec[name.."-lastopen"] = time() - end + local _, _, _, _, _, _, lootSource = ... + if lootSource == 10 then + ns.dbpc[name.."-lastopen"] = time() + end - dataobj:Scan() + dataobj:Scan() end) diff --git a/modules/GarrisonFreeFood.lua b/modules/GarrisonFreeFood.lua index 9bc3e47..7d93de5 100644 --- a/modules/GarrisonFreeFood.lua +++ b/modules/GarrisonFreeFood.lua @@ -23,6 +23,7 @@ ns.defaultspc[name.."-enabled"] = true local function ScanPlots() local plots = C_Garrison.GetPlots(LE_FOLLOWER_TYPE_GARRISON_6_0) + if not plots then return end for i,plot in ipairs(plots) do local id, _, _, _, rank = C_Garrison.GetOwnedBuildingInfoAbbrev(plot.id) if id == 137 and rank == 3 then return true end @@ -39,7 +40,7 @@ end local function Test(self) - if not C_Garrison.IsOnGarrisonMap() or not HasTree() then return end + if not ns.InGarrison() or not HasTree() then return end for id in pairs(foods) do if GetItemCount(id) > 0 then return end From 2420119bdc44e8080c0803e8c4173fb0ca7696cf Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Sat, 28 Jan 2017 12:36:10 -0800 Subject: [PATCH 44/45] Use Tekkub's .toc too --- Cork.toc | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/Cork.toc b/Cork.toc index 237c509..22c8add 100644 --- a/Cork.toc +++ b/Cork.toc @@ -1,11 +1,8 @@ -## Interface: 60000 +## Interface: 70100 ## Title: Cork ## Notes: Buff reminders and more ## Author: Tekkub Stoutwrithe -## Version: Alpha -## X-Website: http://www.tekkub.net/ -## X-Email: tekkub-wow@googlegroups.com ## X-Credits: Thiana (Warlock modules), Gnancy (Soullink module) ## X-Category: Buffs ## X-Icon: Interface\Icons\INV_Drink_11 @@ -24,6 +21,8 @@ CallbackHandler-1.0.lua LibDataBroker-1.1\LibDataBroker-1.1.lua AceEvent-3.0\AceEvent-3.0.xml +services\holiday_active.lua + Locale.lua KeyBlacklist.lua @@ -42,20 +41,30 @@ templates\TempEnchant.lua modules\DeathKnight.lua modules\Druid.lua +modules\Hunter.lua modules\Mage.lua modules\Monk.lua modules\Paladin.lua +modules\Priest.lua modules\RogueWeapon.lua +modules\Shaman.lua modules\Warlock.lua modules\WarlockHealthstone.lua modules\WarlockPets.lua +modules\WarlockSoulLink.lua +modules\Warrior.lua +modules\ArtifactPowerItems.lua modules\BattleStandard.lua +modules\BonusEvents.lua modules\BuffItems.lua +modules\ClassHallWorkOrders.lua +modules\Capsules.lua modules\Combine.lua modules\DarkmoonExp.lua -modules\Dig.lua modules\FishingHat.lua +modules\GarrisonBodyguardMinifier.lua +modules\GarrisonBuildings.lua modules\GarrisonCache.lua modules\GarrisonFreeFood.lua modules\GarrisonMineItems.lua @@ -65,6 +74,7 @@ modules\LancePole.lua modules\Lures.lua modules\Minipet.lua modules\OpenableItems.lua +modules\PilgrimsBountyRep.lua modules\QuestStartingItems.lua modules\Repairs.lua modules\Salvage.lua From 4c604ceaafb71b1c5d73ba2e9023f853b44f516d Mon Sep 17 00:00:00 2001 From: "Craig R. Hughes" Date: Fri, 3 Feb 2017 21:15:37 -0800 Subject: [PATCH 45/45] Restore BufferItems to tekkub version --- modules/BuffItems.lua | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/modules/BuffItems.lua b/modules/BuffItems.lua index 8e5d462..dbd063d 100644 --- a/modules/BuffItems.lua +++ b/modules/BuffItems.lua @@ -8,15 +8,6 @@ local ae = LibStub("AceEvent-3.0") if level < 80 then return end --- Drums of Forgotten Kings -Cork:GenerateItemBuffer({PALADIN = true, DRUID = true, MONK = true}, 49633, 69378, 20217) - - --- Runescroll of Fortitude -local id = level < 85 and 49632 or level < 90 and 62251 or 79257 -Cork:GenerateItemBuffer("PRIEST", id, 69377, 21562) - - -- Only available to alchys local itemname = GetItemInfo(75525) or "Alchemist's Flask" local dataobj = Cork:GenerateSelfBuffer(itemname, GetItemIcon(75525), @@ -51,8 +42,3 @@ local dataobj = Cork:GenerateItemSelfBuffer(120182, 178119) function dataobj:Init() Cork.defaultspc[self.name.."-enabled"] = level < 100 and GetItemCount(120182) > 0 end - - --- Bodyguard Miniaturization Device -local dataobj = Cork:GenerateItemSelfBuffer(122298) -dataobj.Test = dataobj.TestWithoutResting