-
[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
-
Legendary
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;
}
-
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
-
Legendary
Originally Posted by
homer91
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?
-
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.
-
Contributor
Originally Posted by
homer91
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.
-
Post Thanks / Like - 1 Thanks
homer91 (1 members gave Thanks to Empted for this useful 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?
-
Legendary
Originally Posted by
homer91
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.
-
Post Thanks / Like - 1 Thanks
homer91 (1 members gave Thanks to TOM_RUS for this useful post)