General Fixes and Improvements

This commit is contained in:
Tercio Jose
2023-05-16 15:21:04 -03:00
parent 7fb0ae469c
commit cebe150e16
10 changed files with 483 additions and 455 deletions
+32
View File
@@ -6484,6 +6484,38 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
end
end
function Details:GetUnitId(unitName)
unitName = unitName or self.nome
local openRaidLib = LibStub:GetLibrary("LibOpenRaid-1.0", true)
if (openRaidLib) then
local unitId = openRaidLib.GetUnitID(unitName)
if (unitId) then
return unitId
end
end
if (IsInRaid()) then
for i = 1, GetNumGroupMembers() do
local unitId = "raid" .. i
if (GetUnitName(unitId, true) == unitName) then
return unitId
end
end
elseif (IsInGroup()) then
for i = 1, GetNumGroupMembers() -1 do
local unitId = "party" .. i
if (GetUnitName(unitId, true) == unitName) then
return unitId
end
end
if (UnitName("player") == unitName) then
return "player"
end
end
end
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--battleground parser