[Question]Getting Unit Aura (Buff) Count menu

User Tag List

Results 1 to 8 of 8
  1. #1
    homer91's Avatar Active Member CoreCoins Purchaser
    Reputation
    79
    Join Date
    Oct 2008
    Posts
    259
    Thanks G/R
    59/7
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Question]Getting Unit Aura (Buff) Count

    Hello all.
    I would like to get the currently active buffs on a Unit.

    CGUnit_C__GetAuraCount would be the most obvious place to search, so I did.

    (This is from 3.3.5 12340)
    Code:
    004F8850  /$  8B81 D00D0000 MOV EAX,DWORD PTR DS:[ECX+0DD0]  ; = AreaCount1
    004F8856  |.  83F8 FF       CMP EAX,-1
    004F8859  |.  75 06         JNE SHORT 004F8861
    004F885B  |.  8B81 540C0000 MOV EAX,DWORD PTR DS:[ECX+0C54]  ; = AreaCount2
    004F8861  \>  C3            RETN
    So there seems to be two variable for aura numbers.
    But I don't think this is what I'm looking for.

    AreaCount1 is not the current count. It seems to count how many different auras were active on the given unit. (max)
    AreaCount2 is always 0 for me. I read it that it's the "overflow" counter, which is pretty unclear tbh.


    The question is : Is the number of auras even stored somewhere, or I'll have to always iterate trough the valid auras?
    Last edited by homer91; 11-20-2012 at 05:32 PM. Reason: moar info for the future =D

    [Question]Getting Unit Aura (Buff) Count
  2. #2
    TOM_RUS's Avatar Legendary
    Reputation
    914
    Join Date
    May 2008
    Posts
    699
    Thanks G/R
    0/52
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    No idea what you talking about, but that's what CGUnit_C::GetAuraCount does:

    Code:
    int __thiscall CGUnit_C::GetAuraCount(int this)
    {
      int result; // eax@1
    
      result = *(this + 4184);
      if ( result == -1 )
        result = *(this + 3420);
      return result;
    }

  3. #3
    homer91's Avatar Active Member CoreCoins Purchaser
    Reputation
    79
    Join Date
    Oct 2008
    Posts
    259
    Thanks G/R
    59/7
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I want to read the given unit's currently active auras number. (Like if Hogger has 2 buffs then return 2.)
    My question was, is there any address that I can read that number from, OR I have to iterate trought the auraTable and count the auras manually?
    Which I do now, but if there is a counter somewhere In wow's memory, I would use that instead.

    I guess result should hold that value I'm talking about but it's not, It returns higher numbers than my actuall aura number is.

    Like : I buff the npc then it returns me 1. When that buff fades, expires, it still remaining 1 it wont change back to 0, hence it's not what I need.
    Last edited by homer91; 11-20-2012 at 08:35 AM. Reason: boo

  4. #4
    TOM_RUS's Avatar Legendary
    Reputation
    914
    Join Date
    May 2008
    Posts
    699
    Thanks G/R
    0/52
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by homer91 View Post
    Like : I buff the npc then it returns me 1. When that buff fades, expires, it still remaining 1 it wont change back to 0, since it's not what I need.
    That's weird, are you sure about this?

  5. #5
    homer91's Avatar Active Member CoreCoins Purchaser
    Reputation
    79
    Join Date
    Oct 2008
    Posts
    259
    Thanks G/R
    59/7
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes I am, and it sure drives me crazy. I just don't understand the logic behind it if it's intended to return these values, instead of the currently active ones.
    Seems like the expired buffs staying in memory, but their spellID beeing set to 0.

  6. #6
    Empted's Avatar Contributor
    Reputation
    83
    Join Date
    Aug 2011
    Posts
    117
    Thanks G/R
    0/5
    Trade Feedback
    2 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by homer91 View Post
    Hello all.
    I would like to get the currently active buffs on a Unit.

    CGUnit_C__GetAuraCount would be the most obvious place to search, so I did.

    (This is from 3.3.5 12340)
    Code:
    004F8850  /$  8B81 D00D0000 MOV EAX,DWORD PTR DS:[ECX+0DD0]  ; = AreaCount1
    004F8856  |.  83F8 FF       CMP EAX,-1
    004F8859  |.  75 06         JNE SHORT 004F8861
    004F885B  |.  8B81 540C0000 MOV EAX,DWORD PTR DS:[ECX+0C54]  ; = AreaCount2
    004F8861  \>  C3            RETN
    So there seems to be two variable for aura numbers.
    But I don't think this is what I'm looking for.

    AreaCount1 is not the current count. It seems to count how many different auras were active on the given unit. (max)
    AreaCount2 is always 0 for me. I read it that it's the "overflow" counter, which is pretty unclear tbh.


    The question is : Is the number of auras even stored somewhere, or I'll have to always iterate trough the valid auras?
    I noticed that aura2 count becoming used after any PvP activity (my bot bugged after gank as I didn't implement second count, probably any other player buffs/debuffs switch to second one). Don't know more details, but while my func does the same logic as GetUnitAuras function does it works just fine.
    Last edited by Empted; 11-21-2012 at 05:21 AM.

  7. Thanks homer91 (1 members gave Thanks to Empted for this useful post)
  8. #7
    homer91's Avatar Active Member CoreCoins Purchaser
    Reputation
    79
    Join Date
    Oct 2008
    Posts
    259
    Thanks G/R
    59/7
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is it possible that the trinitycore server not sending me the right packet to update aura counts? Or is it the client's work and has nothing to do with the server?

  9. #8
    TOM_RUS's Avatar Legendary
    Reputation
    914
    Join Date
    May 2008
    Posts
    699
    Thanks G/R
    0/52
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by homer91 View Post
    Is it possible that the trinitycore server not sending me the right packet to update aura counts? Or is it the client's work and has nothing to do with the server?
    Just try on live server and see if you have same issue? And yes, aura remove is handled server side (at least it was in wotlk).
    Last edited by TOM_RUS; 11-25-2012 at 03:48 PM.

  10. Thanks homer91 (1 members gave Thanks to TOM_RUS for this useful post)

Similar Threads

  1. Replies: 6
    Last Post: 03-26-2011, 02:30 AM
  2. [How to] Get free "big" Buffs before farming
    By NecroNz in forum World of Warcraft Guides
    Replies: 2
    Last Post: 02-02-2008, 08:39 PM
  3. [Question] Getting Random Loot Out Of A Bag...
    By Bumbo in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 12-16-2007, 11:28 PM
  4. [Question] Getting rid of impassable terrain
    By pieliker in forum WoW ME Questions and Requests
    Replies: 2
    Last Post: 10-28-2007, 06:19 AM
  5. [Question] Getting errors since the last patch.
    By adonai1 in forum WoW ME Questions and Requests
    Replies: 2
    Last Post: 10-13-2007, 03:24 PM
All times are GMT -5. The time now is 08:12 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search