1. #1

    Custom Trigger Exit

    Hey all,

    I'm working on a Sacred Shield Aura for a friend, and working on a custom triggered progress bar to display the absorb remaining.

    I started with an aura suggested by user pnutbutter, and worked it to where it will show the maximum and current values of the absorb of SS. Note -- this required parsing through the list of active buffs and looking for the SS absorb Spell ID.

    That's all fine and dandy, now, however, the aura is not exiting when the duration of SS is up.

    My custom trigger
    Code:
    function(event,unit)
        
        local i = 1;
        local buff = UnitBuff("player", i);
        local sacredShieldAbsorbIndex;
        while buff do
            
            i = i + 1;
            buff = UnitBuff("player", i);
            local buffID = select(11,UnitBuff("player", i));
            if buffID == 65148 then
                --[[DEFAULT_CHAT_FRAME:AddMessage("Found absorb");]]--
                sacredShieldAbsorbIndex = i;
            end;        
            
        end;
        
        if unit and UnitIsUnit(unit,"player") then
            
            local duration,expTime,_,_,_,_,_,_,_,current=select(6,UnitBuff("player", sacredShieldAbsorbIndex));
            
            WA_SacredShieldCurrent=current or 0;
            
            DEFAULT_CHAT_FRAME:AddMessage(current)
            
            
            if floor((expTime-GetTime())*100+0.5)/100>=duration then
                WA_SacredShieldMax=current;
            end;
            
            if not UnitBuff("player", "Sacred Shield") then
                WA_SacredShieldMax=0;
                DEFAULT_CHAT_FRAME:AddMessage("Should Exit Here");
                return false;
            end;
            
            return current>0;
        end;
    end;
    The custom trigger I based this off of still closes when it is supposed to. So it must have been something that I did in the parsing through the Spell IDs. Please excuse how hacky this code is, this is my first venture into Lua.

    Thank you in advance.

  2. #2
    What Untrigger do you use currently?

    Try

    Code:
    function()  
        local buffName = UnitBuff("player", "Sacred Shield")
        return buffName == nil
    end

Posting Permissions

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