-
Member
UnitFields (Mounted, Sitting, etc) Changed in MoP?
Hey guys,
Are all of the Unit and Item flags still the same for MoP? I am having an issue with Sitting and Mounted (and possibly others). Here is the list I am currently using:
Code:
[Flags]
public enum UnitFlags : uint
{
None = 0,
Sitting = 0x1,
Influenced = 0x4,
PlayerControlled = 0x8,
Totem = 0x10,
Preparation = 0x20,
PlusMob = 0x40,
NotAttackable = 0x100,
Looting = 0x400,
PetInCombat = 0x800,
PvPFlagged = 0x1000,
Silenced = 0x2000,
Pacified = 0x20000,
Stunned = 0x40000,
CanPerformAction_Mask1 = 0x60000,
Combat = 0x80000,
TaxiFlight = 0x100000,
Disarmed = 0x200000,
Confused = 0x400000,
Fleeing = 0x800000,
Possessed = 0x1000000,
NotSelectable = 0x2000000,
Skinnable = 0x4000000,
Mounted = 0x8000000,
Dazed = 0x20000000,
Sheathe = 0x40000000,
}
[Flags]
public enum UnitDynamicFlags
{
None = 0,
Lootable = 0x1,
TrackUnit = 0x2,
TaggedByOther = 0x4,
TaggedByMe = 0x8,
SpecialInfo = 0x10,
Dead = 0x20,
ReferAFriendLinked = 0x40,
IsTappedByAllThreatList = 0x80,
}
public bool IsSitting
{
get { return HasUnitFlag(GameFlags.UnitFlags.Sitting); }
}
internal bool HasUnitFlag(GameFlags.UnitFlags flag)
{
return UnitFlags[(int)flag];
}
private BitVector32 UnitFlags { get { return new BitVector32((int) GetDescriptor<uint>(Descriptors.WoWUnitFields.Flags)); } }
Thanks in advance for taking a look, I appreciate it. 
-Shadow
-
Active Member
I've been doing this to get offsets manually.
tip. CheatEngine will let you change the "range" it scans....set the start to = lp.baseaddress to reduce the # of results found. (any below ur player are probably not info on ur player. assumed*)
sit --> do byte scan for '1' ie. isSitting = True
stand up --> do byte scan for '0' ie. isSitting = false
keep doing this until you only have one address (which should be 'just a little ways' after .baseAddress). subtract that address from lp.base and you have the IsSitting offset. (note: that doesn't use UnitFields, which I haven't looked into yet, so this IS ASSUMING the issitting offset is relative to .baseaddr
when I did it
lp.base: 143DD000
lp.IsSitting 143E0A18
subtract and you get 3A18, so (assuming it's constant) Unit.BaseAddress + 3A18 = is sitting address (as byte)
about to test and make sure it works -- i haven't looked into unitfields yet, I'm pretty sure it's a pointer to more 'data about the object' but again i haven't looked into it yet --> IsSitting could* be relative to UnitFields, not .Base. or maybe both. going back to test now.
confirmed (only tested on LocalPlayer not others in world). works, but going from baseAddress is sloppy, from what I assume, unitFields is there for a reason. but this works.
...which means the offset i just gave you will require you to change your code and read from (.base + offset) not (.unitFields + offset) -- i hope you understand that. I'll look into UnitFieldsAddr some day soon.
Do some debugging yourself --> I thought* UnitFieldsAddress was constant? ie. for any PlayerObj UnitFields will point to ...lets say..5000 past your .baseaddress. IF that's true, you should able to display your unitfieldsaddr and then subtract it from 143E0A18 instead of subtracting .base, to make teh offset relative to UnitFields not Base. all theory as I haven't actually looked where UnitFields points, and if it's constant etc. i know jack about it.
edit: I didn't answer your question, but now you can figure out yourself? sry.
Last edited by abuckau907; 11-13-2012 at 02:24 AM.
-
Active Member
Originally Posted by
abuckau907
I've been doing this to get offsets manually.
tip. CheatEngine will let you change the "range" it scans....set the start to = lp.baseaddress to reduce the # of results found. (any below ur player are probably not info on ur player. assumed*)
sit --> do byte scan for '1' ie. isSitting = True
stand up --> do byte scan for '0' ie. isSitting = false
keep doing this until you only have one address (which should be 'just a little ways' after .baseAddress). subtract that address from lp.base and you have the IsSitting offset. (note: that doesn't use UnitFields, which I haven't looked into yet, so this IS ASSUMING the issitting offset is relative to .baseaddr
when I did it
lp.base: 143DD000
lp.IsSitting 143E0A18
subtract and you get 3A18, so (assuming it's constant) Unit.BaseAddress + 3A18 = is sitting address (as byte)
about to test and make sure it works -- i haven't looked into unitfields yet, I'm pretty sure it's a pointer to more 'data about the object' but again i haven't looked into it yet --> IsSitting could* be relative to UnitFields, not .Base. or maybe both. going back to test now.
confirmed (only tested on LocalPlayer not others in world). works, but going from baseAddress is sloppy, from what I assume, unitFields is there for a reason. but this works.
...which means the offset i just gave you will require you to change your code and read from (.base + offset) not (.unitFields + offset) -- i hope you understand that. I'll look into UnitFieldsAddr some day soon.
Do some debugging yourself --> I thought* UnitFieldsAddress was constant? ie. for any PlayerObj UnitFields will point to ...lets say..5000 past your .baseaddress. IF that's true, you should able to display your unitfieldsaddr and then subtract it from 143E0A18 instead of subtracting .base, to make teh offset relative to UnitFields not Base. all theory as I haven't actually looked where UnitFields points, and if it's constant etc. i know jack about it.
edit: I didn't answer your question, but now you can figure out yourself? sry.
You could also do a scan for "what writes to this address" and you will get the offset for unitfields easily
Sent from my GT-I9100 using Tapatalk 2
-
Post Thanks / Like - 1 Thanks
Hrap (1 members gave Thanks to Frosttall for this useful post)
-
Member
Hey guys,
Thanks for your suggestions I appreciate it. I poked around with CE and found that they moved these flags from the UnitFlags to a separate descriptor:
Code:
public bool IsMounted
{
get { return GetDescriptor<uint>(Descriptors.WoWUnitFields.MountDisplayID) > 0; }
}
public bool IsSitting
{
get { return GetDescriptor<bool>(Descriptors.WoWUnitFields.AnimTier); }
}