I am trying to make a WA for some PI tracking and therefore am intresstes in the amount of Priests in my Group.
´´´
function(allstates, event, ...)
local timeStamp = GetTime()
if event == "COMBAT_LOG_EVENT_UNFILTERED" then
local _, subevent, _, sourceGUID = ...
local destGUID, destName = select(8, ...)
local spellID = select(12, ...) or 0
if subevent == "SPELL_AURA_APPLIED" and spellID == 10060 then
local numPriests = 0
for i = 1, GetNumGroupMembers() do
local class = UnitClass("raid" .. i) or UnitClass("party" .. i) or UnitClass("player")
local unit = "raid" .. i
if UnitisUnit(unit, "player") then
unit = "PLAYER"
end
print(i .. ": " .. class)
print(i .. ": " .. unit)
if class == "Priest" and UnitIsConnected(unit) and not UnitIsDeadOrGhost(unit) then
numPriests = numPriests + 1
end
end
print("Number of Priest in Group: " .. numPriests)
print("Number of Members in Group: " .. GetNumGroupMembers())
end
end
end
´´´
this works with every member of the group except the player, I am trying to convert the raid(i) into "PLAYER" but i can´t find a solution