/
local function onEnter(self, ...) |
GameTooltip:SetOwner(self, "ANCHOR_RIGHT", self:GetWidth()/-4, 5) |
GameTooltip:SetSpellByID(self.spellId) |
GameTooltip:AddLine(self.spellId) |
-- GameTooltip:AddLine(self.spellId) |
GameTooltip:Show() |
end |
[105809] = 18, -- Holy Avenger |
[114250] = 15, -- Selfless Healer |
[114163] = 30, -- Eternal Flame (yes, haste affects it...) |
[90174] = 8, -- Divine Purpose |
} |
-- defaults |
[105809] = true, -- Holy Avenger |
[114250] = true, -- Selfless Healer |
[114163] = true, -- Eternal Flame |
[90174] = true, -- Divine Purpose |
}, |
} |
local INQUISITION = GetSpellInfo(84963) |
local SELFLESSHEALER = GetSpellInfo(114250) |
-- Look up class colors once, and then cache |
local colors = setmetatable({ |
DEATHKNIGHT = "c41e3a", |
DRUID = "ff7c0a", |
HUNTER = "aad372", |
MAGE = "68ccef", |
PALADIN = "f48cba", |
PRIEST = "ffffff", |
ROGUE = "fff468", |
SHAMAN = "0070dd", |
WARLOCK = "9382c9", |
WARRIOR = "c69b6d", |
}, { __index = function() |
return "ffffff" |
}, { __index = function(tbl, index) |
local classColor = string.sub(RAID_CLASS_COLORS[index].colorStr, 3, 8) |
tbl[index] = classColor |
return classColor or "ffffff" |
end |
}) |
-- Selfless healer |
if (combatEvent == "SPELL_AURA_APPLIED_DOSE") then |
self:RemoveFrame(spellID, true) |
self:RemoveFrame(spellID, destGUID) |
self:SetupIcon(spellID, destName, destGUID) |
elseif (combatEvent == "SPELL_AURA_REMOVED") then |
self:RemoveFrame(spellID, false) |
self:RemoveFrame(spellID, destGUID) |
elseif (combatEvent == "SPELL_AURA_APPLIED") then |
-- Only track Devotion Aura on player |
if spellID == 31821 and destGUID ~= pguid then return end |
-- Get rid of Beacon, to avoid duplicates due to being in different realms |
if spellID == 53563 then |
self:RemoveFrame(spellID) |
self:RemoveFrame(spellID, destGUID) |
end |
self:SetupIcon(spellID, destName, destGUID) |
elseif (combatEvent == "SPELL_AURA_REFRESH") then |
self:RemoveFrame(spellID, true) |
self:RemoveFrame(spellID, destGUID) |
self:SetupIcon(spellID, destName, destGUID) |
end |
end |
end |
-- Remove bar |
function Blessed:RemoveFrame(spellID) |
function Blessed:RemoveFrame(spellID, destGUID) |
if #frames == 0 then return end |
for i, frame in pairs(frames) do |
if frame.id == spellID then |
if frame.id == spellID and frame.guid == destGUID then |
frame:Hide() |
table.remove(frames, i) |
table.insert(framePool, frame) |
self.timer:SetFormattedText("%.0f", floor(self.duration)) |
if self.duration <= 0 then |
Blessed:RemoveFrame(self.id) |
Blessed:RemoveFrame(self.id, self.guid) |
elseif self.duration <= 5 then |
self.timer:SetTextColor(1, 0, 0) |
end |
-- Border |
frame.border = frame:CreateTexture(nil, "OVERLAY") |
frame.border:SetParent(frame) |
frame.border:SetTexture('Interface\\AddOns\\Blessed\\simplesquare_roth') |
frame.border:SetPoint('TOPRIGHT', frame, 2, 2) |
frame.border:SetPoint('BOTTOMLEFT', frame, -2, -2) |
frame.border:SetTexture("Interface\\AddOns\\Blessed\\simplesquare_roth") |
frame.border:SetPoint("TOPRIGHT", frame, 2, 2) |
frame.border:SetPoint("BOTTOMLEFT", frame, -2, -2) |
frame.border:SetVertexColor(0.3, 0.3, 0.3) |
return frame |
end |
-- Setup a timer |
function Blessed:SetupIcon(spellID, targetName, targetGUID) |
function Blessed:SetupIcon(spellID, destName, destGUID) |
local frame = self:GetFrame() |
local duration = durations[spellID] |
end |
local icon = select(3, GetSpellInfo(spellID)) |
local class = select(2, GetPlayerInfoByGUID(targetGUID)) |
local class = select(2, GetPlayerInfoByGUID(destGUID)) |
frame.icon:SetTexture(icon) |
if spellID == 114250 then |
local stacks = select(4, UnitAura("player", SELFLESSHEALER)) |
frame.target:SetFormattedText("|cff%s%s|r (%d)", colors[class], targetGUID ~= pguid and string.sub(targetName, 0, 3) or "You!", stacks or 0) |
frame.target:SetFormattedText("|cff%s%s|r (%d)", colors[class], destGUID ~= pguid and string.sub(destName, 0, 3) or "You!", stacks or 0) |
else |
frame.target:SetFormattedText("|cff%s%s|r", colors[class], targetGUID ~= pguid and string.sub(targetName, 0, 3) or "You!") |
frame.target:SetFormattedText("|cff%s%s|r", colors[class], destGUID ~= pguid and string.sub(destName, 0, 3) or "You!") |
end |
if spellID ~= 53563 then |
frame.timer:SetFormattedText("%.0f", floor(duration)) |
frame.timer:SetTextColor(1, 1, 1) |
frame.duration = duration |
frame.cd:SetCooldown(GetTime(), duration) |
else |
end |
frame.id = spellID |
frame.guid = destGUID |
frame.update = 1 |
table.insert(frames, frame) |