Thread: Custom WA help

  1. #1

    Custom WA help

    Hello, I am trying to create a WA that will show the duration of a debuff in text. I got this to work just fine, as you can see here:



    However, for the 3 WA's that have the dots there on inverse, I would like to be able to have an exclamation point or asterisk next to them when they are under 30% duration, so I can know to refresh them without losing any duration.

    I lack the knowledge to code in LUA, so I was hoping I could find some help here.

    For example: If my rupture was <30% duration, the WA would display 8.4! or 8.4*

  2. #2
    Deleted
    easiest way would be to duplicate the aura for your rupture for example and change the display to show an astersik for example and change the trigger of the new aura to show only when the remaining time is " <= 8.4s" and change the old one to show only when it is " >= 8.4s"
    If you want it in one aura using a custom function I could look into it later today but maybe someone else is better/quicker with it.

  3. #3
    Unfortunately, this is going to require custom code: there is no way to know the "original" duration of a debuff, and rupture lasts longer with more combo points. So, unless you fancy hard-coding the time, you will have to grab the duration during the AURA_APPLIED event in order to use it to figure out when to switch over to the other indicator.

  4. #4
    came up with this



    However, occasionally if my rupture will drop there will be a remainder text time that is equal to 30% of the application, but i'm unsure why. any ideas?

  5. #5
    Mechagnome Krazyito's Avatar
    10+ Year Old Account
    Join Date
    Oct 2010
    Location
    Dallas, TX
    Posts
    561
    Code:
    d8d4eaGAIsRhPqpwLAxkuBdLQAFOuLdlL5kvXSj8qKcUPubDEKs3wuonQ2PkQ9kSBs2pmkPQgMcmof0ZjYjrPmyQHlshsQqoLc5yOOZjvPfkIQwkrLflvOwUIwekzvIOyzIW6KkYeLk1urYKvjtxPll5Qsf4zsLCDvzJsf10qH2SOA7OGpkIsZcPYNrQ67IOYFvHEkPgTky8evDjKIULiY1qPY9urwjIVru8Bv1bZGk08qZMARzE7U6HT7VsQhDAjehp323Sokxj7JHs1w(xfAPqNymZXdgpi0zH(k0xbvOZ)QvZPXko3vIqFXLsfnAPk53qtZ7qF)K2Fgvj)g68N6E5Fv)rGaddddcmmmS4F3eWL8P8zB5FffpROd(P4ln0K2Ash8r6GpshSuAjeS1n8jyPsu3BFzOdUdu8n5F559zLkA0wtw0bZsUs2hdLQT8VI1OrGaddddcmmmCsj1Hn1Rje0cN(wyUcUJBsf81B2w(xb)ZHLslHa(qnlqGHHHf)7MawkTeIUFZ2Y)k4tWmtacmmmmiWWWW8CyP0siyRB4tNGLrggHBQl4NIV0qtARj8PtWSsfnARjly49qPabgggggggw8VBcyP0siO4zf8j4s(u(ST8VIINvWjbNS1sXZQ(JabggggggggeyyyyyyyyEoSuAjeu8ScM9GLslHO73ST8VcozGh3f8EOuGadddddddddddpR9nvW9zrZXdyMZAuNY)ZS22xkTeckEwnceyyyyyyy4sivGadddddddddddpR9nvW9zrZXdyMZAuNY)ZS22xkTeckEwncE8yywDelqGHHHHHHHl1fiWWWWWWWWGaddddddddcmmmCPUabggggKsDbciGaciGaciGaciGaciGaciGaciGaciGaciGaciGaciHMR47X7FwQO26koZm07Ktp91mOcTQLvsbvCMzOLRK9XqPAl)RIn2qpl65FffTPvO3s(n0jh)ApeDwMbdtWUHS)WedzSREzh7se5jXOmHw9YOMC6PVMsXzMHMFf6R3ST8VcEw5Zs6qOpuC6pSrNh2BxdsWKjJj6DWWEtmCqKNeJddT43UcQqFXZZ53pXsBqf6SNy5bvSXg65xubvOZEILhuXgBO3MOuBqf6SNy5bvSXg6z7UcQqN9elpOIn2yJn0TGk0YvY(yOuTL)vHMn1wZ82D1dB3FLup60sioEUTVzDuUs2hdLQT8Vk2qZqCMjJjygBe
    I made you a base to work off of.

    Basically here is what I did. I made a basic text aura that triggered when I put a Rejuv on myself (you can change this for debuffs if needed). After that, I went to the 'Display tab' and made a custom function.

    Code:
    function()
        local expirationTime, unitCaster, _, _, spellID = select(7, UnitBuff("player", "Rejuvenation"))
        --Manually put in base duration of spell here
        local spellDuration = 12
        
        if spellID == 774 and unitCaster == "player"  then
            local spellTime = expirationTime - GetTime()
            
            if spellTime > spellDuration * .3 then
                return ("%.01f"):format(spellTime)
            else
                return ("%.01f"):format(spellTime) .. "!"
            end
    
        end
    end
    I hardcoded the duration of the spell so you always have the correct 30% remaining. Then I just returned the time left on the buff and concatenated a '!' if it was below 30%.

    For you, you're going to have to use UnitDebuff instead and make sure that you have it set to 'target' as well as the spell you want to track. Find the spellID of your debuffs and set the base duration and you should be good to go. Let me know if you have any trouble.

  6. #6
    Quote Originally Posted by Krazyito View Post
    Code:
    d8d4eaGAIsRhPqpwLAxkuBdLQAFOuLdlL5kvXSj8qKcUPubDEKs3wuonQ2PkQ9kSBs2pmkPQgMcmof0ZjYjrPmyQHlshsQqoLc5yOOZjvPfkIQwkrLflvOwUIwekzvIOyzIW6KkYeLk1urYKvjtxPll5Qsf4zsLCDvzJsf10qH2SOA7OGpkIsZcPYNrQ67IOYFvHEkPgTky8evDjKIULiY1qPY9urwjIVru8Bv1bZGk08qZMARzE7U6HT7VsQhDAjehp323Sokxj7JHs1w(xfAPqNymZXdgpi0zH(k0xbvOZ)QvZPXko3vIqFXLsfnAPk53qtZ7qF)K2Fgvj)g68N6E5Fv)rGaddddcmmmS4F3eWL8P8zB5FffpROd(P4ln0K2Ash8r6GpshSuAjeS1n8jyPsu3BFzOdUdu8n5F559zLkA0wtw0bZsUs2hdLQT8VI1OrGaddddcmmmCsj1Hn1Rje0cN(wyUcUJBsf81B2w(xb)ZHLslHa(qnlqGHHHf)7MawkTeIUFZ2Y)k4tWmtacmmmmiWWWW8CyP0siyRB4tNGLrggHBQl4NIV0qtARj8PtWSsfnARjly49qPabgggggggw8VBcyP0siO4zf8j4s(u(ST8VIINvWjbNS1sXZQ(JabggggggggeyyyyyyyyEoSuAjeu8ScM9GLslHO73ST8VcozGh3f8EOuGadddddddddddpR9nvW9zrZXdyMZAuNY)ZS22xkTeckEwnceyyyyyyy4sivGadddddddddddpR9nvW9zrZXdyMZAuNY)ZS22xkTeckEwncE8yywDelqGHHHHHHHl1fiWWWWWWWWGaddddddddcmmmCPUabggggKsDbciGaciGaciGaciGaciGaciGaciGaciGaciGaciGaciHMR47X7FwQO26koZm07Ktp91mOcTQLvsbvCMzOLRK9XqPAl)RIn2qpl65FffTPvO3s(n0jh)ApeDwMbdtWUHS)WedzSREzh7se5jXOmHw9YOMC6PVMsXzMHMFf6R3ST8VcEw5Zs6qOpuC6pSrNh2BxdsWKjJj6DWWEtmCqKNeJddT43UcQqFXZZ53pXsBqf6SNy5bvSXg65xubvOZEILhuXgBO3MOuBqf6SNy5bvSXg6z7UcQqN9elpOIn2yJn0TGk0YvY(yOuTL)vHMn1wZ82D1dB3FLup60sioEUTVzDuUs2hdLQT8Vk2qZqCMjJjygBe
    I made you a base to work off of.

    Basically here is what I did. I made a basic text aura that triggered when I put a Rejuv on myself (you can change this for debuffs if needed). After that, I went to the 'Display tab' and made a custom function.

    Code:
    function()
        local expirationTime, unitCaster, _, _, spellID = select(7, UnitBuff("player", "Rejuvenation"))
        --Manually put in base duration of spell here
        local spellDuration = 12
        
        if spellID == 774 and unitCaster == "player"  then
            local spellTime = expirationTime - GetTime()
            
            if spellTime > spellDuration * .3 then
                return ("%.01f"):format(spellTime)
            else
                return ("%.01f"):format(spellTime) .. "!"
            end
    
        end
    end
    I hardcoded the duration of the spell so you always have the correct 30% remaining. Then I just returned the time left on the buff and concatenated a '!' if it was below 30%.

    For you, you're going to have to use UnitDebuff instead and make sure that you have it set to 'target' as well as the spell you want to track. Find the spellID of your debuffs and set the base duration and you should be good to go. Let me know if you have any trouble.
    Thank you very much, appreciate it.

Posting Permissions

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