WeakAuras

Having Aura Appear when x seconds left

  • 7 posts
    #1 Nov 19, 2010 at 05:31 UTC - 0 likes

    Hey.

    A little question: I'd like to have aura pop up when I have for example 5 seconds left on Sunder Armor on target and be hidden the rest of time. How is that done in WA?

    I just recently started transition from POWA to WA and this has been the only thing i've been unable to do so far.

    now that I posted: any chance of tweaking this "Action - On Hide - /say Sunder Dropped!" to only happen if sunder actually drops while you have a target, not every time you drop the mob from your target?

    Last edited Nov 19, 2010 by ringuh
    #2 Nov 19, 2010 at 09:05 UTC - 0 likes

    Neither of these things are directly supported, but they can be accomplished with a little custom magic. For the first, I would use a custom animation. Set the display's Main animation's Type to "Custom", Time in to "Relative", % of Progress to "100%", check Fade, and set the Type to "Custom Function". For the Custom Function, enter:

    function(progress)
      if(progress < .833) then
        return 0
      else
        return 1
      end
    end
    

    This will cause the display to be hidden for 83.3% of its progress (25 seconds), and then become visible.

    The second is not really possible using Aura tracking, but can be accomplished by using a custom trigger. You would set the Trigger Type to "Custom", Event Type to "Event", Event(s) to "COMBAT_LOG_EVENT_UNFILTERED", and Duration (s) to 30. Then, set the Custom Trigger to:

    function(_, _, event, _, source, _, _, _, _, _, spellname)
      if(event == "SPELL_AURA_APPLIED" or event == "SPELL_AURA_REFRESH") then
        if(source and UnitIsUnit(source, "player")) then
          if(spellname == "Sunder Armor") then
            return true
          end
        end
      end
    end
    

    This may have some unwanted behavior, though. The display will not hide when your target dies, and it will not distinguish between Sunder Armor debuffs placed on different mobs. It *might* be possible to solve those issues, but it would be tantamount to writing an addon whose purpose is to track debuffs on multiple mobs, within WeakAuras's custom boxes.

    Last edited Nov 19, 2010 by Mirrormn
    #3 Dec 22, 2010 at 19:25 UTC - 0 likes

    hey,

    the first option does not work, so I printed the progress variable to Chat... seems like the decimal point gone two digits to the left. The chat-spam stopped at 0.009956333399. It should've stopped at 0.9999999r

    Bye, Ravengus.

    #4 Dec 23, 2010 at 09:21 UTC - 0 likes

    @Ravengus: Go

    I have noticed that progress-based animations do not always work correctly. I'll have to take a look at them.

    #5 Dec 28, 2010 at 23:13 UTC - 0 likes

    hey,

    I think you might misunderstood me, I want a function to be off 80% of the time:

    function(progress)
      if progress and (progress < 0.008) then
        return 0
      else
        return 1
      end
    end
    


    DOES work! (But obv. it should be "0.8" instead of "0.008" in a perfect bugfree world)

    Bye, RedAces.

    #6 Jan 28, 2011 at 18:32 UTC - 0 likes

    I did a little bit of trial and error and came eventually to this function:

    function(progress)
      local _, _, _, _, _, _, remT = UnitAura("player", "Inquisition")
      if remT then
        remT = remT - GetTime()
        if (remT < 6) then
          return (6 - remT) / 6
        end
      end
     return 0
    end
    

    Change "Inquisition" and the "6" with the values you need. Right now it fades in at 6 second left on Inquisition until it is fully visible at 0 seconds left. Obviously you need a second texture to announce the missing Inquisition (because this first texture will hide itself as soon the Inq-Buff drops).

    Last edited Jan 29, 2011 by Ravengus
    #7 Jan 28, 2011 at 20:48 UTC - 0 likes

    I have added a "Hide" type Alpha animation in 1.3 which can be used to simply hide a display for a certain amount of time or percentage of its duration. However, it's not yet a perfect solution due to some limitations in the animation system. If you want your display to only be visible for the last 6 seconds of the aura's duration and the aura's duration can vary, you will need to stick with the custom path function you've posted... for now. I'm trying to make this something anyone can achieve without using custom Lua, but it's a rather touchy thing.

  • 7 posts

You must login to post a comment. Don't have an account? Register to get one!