| Updated: | 10-18-10 01:00 PM |
| Created: | unknown |
| Downloads: | 26,098 |
| Favorites: | 173 |
| MD5: |

self.DebuffHighlightBackdrop = true
local dbh = self:CreateTexture(nil, "OVERLAY")
dbh:SetAllPoints(self)
dbh:SetTexture("SomeKindOfTexturepath")
dbh:SetBlendMode("ADD")
dbh:SetVertexColor(0,0,0,0) -- set alpha to 0 to hide the texture
self.DebuffHighlight = dbh
local dbh = hp:CreateTexture(nil, "OVERLAY")
self.DebuffHighlightAlpha = .5
self.DebuffHighlightFilter = true
local dbh = hp:CreateTexture(nil, "OVERLAY")
dbh:SetWidth(32)
dbh:SetHeight(32)
dbh:SetPoint("CENTER", self, "CENTER")
self.DebuffHighlight = dbh
self.DebuffHighlightUseTexture = true
File Name |
Version |
Size |
Author |
Date |
r48-release |
3kB |
Ammo |
10-16-10 08:06 AM |
|
r44-release |
3kB |
Ammo |
04-30-09 05:12 AM |
|
r41-release |
4kB |
Ammo |
01-06-09 06:00 AM |
|
r36-release |
4kB |
Ammo |
12-23-08 04:48 AM |
![]() |
Comment Options |
|
|
|
|
A Defias Bandit
Forum posts: 3
File comments: 27
Uploads: 0
|
And these talent checks do not work currently for me (german client)
|
|
|
|
|
|
|
A Defias Bandit
Forum posts: 3
File comments: 27
Uploads: 0
|
On a german client i cannot get my resto shaman to highlight magic debuffs. If i change the value in the CanDispel to true it works, but somehow the Talentcheck doesnt seem to work.
|
|
|
|
|
||
Here's the code for my layout's raid frame: lua Code:
Last edited by drakull : 12-15-10 at 06:27 AM.
|
||
|
|
|
|
|
|
A Kobold Labourer
Forum posts: 0
File comments: 5
Uploads: 0
|
Quick question..
Does it matter what unitframe your using? Also, i'm new at this but what do you do to make the health frame light up when a debuff is on you? |
|
|
|
|
||
|
||
|
|
|
|
|
|
A Kobold Labourer
Forum posts: 0
File comments: 1
Uploads: 0
|
I currently have borders around my health and power frames. For some reason the backdrop/backdrop border doesn't get highlighted properly and sometimes don't show up at all. But if i get rid of the borders it works fine. Any help would be appreciated. Thx
|
|
|
|
|
|
|
The "CanDispel" table is not updated to 4.0.
Code:
local CanDispel = {
PRIEST = { Magic = true, Disease = true, },
SHAMAN = { Poison = true, Disease = true, Curse = true, },
PALADIN = { Magic = true, Poison = true, Disease = true, },
MAGE = { Curse = true, },
DRUID = { Curse = true, Poison = true, }
}
Code:
local CanDispel = {
PRIEST = { Magic = true, Disease = true },
SHAMAN = { Magic = true, Curse = true },
PALADIN = { Magic = true, Poison = true, Disease = true },
MAGE = { Curse = true },
DRUID = { Magic = true, Curse = true, Poison = true }
}
Edit: took too long to post. Elv22 was faster. ![]()
Last edited by drakull : 10-17-10 at 11:39 AM.
|
|
|
|
|
|
|
|
Update
Hi there, I went ahead and updated this myself when I was on the PTR, because some classes like paladin, shaman, druid don't get dispel magic unless they are a healer spec, this can cause the debuff highlight to become inaccurate. I went ahead and made it so we check everytime you fill in new talent points, respec, ect.. it checks if you have a certain talent point in your spec in order to show magic for a few select classes.
Paladin: You need Sacred Cleansing Shaman: You need Improved Cleanse Spirit Druid: You need natures cure Code:
if not oUF then return end
local playerClass = select(2,UnitClass("player"))
local CanDispel = {
PRIEST = { Magic = true, Disease = true, },
SHAMAN = { Magic = false, Curse = true, },
PALADIN = { Magic = false, Poison = true, Disease = true, },
MAGE = { Curse = true, },
DRUID = { Magic = false, Curse = true, Poison = true, }
}
local dispellist = CanDispel[playerClass] or {}
local origColors = {}
local origBorderColors = {}
local origPostUpdateAura = {}
local function GetDebuffType(unit, filter)
if not UnitCanAssist("player", unit) then return nil end
local i = 1
while true do
local _, _, texture, _, debufftype = UnitAura(unit, i, "HARMFUL")
if not texture then break end
if debufftype and not filter or (filter and dispellist[debufftype]) then
return debufftype, texture
end
i = i + 1
end
end
-- Return true if the talent matching the name of the spell given by (Credit Pitbull4)
-- spellid has at least one point spent in it or false otherwise
function CheckForKnownTalent(spellid)
local wanted_name = GetSpellInfo(spellid)
if not wanted_name then return nil end
local num_tabs = GetNumTalentTabs()
for t=1, num_tabs do
local num_talents = GetNumTalents(t)
for i=1, num_talents do
local name_talent, _, _, _, current_rank = GetTalentInfo(t,i)
if name_talent and (name_talent == wanted_name) then
if current_rank and (current_rank > 0) then
return true
else
return false
end
end
end
end
return false
end
local function CheckSpec(self, event, levels)
-- Not interested in gained points from leveling
if event == "CHARACTER_POINTS_CHANGED" and levels > 0 then return end
--Check for certain talents to see if we can dispel magic or not
if playerClass == "PALADIN" then
--Check to see if we have the 'Sacred Cleansing' talent.
if CheckForKnownTalent(53551) then
dispellist.Magic = true
else
dispellist.Magic = false
end
elseif playerClass == "SHAMAN" then
--Check to see if we have the 'Improved Cleanse Spirit' talent.
if CheckForKnownTalent(77130) then
dispellist.Magic = true
else
dispellist.Magic = false
end
elseif playerClass == "DRUID" then
--Check to see if we have the 'Nature's Cure' talent.
if CheckForKnownTalent(88423) then
dispellist.Magic = true
else
dispellist.Magic = false
end
end
end
local function Update(object, event, unit)
if object.unit ~= unit then return end
local debuffType, texture = GetDebuffType(unit, object.DebuffHighlightFilter)
if debuffType then
local color = DebuffTypeColor[debuffType]
if object.DebuffHighlightBackdrop then
object:SetBackdropColor(color.r, color.g, color.b, object.DebuffHighlightAlpha or 1)
elseif object.DebuffHighlightUseTexture then
object.DebuffHighlight:SetTexture(texture)
else
object.DebuffHighlight:SetVertexColor(color.r, color.g, color.b, object.DebuffHighlightAlpha or .5)
end
else
if object.DebuffHighlightBackdrop then
local color = origColors[object]
object:SetBackdropColor(color.r, color.g, color.b, color.a)
color = origBorderColors[object]
object:SetBackdropBorderColor(color.r, color.g, color.b, color.a)
elseif object.DebuffHighlightUseTexture then
object.DebuffHighlight:SetTexture(nil)
else
local color = origColors[object]
object.DebuffHighlight:SetVertexColor(color.r, color.g, color.b, color.a)
end
end
end
local function Enable(object)
-- if we're not highlighting this unit return
if not object.DebuffHighlightBackdrop and not object.DebuffHighlight then
return
end
-- if we're filtering highlights and we're not of the dispelling type, return
if object.DebuffHighlightFilter and not CanDispel[playerClass] then
return
end
-- make sure aura scanning is active for this object
object:RegisterEvent("UNIT_AURA", Update)
object:RegisterEvent("PLAYER_TALENT_UPDATE", CheckSpec)
object:RegisterEvent("CHARACTER_POINTS_CHANGED", CheckSpec)
if object.DebuffHighlightBackdrop then
local r, g, b, a = object:GetBackdropColor()
origColors[object] = { r = r, g = g, b = b, a = a}
r, g, b, a = object:GetBackdropBorderColor()
origBorderColors[object] = { r = r, g = g, b = b, a = a}
elseif not object.DebuffHighlightUseTexture then -- color debuffs
-- object.DebuffHighlight
local r, g, b, a = object.DebuffHighlight:GetVertexColor()
origColors[object] = { r = r, g = g, b = b, a = a}
end
return true
end
local function Disable(object)
if object.DebuffHighlightBackdrop or object.DebuffHighlight then
object:UnregisterEvent("UNIT_AURA", Update)
object:UnregisterEvent("PLAYER_TALENT_UPDATE", CheckSpec)
object:UnregisterEvent("CHARACTER_POINTS_CHANGED", CheckSpec)
end
end
oUF:AddElement('DebuffHighlight', Update, Enable, Disable)
for i, frame in ipairs(oUF.objects) do Enable(frame) end
Last edited by Elv22 : 10-17-10 at 10:47 AM.
|
|
|
|
|
|
|
|
A Deviate Faerie Dragon
Forum posts: 14
File comments: 63
Uploads: 0
|
hey
sry, i am a total lua noob.... in which file i have to put "self.DebuffHighlightFilter = true" for filtering the debuffs? thx xark |
|
|
|
|
|
|
Has anyone had any issues getting this working lately with the Pitbull-esque glow texture?
I tried messing around for a bit with no success, though verifying the texture was loaded and in the proper place. I also tried installing Ammo's layout just to see if it worked and had no luck. |
|
|
|
|
|
||
Your solution is the way to go-Ammo |
||
|
|
|
|
|
|
Hi, thanks anyway. I duplicated the addon, did a search replace on "DebuffHighlight" for "HOTHightlight" and then just changed your UnitAura's checking to only check for specific spells, and force a single color.
I then just added it to my layout, so I use 1 overlay texture for debuffs, and a second one (that doesn't overlap with the debuff one) for the HOT one. :-) Thanks for this addon though. ^_^ |
|
|
|
|
|
||
Try oUF_Indicators or something. |
||
|
|
|
|
|
|
Is it possible to have another version for tracking when a unit has a Heal over Time on them?
|
|
|
|
![]() |