Пример #1
0
        protected static bool ConsumePrefix()
        {
            var feature = FeatureFactory.GetFeature <Stamina>();

            if (feature == null || !feature.Enabled)
            {
                return(true);          // keep using original code, we are not enabled
            }
            return(false);             // skip the original code and all other prefix methods
        }
Пример #2
0
        protected static bool ExaminedPrefix(ref bool __result)
        {
            var feature = FeatureFactory.GetFeature <Examine>();

            if (feature == null || !feature.Enabled)
            {
                return(true);                // keep using original code, we are not enabled
            }
            __result = true;
            return(false);             // skip the original code and all other prefix methods
        }
Пример #3
0
        protected static bool CreateShotPrefix(object ammo, Vector3 origin, ref Vector3 direction, int fireIndex, Player player, Item weapon, ref float speedFactor, int fragmentIndex)
        {
            var feature = FeatureFactory.GetFeature <Aimbot>();

            if (feature == null || !feature.SilentAim || feature._silentAimTarget == null)
            {
                return(true);                // keep using original code, we are not enabled
            }
            direction   = (feature._silentAimTarget.position - origin).normalized;
            speedFactor = feature.SilentAimSpeedFactor;

            return(true);            // call the original code with updated direction and speedFactor
        }
Пример #4
0
        protected static bool ApplyDamagePrefix(object?__instance, ref float __result)
        {
            var feature = FeatureFactory.GetFeature <Health>();

            if (feature == null || !feature.Enabled || __instance == null)
            {
                return(true);                // keep using original code, we are not enabled
            }
            var healthControllerWrapper = new HealthControllerWrapper(__instance);
            var player = healthControllerWrapper.Player;

            if (player == null || !player.IsYourPlayer)
            {
                return(true);                // keep using original code, apply damage to others
            }
            __result = 0f;
            return(false);             // skip the original code and all other prefix methods
        }