Esempio n. 1
0
        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));
        }
Esempio n. 2
0
        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);
            }
        }
Esempio n. 3
0
 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}");
     }
 }
Esempio n. 4
0
        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);
            }
        }
Esempio n. 5
0
 public static bool Find(Identity identity, out Dynel dynel)
 {
     return((dynel = AllDynels.FirstOrDefault(x => x.Identity == identity)) != null);
 }
Esempio n. 6
0
        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>());
        }
Esempio n. 7
0
 public static T Cast <T>(this Dynel dynel) where T : Dynel
 {
     return((T)Activator.CreateInstance(typeof(T), dynel.Pointer));
 }
Esempio n. 8
0
 public Corpse(Dynel dynel) : base(dynel.Pointer)
 {
 }
Esempio n. 9
0
 public bool UseOn(Dynel target)
 {
     return(UseOn(target.Identity));
 }
Esempio n. 10
0
 public SimpleChar(Dynel dynel) : base(dynel.Pointer)
 {
 }
Esempio n. 11
0
 public bool IsDynelInRange(Dynel target)
 {
     return(WeaponHolder_t.IsDynelInWeaponRange(_pWeaponHolder, _pWeaponUnk, target.Pointer) == 0x01);
 }
Esempio n. 12
0
 internal WeaponItem(Dynel dynel) : base(dynel.Pointer)
 {
 }
Esempio n. 13
0
 public static void Open(Dynel target)
 {
     Open(target.Identity);
 }
Esempio n. 14
0
 public SimpleItem(Dynel dynel) : base(dynel.Pointer)
 {
 }