Apexx 60 Posted August 26, 2017 Share Posted August 26, 2017 Hi, I was curious if there is a way to check if my current target is humanoid and has a weapon? Thanks! Link to comment https://wrobot.eu/forums/topic/6878-check-if-target-has-a-weapon/ Share on other sites More sharing options...
reapler 154 Posted August 26, 2017 Share Posted August 26, 2017 Hello, i think your goal is to check whether you can disarm? Link to comment https://wrobot.eu/forums/topic/6878-check-if-target-has-a-weapon/#findComment-31152 Share on other sites More sharing options...
Apexx 60 Posted August 26, 2017 Author Share Posted August 26, 2017 That is correct. Link to comment https://wrobot.eu/forums/topic/6878-check-if-target-has-a-weapon/#findComment-31153 Share on other sites More sharing options...
reapler 154 Posted August 26, 2017 Share Posted August 26, 2017 Well, you can use these methods to check your unit: /// <summary> /// Used to get the main hand weapon of an unit. /// </summary> /// <remarks>Using 3.3.5a(12340) offsets.</remarks> /// <param name="unit">The unit.</param> public int MainHandId(WoWUnit unit) { if (unit.PlayerControlled) return wManager.Wow.Memory.WowMemory.Memory.ReadInt32(unit.GetDescriptorAddress(0x4E4)); return wManager.Wow.Memory.WowMemory.Memory.ReadInt32(unit.GetDescriptorAddress(0xE0)); } public bool IsDisarmed(WoWUnit unit) { return unit.UnitFlags.HasFlag(UnitFlags.Disarmed); } public bool IsHumanoid(WoWUnit unit) { return unit.CreatureTypeTarget == "Humanoid"; } As you can see you need for the main hand id different offsets, which are for wotlk(maybe it works for other expansions). Please note that the id will still be returned for player characters even when shapeshifted or disarmed. If a npc / player doesn't carry a weapon, it will be zero. I think it should suffice to build a properly check for disarm. Apexx 1 Link to comment https://wrobot.eu/forums/topic/6878-check-if-target-has-a-weapon/#findComment-31158 Share on other sites More sharing options...
Apexx 60 Posted August 26, 2017 Author Share Posted August 26, 2017 Nice! Thank you, @reapler. I will give it a try. Link to comment https://wrobot.eu/forums/topic/6878-check-if-target-has-a-weapon/#findComment-31159 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now