Jump to content

Recommended Posts

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.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...