WeakAuras

Threat percentage

  • 5 posts
    #1 Sep 11, 2011 at 22:38 UTC - 0 likes

    Hi,

    I want an Weakauras that is Tracking my Aggro and whispering an given Paladin, with "My Aggro is Over x% please give me your Hand of Salvation" and the Best Solution would be if it would also Track the Combatlog for the tracking if the Hand is on Cooldown or not. But the Mayor Part is the Whispering the Paladin when the Treshhold is over x% i tried something:

    function()
        local _,_,threatpct = UnitDetailedThreatSituation("player","target")
        if threatpct > 90 then
            return ("%i"):format(threatpct)
            elseif threatpct < 90 then
                return("Evereything OK")
                end
            end
    

    and in the Display Text an %c% for getting the "exact" treshold.

    But it permanantly showing the aggro and when i turn on the feature whisper under action it whispers when i start the combat.

    would somebody please help me?

    #2 Sep 12, 2011 at 16:17 UTC - 0 likes

    For simplicity assuming you don't care if "Hand of Salvation" is on cooldown or not (since other players cooldowns are quite unreliable to track), just create a simple Display with trigger type Threat situation and status "above tank but not tanking". Then in the Actions -> OnShow Tab enable Send message, add your text and set it to send to raid (otherwise you have to manually change the whisper target name everytime).

    If you really want to manually define the Threat-%, use this trigger instead (keep the OnShow Stuff):

    • Type: Custom -> Event
    • Events: UNIT_THREAT_LIST_UPDATE, UNIT_THREAT_SITUATION_UPDATE
    • Custom (show) trigger:
    function()
      local _, _, threatpct = UnitDetailedThreatSituation("player", "target")
      return threatpct > 90
    end
    
    • Hide: Timed, x-seconds

    To display the Threat-% in a text display use:

    • Text: %c
    • Update: Update on every frame
    • Custom text code:
    function()
      local _, _, threatpct = UnitDetailedThreatSituation("player", "target")
      return ("%i"):format(threatpct or 0).. "%%"
    end
    
    Last edited Sep 13, 2011 by CommanderSirow
    #3 Sep 13, 2011 at 00:43 UTC - 0 likes

    First of all thanks for helping,

    I tested it and found out a bug it just announce it once and "stuck" until an /rl and i didnt figured out so far how to fix it. Maybe its just because im fairly new to this addon.

    edit:

    OK bug found, but now by 1 seconds it spams every second and when i take 2 seconds + it's sending the message and a random given time.

    Last edited Sep 13, 2011 by Rhoxo
    #4 Sep 13, 2011 at 08:39 UTC - 0 likes

    Oh yeah my bad, this trigger will actually continue to fire until you are lower on threat again.

    Use this triggers instead:

    • Custom (show) trigger:
    function()
      local _, _, threatpct = UnitDetailedThreatSituation("player", "target")
      return threatpct  and threatpct >= 90
    end
    
    • Custom (hide) trigger: (instead of timed)
    function()
      if not UnitAffectingCombat("player") then
        return true
      end
    
      local _, _, threatpct = UnitDetailedThreatSituation("player", "target")
      return not threatpct or threatpct < 90
    end
    
    • Events: UNIT_THREAT_LIST_UPDATE, UNIT_THREAT_SITUATION_UPDATE, PLAYER_REGEN_ENABLED

    Edit:

    If you don't want to trigger the display as often when crossing the 90% border, replace the 90 in the custom (hide) trigger with for example 85.

    Last edited Sep 13, 2011 by CommanderSirow
    #5 Sep 13, 2011 at 12:48 UTC - 0 likes

    tested it in ZA / ZG and i have to say it works!! thanks again for your help!

  • 5 posts

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