View Single Post
02-29-24, 11:38 PM   #4
Kovexpulthul
A Defias Bandit
Join Date: Feb 2024
Posts: 2
Originally Posted by Xrystal View Post
That reminds me of one of my first addons back in the old Burning Crusade days when I was mage tanking Krosh Firehand. Wrote an addon to track the shield buff on him so I could steal it rofl.

I also did one more recently ( several expansions back ) where I watched for power shield on my priest. Or something similar.

Neither addon would work now ( if I still had the code somewhere ) unfortunately but could be a good starting point.

I'll monitor the post to see if you get any joy.
Forgot to mention this is to work on a private server 3.3.5 Wotlk so maybe it would work?

I want it to look like this combat indicator, next to my player frame just tracking how much SnD I have left:


Originally Posted by Fizzlemizz View Post
It's a bit of a loaded question as it's missing details (most of which probably come with WeakAuras). You could start with something like:

Lua Code:
  1. local spellID, SnDID = 315496 -- S&D
  2. local _, _, icon = GetSpellInfo(spellID)
  3.  
  4. local f = CreateFrame("Frame", "Kovexpulthul_Buff", PlayerFrame, "AuraButtonArtTemplate")
  5. f:Hide()
  6. f:SetSize(40, 40)
  7. f.Icon:SetTexture(icon)
  8. f:SetPoint("RIGHT", PlayerFrame, "LEFT", 0, 0)
  9. f:RegisterEvent("UNIT_AURA")
  10. f:SetScript("OnEvent", function(self, event, ...)
  11.     local unit, auraInfo = ...
  12.     local added, updated, removed, full = auraInfo.addedAuras, auraInfo.updatedAuraInstanceIDs, auraInfo.removedAuraInstanceIDs, auraInfo.isFullUpdate
  13.     if added then
  14.         for k, v in pairs(added) do
  15.             if v.spellId == spellID then
  16.                 SnDID = v.auraInstanceID
  17.                 self:Show()
  18.                 break
  19.             end
  20.         end
  21.     end
  22.     if removed then
  23.         for k, id in pairs(removed) do
  24.             if id == SnDID then
  25.                 SnDID = nil
  26.                 self:Hide()
  27.                 break
  28.             end
  29.         end
  30.     end
  31. end)

It's been a while since I looked at auras so there may well be a better way.
It doesn't seem to work. I changed spellID to correct one (6774, because I forgot to mention this is to work on private server on 3.3.5 patch) and it doesn't work, doesn't show anything