1. #1

    WeakAuras usable interrupt in and out of range

    Hello dear community, I would be very appreciate for assisting me in with next triggers, by adding the additional conditions for checking Range of usable spell. Here're the triggers:
    Basicaly how it works: When somebody casts any interruptable spell and when my Kick (or any other similar spell) is ready (not on cooldown) the Icon appears, all I want is to add Range condition. Thanks in advance, wish You all full of love in the Happy New Year

    //For in:

    function ()

    if not UnitExists("target") or not UnitIsEnemy("player", "target") then return false end

    local name, _, _, _, _, endTime, _, _, noInterrupt = UnitCastingInfo("target")

    local start, duration = GetSpellCooldown(57994)

    if name and not noInterrupt and ( start == 0 or start + duration < endTime / 1000 ) then
    return true
    end

    name, _, _, _, _, endTime, _, noInterrupt = UnitChannelInfo("target")

    if name and not noInterrupt and ( start == 0 or start + duration < endTime / 1000 ) then
    return true
    end

    return false
    end

    //For out (Untrigger):

    function ()
    if not UnitExists("target") or not UnitIsEnemy("player", "target") then return true end

    local name, _, _, _, _, endTime, _, _, noInterrupt = UnitCastingInfo("target")

    local start, duration = GetSpellCooldown(57994)

    if not name or noInterrupt or ( start + duration > endTime / 1000 ) then
    return true
    end

    name, _, _, _, _, endTime, _, _, noInterrupt = UnitChannelInfo("target")

    if not name or noInterrupt or ( start + duration > endTime / 1000 ) then
    return true
    end

    return false
    end

  2. #2
    Field Marshal Dareous's Avatar
    10+ Year Old Account
    Join Date
    Nov 2011
    Location
    Alberta, Canada
    Posts
    68
    You should be able to use IsSpellInRange("kick", "target") http://wowprogramming.com/docs/api/IsSpellInRange

  3. #3
    The thing is that Im complete noob in custom triggers, even that one I got from this forum Thats why Im asking for help..

  4. #4
    So, I played with it, and got it to work by wrapping your "return true" condition with a condition to check for range.
    I didn't touch the untrigger function as it seemed to work without touching it. Maybe you want to, I don't know.

    Do take note, that the IsSpellInRange() is currently checking for the hunter's interrupt Muzzle, you'll have to change that to whatever.

    Code:
    function ()
        
        if not UnitExists("target") or not UnitIsEnemy("player", "target") then return false end
        
        local name, _, _, _, _, endTime, _, _, noInterrupt = UnitCastingInfo("target")
        
        local start, duration = GetSpellCooldown(57994)
        
        if IsSpellInRange("Muzzle", "target") == 1 then
            if name and not noInterrupt and ( start == 0 or start + duration < endTime / 1000 ) then
                return true
            end
            
            name, _, _, _, _, endTime, _, noInterrupt = UnitChannelInfo("target")
            
            if name and not noInterrupt and ( start == 0 or start + duration < endTime / 1000 ) then
                return true
            end
        end
        
        
        return false
    end

  5. #5
    Thank You so much!!! Works perfectly

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •