local bleeds = CreateFrame("Frame", nil, TargetFrame)
bleeds:SetFrameLevel(TargetFrame:GetFrameLevel() + 1)
bleeds.Texture = bleeds:CreateTexture(nil, "ARTWORK")
bleeds.Texture:SetPoint("TOPLEFT", "TargetFrame", "TOPLEFT",120, -5)
bleeds.Texture:SetSize(26,26)
SetPortraitToTexture(bleeds.Texture, "Interface\\Icons\\spell_shadow_lifedrain")
bleeds.Border = CreateFrame("Frame", nil, bleeds)
bleeds.Border:SetFrameLevel(bleeds:GetFrameLevel() + 1)
bleeds.Border:SetAllPoints()
bleeds.Border.Texture = bleeds.Border:CreateTexture(nil, "ARTWORK")
bleeds.Border.Texture:SetTexture("Interface\\Minimap\\MiniMap-TrackingBorder")
if IsAddOnLoaded("Lorti UI") then
bleeds.Border.Texture:SetVertexColor(.005,.005,.005)
end
bleeds.Border.Texture:SetPoint("TOPLEFT", "TargetFrame", "TOPLEFT",117, -3)
bleeds.Border.Texture:SetSize(54,54)
bleeds.spellDB = {
89775, -- Hemo
1943, -- Rupture
703, -- Garrote
122233, -- Crimson Tempest
}
bleeds:RegisterEvent("UNIT_AURA")
bleeds:RegisterEvent("PLAYER_TARGET_CHANGED")
bleeds:SetScript("OnEvent", function(self, event, unit)
bleeds.CheckAura(unit)
end)
function bleeds.CheckAura(unit)
for idx, spellID in ipairs(bleeds.spellDB) do
local spellname = GetSpellInfo(spellID)
local unitCaster = select(8, UnitDebuff("target", spellname))
local id = select(11, UnitDebuff("target", spellname))
if id and unitCaster == "player" then
bleeds:Show()
if TargetFrameTextureFrameQuestIcon:IsShown() then
TargetFrameTextureFrameQuestIcon:Hide()
end
return
end
end
bleeds:Hide()
end