WeakAuras

Mob Targeting me

  • 2 posts
    #1 Oct 28, 2011 at 01:11 UTC - 0 likes

    Is there an option or maybe some custom trigger, to show an aura, if a mob (or maybe my focus target) is targeting me (even if i dont have aggro)? Threat status doesnt seemn to work here:(

    Thanks in advance!

    Last edited Oct 28, 2011 by ZyPH
    #2 Oct 28, 2011 at 17:16 UTC - 0 likes
    • Type: Custom, Event
    • Events: UNIT_TARGET
    • Code:
    function(unitId) 
      if UnitCanAttack(unitId, "player") and UnitIsUnit("player", unitId .. "target") then
        return true
      end
    end
    
    • Hide: Timed

    Alternative:

    • Show code:
    function(unitId) 
      if UnitCanAttack(unitId, "player") and UnitIsUnit("player", unitId .. "target") then
        WA_IS_TARGETING = WA_IS_TARGETING or {};
        WA_IS_TARGETING[unitId] = UnitGUID(unitId);
        return true
      end
    end
    
    • Hide code:
    function(unitId) 
      if not UnitCanAttack(unitId, "player") and WA_IS_TARGETING[unitId] then
        WA_IS_TARGETING[unitId] = nil;
      end
    
      if not UnitIsUnit("player", unitId .. "target") and WA_IS_TARGETING[unitId] then
        WA_IS_TARGETING[unitId] = nil;
      end
    
      local problem = false;
      for uid, guid in pairs(WA_IS_TARGETING) do
        if UnitGUID(uid) ~= guid then
          WA_IS_TARGETING[unitId] = nil;
        else
          problem = true;
        end
      end
    
      return problem;
    end
    

    Note: Works only for target, focus, maybe raidmember targets (basically, every unit that fires UNIT_TARGET).

  • 2 posts

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