Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Omen:RecordThreat(srcGUID)
- -- First find the unitID of the player that matches srcGUID
- local unitID
- if UnitGUID("player") == srcGUID then
- unitID = "player"
- end
- if not unitID and inRaid then
- for i = 1, GetNumGroupMembers() do
- if UnitGUID(rID[i]) == srcGUID then
- unitID = rID[i]
- break
- end
- end
- end
- if not unitID and inParty then
- for i = 1, GetNumSubgroupMembers() do
- if UnitGUID(pID[i]) == srcGUID then
- unitID = pID[i]
- break
- end
- end
- end
- if not unitID then return end
- --self:Print('UnitID "'..unitID..'" found to be caster of MI/Fade')
- -- Record the threat of this unitID on all reachable targets
- if inParty or inRaid then
- if inRaid then
- for i = 1, GetNumGroupMembers() do
- recordThreat(unitID, rID[i], srcGUID)
- recordThreat(unitID, rpID[i], srcGUID)
- recordThreat(unitID, rtID[i], srcGUID)
- recordThreat(unitID, rptID[i], srcGUID)
- end
- else
- for i = 1, GetNumSubgroupMembers() do
- recordThreat(unitID, pID[i], srcGUID)
- recordThreat(unitID, ppID[i], srcGUID)
- recordThreat(unitID, ptID[i], srcGUID)
- recordThreat(unitID, pptID[i], srcGUID)
- end
- end
- end
- if not inRaid then
- recordThreat(unitID, "player", srcGUID)
- recordThreat(unitID, "pet", srcGUID)
- recordThreat(unitID, "target", srcGUID)
- recordThreat(unitID, "pettarget", srcGUID)
- end
- recordThreat(unitID, "target", srcGUID)
- recordThreat(unitID, "targettarget", srcGUID)
- recordThreat(unitID, "focus", srcGUID)
- recordThreat(unitID, "focustarget", srcGUID)
- recordThreat(unitID, "mouseover", srcGUID)
- recordThreat(unitID, "mouseovertarget", srcGUID)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement