WeakAuras

WeakAuras

206M Downloads

WeakAuras isn't always detecting an enemy players cast in Classic

bgfds opened this issue ยท 2 comments

commented

Using the built-in Cast trigger, sometimes it will fail to detect an enemy player is casting and not even show a cast bar.

Interestingly, even when using custom to check the combatlog for SPELL_CAST_START WA will occasionally miss a cast

https://streamable.com/20zi7

video showcasing it, the top left is obviously my weakaura, bottom right is a standalone cast bar addon

aura_env.spells = {
    [(GetSpellInfo(123456))] = 1.5, -- fear
    [(GetSpellInfo(654321))] = 1.5, -- immo
    [(GetSpellInfo(123123))] = 2, -- etc.
    [(GetSpellInfo(654456))] = 2.5, -- change the spellIDs and durations
}

-- TRIGGER Custom - TSU - events - CLEU:SPELL_CAST_START:SPELL_CAST_FAILED PLAYER_TARGET_CHANGED FRAME_UPDATE
function(allstates, event, _, subEvent, _, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags, _, spellName)
    if subEvent == "SPELL_CAST_START" 
    and sourceGUID == UnitGUID('target') 
    and CombatLog_Object_IsA(sourceFlags, COMBATLOG_FILTER_HOSTILE_PLAYERS)
    and aura_env.spells[spellName]
    then
        allstates[""] = {
            show = true,
            changed = true,
            progressType = "timed",
            duration = aura_env.spells[spellName], 
            expirationTime = GetTime() + aura_env.spells[spellName],
            name = destName or sourceName .. " - " .. spellName,
            caster = sourceName,
            autoHide = true
        }
    elseif allstates[""] 
        and (
            event == "PLAYER_TARGET_CHANGED" 
            or (event == "FRAME_UPDATE" and GetUnitSpeed("target") > 0)
            or subEvent == "SPELL_CAST_FAILED" and sourceGUID == UnitGUID("target")
        ) 
    then
        allstates[""]show = false
        allstates[""].changed = true
    end
    return true    
end

Someone in the discord made this for me, but like I said the issue even happens with the default status casting trigger

commented

It's an upstream issue, but i may have a fix, i'll keep you updated

commented

LibClassicCasterino was updated to fix this issue