Beispiel #1
0
 private void addSphere(Vector2 position, float radius)
 {
     gfx = new SphereComponent(4)
     {
         RelativeTranslation = new Vector3(position.X, position.Y, 0),
         // Because Scale is the diameter, the radius need to be doubled
         RelativeScale = new Vector3(radius * 2, radius * 2, radius * 2),
     };
     AddComponent(gfx);
 }
Beispiel #2
0
 private void AddSphere(float radius)
 {
     gfx = new SphereComponent(4)
     {
         Name = "Ball",
         // Because Scale is the diameter, the radius need to be doubled
         RelativeScale = new Vector3(radius * 2, radius * 2, radius * 2),
         Material      = new Material
         {
             Color            = new Vector4(0.55f, 0.20f, 0.20f, 1),
             Ambient          = 0.3f,
             Shininess        = 32.0f,
             SpecularStrength = 0.5f,
             CastShadow       = true,
         },
     };
     AddComponent(gfx);
 }
        public static bool GetPoint(GameObject Target, Vector3 StartPos, double MaxRange, out Vector3 Point)
        {
            Point = Vector3.zero;
            if (!G.Settings.AimbotOptions.ExpandHitboxes)
            {
                return(false);
            }
            if (Target == null)
            {
                return(false);
            }

            SphereComponent Component = Target.GetComponent <SphereComponent>();

            // big ponch range
            if (Vector3.Distance(Target.transform.position, StartPos) <= 15.5f)
            {
                Point = Player.player.transform.position;
                return(true);
            }

            Vector3[] verts = Component.Sphere.GetComponent <MeshCollider>().sharedMesh.vertices;
            foreach (Vector3 vertex in verts)
            {
                Vector3 tVertex = Component.Sphere.transform.TransformPoint(vertex);

                float Distance = (float)Vector3.Distance(StartPos, tVertex);
                if (Distance > MaxRange)
                {
                    continue;
                }

                if (Physics.Raycast(StartPos, Vector3.Normalize(tVertex - StartPos), Distance, RayMasks.DAMAGE_CLIENT))
                {
                    continue;
                }
                Point = tVertex;
                return(true);
            }

            return(false);
        }
        public static bool SilAimRaycast(out RaycastInfo info)
        {
            ItemGunAsset currentGun = Player.player.equipment.asset as ItemGunAsset;
            float        Range      = currentGun?.range ?? 15.5f;
            Transform    t          = (Player.player.look.perspective == EPlayerPerspective.FIRST ? Player.player.look.aim : G.MainCamera.transform);

            info = OriginalRaycast(new Ray(t.position, t.forward), Range, RayMasks.DAMAGE_CLIENT);
            Player aimplayer = null;
            int?   fov       = null;

            if (G.Settings.AimbotOptions.SilentAimLimitFOV)
            {
                fov = G.Settings.AimbotOptions.SilentAimFOV;
            }
            if (T.GetNearestPlayer(fov, (int)T.GetGunDistance()))
            {
                aimplayer = T.GetNearestPlayer();
            }
            else
            {
                return(false);
            }

            if (G.Settings.AimbotOptions.HitChance != 100)
            {
                if (!(T.Random.Next(0, 100) < G.Settings.AimbotOptions.HitChance))
                {
                    return(false);
                }
            }

            SphereComponent Component = aimplayer.gameObject.GetComponent <SphereComponent>();

            if (!Component)
            {
                aimplayer.gameObject.AddComponent <SphereComponent>();
            }
            Component.LastHit = Time.realtimeSinceStartup;

            Vector3 point;

            if (T.VisibleFromCamera(T.GetLimbPosition(aimplayer.gameObject.transform, "Skull")))
            {
                point = T.GetLimbPosition(aimplayer.gameObject.transform, "Skull");
            }
            else if (T.VisibleFromCamera(T.GetLimbPosition(aimplayer.gameObject.transform, "Spine")))
            {
                point = T.GetLimbPosition(aimplayer.gameObject.transform, "Spine");
            }
            else if (T.VisibleFromCamera(T.GetLimbPosition(aimplayer.gameObject.transform, "Right_Hip")))
            {
                point = T.GetLimbPosition(aimplayer.gameObject.transform, "Right_Hip");
            }
            else if (T.VisibleFromCamera(T.GetLimbPosition(aimplayer.gameObject.transform, "Left_Foot")))
            {
                point = T.GetLimbPosition(aimplayer.gameObject.transform, "Left_Foot");
            }
            else if (T.VisibleFromCamera(T.GetLimbPosition(aimplayer.gameObject.transform, "Right_Leg")))
            {
                point = T.GetLimbPosition(aimplayer.gameObject.transform, "Right_Leg");
            }
            else if (!GetPoint(aimplayer.gameObject, Player.player.look.aim.position, Range, out point))
            {
                return(false);
            }


            ELimb lomb;

            if (G.Settings.AimbotOptions.TargetL == TargetLimb1.RANDOM)
            {
                lomb = T.GetLimb(TargetLimb.RANDOM);
            }
            else
            {
                lomb = (ELimb)G.Settings.AimbotOptions.TargetL;
            }
            if (G.Settings.TargetLimb.TryGetValue(aimplayer.channel.owner.playerID.steamID.m_SteamID, out TargetLimb limb))
            {
                if (limb != TargetLimb.GLOBAL)
                {
                    lomb = T.GetLimb(limb);
                }
            }


            info = new RaycastInfo(aimplayer.transform)
            {
                point     = point,
                direction = Player.player.look.aim.forward,
                limb      = lomb,
                material  = EPhysicsMaterial.NONE,
                player    = aimplayer,
            };
            return(true);
        }