Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.63 KB | None | 0 0
  1. function Omen:RecordThreat(srcGUID)
  2.     -- First find the unitID of the player that matches srcGUID
  3.     local unitID
  4.     if UnitGUID("player") == srcGUID then
  5.         unitID = "player"
  6.     end
  7.     if not unitID and inRaid then
  8.         for i = 1, GetNumGroupMembers() do
  9.             if UnitGUID(rID[i]) == srcGUID then
  10.                 unitID = rID[i]
  11.                 break
  12.             end
  13.         end
  14.     end
  15.     if not unitID and inParty then
  16.         for i = 1, GetNumSubgroupMembers() do
  17.             if UnitGUID(pID[i]) == srcGUID then
  18.                 unitID = pID[i]
  19.                 break
  20.             end
  21.         end
  22.     end
  23.     if not unitID then return end
  24.     --self:Print('UnitID "'..unitID..'" found to be caster of MI/Fade')
  25.  
  26.     -- Record the threat of this unitID on all reachable targets
  27.     if inParty or inRaid then
  28.         if inRaid then
  29.             for i = 1, GetNumGroupMembers() do
  30.                 recordThreat(unitID, rID[i], srcGUID)
  31.                 recordThreat(unitID, rpID[i], srcGUID)
  32.                 recordThreat(unitID, rtID[i], srcGUID)
  33.                 recordThreat(unitID, rptID[i], srcGUID)
  34.             end
  35.         else
  36.             for i = 1, GetNumSubgroupMembers() do
  37.                 recordThreat(unitID, pID[i], srcGUID)
  38.                 recordThreat(unitID, ppID[i], srcGUID)
  39.                 recordThreat(unitID, ptID[i], srcGUID)
  40.                 recordThreat(unitID, pptID[i], srcGUID)
  41.             end
  42.         end
  43.  
  44.     end
  45.     if not inRaid then
  46.         recordThreat(unitID, "player", srcGUID)
  47.         recordThreat(unitID, "pet", srcGUID)
  48.         recordThreat(unitID, "target", srcGUID)
  49.         recordThreat(unitID, "pettarget", srcGUID)
  50.     end
  51.     recordThreat(unitID, "target", srcGUID)
  52.     recordThreat(unitID, "targettarget", srcGUID)
  53.     recordThreat(unitID, "focus", srcGUID)
  54.     recordThreat(unitID, "focustarget", srcGUID)
  55.     recordThreat(unitID, "mouseover", srcGUID)
  56.     recordThreat(unitID, "mouseovertarget", srcGUID)
  57. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement