public static bool IsValid(Dynel dynel) { if (dynel == null) { return(false); } return(AllDynels.Any(x => x.Pointer == dynel.Pointer && x.Identity == dynel.Identity && dynel.VehiclePointer != IntPtr.Zero)); }
public void Attack(Dynel target, bool attackWithPets = true) { if (target.GetStat(Stat.Health) == 0) { return; } Attack(target.Identity); if (attackWithPets && Pets.Length > 0) { Pets.Attack(target.Identity); } }
internal static void Update() { try { while (_queuedDynelSpawns.Count > 0) { Dynel dynel = _queuedDynelSpawns.Dequeue(); DynelSpawned?.Invoke(null, dynel); } } catch (Exception e) { Chat.WriteLine($"This shouldn't happen pls report (DynelManager): {e.Message}"); } }
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 static bool Find(Identity identity, out Dynel dynel) { return((dynel = AllDynels.FirstOrDefault(x => x.Identity == identity)) != null); }
public static T GetDynel <T>(Identity identity) where T : Dynel { Dynel dynel = AllDynels.FirstOrDefault(x => x.Identity == identity); return(dynel == null ? null : dynel.Cast <T>()); }
public static T Cast <T>(this Dynel dynel) where T : Dynel { return((T)Activator.CreateInstance(typeof(T), dynel.Pointer)); }
public Corpse(Dynel dynel) : base(dynel.Pointer) { }
public bool UseOn(Dynel target) { return(UseOn(target.Identity)); }
public SimpleChar(Dynel dynel) : base(dynel.Pointer) { }
public bool IsDynelInRange(Dynel target) { return(WeaponHolder_t.IsDynelInWeaponRange(_pWeaponHolder, _pWeaponUnk, target.Pointer) == 0x01); }
internal WeaponItem(Dynel dynel) : base(dynel.Pointer) { }
public static void Open(Dynel target) { Open(target.Identity); }
public SimpleItem(Dynel dynel) : base(dynel.Pointer) { }