Add files via upload
This commit is contained in:
@@ -1268,30 +1268,34 @@ end
|
||||
-- ============================================================
|
||||
|
||||
function addon.ThreatEngine:GetThreatOnTarget(mobName)
|
||||
if not mobName then return 0, 0, 0, 0, false, nil end
|
||||
if not mobName then return 0, 0, 0, 0, false, nil, 0 end
|
||||
|
||||
-- Check if we have threat data for this mob
|
||||
local mobThreat = threatData[mobName]
|
||||
if not mobThreat then
|
||||
return 0, 0, 0, 0, false, nil
|
||||
return 0, 0, 0, 0, false, nil, 0
|
||||
end
|
||||
|
||||
-- Find player's threat and top threat
|
||||
-- Find player's threat, top threat and second-highest threat
|
||||
local playerThreat = mobThreat[playerName] or 0
|
||||
local topThreat = 0
|
||||
local topPlayer = nil
|
||||
local secondThreat = 0
|
||||
local sourceCount = 0
|
||||
|
||||
for source, value in pairs(mobThreat) do
|
||||
sourceCount = sourceCount + 1
|
||||
if value > topThreat then
|
||||
secondThreat = topThreat
|
||||
topThreat = value
|
||||
topPlayer = source
|
||||
elseif value > secondThreat then
|
||||
secondThreat = value
|
||||
end
|
||||
end
|
||||
|
||||
if topThreat <= 0 then
|
||||
return 0, 0, 0, 0, false, nil
|
||||
return 0, 0, 0, 0, false, nil, 0
|
||||
end
|
||||
|
||||
-- Calculate the player's percentage relative to top threat
|
||||
@@ -1314,7 +1318,7 @@ function addon.ThreatEngine:GetThreatOnTarget(mobName)
|
||||
-- (via addon communication or party combat log parsing).
|
||||
local hasGroupData = (sourceCount > 1)
|
||||
|
||||
return pct, sit, playerThreat, topThreat, hasGroupData, topPlayer
|
||||
return pct, sit, playerThreat, topThreat, hasGroupData, topPlayer, secondThreat
|
||||
end
|
||||
|
||||
-- ============================================================
|
||||
|
||||
Reference in New Issue
Block a user