Ejemplo n.º 1
0
        public void OnGUI()
        {
            if (isOn && ctrl_Connector.isOn)
            {
                window_Main = GUILayout.Window(ctrl_Connector.id_AimlockTriggerbot, window_Main, onWindow, "Aimlock/Triggerbot");
            }

            if (aimlock || triggerbot && tool_ToolZ.getLocalPlayer().equipment.asset is ItemWeaponAsset)
            {
                RaycastHit hit;
                if (tool_ToolZ.getLookingAt(out hit, (nodistance ? Mathf.Infinity : ((ItemWeaponAsset)tool_ToolZ.getLocalPlayer().equipment.asset).range)))
                {
                    if (players && DamageTool.getPlayer(hit.transform) && DamageTool.getPlayer(hit.transform) != tool_ToolZ.getLocalPlayer() && !ctrl_Connector.skid.isWhitelist(tool_ToolZ.getPlayerID(DamageTool.getPlayer(hit.transform))))
                    {
                        if (nofriends && !ctrl_Connector.hack_Friends.isFriend(DamageTool.getPlayer(hit.transform)))
                        {
                            if (noadmins && !tool_ToolZ.getSteamPlayer(DamageTool.getPlayer(hit.transform)).isAdmin)
                            {
                                useAttack();
                            }
                            else
                            {
                                if (!noadmins)
                                {
                                    useAttack();
                                }
                            }
                        }
                        else
                        {
                            if (!nofriends)
                            {
                                useAttack();
                            }
                        }
                    }
                    else if (zombies && DamageTool.getZombie(hit.transform))
                    {
                        useAttack();
                    }
                    else if (animals && DamageTool.getAnimal(hit.transform))
                    {
                        useAttack();
                    }
                    else
                    {
                        useReset();
                    }
                }
                else
                {
                    useReset();
                }
            }
            else
            {
                useReset();
            }
        }
Ejemplo n.º 2
0
 // Token: 0x060009E4 RID: 2532 RVA: 0x00050760 File Offset: 0x0004EB60
 public void OnTriggerEnter(Collider other)
 {
     if (other.isTrigger)
     {
         return;
     }
     if (!Provider.isServer)
     {
         return;
     }
     if (other.CompareTag("Player"))
     {
         if (this.killPlayers)
         {
             Player player = DamageTool.getPlayer(other.transform);
             if (player != null)
             {
                 EPlayerKill eplayerKill;
                 DamageTool.damage(player, this.deathCause, ELimb.SPINE, CSteamID.Nil, Vector3.up, 101f, 1f, out eplayerKill);
             }
         }
     }
     else if (other.CompareTag("Agent"))
     {
         if (this.killZombies || this.killAnimals)
         {
             Zombie zombie = DamageTool.getZombie(other.transform);
             if (zombie != null)
             {
                 if (this.killZombies)
                 {
                     EPlayerKill eplayerKill2;
                     uint        num;
                     DamageTool.damage(zombie, Vector3.up, 65000f, 1f, out eplayerKill2, out num);
                 }
             }
             else if (this.killAnimals)
             {
                 Animal animal = DamageTool.getAnimal(other.transform);
                 if (animal != null)
                 {
                     EPlayerKill eplayerKill3;
                     uint        num2;
                     DamageTool.damage(animal, Vector3.up, 65000f, 1f, out eplayerKill3, out num2);
                 }
             }
         }
     }
     else if (other.CompareTag("Vehicle") && this.killVehicles)
     {
         InteractableVehicle vehicle = DamageTool.getVehicle(other.transform);
         if (vehicle != null && !vehicle.isDead)
         {
             EPlayerKill eplayerKill4;
             DamageTool.damage(vehicle, false, Vector3.zero, false, 65000f, 1f, false, out eplayerKill4);
         }
     }
 }
        public static RaycastInfo OriginalRaycast(Ray ray, float range, int mask)
        {
            RaycastHit hit;

            PhysicsUtility.raycast(ray, out hit, range, mask, QueryTriggerInteraction.UseGlobal);
            RaycastInfo raycastInfo = new RaycastInfo(hit);

            raycastInfo.direction = ray.direction;
            if (raycastInfo.transform != null)
            {
                if (raycastInfo.transform.CompareTag("Barricade"))
                {
                    raycastInfo.transform = DamageTool.getBarricadeRootTransform(raycastInfo.transform);
                }

                else if (raycastInfo.transform.CompareTag("Structure"))
                {
                    raycastInfo.transform = DamageTool.getStructureRootTransform(raycastInfo.transform);
                }

                if (raycastInfo.transform.CompareTag("Enemy"))
                {
                    raycastInfo.player = DamageTool.getPlayer(raycastInfo.transform);
                }

                if (raycastInfo.transform.CompareTag("Zombie"))
                {
                    raycastInfo.zombie = DamageTool.getZombie(raycastInfo.transform);
                }

                if (raycastInfo.transform.CompareTag("Animal"))
                {
                    raycastInfo.animal = DamageTool.getAnimal(raycastInfo.transform);
                }

                raycastInfo.limb = DamageTool.getLimb(raycastInfo.transform);

                if (raycastInfo.transform.CompareTag("Vehicle"))
                {
                    raycastInfo.vehicle = DamageTool.getVehicle(raycastInfo.transform);
                }

                if (raycastInfo.zombie != null && raycastInfo.zombie.isRadioactive)
                {
                    raycastInfo.material = EPhysicsMaterial.ALIEN_DYNAMIC;
                }
                else
                {
                    raycastInfo.material = DamageTool.getMaterial(hit.point, raycastInfo.transform, raycastInfo.collider);
                }
            }
            return(raycastInfo);
        }
Ejemplo n.º 4
0
        public static RaycastInfo raycast(Ray ray, float range, int mask)
        {
            RaycastHit hit;
            int        msk = RayMasks.ENEMY | RayMasks.ENTITY | RayMasks.VEHICLE;

            if (ComponentManager.hack_Weapons.meleeThroughWalls)
            {
                Physics.Raycast(ray, out hit, range, msk);
            }
            else
            {
                Physics.Raycast(ray, out hit, range, mask);
            }
            RaycastInfo raycastInfo = new RaycastInfo(hit);

            raycastInfo.direction = ray.direction;
            if (hit.transform != null)
            {
                if (hit.transform.CompareTag("Enemy"))
                {
                    raycastInfo.player = DamageTool.getPlayer(raycastInfo.transform);
                }
                if (hit.transform.CompareTag("Zombie"))
                {
                    raycastInfo.zombie = DamageTool.getZombie(raycastInfo.transform);
                }
                if (hit.transform.CompareTag("Animal"))
                {
                    raycastInfo.animal = DamageTool.getAnimal(raycastInfo.transform);
                }
                raycastInfo.limb = DamageTool.getLimb(raycastInfo.transform);
                if (hit.transform.CompareTag("Vehicle"))
                {
                    raycastInfo.vehicle = DamageTool.getVehicle(raycastInfo.transform);
                }
                if (raycastInfo.zombie != null && raycastInfo.zombie.isRadioactive)
                {
                    raycastInfo.material = EPhysicsMaterial.ALIEN_DYNAMIC;
                }
                else
                {
                    raycastInfo.material = DamageTool.getMaterial(hit.point, hit.transform, hit.collider);
                }
            }
            return(raycastInfo);
        }
Ejemplo n.º 5
0
        public static RaycastInfo GenerateOriginalRaycast(Ray ray, float range, int mask)
        {
            PhysicsUtility.raycast(ray, out RaycastHit hit, range, mask, QueryTriggerInteraction.UseGlobal);
            RaycastInfo raycastInfo = new RaycastInfo(hit)
            {
                direction = ray.direction
            };

            if (hit.transform == null)
            {
                return(raycastInfo);
            }

            if (raycastInfo.transform.CompareTag("Barricade"))
            {
                raycastInfo.transform = DamageTool.getBarricadeRootTransform(raycastInfo.transform);
            }

            else if (raycastInfo.transform.CompareTag("Structure"))
            {
                raycastInfo.transform = DamageTool.getStructureRootTransform(raycastInfo.transform);
            }

            if (raycastInfo.transform.CompareTag("Enemy"))
            {
                raycastInfo.player = DamageTool.getPlayer(raycastInfo.transform);
            }

            if (raycastInfo.transform.CompareTag("Zombie"))
            {
                raycastInfo.zombie = DamageTool.getZombie(raycastInfo.transform);
            }

            if (raycastInfo.transform.CompareTag("Animal"))
            {
                raycastInfo.animal = DamageTool.getAnimal(raycastInfo.transform);
            }

            raycastInfo.limb = DamageTool.getLimb(raycastInfo.transform);

            if (RaycastOptions.UseCustomLimb)
            {
                raycastInfo.limb = RaycastOptions.TargetLimb;
            }

            else if (RaycastOptions.UseRandomLimb)
            {
                ELimb[] Limbs = (ELimb[])Enum.GetValues(typeof(ELimb));
                raycastInfo.limb = Limbs[MathUtilities.Random.Next(0, Limbs.Length)];
            }

            if (raycastInfo.transform.CompareTag("Vehicle"))
            {
                raycastInfo.vehicle = DamageTool.getVehicle(raycastInfo.transform);
            }

            if (raycastInfo.zombie != null && raycastInfo.zombie.isRadioactive)
            {
                raycastInfo.material = EPhysicsMaterial.ALIEN_DYNAMIC;
            }
            else
            {
                raycastInfo.material = DamageTool.getMaterial(hit.point, raycastInfo.transform, raycastInfo.collider);
            }

            return(raycastInfo);
        }
        // Token: 0x06000094 RID: 148 RVA: 0x000068DC File Offset: 0x00004ADC
        public static RaycastInfo GenerateOriginalRaycast(Ray ray, float range, int mask)
        {
            RaycastHit hit;

            PhysicsUtility.raycast(ray, out hit, range, mask, QueryTriggerInteraction.UseGlobal);
            RaycastInfo raycastInfo = new RaycastInfo(hit);

            raycastInfo.direction = ray.direction;
            bool        flag = !(raycastInfo.transform == null);
            RaycastInfo result;

            if (flag)
            {
                bool flag2 = raycastInfo.transform.CompareTag("Barricade");
                if (flag2)
                {
                    raycastInfo.transform = DamageTool.getBarricadeRootTransform(raycastInfo.transform);
                }
                else
                {
                    bool flag3 = raycastInfo.transform.CompareTag("Structure");
                    if (flag3)
                    {
                        raycastInfo.transform = DamageTool.getStructureRootTransform(raycastInfo.transform);
                    }
                }
                bool flag4 = raycastInfo.transform.CompareTag("Enemy");
                if (flag4)
                {
                    raycastInfo.player = DamageTool.getPlayer(raycastInfo.transform);
                }
                bool flag5 = raycastInfo.transform.CompareTag("Zombie");
                if (flag5)
                {
                    raycastInfo.zombie = DamageTool.getZombie(raycastInfo.transform);
                }
                bool flag6 = raycastInfo.transform.CompareTag("Animal");
                if (flag6)
                {
                    raycastInfo.animal = DamageTool.getAnimal(raycastInfo.transform);
                }
                raycastInfo.limb = DamageTool.getLimb(raycastInfo.transform);
                bool flag7 = !RaycastOptions.UseRandomLimb;
                if (flag7)
                {
                    bool useCustomLimb = RaycastOptions.UseCustomLimb;
                    if (useCustomLimb)
                    {
                        raycastInfo.limb = RaycastOptions.TargetLimb;
                    }
                }
                else
                {
                    ELimb[] array = (ELimb[])Enum.GetValues(typeof(ELimb));
                    raycastInfo.limb = array[MathUtilities.Random.Next(0, array.Length)];
                }
                bool flag8 = raycastInfo.transform.CompareTag("Vehicle");
                if (flag8)
                {
                    raycastInfo.vehicle = DamageTool.getVehicle(raycastInfo.transform);
                }
                else
                {
                    bool flag9 = raycastInfo.zombie != null && raycastInfo.zombie.isRadioactive;
                    if (flag9)
                    {
                        raycastInfo.material = EPhysicsMaterial.ALIEN_DYNAMIC;
                    }
                    else
                    {
                        raycastInfo.material = DamageTool.getMaterial(hit.point, raycastInfo.transform, raycastInfo.collider);
                    }
                }
                bool alwaysHitHead = RaycastOptions.AlwaysHitHead;
                if (alwaysHitHead)
                {
                    raycastInfo.limb = ELimb.SKULL;
                }
                result = raycastInfo;
            }
            else
            {
                result = raycastInfo;
            }
            return(result);
        }
Ejemplo n.º 7
0
        public static RaycastInfo OV_raycast(Ray ray, float range, int mask)
        {
            ItemWeaponAsset weapon = (ItemWeaponAsset)Player.player.equipment.asset;

            /*if (MenuGUI.instance.LongRangeMelee && weapon == null)
             * {
             *  range = MenuGUI.instance.MeleeRange;
             * }*/
            range = Mathf.Infinity;
            RaycastHit hit;

            PhysicsUtility.raycast(ray, out hit, range, mask, 0);
            RaycastInfo raycastInfo = new RaycastInfo(hit);

            if (MenuGUI.instance.silentAim)
            {
                if (hit.transform == null && Functions.GetDistance(Functions.GetNearestPlayer().transform.position) >= Functions.GetGunDistance())
                {
                    return(raycastInfo);
                }
            }

            if (hit.transform.CompareTag("Zombie"))
            {
                raycastInfo.zombie = DamageTool.getZombie(raycastInfo.transform);
            }
            if (hit.transform.CompareTag("Animal"))
            {
                raycastInfo.animal = DamageTool.getAnimal(raycastInfo.transform);
            }
            raycastInfo.direction = new Vector3(0, MenuGUI.instance.launchAmount, 0);

            if (MenuGUI.instance.silentAim && !hit.transform.CompareTag("Zombie"))
            {
                if (Functions.GetDistFrom(Functions.GetNearestPlayer().transform.position, Player.player.look.aim.position) <= 15.5)
                {
                    raycastInfo.point = Player.player.transform.position;
                }
                else
                {
                    raycastInfo.point = Functions.GetLimbPosition(Functions.GetNearestPlayer().transform, "Skull");
                }
                if (MenuGUI.instance.randomLimb)
                {
                    ELimb[] array = (ELimb[])Enum.GetValues(typeof(ELimb));
                    raycastInfo.limb = array[Random.Next(0, array.Length)];
                }
                else
                {
                    raycastInfo.limb = ELimb.SKULL;
                }
                raycastInfo.player = Functions.GetNearestPlayer();
            }
            else
            {
                raycastInfo.limb = DamageTool.getLimb(hit.transform);
                if (hit.transform.CompareTag("Enemy"))
                {
                    raycastInfo.player = DamageTool.getPlayer(raycastInfo.transform);
                }
            }

            if (hit.transform.CompareTag("Vehicle"))
            {
                raycastInfo.vehicle = DamageTool.getVehicle(raycastInfo.transform);
            }
            if (raycastInfo.zombie != null && raycastInfo.zombie.isRadioactive)
            {
                raycastInfo.material = EPhysicsMaterial.ALIEN_DYNAMIC;
            }
            else
            {
                raycastInfo.material = EPhysicsMaterial.NONE;
            }
            return(raycastInfo);
        }
Ejemplo n.º 8
0
 public void Update()
 {
     if (lastCheck == null || (DateTime.Now - lastCheck).TotalMilliseconds >= 1500)
     {
         //enabled = (bool)ctrl_Connector.hack_Settings.getSetting("enable_smartUI").value;
         lastCheck = DateTime.Now;
     }
     if (enabled)
     {
         displayInfo.Clear();
         if (PlayerInteract.interactable != null)
         {
             if (PlayerInteract.interactable is InteractableStorage)
             {
                 InteractableStorage storage = (InteractableStorage)PlayerInteract.interactable;
                 displayInfo.Add("Type: Storage");
                 //if (storage.owner != CSteamID.Nil)
                 //{
                 //displayInfo.Add("Owner: " + tool_ToolZ.getSteamPlayer(storage.owner.m_SteamID).playerID.playerName);
                 //}
                 displayInfo.Add("Locked: " + (getLocked(storage) ? "Yes" : "No"));
                 displayInfo.Add("HasItems: " + (storage.items.getItemCount() > 0 ? "Yes" : "No"));
                 //hasCrack = getLocked(storage);
                 int disp = getDisplay();
                 info_window.width = disp;
                 info_window.x     = Screen.width - disp - 10;
                 inte = PlayerInteract.interactable;
             }
             else if (PlayerInteract.interactable is InteractableDoor)
             {
                 InteractableDoor door = (InteractableDoor)PlayerInteract.interactable;
                 displayInfo.Add("Type: Door");
                 //if (door.owner != CSteamID.Nil)
                 //{
                 //displayInfo.Add("Owner: " + tool_ToolZ.getSteamPlayer(door.owner.m_SteamID).playerID.playerName);
                 //}
                 displayInfo.Add("Locked: " + (getLocked(door) ? "Yes" : "No"));
                 //hasCrack = getLocked(door);
                 int disp = getDisplay();
                 info_window.width = disp;
                 info_window.x     = Screen.width - disp - 10;
                 inte = PlayerInteract.interactable;
             }
         }
         else
         {
             hasCrack = false;
             RaycastHit hit;
             if (tool_ToolZ.getLookingAt(out hit))
             {
                 if (DamageTool.getPlayer(hit.transform) && DamageTool.getPlayer(hit.transform) != tool_ToolZ.getLocalPlayer())
                 {
                     Player p = DamageTool.getPlayer(hit.transform);
                     displayInfo.Add("Type: Player");
                     displayInfo.Add("Name: " + p.name);
                     displayInfo.Add("Health: " + p.life.health);
                     displayInfo.Add("Food: " + p.life.food);
                     displayInfo.Add("Water: " + p.life.water);
                     displayInfo.Add("Stamina: " + p.life.stamina);
                     displayInfo.Add("Distance: " + Math.Round(tool_ToolZ.getDistance(p.transform.position), 0));
                     if (tool_ToolZ.getLocalPlayer().equipment.asset != null && tool_ToolZ.getLocalPlayer().equipment.asset is ItemWeaponAsset)
                     {
                         displayInfo.Add("Will hit: " + (tool_ToolZ.getDistance(p.transform.position) <= ((ItemWeaponAsset)tool_ToolZ.getLocalPlayer().equipment.asset).range ? "Yes" : "No"));
                     }
                     int disp = getDisplay();
                     info_window.width = disp;
                     info_window.x     = Screen.width - disp - 10;
                 }
                 else if (DamageTool.getZombie(hit.transform))
                 {
                     Zombie t = DamageTool.getZombie(hit.transform);
                     displayInfo.Add("Type: Zombie");
                     displayInfo.Add("Health: " + getHealth(t));
                     displayInfo.Add("Distance: " + Math.Round(tool_ToolZ.getDistance(t.transform.position), 0));
                     if (tool_ToolZ.getLocalPlayer().equipment.asset != null && tool_ToolZ.getLocalPlayer().equipment.asset is ItemWeaponAsset)
                     {
                         displayInfo.Add("Will hit: " + (tool_ToolZ.getDistance(t.transform.position) <= ((ItemWeaponAsset)tool_ToolZ.getLocalPlayer().equipment.asset).range ? "Yes" : "No"));
                     }
                     int disp = getDisplay();
                     info_window.width = disp;
                     info_window.x     = Screen.width - disp - 10;
                 }
                 else if (DamageTool.getAnimal(hit.transform))
                 {
                     Animal t = DamageTool.getAnimal(hit.transform);
                     displayInfo.Add("Type: Animal");
                     displayInfo.Add("Health: " + getHealth(t));
                     displayInfo.Add("Distance: " + Math.Round(tool_ToolZ.getDistance(t.transform.position), 0));
                     if (tool_ToolZ.getLocalPlayer().equipment.asset != null && tool_ToolZ.getLocalPlayer().equipment.asset is ItemWeaponAsset)
                     {
                         displayInfo.Add("Will hit: " + (tool_ToolZ.getDistance(t.transform.position) <= ((ItemWeaponAsset)tool_ToolZ.getLocalPlayer().equipment.asset).range ? "Yes" : "No"));
                     }
                     int disp = getDisplay();
                     info_window.width = disp;
                     info_window.x     = Screen.width - disp - 10;
                 }
             }
         }
     }
 }
Ejemplo n.º 9
0
        public static RaycastInfo raycast(Ray ray, float range, int mask)
        {
            int num;

            if (MP_Weapons.attackThroughWalls)
            {
                num = RayMasks.VEHICLE | RayMasks.ENEMY | RayMasks.ENTITY;
            }
            else
            {
                num = mask;
            }

            RaycastHit hit;

            Physics.Raycast(ray, out hit, range, num);
            RaycastInfo raycastInfo = new RaycastInfo(hit);

            raycastInfo.direction = ray.direction;
            if (hit.transform != null)
            {
                if (hit.transform.CompareTag("Enemy"))
                {
                    raycastInfo.player = DamageTool.getPlayer(raycastInfo.transform);
                }
                if (hit.transform.CompareTag("Zombie"))
                {
                    raycastInfo.zombie = DamageTool.getZombie(raycastInfo.transform);
                }
                if (hit.transform.CompareTag("Animal"))
                {
                    raycastInfo.animal = DamageTool.getAnimal(raycastInfo.transform);
                }
                raycastInfo.limb = DamageTool.getLimb(raycastInfo.transform);
                if (hit.transform.CompareTag("Vehicle"))
                {
                    raycastInfo.vehicle = DamageTool.getVehicle(raycastInfo.transform);
                }
                if (raycastInfo.zombie != null && raycastInfo.zombie.isRadioactive)
                {
                    raycastInfo.material = EPhysicsMaterial.ALIEN_DYNAMIC;
                }
                else
                {
                    raycastInfo.material = DamageTool.getMaterial(hit.point, hit.transform, hit.collider);
                }

                if (MP_Weapons.alwaysHitHead) // idk if it should interfere with silentaim so i just put it above silent aim :\
                {
                    raycastInfo.limb = ELimb.SKULL;
                }

                #region SilentAim
                if (MP_Aimbot.silentAim)
                {
                    Player p = ((SteamPlayer)MP_Aimbot.attackNext).player;

                    if (p == null || raycastInfo.zombie != null)
                    {
                        return(raycastInfo);
                    }

                    raycastInfo.player = p;
                    raycastInfo.limb   = MP_Aimbot.aimLocation;
                }
                #endregion
            }
            return(raycastInfo);
        }
        // Token: 0x060001F3 RID: 499 RVA: 0x00012908 File Offset: 0x00010B08
        public void OnGUI()
        {
            Player mainPlayer = OptimizationVariables.MainPlayer;
            bool   flag       = mainPlayer == null;
            object obj;

            if (flag)
            {
                obj = null;
            }
            else
            {
                PlayerEquipment equipment = mainPlayer.equipment;
                obj = ((equipment != null) ? equipment.useable : null);
            }
            UseableGun useableGun = obj as UseableGun;
            bool       flag2      = useableGun == null || TrajectoryComponent.spying || !WeaponOptions.EnableBulletDropPrediction || !Provider.modeConfigData.Gameplay.Ballistics;
            bool       flag3      = flag2;

            if (flag3)
            {
                bool flag4 = TrajectoryComponent.Highlighted != null;
                bool flag5 = flag4;
                if (flag5)
                {
                    TrajectoryComponent.RemoveHighlight(TrajectoryComponent.Highlighted);
                    TrajectoryComponent.Highlighted = null;
                }
            }
            else
            {
                RaycastHit     raycastHit;
                List <Vector3> list   = TrajectoryComponent.PlotTrajectory(useableGun, out raycastHit, 255);
                bool           flag6  = Vector3.Distance(list.Last <Vector3>(), OptimizationVariables.MainPlayer.look.aim.position) > useableGun.equippedGunAsset.range;
                ColorVariable  color  = ColorUtilities.getColor("_TrajectoryPredictionInRange");
                ColorVariable  color2 = ColorUtilities.getColor("_TrajectoryPredictionOutOfRange");
                bool           flag7  = WeaponOptions.HighlightBulletDropPredictionTarget && raycastHit.collider != null;
                bool           flag8  = flag7;
                if (flag8)
                {
                    Transform  transform  = raycastHit.transform;
                    GameObject gameObject = null;
                    bool       flag9      = DamageTool.getPlayer(transform) != null;
                    bool       flag10     = flag9;
                    if (flag10)
                    {
                        gameObject = DamageTool.getPlayer(transform).gameObject;
                    }
                    else
                    {
                        bool flag11 = DamageTool.getZombie(transform) != null;
                        bool flag12 = flag11;
                        if (flag12)
                        {
                            gameObject = DamageTool.getZombie(transform).gameObject;
                        }
                        else
                        {
                            bool flag13 = DamageTool.getAnimal(transform) != null;
                            bool flag14 = flag13;
                            if (flag14)
                            {
                                gameObject = DamageTool.getAnimal(transform).gameObject;
                            }
                            else
                            {
                                bool flag15 = DamageTool.getVehicle(transform) != null;
                                bool flag16 = flag15;
                                if (flag16)
                                {
                                    gameObject = DamageTool.getVehicle(transform).gameObject;
                                }
                            }
                        }
                    }
                    bool flag17 = gameObject != null;
                    bool flag18 = flag17;
                    if (flag18)
                    {
                        Highlighter highlighter = gameObject.GetComponent <Highlighter>() ?? gameObject.AddComponent <Highlighter>();
                        bool        flag19      = !highlighter.enabled;
                        bool        flag20      = flag19;
                        if (flag20)
                        {
                            highlighter.occluder = true;
                            highlighter.overlay  = true;
                            highlighter.ConstantOnImmediate(flag6 ? color2 : color);
                        }
                        bool flag21 = TrajectoryComponent.Highlighted != null && highlighter != TrajectoryComponent.Highlighted;
                        bool flag22 = flag21;
                        if (flag22)
                        {
                            TrajectoryComponent.RemoveHighlight(TrajectoryComponent.Highlighted);
                        }
                        TrajectoryComponent.Highlighted = highlighter;
                    }
                    else
                    {
                        bool flag23 = TrajectoryComponent.Highlighted != null;
                        bool flag24 = flag23;
                        if (flag24)
                        {
                            TrajectoryComponent.RemoveHighlight(TrajectoryComponent.Highlighted);
                            TrajectoryComponent.Highlighted = null;
                        }
                    }
                }
                else
                {
                    bool flag25 = !WeaponOptions.HighlightBulletDropPredictionTarget && TrajectoryComponent.Highlighted != null;
                    bool flag26 = flag25;
                    if (flag26)
                    {
                        TrajectoryComponent.RemoveHighlight(TrajectoryComponent.Highlighted);
                        TrajectoryComponent.Highlighted = null;
                    }
                }
                ESPComponent.GLMat.SetPass(0);
                GL.PushMatrix();
                GL.LoadProjectionMatrix(OptimizationVariables.MainCam.projectionMatrix);
                GL.modelview = OptimizationVariables.MainCam.worldToCameraMatrix;
                GL.Begin(2);
                GL.Color(flag6 ? color2 : color);
                foreach (Vector3 v in list)
                {
                    GL.Vertex(v);
                }
                GL.End();
                GL.PopMatrix();
            }
        }
Ejemplo n.º 11
0
 public void Update()
 {
     if (triggerbot)
     {
         ItemAsset ia = Information.player.equipment.asset;
         Useable   us = Information.player.equipment.useable;
         if (Information.player.equipment.isSelected && ia != null && ia is ItemWeaponAsset)
         {
             RaycastHit hit;
             if (Tool.getLookingAt(out hit, (wepDistance ? ((ItemWeaponAsset)ia).range : distance)))
             {
                 if ((trig_players && DamageTool.getPlayer(hit.transform)) || (trig_zombies && DamageTool.getZombie(hit.transform)) || (trig_animal && DamageTool.getAnimal(hit.transform)))
                 {
                     attack(ia, Tool.getDistance(hit.transform.position));
                 }
             }
         }
     }
 }
Ejemplo n.º 12
0
        // Token: 0x06000237 RID: 567 RVA: 0x000152E4 File Offset: 0x000134E4
        public static RaycastInfo GenerateOriginalRaycast(Ray ray, float range, int mask, Player ignorePlayer = null)
        {
            RaycastHit hit;

            PhysicsUtility.raycast(ray, out hit, range, mask, QueryTriggerInteraction.UseGlobal);
            RaycastInfo raycastInfo = new RaycastInfo(hit)
            {
                direction = ray.direction
            };

            if (!(raycastInfo.transform == null))
            {
                if (!raycastInfo.transform.CompareTag("Barricade"))
                {
                    if (raycastInfo.transform.CompareTag("Structure"))
                    {
                        raycastInfo.transform = DamageTool.getStructureRootTransform(raycastInfo.transform);
                    }
                }
                else
                {
                    raycastInfo.transform = DamageTool.getBarricadeRootTransform(raycastInfo.transform);
                }
                if (raycastInfo.transform.CompareTag("Enemy"))
                {
                    raycastInfo.player = DamageTool.getPlayer(raycastInfo.transform);
                    if (raycastInfo.player == ignorePlayer)
                    {
                        raycastInfo.player = null;
                    }
                }
                if (raycastInfo.transform.CompareTag("Zombie"))
                {
                    raycastInfo.zombie = DamageTool.getZombie(raycastInfo.transform);
                }
                if (raycastInfo.transform.CompareTag("Animal"))
                {
                    raycastInfo.animal = DamageTool.getAnimal(raycastInfo.transform);
                }
                raycastInfo.limb = DamageTool.getLimb(raycastInfo.transform);
                if (!RaycastOptions.UseRandomLimb)
                {
                    if (RaycastOptions.UseCustomLimb)
                    {
                        raycastInfo.limb = RaycastOptions.TargetLimb;
                    }
                }
                else
                {
                    raycastInfo.limb = MathUtilities.RandomEnumValue <ELimb>();
                }
                if (raycastInfo.transform.CompareTag("Vehicle"))
                {
                    raycastInfo.vehicle = DamageTool.getVehicle(raycastInfo.transform);
                }
                if (raycastInfo.zombie != null && raycastInfo.zombie.isRadioactive)
                {
                    raycastInfo.material = EPhysicsMaterial.ALIEN_DYNAMIC;
                }
                else
                {
                    raycastInfo.material = DamageTool.getMaterial(hit.point, raycastInfo.transform, raycastInfo.collider);
                }
                return(raycastInfo);
            }
            return(raycastInfo);
        }
Ejemplo n.º 13
0
        private void udESP()
        {
            while (!terminate)
            {
                try
                {
                    if (espEnabled)
                    {
                        if (dManager.d_ref)
                        {
                            dManager.drawing_esp.Clear();
                            Collider[] cols = Physics.OverlapSphere(Information.player.transform.position, distance, RayMasks.DAMAGE_CLIENT);
                            foreach (Collider c in cols)
                            {
                                if (DamageTool.getPlayer(c.transform) != null)
                                {
                                    SDG.Unturned.Player ut = DamageTool.getPlayer(c.transform);
                                    if (esp_player)
                                    {
                                        if (ut.gameObject == null)
                                        {
                                            continue;
                                        }
                                        SteamPlayer ply      = Tool.getSteamPlayer(ut.gameObject);
                                        bool        isFriend = ComponentManager.friend_manager.exists(ply.playerID.steamID.m_SteamID);
                                        float       dist     = (float)Math.Round(Tool.getDistance(ut.transform.position));
                                        Vector3     c2s      = MainCamera.instance.WorldToScreenPoint(ut.transform.position);
                                        Highlighter h        = ut.gameObject.GetComponent <Highlighter>();

                                        if (c2s.z <= 0)
                                        {
                                            continue;
                                        }

                                        c2s.x = c2s.x - 64f;
                                        c2s.y = (Screen.height - (c2s.y + 1f)) - 12f;

                                        if (Array.Exists(dManager.drawing_esp.ToArray(), a => a.pos == c2s))
                                        {
                                            continue;
                                        }

                                        dManager.drawing_esp.Add(new DrawType((p_name ? ply.playerID.nickName : "") + (p_distance ? "[" + dist + "]" : ""), c2s, (isFriend ? Information.esp_friends : Information.esp_players), p_name || p_distance, ut.gameObject, Tool.BoundsToScreenRect(c.bounds)));


                                        if (draw_highlight)
                                        {
                                            if (h == null)
                                            {
                                                h = ut.gameObject.AddComponent <Highlighter>();
                                                h.OccluderOn();
                                                h.SeeThroughOn();
                                                h.ConstantOn((isFriend ? Information.esp_friends : Information.esp_players));
                                            }
                                            HighlightType ht = dManager.highlights.Find(a => a.h == h);
                                            if (ht == null)
                                            {
                                                dManager.highlights.Add(new HighlightType(h, ut.gameObject));
                                            }
                                            else
                                            {
                                                ht.hasUd = true;
                                            }
                                        }
                                        continue;
                                    }
                                }

                                if (DamageTool.getZombie(c.transform))
                                {
                                    SDG.Unturned.Zombie ut = DamageTool.getZombie(c.transform);
                                    if (esp_zombie)
                                    {
                                        if (ut.gameObject == null && !ut.isDead)
                                        {
                                            continue;
                                        }
                                        float       dist = (float)Math.Round(Tool.getDistance(ut.transform.position));
                                        Vector3     c2s  = Camera.main.WorldToScreenPoint(ut.transform.position);
                                        Highlighter h    = ut.gameObject.GetComponent <Highlighter>();

                                        if (c2s.z <= 0)
                                        {
                                            continue;
                                        }

                                        c2s.x = c2s.x - 64f;
                                        c2s.y = (Screen.height - (c2s.y + 1f)) - 12f;

                                        if (Array.Exists(dManager.drawing_esp.ToArray(), a => a.pos == c2s))
                                        {
                                            continue;
                                        }

                                        dManager.drawing_esp.Add(new DrawType((z_name ? getZombieName(ut) : "") + (z_distance ? "[" + dist + "]" : ""), c2s, Information.esp_zombies, z_name || z_distance, ut.gameObject, Tool.BoundsToScreenRect(c.bounds)));

                                        if (draw_highlight)
                                        {
                                            if (h == null)
                                            {
                                                h = ut.gameObject.AddComponent <Highlighter>();
                                                h.OccluderOn();
                                                h.SeeThroughOn();
                                                h.ConstantOn(Information.esp_zombies);
                                            }
                                            HighlightType ht = dManager.highlights.Find(a => a.h == h);
                                            if (ht == null)
                                            {
                                                dManager.highlights.Add(new HighlightType(h, ut.gameObject));
                                            }
                                            else
                                            {
                                                ht.hasUd = true;
                                            }
                                        }
                                        continue;
                                    }
                                }
                            }
                            dManager.d_ref = false;
                        }
                    }
                    else
                    {
                        dManager.rm_highlights = true;
                        dManager.drawing_esp.Clear();
                    }
                }
                catch (Exception ex)
                {
                    Debug.LogException(ex);
                }
            }
        }