1. #1

    Weak Auras LUA Questions

    I'm working on a custom show/hide trigger in WA for Sacred Shield, but I'm encountering 2 issues with the code as I have it now.

    Code:
    function()    local name,_,_,_,_,_,expires = UnitBuff("player", "Sacred Shield",nil,"PLAYER")
        if name and (expires - GetTime()) > 9 then
            return false
        end
        return true
    end
    This normally works flawlessly, but I've noticed a 1-2 second delay from when it *should* proc, to when it does proc (hence why it's at ">9"). The other issue is that if my primary sacred shield buff (ie 30s duration) falls off, but the other sacred shield remains, it then takes priority on all recasts until such a time where it's broken and the first one takes priority again. For Raids this isn't an issue, but for CMs/Heroics/Old Content, it's pretty common for me to not take enough damage to break a Sacred Shield. With that being said here are the questions...

    1. Is there a way to fix the trigger to operate off of SpellID instead of the buff name?

    2. is there a way to reduce the time between when it should trigger and when it actually does?

  2. #2
    The spell ID vs spell name is the root of both problems. I suspect you're doing the typical paladin thing of tracking the sacred shield buff on a friendly unit to remind you to recast when it's due to drop off. The solution is to make an aura as you would normally but check the "Use full scan" option and then replace spell names with Spell IDs.

    You could do it with lua if there's some more complex behaviour in the trigger that you require but if it's just "check for some buff on some unit and ensure it has more than some amount of time remaining" then you can just use the regular interface for that. If you wanted a custom trigger to do additional functionality (like whisper the player) you should move that out of the trigger and into an on show/on hide event.

  3. #3
    That is how I have been doing it, the method above makes it so that my SS has 100% uptime as it's casted as soon as the warning comes up. Scrounging up the last 5-10% of uptime on SS greatly assists with extra mitigation.

    As of right now the way it's setup is a normal icon with text duration on it tracking the spell ID via full scan. A second icon (red) becomes active when the buff is off. A third aura calculates out the value of the absorb based on current AP levels, to determine optimal time to recast SS. The final element is an invisible texture setup with animations and sounds to alert me at the 8s mark to recast sacred shield next non-holy power generating GCD.

    Ideally I want to set it up so that I have 1 text setup and 1 icon that would be full color at >8s, red <8s, and display duration. A second invisible texture could be there for the animation and sound files I want.

    I've included an SS of how it's setup currently to give you an idea of what I'm trying to accomplish. I know it's possible, but I'm not very strong with lua... https://dl.dropboxusercontent.com/u/...513_050207.jpg

    edit: Also, the reason for the lua is because "use full scan" doesn't have a duration functionality to it, otherwise I wouldn't have to tinker with this.
    Last edited by dementedlogic; 2013-06-07 at 05:37 PM.

Posting Permissions

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