View Single Post
07-25-16, 04:52 PM   #57
Ketho
A Pyroguard Emberseer
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,026
Originally Posted by syncrow View Post
For All player based debuffs we need
Lua Code:
  1. filter = "HARMFUL|PLAYER"

I tried to show all (harmful) spells from the player, but didn't work
  • When I tried Hemorrhage, nameplateShowPersonal always seemed to be false
    Is it maybe because it's a talent?
https://gfycat.com/DeterminedDarkCarpenterant

Lua Code:
  1. hooksecurefunc(NamePlateDriverFrame, "OnUnitAuraUpdate", function(self, unit)
  2.     local filter;
  3.     if UnitIsUnit("player", unit) then
  4.         filter = "HELPFUL|INCLUDE_NAME_PLATE_ONLY";
  5.     else
  6.         local reaction = UnitReaction("player", unit);
  7.         if reaction and reaction <= 4 then
  8.             -- Reaction 4 is neutral and less than 4 becomes increasingly more hostile
  9.             filter = "HARMFUL|PLAYER";
  10.         else
  11.             filter = "NONE";
  12.         end
  13.     end
  14.  
  15.     local nameplate = C_NamePlate.GetNamePlateForUnit(unit);
  16.     if (nameplate) then
  17.         nameplate.UnitFrame.BuffFrame:UpdateBuffs(nameplate.namePlateUnitToken, filter);
  18.     end
  19.  
  20.     -- debug
  21.     local name, rank, texture, count, debuffType, duration, expirationTime, caster, _, nameplateShowPersonal, spellId, _, _, _, nameplateShowAll = UnitAura(nameplate.namePlateUnitToken, 1, filter)
  22.     if nameplateShowPersonal ~= nil then -- still want boolean false
  23.         print(nameplate.namePlateUnitToken, filter, name, caster, nameplateShowAll, nameplateShowPersonal, (nameplateShowPersonal and (caster == "player" or caster == "pet" or caster == "vehicle")))
  24.     end
  25. end)
NamePlateDriverMixin:OnUnitAuraUpdate
NameplateBuffContainerMixin:UpdateBuffs

Last edited by Ketho : 07-25-16 at 07:24 PM.