-
Contributor
Avid Ailurophile
-
Post Thanks / Like - 4 Thanks
-
Member
-
Member
Thanks.
PS How check can attack from flags like lua api "UnitCanAttack" ?
-
Contributor
Avid Ailurophile
Originally Posted by
ermite66
Thanks.
PS How check can attack from flags like lua api "UnitCanAttack" ?
It's a bit more than "can or can not" attack. While some scripts are a true/false (1/0) value, Others require you to check multiple things ie : unit flags, dynamic flags, faction template etc.
The first set of unit flags themselves can be found at (uint)[UnitBase + 0xD5F0]. Out of the first set of flags there's some of interest.
Code:
[Flags]
public enum Flags1 : uint
{
NoAttack = 0x80,
ImmunePC = 0x100,
ImmuneNPC = 0x200,
NoAttack2 = 0x10000,
Uninteractible = 0x2000000,
Immune = 0x80000000
}
A simple check if any of these are true (ugly, but it works) : var result = (UnitFlag1 & (Flags1.NoAttack | Flags1.NoAttack2 | Flags1.Immune | Flags1.ImmunePC | Flags1.ImmuneNPC | Flags1.Uninteractible)) != 0;
Unit dynamic flags are found at UnitBase + 0xDC, and to check if tapped: (DynamicFlag & 0x10) != 0; ("is lootable" being 0x4)
"May all your bacon burn"
-
Post Thanks / Like - 1 Thanks
ermite66 (1 members gave Thanks to Razzue for this useful post)
-
Member
Im reading corectly ? Flags are changed on combat, or if unit dead, ect, but for innactive enemy always Flag1 = 0 , Flag2 = 2048 , Flag3 = 0 , DynamiFlag = 0
Снимок.JPG
PSS for lootable unit dynamic = 0x4
what size of flag to read? 4 , 16 , 32 or 64 bit ?
Last edited by ermite66; 10-16-2022 at 10:55 AM.
-
Member
Originally Posted by
ermite66
Im reading corectly ? Flags are changed on combat, or if unit dead, ect, but for innactive enemy always Flag1 = 0 , Flag2 = 2048 , Flag3 = 0 , DynamiFlag = 0
Снимок.JPG
PSS for lootable unit dynamic = 0x4
what size of flag to read? 4 , 16 , 32 or 64 bit ?
regardless of size, all 4 flags are the same for units that i can attack and for friendly ones ...
-
Contributor
Avid Ailurophile
-
Member
Originally Posted by
Razzue
Capture.JPG
Working as expected on my end.
As I said, there's MORE to it than just flag checking. If you want to learn how the script works you will need to reverse the game, and script yourself
I think its compare factions with faction.dbc and factiontemplate.dbc ... but i dontno how extract this from wrath classic ... for navigation i use trinity core algorhytm for mob movement and 335a-12340 mmaps, it causes inconvenience =) but faction.dbc and factiontemplate.dbc doesnt match with wrath factions.
PS best way write internal hack ... but i have DigiCert for kernel ...
Last edited by ermite66; 10-16-2022 at 11:53 AM.
-
Established Member
const uint64_t UnitCanAttack = 0x13C8D50; // bool (CGObject* player, CGUnit* unit, bool isPet)
-
Member
How get zone id or location id from Zone_ID = 0x301FB78; ? I try find this on 335a 12340 dbc e.g. 1454 stormwind , and not found anithing ... or how extract wrath classic mpq's ?
-
Member
Originally Posted by
oiramario
const uint64_t UnitCanAttack = 0x13C8D50; // bool (CGObject* player, CGUnit* unit, bool isPet)
im externaly =)
-
-
Member
Razzue, How u use Offsets::Object_Manager::Zone_ID ? It can be conver to mapID (0 - Azeroth, 571 - Northrend , or zoneID for dange ), eg - in stormwind it return 1453 , in elvunforest 1429, need convert to location for continent , contetent is azeroth , id must be 0 , it may be convert by dbc, but dbc from 335a 12340 and mmaps too.
PS UnitCanAttack easy make by FactionTemplate.dbc , need check hostile fraction and location & SanctumFlag (for cur zone) == 0 , can see how it doing trinity core.
Last edited by ermite66; 10-17-2022 at 06:16 AM.
-
Contributor
Avid Ailurophile
Originally Posted by
ermite66
Razzue, How u use Offsets::Object_Manager::Zone_ID ? It can be conver to mapID (0 - Azeroth, 571 - Northrend , or zoneID for dange ), eg - in stormwind it return 1453 , in elvunforest 1429, need convert to location for continent , contetent is azeroth , id must be 0 , it may be convert by dbc, but dbc from 335a 12340 and mmaps too.
PS UnitCanAttack easy make by FactionTemplate.dbc , need check hostile fraction and location & SanctumFlag (for cur zone) == 0 , can see how it doing trinity core.
I am well aware how it works xD as stated before I have a fully function external bot that runs exactly as expected 🤣 the whole point is for YOU to do some legwork instead of asking to be spoonfeed.
Zone ID = WoW.tools | Database browser[1]=1453
Map ID is (int)[[Game + ObjectManager] + x] (works with map DB2), area id's are (int)[Game + ObjectManager + x] and works with area table DB2. I'm not telling you the offsets, you can find them via CE/ReClass/Ida just fine.
Capture.JPG
Last edited by Razzue; 10-17-2022 at 06:40 AM.
"May all your bacon burn"
-
Member
Originally Posted by
Razzue
I am well aware how it works xD as stated before I have a fully function external bot that runs exactly as expected 🤣 the whole point is for YOU to do some legwork instead of asking to be spoonfeed.
Zone ID =
WoW.tools | Database browser[1]=1453
Map ID is (int)[[Game + ObjectManager] + x] (works with map DB2), area id's are (int)[Game + ObjectManager + x] and works with area table DB2. I'm not telling you the offsets, you can find them via CE/ReClass/Ida just fine.
Capture.JPG
and return in stormwind : 1453 for zoneid , 1519 for mapid and 0 for areaid ? i think find this
PS hurried, only 1 offset is, which is returned 1519 for stormwind and others maps. It can already be used with the DBC to get the continent.
Last edited by ermite66; 10-17-2022 at 08:55 AM.