Add files via upload

This commit is contained in:
Relationship
2026-07-08 18:24:21 +01:00
committed by GitHub
parent d0a77fe622
commit 16705f72ac
6 changed files with 196 additions and 18 deletions
+9 -5
View File
@@ -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
-- ============================================================