Author SHA1 Message Date
Andreas 4567bea3f9 Override role as TANK based on MT assignments
This is particularly helpful in fights like High King Maulgar,
Illidari Council or Kael'Thas where a DPS player is temporarily
made into a tank.
2026-10-29 12:54:24 +01:00
2 changed files with 13 additions and 3 deletions

No files matched your search

+11 -1
View File
@@ -541,10 +541,20 @@ function UnitFrame:UNIT_POWER_UPDATE()
self:UpdatePower()
end
function UnitFrame:UpdateRole(role)
function UnitFrame:GetRole(role)
if role == nil then
role = UnitGroupRolesAssigned(self.unit)
end
if GetPartyAssignment("MAINTANK", self.unit) then
role = "TANK"
end
return role
end
function UnitFrame:UpdateRole(role)
role = self:GetRole(role)
if role == "HEALER" then
self:EnablePower(Enum.PowerType.Mana)
elseif role == "TANK" and select(3, UnitClass(self.unit)) == 6 then
+2 -2
View File
@@ -53,8 +53,8 @@ local function UnitFrameDefaultCompare(lhs, rhs)
end
-- tank < healer < damage < ?
local lrole = RoleValue(UnitGroupRolesAssigned(lunit))
local rrole = RoleValue(UnitGroupRolesAssigned(runit))
local lrole = RoleValue(lhs:GetRole())
local rrole = RoleValue(rhs:GetRole())
if lrole ~= rrole then
return lrole < rrole