public bool IsInAttackRange(bool requireAllWeapons = false) { Dictionary <EquipSlot, WeaponItem> weapons = DynelManager.LocalPlayer.Weapons; if (weapons.Count > 0) { if (!requireAllWeapons) { return(weapons.Values.Any(x => x.IsDynelInRange(this))); } return(weapons.Values.Count(x => x.IsDynelInRange(this)) == weapons.Count); } else { IntPtr pWeaponHolder = DynelManager.LocalPlayer.pWeaponHolder; IntPtr dummyWeapon = WeaponHolder_t.GetDummyWeapon(pWeaponHolder, Stat.MartialArts); if (dummyWeapon == IntPtr.Zero) { return(false); } IntPtr pdummyWeaponUnk = *(IntPtr *)(dummyWeapon + 0xE4); return(WeaponHolder_t.IsDynelInWeaponRange(pWeaponHolder, pdummyWeaponUnk, Pointer) == 0x01); } }
private Dictionary <EquipSlot, WeaponItem> GetWeapons() { Dictionary <EquipSlot, WeaponItem> weapons = new Dictionary <EquipSlot, WeaponItem>(); IntPtr pWeaponHolder = (IntPtr)(*(MemStruct *)Pointer).WeaponHolder; if (pWeaponHolder == IntPtr.Zero) { return(weapons); } IntPtr right = WeaponHolder_t.GetWeapon(pWeaponHolder, EquipSlot.Weap_RightHand, 0); if (right != IntPtr.Zero) { weapons.Add(EquipSlot.Weap_RightHand, new WeaponItem(*(IntPtr *)(right + 0x14) + Offsets.RTTIDynamicCast.SimpleItem_t.n3Dynel_t, pWeaponHolder, right)); } IntPtr left = WeaponHolder_t.GetWeapon(pWeaponHolder, EquipSlot.Weap_LeftHand, 0); if (left != IntPtr.Zero) { weapons.Add(EquipSlot.Weap_LeftHand, new WeaponItem(*(IntPtr *)(left + 0x14) + Offsets.RTTIDynamicCast.SimpleItem_t.n3Dynel_t, pWeaponHolder, left)); } return(weapons); }
public unsafe bool IsInRange(Dynel target) { const EquipSlot MainHand = EquipSlot.Weap_RightHand; const EquipSlot OffHand = EquipSlot.Weap_LeftHand; Dictionary <EquipSlot, WeaponItem> weapons = DynelManager.LocalPlayer.Weapons; SpecialAttack specialAttack = this == Backstab ? SpecialAttack.SneakAttack : this; if (weapons.Count > 0) { if (weapons.ContainsKey(MainHand) && weapons[MainHand].SpecialAttacks.Contains(specialAttack)) { return(weapons[MainHand].IsDynelInRange(target)); } else if (weapons.ContainsKey(OffHand) && weapons[OffHand].SpecialAttacks.Contains(specialAttack)) { return(weapons[OffHand].IsDynelInRange(target)); } else { return(false); } } else { IntPtr pWeaponHolder = DynelManager.LocalPlayer.pWeaponHolder; IntPtr dummyWeapon = WeaponHolder_t.GetDummyWeapon(pWeaponHolder, this._stat); if (dummyWeapon == null) { return(false); } IntPtr pdummyWeaponUnk = *(IntPtr *)(dummyWeapon + 0xE4); return(WeaponHolder_t.IsDynelInWeaponRange(pWeaponHolder, pdummyWeaponUnk, target.Pointer) == 0x01); } }
public bool IsDynelInRange(Dynel target) { return(WeaponHolder_t.IsDynelInWeaponRange(_pWeaponHolder, _pWeaponUnk, target.Pointer) == 0x01); }