Decompiled source of FishAimbotNoScopeEdition v1.0.0

NoScopeAimbot.dll

Decompiled 2 hours ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("NoScopeAimbot")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("NoScopeAimbot")]
[assembly: AssemblyCopyright("Copyright ©  2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("338f0601-f39f-4f47-b874-a5de82b5f929")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace FishAimbotNoScope;

[BepInPlugin("com.yourname.fishaimbotnoscope", "Fish Aimbot No-Scope", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
	private void Awake()
	{
		Harmony.CreateAndPatchAll(typeof(ShootAimPatch), (string)null);
	}
}
[HarmonyPatch(typeof(Weapon), "Shoot")]
public static class ShootAimPatch
{
	private const float MaxDistance = 2000f;

	private const float MaxFov = 180f;

	private static void Prefix(Weapon __instance)
	{
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_0059: Unknown result type (might be due to invalid IL or missing references)
		//IL_0048: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_0075: Unknown result type (might be due to invalid IL or missing references)
		//IL_0077: Unknown result type (might be due to invalid IL or missing references)
		//IL_0078: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0081: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_0086: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Unknown result type (might be due to invalid IL or missing references)
		//IL_008b: Unknown result type (might be due to invalid IL or missing references)
		object obj;
		if (__instance == null)
		{
			obj = null;
		}
		else
		{
			Attachments attachments = __instance.Attachments;
			obj = ((attachments != null) ? attachments.FirePoint : null);
		}
		if (!((Object)obj == (Object)null))
		{
			Transform firePoint = __instance.Attachments.FirePoint;
			Vector3 position = firePoint.position;
			Vector3 val = (((Object)(object)Camera.main != (Object)null) ? ((Component)Camera.main).transform.forward : firePoint.forward);
			Vector3 targetPos;
			Transform bestTarget = GetBestTarget(position, val, out targetPos);
			Vector3 val2;
			if (!((Object)(object)bestTarget != (Object)null))
			{
				val2 = val;
			}
			else
			{
				Vector3 val3 = targetPos - position;
				val2 = ((Vector3)(ref val3)).normalized;
			}
			Vector3 val4 = val2;
			firePoint.rotation = Quaternion.LookRotation(val4);
		}
	}

	private static Transform GetBestTarget(Vector3 origin, Vector3 lookDir, out Vector3 targetPos)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0097: Unknown result type (might be due to invalid IL or missing references)
		//IL_009c: Unknown result type (might be due to invalid IL or missing references)
		//IL_009e: Unknown result type (might be due to invalid IL or missing references)
		//IL_009f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0124: Unknown result type (might be due to invalid IL or missing references)
		//IL_0126: Unknown result type (might be due to invalid IL or missing references)
		targetPos = Vector3.zero;
		Transform result = null;
		float num = float.MaxValue;
		Creature[] array = Object.FindObjectsByType<Creature>((FindObjectsSortMode)0);
		foreach (Creature val in array)
		{
			if ((Object)(object)val == (Object)null || val.IsDead)
			{
				continue;
			}
			Fish val2 = (Fish)(object)((val is Fish) ? val : null);
			if (val2 != null && (Object)(object)((Item)val2).AttachedRod != (Object)null)
			{
				continue;
			}
			string text = ((Object)val).name.ToLower();
			if (text.Contains("seagull"))
			{
				continue;
			}
			Vector3 center = GetCenter(val);
			float num2 = Vector3.Distance(origin, center);
			if (num2 > 2000f)
			{
				continue;
			}
			Vector3 val3 = center - origin;
			Vector3 normalized = ((Vector3)(ref val3)).normalized;
			float num3 = Vector3.Angle(lookDir, normalized);
			if (!(num3 > 90f))
			{
				float num4 = (text.Contains("albatross") ? (num3 * 0.05f) : (num3 + num2 * 0.01f));
				if (num4 < num)
				{
					num = num4;
					result = ((Component)val).transform;
					targetPos = center;
				}
			}
		}
		return result;
	}

	private static Vector3 GetCenter(Creature creature)
	{
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_0065: Unknown result type (might be due to invalid IL or missing references)
		//IL_006a: Unknown result type (might be due to invalid IL or missing references)
		//IL_003a: Unknown result type (might be due to invalid IL or missing references)
		//IL_003f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0042: Unknown result type (might be due to invalid IL or missing references)
		//IL_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_006e: Unknown result type (might be due to invalid IL or missing references)
		Collider componentInChildren = ((Component)creature).GetComponentInChildren<Collider>();
		Bounds bounds;
		if ((Object)(object)componentInChildren != (Object)null)
		{
			bounds = componentInChildren.bounds;
			return ((Bounds)(ref bounds)).center;
		}
		Renderer componentInChildren2 = ((Component)creature).GetComponentInChildren<Renderer>();
		if ((Object)(object)componentInChildren2 != (Object)null)
		{
			bounds = componentInChildren2.bounds;
			return ((Bounds)(ref bounds)).center;
		}
		return ((Component)creature).transform.position + Vector3.up * 0.75f;
	}
}