Detect if local player is in an encounter? menu

User Tag List

Results 1 to 3 of 3
  1. #1
    jnco's Avatar Member
    Reputation
    3
    Join Date
    Jun 2022
    Posts
    7
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Detect if local player is in an encounter?

    Has anyone seen a flag or function that might detect if the local player is in an encounter?

    Addons like WeakAuras are subscribing to combat log events - internally though I imagine I'd have to continuously loop through the combat log and that feels like it might decrease performance.

    edit: i'm dumb, there's a script function
    Last edited by jnco; 06-02-2023 at 12:13 PM. Reason: i'm stupid

    Detect if local player is in an encounter?
  2. #2
    _chase's Avatar Established Member
    Reputation
    95
    Join Date
    Dec 2019
    Posts
    58
    Thanks G/R
    17/49
    Trade Feedback
    0 (0%)
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    ENCOUNTER_START - Wowpedia - Your wiki guide to the World of Warcraft

    I just searched for ENCOUNTER_START string constant and found this.
    I imagine something here is a flag for being in encounter. This is just from some revision I have up rn, do the string search in the actual revision you're using

    Code:
    __int64 __fastcall sub_141408740(unsigned int *a1, const char *a2)
    {
      __int64 result; // rax
      bool v5; // si
      unsigned __int32 v6; // eax
      const char *v7; // r9
      unsigned int v8; // [rsp+20h] [rbp-1028h]
      unsigned int v9; // [rsp+28h] [rbp-1020h]
      unsigned __int32 v10; // [rsp+30h] [rbp-1018h]
      int v11; // [rsp+38h] [rbp-1010h]
      char v12[4096]; // [rsp+40h] [rbp-1008h] BYREF
    
      result = sub_1415E6380(1i64);
      v5 = (_DWORD)result != 0;
      if ( (_DWORD)result )
      {
        v6 = objMgr::MapId();
        v7 = byte_142261CFA;
        v11 = 11;
        v10 = v6;
        if ( a2 )
          v7 = a2;
        v8 = a1[9];
        v9 = a1[10];
        sub_140227BE0(v12, "ENCOUNTER_START,%d,\"%s\",%d,%d,%d,%d", a1[8], v7, v8, v9, v10, v11);
        if ( v5 )
          sub_1415DEBE0(v12);
        return sub_141409960(a1 + 12);
      }
      return result;
    }

  3. #3
    Glitt's Avatar Active Member CoreCoins Purchaser
    Reputation
    38
    Join Date
    Dec 2022
    Posts
    49
    Thanks G/R
    8/15
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by jnco View Post
    Has anyone seen a flag or function that might detect if the local player is in an encounter?

    Addons like WeakAuras are subscribing to combat log events - internally though I imagine I'd have to continuously loop through the combat log and that feels like it might decrease performance.

    edit: i'm dumb, there's a script function
    Glad you found what you needed. In case you need more than just a yes/no on combat you can use this one it returns levels of threat for the units specified. _chase has the solution that you would need for combat where you might not be in the same party or targeting, but for 90 percent of the time this works pretty nice.

    status = UnitThreatSituation("unit"[, "otherunit"])

Similar Threads

  1. 2.4.3 Detect if the player is moving in the dungeon
    By citrot in forum WoW UI, Macros and Talent Specs
    Replies: 0
    Last Post: 09-25-2017, 06:28 AM
  2. How to check if a unit is in line of sight
    By klee946 in forum WoW Memory Editing
    Replies: 6
    Last Post: 08-01-2017, 06:56 PM
  3. Replies: 5
    Last Post: 02-24-2013, 03:29 PM
  4. [Request] Macro to check if crafting/action is in progress
    By marina_v1 in forum WoW UI, Macros and Talent Specs
    Replies: 5
    Last Post: 12-06-2012, 07:47 AM
  5. How to detect if a spell is usable?
    By phthegreat in forum WoW Memory Editing
    Replies: 4
    Last Post: 06-23-2010, 11:16 AM
All times are GMT -5. The time now is 10:16 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search