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
1 change: 1 addition & 0 deletions Cork.toc
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ modules\Priest.lua
modules\RogueWeapon.lua
modules\Shaman.lua
modules\Warlock.lua
modules\WarlockGoSacrifice.lua
modules\WarlockPets.lua
modules\WarlockSoulLink.lua
modules\WarlockHealthstone.lua
Expand Down
16 changes: 10 additions & 6 deletions modules/Warlock.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@ local myname, Cork = ...
if Cork.MYCLASS ~= "WARLOCK" then return end


-- Grimoire of Sacrifice
local spellname, _, icon = GetSpellInfo(108503)
Cork:GenerateSelfBuffer(spellname, icon)


-- Dark Intent
local FORT, CSHOUT = GetSpellInfo(21562), GetSpellInfo(469)
local ARCB, BWRATH = GetSpellInfo(1459), GetSpellInfo(77747)
local spellname, _, icon = GetSpellInfo(109773)
Cork:GenerateRaidBuffer(spellname, icon)
Cork:GenerateRaidBuffer(spellname, icon, nil, nil, function(unit)
if UnitAura(unit, spellname) then return true end
if (UnitAura(unit, FORT) or UnitAura(unit, CSHOUT)) -- Another stamina buff
and (UnitAura(unit, ARCB) or UnitAura(unit, BWRATH) or UnitPowerType(unit) ~= SPELL_POWER_MANA) -- Another spellpower buff (or not a mana user)
then
return true
end
end)


-- Soulstone
Expand Down
38 changes: 38 additions & 0 deletions modules/WarlockGoSacrifice.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

local myname, Cork = ...
if Cork.MYCLASS ~= "WARLOCK" then return end

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

local spellname, _, icon = GetSpellInfo(108503)
local iconline = IconLine(icon, spellname)

local dataobj = ldb:NewDataObject("Cork Grimoire of Sacrifice", {type = "cork"})

local function IsGoSEnabled()
return select(5, GetTalentInfo(15))
end

function dataobj:Init()
Cork.defaultspc["Grimoire of Sacrifice-enabled"] = IsGoSEnabled()
end

local function Test()
if not IsMounted() and Cork.dbpc["Grimoire of Sacrifice-enabled"] and IsGoSEnabled() and UnitExists("pet") and not UnitIsDead("pet") and not UnitAura("player", spellname) then
return iconline
end
end

function dataobj:Scan()
dataobj.player = Test()
end

function dataobj:CorkIt(frame)
if self.player then
return frame:SetManyAttributes("type1", "spell", "spell", spellname)
end
end

ae.RegisterEvent("Cork "..spellname, "UNIT_PET", function(event, unit) if unit == "player" then dataobj.player = Test() end end)
ae.RegisterEvent("Cork "..spellname, "UNIT_AURA", function(event, unit) if unit == "player" then dataobj.player = Test() end end)
11 changes: 3 additions & 8 deletions modules/WarlockPets.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ local SUC, _, SUCICON = GetSpellInfo(712)
local FELH, _, FELHICON = GetSpellInfo(691)
local FELG, _, FELGICON = GetSpellInfo(30146)
local soulburn = GetSpellInfo(74434)
local gos = GetSpellInfo(108503) -- Grimoire of Sacrifice

local defaultspell = IMP

Expand All @@ -33,21 +34,15 @@ local function RefreshKnownSpells() -- Refresh in case the player has learned th
for buff in pairs(icons) do if known[buff] == nil then known[buff] = GetSpellInfo(buff) end end
end

local function IsMountSummoned()
for i=1,GetNumCompanions("MOUNT") do
if select(5,GetCompanionInfo("MOUNT", i) ) then return true end
end
end

function dataobj:Init() RefreshKnownSpells() Cork.defaultspc["Summon demon-enabled"] = known[buffnames[spellidlist[1]]] ~= nil end
function dataobj:Scan()
if IsMountSummoned() or not Cork.dbpc["Summon demon-enabled"] or UnitExists("pet") then dataobj.player = nil
if IsMounted() or not Cork.dbpc["Summon demon-enabled"] or (UnitExists("pet") and not UnitIsDead("pet")) or UnitAura("player", gos) then dataobj.player = nil
else dataobj.player = IconLine(icons[Cork.dbpc["Summon demon-spell"]], Cork.dbpc["Summon demon-spell"]) end

end

ae.RegisterEvent("Cork Summon demon", "UNIT_PET", function(event, unit) if unit == "player" then dataobj:Scan() end end)
ae.RegisterEvent("Cork mount check", "COMPANION_UPDATE", function(event, type) if type == "MOUNT" then dataobj:Scan() end end)
ae.RegisterEvent("Cork Summon demon", "UNIT_AURA", function(event, unit) if unit == "player" then dataobj:Scan() end end)
function dataobj:CorkIt(frame)
if self.player then
knowssoulburn = knowssoulburn or GetSpellInfo(soulburn)
Expand Down
34 changes: 18 additions & 16 deletions modules/WarlockSoulLink.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,30 @@ local myname, Cork = ...
local UnitAura = UnitAura
local ldb, ae = LibStub:GetLibrary("LibDataBroker-1.1"), LibStub("AceEvent-3.0")

local function IsSoulLinkEnabled()
return select(5, GetTalentInfo(7))
end

local soul_link_enabled = select(5, GetTalentInfo(7))
if soul_link_enabled then
local spellname, _, icon = GetSpellInfo(108415)
local IconLine = Cork.IconLine(icon, spellname)
local spellname, _, icon = GetSpellInfo(108415)
local gos = GetSpellInfo(108503) -- Grimoire of Sacrifice
local IconLine = Cork.IconLine(icon, spellname)

local dataobj = LibStub:GetLibrary("LibDataBroker-1.1"):NewDataObject("Cork "..spellname, {type = "cork", tiplink = GetSpellLink(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
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
local function Test(unit)
if Cork.dbpc[spellname.."-enabled"] and IsSoulLinkEnabled() and UnitExists("pet") and not UnitIsDead("pet") and not UnitAura("pet", spellname) and UnitName("pet") ~= UNKNOWN and not IsMounted() and not UnitAura("player", gos) 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)
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)
ae.RegisterEvent("Cork "..spellname, "PLAYER_TALENT_UPDATE", function(event, unit) dataobj.pet = Test() end)

function dataobj:Scan() self.pet = Test() 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
function dataobj:CorkIt(frame)
if self.pet then return frame:SetManyAttributes("type1", "spell", "spell", spellname) end
end