Not getting auras for NPCs menu

User Tag List

Results 1 to 2 of 2
  1. #1
    ejt's Avatar Contributor
    Reputation
    209
    Join Date
    Mar 2008
    Posts
    166
    Thanks G/R
    3/111
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Not getting auras for NPCs

    Hey,

    I've been stuck for a while now and posting to see if anyone have a solution.

    I'm trying to get auras for units and its working great for players but it will not work for NPCs...

    My function for getting auras:

    Code:
    std::vector<Aura> WoWUnit::GetAuras()
    {
    	std::vector<Aura> retval;
    
    	int32 count = Read<int32>(UnitAuraCount);
    	int32 first = Read<int32>(UnitAuraFirst);
    	uint64 table = Read<uint64>(UnitAuraTable);
    
    	if (count == -1)
    		count = first;
    
    	for (int32 i = 0; i < count; ++i)
    	{
    		Aura aura = ReadRelative<Aura>(table + (sizeof(Aura) * i));
    		
    		if (aura.SpellId > 0)
    			retval.push_back(aura);
    	}
    
    	return retval;
    }
    Aura structure

    Code:
    struct Aura
    {
    	uint32 unknown_00;
    	uint32 unknown_04;
    	uint32 unknown_08;
    	uint32 unknown_0C;
    	uint32 unknown_10;
    	uint32 unknown_14;
    	uint32 unknown_18;
    	uint32 unknown_1C;
    	uint32 unknown_20;
    	uint8 unknown_24;
    	uint8 unknown_25;
    	uint8 unknown_26;
    	uint8 unknown_27;
    	uint32 unknown_2C;
    	uint32 unknown_30;
    	uint32 unknown_34;
    	uint32 unknown_38;
    	uint32 unknown_3C;
    	uint32 unknown_40;
    	uint32 unknown_44;
    	uint32 unknown_48;
    	uint32 unknown_4C;
    	uint32 unknown_50;
    	uint32 unknown_54;
    	uint32 unknown_58;
    	uint32 unknown_5C;
    	uint32 unknown_60;
    	uint32 unknown_64;
    	WoWGUID OwnerGUID;
    	uint32 unknown_78;
    	uint32 unknown_7C;
    	uint32 unknown_80;
    	uint32 unknown_84;
    	uint32 SpellId;
    	uint32 unknown_8C;
    	/*
    	0x1/1 = Passive hidden?
    	0x3/3 = Hidden, incl Find Minerals passive
    	0x7/7 = buff? Swift Landing
    	0x9/9 = Talent? No, trinket/item passive also
    	0xB/11 = Passive buff?
    	0xF/15 = Buff?
    	0x11/17 = Debuff? Passive? Not removable?
    	0x14/20 = Debuff? dispellable?
    	0x1C/20 = Debuff? not dispellable?
    	0x1D/29 = PvP Rules Enabled (in pvp combat?)
    	*/
    	uint8 Flags;
    	uint8 Stack;
    	uint16 CasterLevel;
    	uint32 Duration;
    	uint32 unknown_98;
    	uint32 unknown_9C;
    	uint32 unknown_A0;
    	uint32 unknown_A4;
    };
    Offsets relative to unit

    Code:
    	UnitAuraFirst = 0x24D8,
    	UnitAuraCount = 0x1A58,
    	UnitAuraTable = 0x1A60,
    For NPCs, UnitAuraCount comes out as C1200000 and UnitAuraFirst is 0x8 but UnitAuraTable doesn't point to anything useful.

    IIRC there should be another aura list, one for staticly allocated and one for dynamicly allocated however I can't for the life of me find it with RE.

    Any help or guidance is appreciated.

    Not getting auras for NPCs
  2. #2
    ejt's Avatar Contributor
    Reputation
    209
    Join Date
    Mar 2008
    Posts
    166
    Thanks G/R
    3/111
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    I'm stupid, the answer was right in front of me this whole time. I forgot that the static list is contained within the unit structure, not outside (via pointer).

    Here's the updated code I use, just got it working so can probably be optimized. Posting here for future reference.

    Code:
    std::vector<Aura> WoWUnit::GetAuras()
    {
    	std::vector<Aura> retval;
    
    	uint64 table = GetAddress() + UnitAuraCount; // 1A58
    	int32 count = Read<int32>(UnitAuraFirst);
    	if (count == -1) // 24D8
    	{
    		table = Read<uint64>(UnitAuraTable); // 1A60
    		count = Read<int32>(UnitAuraCount);
    	}
    
    	for (int32 i = 0; i < count; ++i)
    	{
    		Aura aura = ReadRelative<Aura>(table + (sizeof(Aura) * i));
    		
    		if (aura.SpellId > 0)
    			retval.push_back(aura);
    	}
    
    	return retval;
    }
    Last edited by ejt; 08-30-2018 at 11:56 AM.

  3. Thanks pogob (1 members gave Thanks to ejt for this useful post)

Similar Threads

  1. Am not getting CC+ for offers.
    By david5150 in forum Report Bugs
    Replies: 4
    Last Post: 05-29-2014, 02:53 AM
  2. How do you not get banned for WoW in game trading?
    By DragonfireEX402 in forum World of Warcraft General
    Replies: 4
    Last Post: 07-08-2013, 12:37 AM
  3. How do I NOT get queued for WG when botting?
    By crixu in forum WoW UI, Macros and Talent Specs
    Replies: 1
    Last Post: 02-08-2010, 05:08 AM
  4. Replies: 20
    Last Post: 01-10-2008, 08:07 PM
  5. how to not get banned for stealing gold from scammed accounts
    By mara99 in forum WoW Scam Prevention
    Replies: 8
    Last Post: 10-22-2007, 12:45 PM
All times are GMT -5. The time now is 11:31 AM. 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