WeakAuras

Targeting Me

  • 7 posts
    #1 Aug 27, 2011 at 15:10 UTC - 0 likes

    Hello,

    I've been trying to set up a warning for when my target changes target to me (basically is targeting me), but can't even think of how to start with this. Any help would be greatly appreciated!

    Edit: Having this work for focus target would be just as good.

    Last edited Aug 27, 2011 by Bathory13
    #2 Aug 27, 2011 at 18:22 UTC - 0 likes

    @Bathory13: Go

    Hi there,

    literally was just about to make a thread with a similar question so thought prob best just to add it to yours save clogging up the forum as im sure the answer will be roughly the same anyway.

    Is there a way of showing a specific units target (not my focus or current target) either in a text display or progress bar.

    I.e say im doing ShannoxHM and im attacking the boss is there a way of having Ragefaces current target displayed?

    I know i can do a dynamic group and have a progress bar set to group/clone for a specific debuff etc but is there a way of achieving it without scanning for debuffs?

    Bit like how Unitframe mods such as SUF can display target of target or target of focus.

    Hope that makes sense and sorry to Bathory13 for adding to your thread.

    #3 Sep 02, 2011 at 05:07 UTC - 0 likes

    I'm not a lua expert but according to wowprogramming.com's reference (scroll down to "type: unitID") you can fetch any unitID's target simply by appending "target" to it. Rageface presumably has a bossN id so you'd want to use a custom display for returning eg boss2target, however that actually looks in lua code. For knowing when your target is targeting you, a custom trigger would have the logic: if targettarget = player then return true; again whatever that actually looks like in lua. I'm sure a cuddly programmer will be along to make that make sense soon :)

    #4 Sep 03, 2011 at 08:35 UTC - 0 likes
    Quote from Bathory13: Go

    Hello,

    I've been trying to set up a warning for when my target changes target to me (basically is targeting me), but can't even think of how to start with this. Any help would be greatly appreciated!

    Edit: Having this work for focus target would be just as good.

    I´m also looking for something similar, basically i´m trying to do a warning when a boss changes target to me. For example when Majordomo targets me for Leaping Flames or when Lich King targets me for Defile.

    #5 Sep 05, 2011 at 10:23 UTC - 0 likes

    This trigger highly depends on if UNIT_TARGET fires for bossN ids. If not, one has to use an "Update on every frame" trigger instead.

    Custom Trigger

    • Event based
    • Events: PLAYER_TARGET_CHANGED (if you are only interest if your target changes target) , PLAYER_FOCUS_CHANGED (if you are only interest if your focus-target changes target), UNIT_TARGET (if it should work if you aren't targeting the mob)

    Custom show function

    function()
      return UnitIsUnit("player", "COMPARE UNIT")
    end
    

    Custom hide function

    function()
      return not UnitIsUnit("player", "COMPARE UNIT")
    end
    

    "COMPARE UNIT":

    Can be "targettarget", "focustarget", "boss1target" ... "boss4target"

    Query boss target by boss name:

    • Custom show function
    function()
      if UnitName("boss1") == "BOSS NAME" then
        return UnitIsUnit("player", "boss1target")
      end
    
      if UnitName("boss2") == "BOSS NAME" then
        return UnitIsUnit("player", "boss2target")
      end
    
      if UnitName("boss3") == "BOSS NAME" then
        return UnitIsUnit("player", "boss3target")
      end
    
      if UnitName("boss4") == "BOSS NAME" then
        return UnitIsUnit("player", "boss4target")
      end
    
      return false
    end
    
    • Custom hide function
    function()
      if UnitName("boss1") == "BOSS NAME" then
        return not UnitIsUnit("player", "boss1target")
      end
    
      if UnitName("boss2") == "BOSS NAME" then
        return not UnitIsUnit("player", "boss2target")
      end
    
      if UnitName("boss3") == "BOSS NAME" then
        return not UnitIsUnit("player", "boss3target")
      end
    
      if UnitName("boss4") == "BOSS NAME" then
        return not UnitIsUnit("player", "boss4target")
      end
    
      return true
    end
    

    In case this trigger only works partially, switch to "Update on every frame" instead of event-based. You should add some load conditaions to this trigger! ;)

    EDIT: This might not work for Rageface, but listening to event "UNIT_THREAT_SITUATION_UPDATE" might work, needs testing though.

    If listening to both "UNIT_THREAT_SITUATION_UPDATE", "UNIT_TARGET" does not work though, than using an OnUpdate trigger is sadly the only solution.

    Last edited Sep 05, 2011 by CommanderSirow
    #6 Sep 09, 2011 at 16:41 UTC - 0 likes

    I'm looking for a way to be notified if I'm targeted by the Molten Elementals from Ragnaros HM fight. My knowledge in coding and LUA language is not good enough for me to do it by myself. I've looked around the internet and found nothing.

    So if anyone could help me out with this one it would be really appreciated.

    Thanks in advance.

    #7 Sep 09, 2011 at 23:14 UTC - 0 likes

    I don't think they have a bossN id associated with them. So you either have to target/focus them or one of your raidmembers.

    In the first case, the aboe triggers should work. In the later case this one:

    function()
      if UnitInRaid("player") then
       for id = 1, GetNumRaidMembers() do
          return UnitIsUnit("player", string.format("raid%dtarget", id))
        end
      end
    end
    

    I really would not recommend using this trigger as this will scan every raidmembers everytime the trigger gets evaluated, which would be quite a performance hog.

    Due to game balance (pvp mainly I guess) there is no easy/fail-safe way to detect if someone (that you aren't aware of, eg. don't have targeted) is targeting you. :(

    The "best" way (pve) to find out if a(n unknown) mob is targeting is basically listening to aggro gains. (Which of course only works if you don't already have aggro AND target change is due to aggro and not some boss-mechanic) *sad-face*

    Last edited Sep 09, 2011 by CommanderSirow
  • 7 posts

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