I’m trying to make the enemy purgeable buffs glow on TBC like they do on retail WoW to quickly identify which ones I can purge. Does anyone know of a script or addon that can do this? ( I don’t want any unit frame addons or anything that makes it look different from default, simply just a glow on the border of the buffs that are purgeable) thanks friends
Does anyone have any suggestions?
If WeakAuras2 or Plater won’t do it for you then I don’t know what else might.
If you know of a weak aura that would work, please let me know. I’ve been trying multiple and none work, same with plater but I don’t really want to use plater
I have no desire to reenter the world of ammo bags and pets that have to be fed in order to keep them from biting their masters on the butt.
Check out the WA forums or their discord.
maybe?
that is what I’m looking for, but it doesnt work
Apparently, you are supposed to hook the unitbuff and unitaura functions. Something like…
– store original versions of API calls
local old_UnitBuff = UnitBuff
local old_UnitAura = UnitAura
–the next bit are global calls so that it affects everything outside the addon:
UnitBuff = Modified_UnitBuff
UnitAura = Modified_UnitAura
So now, anything trying to call UnitBuff is going to call your custom function and not the default one.
Now we need to write the custom function:
function Modified_UnitBuff(…)
– get default stuff
local name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable, shouldConsolidate, spellID, canApplyAura, isBossDebuff = old_UnitBuff(…)
–Now, the Purge spell (which is what you specified) works on magic debuffs. We grabbed that info just now from old_UnitBuff so we can do this
if debuffType = “magic” then
isStealable = 1
end
–setting isStealable to 1 makes the debuff glow.
–And then, you need to pass all this info back into the system so that it modifies the game.
return name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable, shouldConsolidate, spellID, canApplyAura, isBossDebuff
end
that’s basically it i think…
thank you but that went right over my head, lol.
I wouldn’t recommend hooking the UnitAura API in that way… it could cause mayhem for frames requiring secure execution.
Something like this might be a little safer. It focuses more narrowly on the target frame debuffs
local numDebuffs = TargetFrame.maxDebuffs or MAX_TARGET_DEBUFFS or 16
hooksecurefunc("TargetFrame_UpdateAuras", function()
for i=1, numDebuffs do
local frame = _G["TargetFrameDebuff" .. i]
if (frame and frame:IsShown()) then
local id = frame:GetID()
local __, __, __, __, debuffType = UnitAura("target", id, "HARMFUL|INCLUDE_NAME_PLATE_ONLY")
if (debuffType == "magic") then
frame.Stealable:Show() -- makes the glowing effect
end
else
break
end
end
end)
Reference: https://www.townlong-yak.com/framexml/live/TargetFrame.lua
Is there any way to put that into a script that I can click upon login?
Turn it into an addon:
https://addon.bool.no/
Your code is close to working, but not quite there. I’ve made a few changes to get it working.
@OP: Here is a working hook for TBC for both focus and target frames, if you’ve figured out the addon suggestion the others have posted in order to get it to run every login.
-- ** Dispel Border for TBC** --
local maxBuffs = MAX_TARGET_BUFFS
hooksecurefunc("TargetFrame_UpdateAuras", function(self)
local selfName = self:GetName()
-- ignore boss frames and units you can't purge
if selfName:match("Boss") or not UnitCanAttack("player", self.unit) then return end
for i = 1, maxBuffs do
local steal = _G[selfName.."Buff"..i.."Stealable"]
local aura = steal and steal:GetParent()
if steal and aura:IsShown() then
local index = aura:GetID()
local _, _, _, debuffType = UnitAura(self.unit, index, "HELPFUL")
if (debuffType == "Magic") then
local w, h = aura:GetSize()
steal:SetSize(w + 3, h + 3)
steal:Show()
end
else
break
end
end
end)
bro thank god for this forum and the gold that has come from it. the script player ‘dumb’ has posted is working perfectly and i absolutely love it. thanks a million i was searching far and wide for this. much love
Any way to have this script work with warlocks? and any way to add :SetSize() into this script?
What do you mean work with warlocks? It’ll work regardless of class.
I updated the code in the original post to include a size so it could work with addons that change the buff size.
You are correct, My old script would show dispel able buff even in Shattrath. When in PvP, the icons light up like they are supposed to. Thank you very much for adding the scaling to it.
Ah, I see. Yeah, if you want it to work that way you could change
if selfName:match("Boss") or not UnitCanAttack("player", self.unit) then return end
to
if selfName:match("Boss") or UnitIsFriend("player", self.unit) then return end
That will highlight everything dispellable on non-friendly units. The downside is, it’ll highlight some things that are dispellable even if you can’t actually dispel them right then (like in shatt, for instance).
Cheers
legendary post, was going insane trying to find something. thank you.
The API really needs a way to distinguish between “can attack” and “enemy” in a simple way.
I’m sure there’s something complicated that can be done with rep levels or threat levels but I’ve run up against this before and it’s annoying.