--COMBAT_LOG_EVENT_UNFILTERED PLAYER_REGEN_DISABLED PLAYER_REGEN_ENABLED TICKER_GO_PING
function(allstates, e, ...)
    if e == "COMBAT_LOG_EVENT_UNFILTERED" then
        if InCombatLockdown() == true then
            local se = select(2, ...)
            if se == "SPELL_CAST_SUCCESS" then
                local caster = select(5, ...)
                local casterFlags = select(6, ...)
                if bit.band(casterFlags, 0x00000010) then --Hostiles
                    --if bit.band(casterFlags, 0x00000140) then --Hostile players
                    local spellID = select(12, ...)
                    if aura_env.spells[spellID] then
                        allstates[caster] = {
                            show = true,
                            changed = true,
                            progressType = "timed",
                            expirationTime = GetTime() + aura_env.spells[spellID].time,
                            duration = aura_env.spells[spellID].time,
                            autohide = true,
                            index = GetTime() + aura_env.spells[spellID].time,
                            resort = true,
                            icon = select(3, GetSpellInfo(spellID)),
                        }
                        return true
                    end
                end
            end
        end
    elseif e == "TICKER_GO_PING" then
        for k, v in pairs(allstates) do
            if v.expirationTime < GetTime() then
                v.show = false
                v.changed = true
            end
            if not v.icon then
                v.show = false
                v.changed = true
            end
        end
        return true
    elseif e == "PLAYER_REGEN_DISABLED" then
        aura_env.tickerGoPing = C_Timer.NewTicker(0.2, function()
            WeakAuras.ScanEvents("TICKER_GO_PING")
        end)
    elseif e == "PLAYER_REGEN_ENABLED" then
        aura_env.tickerGoPing:Cancel()
        for k, v in pairs(allstates) do
            v.show = false
            v.changed = true
        end
        return true
    end
end

--INIT
aura_env.spells = {
    --[774] = {
    --    ["time"] = 10,
    --    ["prio"] = true,
    --},
    [6552] = {
        ["time"] = 15,
        ["prio"] = true,
    }, --Pummel
    [23920] = {
        ["time"] = 25,
        prio = false,
    }, --Spell Reflection
    [1766] = {
        ["time"] = 15,
        ["prio"] = true,
    }, --Kick
    [47528] = {
        ["time"] = 15,
        ["prio"] = true,
    }, --Mind Freeze
    [47476] = {
        ["time"] = 60,
        prio = false,
    }, --Strangulate
    [96231] = {
        ["time"] = 15,
        ["prio"] = true,
    }, --Rebuke
    [31935] = {
        ["time"] = 15,
        ["prio"] = true,
    }, --Avengers Shield
    [57994] = {
        ["time"] = 12,
        ["prio"] = true,
    }, --Wind Shear
    [2139] = {
        ["time"] = 24,
        ["prio"] = true,
    }, --Counterspell
    [19647] = {
        ["time"] = 24,
        ["prio"] = true,
    }, --Spell Lock
    [119911] = {
        ["time"] = 24,
        ["prio"] = true,
    }, --Optical Blast
    [106839] = {
        ["time"] = 15,
        ["prio"] = true,
    }, --Skull Bash
    [78675] = {
        ["time"] = 60,
        ["prio"] = true,
    }, --Solar Bream
    [116705] = {
        ["time"] = 15,
        ["prio"] = true,
    }, --Spear Hand Strike
    [15487] = {
        ["time"] = 45,
        prio = false,
    }, --Silence
    [114028] = {
        ["time"] = 30,
        prio = false,
    }, --Mass Spell Reflect
    [147362] = {
        ["time"] = 24,
        ["prio"] = true,
    }, --Counter Shot
}
