Add files via upload
This commit is contained in:
@@ -1298,8 +1298,31 @@ function addon.ThreatEngine:GetThreatOnTarget(mobName)
|
||||
return 0, 0, 0, 0, false, nil, 0
|
||||
end
|
||||
|
||||
-- Calculate the player's percentage relative to top threat
|
||||
local pct = (playerThreat / topThreat) * 100
|
||||
-- Calculate the player's threat percentage.
|
||||
--
|
||||
-- Two-mode display so the number matches user intuition:
|
||||
-- * If the player IS the current top-threat holder, show how far
|
||||
-- ahead they are of the runner-up: pct = playerThreat/second * 100.
|
||||
-- A tank comfortably tanking a mob will read something like 120%
|
||||
-- or 200% — anything > 100 means "you are above the next player".
|
||||
-- * If the player is NOT top, show their share of the top holder's
|
||||
-- threat: pct = playerThreat/top * 100. This is 0-100 and answers
|
||||
-- "how close am I to pulling aggro off the current top holder".
|
||||
--
|
||||
-- This lets the plate show > 100% for the actual threat leader
|
||||
-- instead of clamping everyone with aggro to a flat 100%.
|
||||
local pct
|
||||
if topPlayer == playerName then
|
||||
if secondThreat > 0 then
|
||||
pct = (playerThreat / secondThreat) * 100
|
||||
else
|
||||
pct = 100
|
||||
end
|
||||
if pct < 100 then pct = 100 end -- safety: top holder never below 100
|
||||
else
|
||||
pct = (playerThreat / topThreat) * 100
|
||||
if pct > 100 then pct = 100 end -- non-top can't exceed the leader
|
||||
end
|
||||
|
||||
-- Determine threat situation based on the player's threat
|
||||
local sit = 0
|
||||
|
||||
Reference in New Issue
Block a user