aggixx

Untitled

Sep 4th, 2019
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. aura_env.update = function(overrideInterval)
  2. if not (overrideInterval or GetTime() - aura_env.lastCheck >= aura_env.config.interval) then
  3. return
  4. end
  5.  
  6. aura_env.lastCheck = GetTime();
  7.  
  8. if not aura_env.iconsInitialized then
  9. aura_env.initIcons();
  10. end
  11.  
  12. local group;
  13.  
  14. if IsInRaid() then
  15. group = "raid"
  16. elseif IsInGroup() then
  17. group = "party"
  18. else
  19. group = "player"
  20. end
  21.  
  22. local groupSize = max(1, GetNumGroupMembers())
  23.  
  24. aura_env.needsBuff = {};
  25.  
  26. for i=1,#aura_env.spells do
  27. local spell = aura_env.spells[i];
  28.  
  29. aura_env.needsBuff[spell] = {};
  30. end
  31.  
  32. for unitId in WA_IterateGroupMembers() do
  33. if UnitIsFriend("player", unitId) and not UnitIsDeadOrGhost(unitId) and UnitIsConnected(unitId) then
  34. for i=1,#aura_env.spells do
  35. local spell = aura_env.spells[i];
  36.  
  37. if IsSpellInRange(spell, unitId) == 1 then
  38. if not WA_GetUnitAura(unitId, spell) then
  39. --print(unitId.." missing "..spell)
  40. local name = UnitName(unitId);
  41. table.insert(aura_env.needsBuff[spell], name);
  42. else
  43. --print(unitId.." has "..spell)
  44. end
  45. end
  46. end
  47. end
  48. end
  49.  
  50. --DevTools_Dump(aura_env.needsBuff)
  51.  
  52. WeakAuras.ScanEvents("RAID_BUFF_TSU");
  53. --print("updated")
  54. end
Advertisement
Add Comment
Please, Sign In to add comment