예제 #1
0
        // Token: 0x060002CC RID: 716 RVA: 0x0001C8E0 File Offset: 0x0001AAE0
        public static void PlayerFlight()
        {
            Player mainPlayer = OptimizationVariables.MainPlayer;
            bool   flag       = !MiscOptions.PlayerFlight;
            bool   flag2      = flag;

            if (flag2)
            {
                ItemCloudAsset itemCloudAsset = mainPlayer.equipment.asset as ItemCloudAsset;
                mainPlayer.movement.itemGravityMultiplier = ((itemCloudAsset != null) ? itemCloudAsset.gravity : 1f);
            }
            else
            {
                mainPlayer.movement.itemGravityMultiplier = 0f;
                float flightSpeedMultiplier = MiscOptions.FlightSpeedMultiplier;
                bool  flag3 = HotkeyUtilities.IsHotkeyHeld("_FlyUp");
                bool  flag4 = flag3;
                if (flag4)
                {
                    mainPlayer.transform.position += mainPlayer.transform.up / 5f * flightSpeedMultiplier;
                }
                bool flag5 = HotkeyUtilities.IsHotkeyHeld("_FlyDown");
                bool flag6 = flag5;
                if (flag6)
                {
                    mainPlayer.transform.position -= mainPlayer.transform.up / 5f * flightSpeedMultiplier;
                }
                bool flag7 = HotkeyUtilities.IsHotkeyHeld("_FlyLeft");
                bool flag8 = flag7;
                if (flag8)
                {
                    mainPlayer.transform.position -= mainPlayer.transform.right / 5f * flightSpeedMultiplier;
                }
                bool flag9  = HotkeyUtilities.IsHotkeyHeld("_FlyRight");
                bool flag10 = flag9;
                if (flag10)
                {
                    mainPlayer.transform.position += mainPlayer.transform.right / 5f * flightSpeedMultiplier;
                }
                bool flag11 = HotkeyUtilities.IsHotkeyHeld("_FlyForward");
                bool flag12 = flag11;
                if (flag12)
                {
                    mainPlayer.transform.position += mainPlayer.transform.forward / 5f * flightSpeedMultiplier;
                }
                bool flag13 = HotkeyUtilities.IsHotkeyHeld("_FlyBackward");
                bool flag14 = flag13;
                if (flag14)
                {
                    mainPlayer.transform.position -= mainPlayer.transform.forward / 5f * flightSpeedMultiplier;
                }
            }
        }
 // Token: 0x06000170 RID: 368 RVA: 0x00002B12 File Offset: 0x00000D12
 public static IEnumerator AimToObject()
 {
     for (;;)
     {
         bool flag  = !DrawUtilities.ShouldRun() || !AimbotOptions.Enabled;
         bool flag4 = flag;
         if (flag4)
         {
             yield return(new WaitForSeconds(0.1f));
         }
         else
         {
             bool flag2 = AimbotCoroutines.LockedObject != null && AimbotCoroutines.LockedObject.transform != null && ESPComponent.MainCamera != null;
             bool flag5 = flag2;
             if (flag5)
             {
                 bool flag3 = HotkeyUtilities.IsHotkeyHeld("_AimbotKey") || !AimbotOptions.OnKey;
                 bool flag6 = flag3;
                 if (flag6)
                 {
                     AimbotCoroutines.IsAiming = true;
                     bool smooth = AimbotOptions.Smooth;
                     bool flag7  = smooth;
                     if (flag7)
                     {
                         AimbotCoroutines.SmoothAim(AimbotCoroutines.LockedObject);
                     }
                     else
                     {
                         AimbotCoroutines.Aim(AimbotCoroutines.LockedObject);
                     }
                 }
                 else
                 {
                     AimbotCoroutines.IsAiming = false;
                 }
             }
             else
             {
                 AimbotCoroutines.IsAiming = false;
             }
             yield return(new WaitForEndOfFrame());
         }
     }
     yield break;
 }
    public static void VehicleFlight()
    {
        InteractableVehicle vehicle = OptimizationVariables.MainPlayer.movement.getVehicle();
        bool flag = vehicle == null;

        if (!flag)
        {
            Rigidbody component = vehicle.GetComponent <Rigidbody>();
            bool      flag2     = component == null;
            if (!flag2)
            {
                bool vehicleFly = MiscOptions.VehicleFly;
                if (vehicleFly)
                {
                    float num = MiscOptions.VehicleUseMaxSpeed ? (vehicle.asset.speedMax * Time.fixedDeltaTime) : (MiscOptions.SpeedMultiplier / 3f);
                    component.useGravity  = false;
                    component.isKinematic = true;
                    Transform transform = vehicle.transform;
                    bool      flag3     = HotkeyUtilities.IsHotkeyHeld("_VFStrafeUp");
                    if (flag3)
                    {
                        transform.position += new Vector3(0f, num * 0.65f, 0f);
                    }
                    bool flag4 = HotkeyUtilities.IsHotkeyHeld("_VFStrafeDown");
                    if (flag4)
                    {
                        transform.position -= new Vector3(0f, num * 0.65f, 0f);
                    }
                    bool flag5 = HotkeyUtilities.IsHotkeyHeld("_VFStrafeLeft");
                    if (flag5)
                    {
                        component.MovePosition(transform.position - transform.right * num);
                    }
                    bool flag6 = HotkeyUtilities.IsHotkeyHeld("_VFStrafeRight");
                    if (flag6)
                    {
                        component.MovePosition(transform.position + transform.right * num);
                    }
                    bool flag7 = HotkeyUtilities.IsHotkeyHeld("_VFMoveForward");
                    if (flag7)
                    {
                        component.MovePosition(transform.position + transform.forward * num);
                    }
                    bool flag8 = HotkeyUtilities.IsHotkeyHeld("_VFMoveBackward");
                    if (flag8)
                    {
                        component.MovePosition(transform.position - transform.forward * num);
                    }
                    bool flag9 = HotkeyUtilities.IsHotkeyHeld("_VFRotateRight");
                    if (flag9)
                    {
                        transform.Rotate(0f, 1f, 0f);
                    }
                    bool flag10 = HotkeyUtilities.IsHotkeyHeld("_VFRotateLeft");
                    if (flag10)
                    {
                        transform.Rotate(0f, -1f, 0f);
                    }
                    bool flag11 = HotkeyUtilities.IsHotkeyHeld("_VFRollLeft");
                    if (flag11)
                    {
                        transform.Rotate(0f, 0f, 2f);
                    }
                    bool flag12 = HotkeyUtilities.IsHotkeyHeld("_VFRollRight");
                    if (flag12)
                    {
                        transform.Rotate(0f, 0f, -2f);
                    }
                    bool flag13 = HotkeyUtilities.IsHotkeyHeld("_VFRotateUp");
                    if (flag13)
                    {
                        vehicle.transform.Rotate(-2f, 0f, 0f);
                    }
                    bool flag14 = HotkeyUtilities.IsHotkeyHeld("_VFRotateDown");
                    if (flag14)
                    {
                        vehicle.transform.Rotate(2f, 0f, 0f);
                    }
                }
                else
                {
                    component.useGravity  = true;
                    component.isKinematic = false;
                }
            }
        }
    }
예제 #4
0
        public void OV_ballistics()
        {
            Useable PlayerUse = OptimizationVariables.MainPlayer.equipment.useable;
            
            if (Provider.isServer)
            {
                OverrideUtilities.CallOriginal(PlayerUse);
                return;
            }
            
            if (Time.realtimeSinceStartup - PlayerLifeUI.hitmarkers[0].lastHit > PlayerUI.HIT_TIME)
            {
                PlayerLifeUI.hitmarkers[0].hitBuildImage.isVisible = false;
                PlayerLifeUI.hitmarkers[0].hitCriticalImage.isVisible = false;
                PlayerLifeUI.hitmarkers[0].hitEntitiyImage.isVisible = false;
            }

            ItemGunAsset PAsset = (ItemGunAsset)OptimizationVariables.MainPlayer.equipment.asset;
            PlayerLook Look = OptimizationVariables.MainPlayer.look;

            if (PAsset.projectile != null)
                return;

            List<BulletInfo> Bullets = (List<BulletInfo>)BulletsField.GetValue(PlayerUse);

            if (Bullets.Count == 0)
                return;

            RaycastInfo ri = null;
            
            if (RaycastOptions.Enabled && (!RaycastOptions.HoldKey || HotkeyUtilities.IsHotkeyHeld("_SilentAimKey")))
                RaycastUtilities.GenerateRaycast(out ri);
            
            if (Provider.modeConfigData.Gameplay.Ballistics)
            {
                if (ri == null)
                {
                    if (WeaponOptions.NoDrop && ri == null)
                    {
                        for (int i = 0; i < Bullets.Count; i++)
                        {
                            BulletInfo bulletInfo = Bullets[i];
                            Ray ray = new Ray(bulletInfo.pos, bulletInfo.dir);
                            RaycastInfo rayInfo =
                                DamageTool.raycast(ray, PAsset.ballisticTravel, RayMasks.DAMAGE_CLIENT);

                            if (IsRaycastInvalid(rayInfo))
                                bulletInfo.pos += bulletInfo.dir * PAsset.ballisticTravel;

                            else
                            {
                                EPlayerHit playerHit = CalcHitMarker(PAsset, ref rayInfo);
                                PlayerUI.hitmark(0, Vector3.zero, false, playerHit);
                                OptimizationVariables.MainPlayer.input.sendRaycast(rayInfo);
                                bulletInfo.steps = 254;
                            }
                        }

                        for (int i = Bullets.Count - 1; i >= 0; i--)
                        {
                            BulletInfo bulletInfo = Bullets[i];
                            bulletInfo.steps += 1;

                            if (bulletInfo.steps >= PAsset.ballisticSteps)
                                Bullets.RemoveAt(i);
                        }

                        return;
                    }

                    if (ri == null)
                    {
                        OverrideUtilities.CallOriginal(PlayerUse);
                        return;
                    }
                }
                for (int i = 0; i < Bullets.Count; i++)
                {
                    BulletInfo bulletInfo = Bullets[i];
                    double distance = VectorUtilities.GetDistance(OptimizationVariables.MainPlayer.transform.position, ri.point);

                    if (bulletInfo.steps * PAsset.ballisticTravel < distance)
                        continue;

                    EPlayerHit eplayerhit = CalcHitMarker(PAsset, ref ri);
                    PlayerUI.hitmark(0, Vector3.zero, false, eplayerhit);
                    OptimizationVariables.MainPlayer.input.sendRaycast(ri);
                    bulletInfo.steps = 254;
                }


                for (int k = Bullets.Count - 1; k >= 0; k--)
                {
                    BulletInfo bulletInfo = Bullets[k];
                    bulletInfo.steps += 1;
                    if (bulletInfo.steps >= PAsset.ballisticSteps)
                        Bullets.RemoveAt(k);
                }
            }
            else
            {
                if (ri != null)
                {
                    for (int i = 0; i < Bullets.Count; i++)
                    {
                        EPlayerHit eplayerhit = CalcHitMarker(PAsset, ref ri);
                        PlayerUI.hitmark(0, Vector3.zero, false, eplayerhit);
                        OptimizationVariables.MainPlayer.input.sendRaycast(ri);
                    }
                    
                    Bullets.Clear();
                }
                else
                    OverrideUtilities.CallOriginal(PlayerUse);
            }
        }