View Single Post
08-20-14, 01:47 AM   #2
Clamsoda
A Frostmaul Preserver
Join Date: Nov 2011
Posts: 269
Dry coded, untested. I am not sure what the arguments are for TargetFrame_UpdateAuras, they could help in optimizing the code; I am also unsure as to how "not s.maxBuffs or i<=s.maxBuffs" was intended to help, it seems a bit useless, but I left it.

Lua Code:
  1. local _, playerClass = UnitClass("player")
  2. if (not playerClass == "ROGUE") then return end
  3.  
  4. local spellIDs = {
  5.     49016 = true,
  6.     52610 = true,
  7.     5229  = true,
  8.     34692 = true,
  9.     19574 = true,
  10.     18499 = true
  11. }
  12.  
  13. hooksecurefunc("TargetFrame_UpdateAuras", function(self)
  14.     for i = 1, MAX_TARGET_BUFFS do
  15.         local _, _, icon, _, debuffType, _, _, _, _, _, spellID = UnitBuiff(self.unit, i)
  16.  
  17.         if (icon) and (not self.maxBuffs or i <= self.maxBuffs) and (spellIDs[spellID]) then
  18.             local stealableBorder = _G[self:GetName().."Buff"..i.."Stealable"]
  19.  
  20.             if UnitIsEnemy("player", "target") and (debuffType == "Magic") then
  21.                 stealableBorder:Show()
  22.             else
  23.                 stealableBorder:Hide()
  24.             end
  25.         end
  26.     end
  27. end)

Last edited by Clamsoda : 08-20-14 at 01:57 AM.
  Reply With Quote