--COMBAT_LOG_EVENT_UNFILTERED PLAYER_REGEN_DISABLED
function(e, ...)
    if e == "COMBAT_LOG_EVENT_UNFILTERED" then
        --for i = 1, 40 do
        --local temp = select(i, ...)
        --if temp then
        --print(i, temp)
        --end
        --end
        local se = select(2, ...)
        if se == "SPELL_CAST_START" then
            local source = select(5, ...) or 0
            local spell = select(13, ...) or 0
            if source:match("Vigilance") and spell == "Infusion" then
                aura_env.infusionCounter = aura_env.infusionCounter + 1
                if aura_env.infusionCounter == 1 or (aura_env.infusionCounter - 1) % 2 == 0 then
                    print("AYAYAYAJAJSDJASDJIASJIDIJDIJD LOL")
                    local lightGroup = {["outer"] = false, ["mid"] = false, ["inner"] = false}
                    local felGroup = {["outer"] = false, ["mid"] = false, ["inner"] = false}
                    for k, v in pairs(aura_env.soakers) do
                        if UnitDebuff(v.unit, "Fel Infusion") and v.alive == true then
                            if felGroup.outer == false then
                                felGroup.outer = k
                            elseif felGroup.mid == false then
                                felGroup.mid = k
                            elseif felGroup.inner == false then
                                felGroup.inner = k
                            end
                        elseif UnitDebuff(v.unit, "Light Infusion") and v.alive == true then
                            if lightGroup.outer == false then
                                lightGroup.outer = k
                            elseif lightGroup.mid == false then
                                lightGroup.mid = k
                            elseif lightGroup.inner == false then
                                lightGroup.inner = k
                            end
                        end
                    end
                    -- Announce soakers pls
                    print("felGroup.outer, felGroup.mid, felGroup.inner", felGroup.outer, felGroup.mid, felGroup.inner)
                    print("lightGroup.outer, lightGroup.mid, lightGroup.inner", lightGroup.outer, lightGroup.mid, lightGroup.inner)
                end
            end
        elseif e == "UNIT_DIED" then
            for k, v in pairs(aura_env.soakers) do
                if UnitIsDeadOrGhost(k) then
                    v.alive = false
                end
            end
        end
    elseif e == "PLAYER_REGEN_DISABLED" then
        aura_env.infusionCounter = 0
        for i = 1, 40 do
            local unit = "raid" .. i
            local class = select(3, UnitClass(unit))
            if UnitIsConnected(unit) then
                local spec = GetInspectSpecialization(unit)
                -- Specs don't work, use classes instead ??? && roles
                print("SPECERINO", spec, unit)
                if aura_env.rangedSpecs[spec] then
                    aura_env.soakers[UnitName(unit)] = {["id"] = unit, ["alive"] = true}
                    print(UnitName(unit), unit)
                    if UnitIsDeadOrGhost(unit) then
                        aura_env.soakers[UnitName(unit)].alive = false
                    end
                end
            end
        end
    end
end
--7@pQ8G)n

--INIT
aura_env.infusionCounter = 0
aura_env.rangedSpecs = {102, 253, 254, 62, 63, 64, 258, 262, 265, 266, 267}
aura_env.soakers = {}
