the initial commit to the repo.
This commit is contained in:
parent
025c032b8c
commit
1b757591b9
264 changed files with 21882 additions and 0 deletions
968
stoopid.raw/stupid.solutions/Exploits.cs
Normal file
968
stoopid.raw/stupid.solutions/Exploits.cs
Normal file
|
|
@ -0,0 +1,968 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Threading.Tasks;
|
||||
using Comfort.Common;
|
||||
using EFT;
|
||||
using EFT.Animations;
|
||||
using EFT.Animations.Recoil;
|
||||
using EFT.Interactive;
|
||||
using EFT.InventoryLogic;
|
||||
using EFT.NextObservedPlayer;
|
||||
using EFT.UI;
|
||||
using stupid.solutions.Data;
|
||||
using stupid.solutions.Features.ESP;
|
||||
using stupid.solutions.stupid.solutions.Data;
|
||||
using stupid.solutions.Utils;
|
||||
using UnityEngine;
|
||||
|
||||
namespace stupid.solutions;
|
||||
|
||||
internal class Exploits : MonoBehaviour
|
||||
{
|
||||
private static readonly Array _bodyParts = Enum.GetValues(typeof(EBodyPart));
|
||||
|
||||
public static BotOwner _botOwner;
|
||||
|
||||
private static Coroutine artillerycoroutine;
|
||||
|
||||
private float waitime = 3f;
|
||||
|
||||
private static Material cachedskyboxmaterial;
|
||||
|
||||
private static bool doorhooked = false;
|
||||
|
||||
private static Dictionary<int, Vector3> originalHeadScales = new Dictionary<int, Vector3>();
|
||||
|
||||
private static Dictionary<int, bool> isHeadScaled = new Dictionary<int, bool>();
|
||||
|
||||
private static TestHook PlayTripwireInteractionHook;
|
||||
|
||||
private static TestHook StopTripwireInteractionHook;
|
||||
|
||||
private static bool isPlayHooked = false;
|
||||
|
||||
private static bool isStopHooked = false;
|
||||
|
||||
private static TestHook AntiFPSDropHook;
|
||||
|
||||
private static bool isantifpshooked = false;
|
||||
|
||||
public void Update()
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.F5))
|
||||
{
|
||||
ConsoleScreen.IAmDevShowMeLogs = !ConsoleScreen.IAmDevShowMeLogs;
|
||||
ConsoleScreen.Log($"Toggling Dev Logs {ConsoleScreen.IAmDevShowMeLogs}");
|
||||
}
|
||||
if (Input.GetKeyDown(KeyCode.F6))
|
||||
{
|
||||
ConsoleScreen.Log("Gameworld Location ID : " + Main.GameWorld.LocationId);
|
||||
}
|
||||
if (Main.GameWorld == null && isHeadScaled.Count > 0)
|
||||
{
|
||||
isHeadScaled.Clear();
|
||||
}
|
||||
if (Main.GameWorld == null && originalHeadScales.Count > 0)
|
||||
{
|
||||
originalHeadScales.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
public static void UnlockAllDoors()
|
||||
{
|
||||
if (!(Main.GameWorld != null))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (Main.OnlineGamePlayers.Count > 0)
|
||||
{
|
||||
ConsoleScreen.Log("No Opening doors in Online !!!");
|
||||
return;
|
||||
}
|
||||
Door[] array = UnityEngine.Object.FindObjectsOfType<Door>();
|
||||
foreach (Door door in array)
|
||||
{
|
||||
if (door.DoorState != EDoorState.Open && !(Vector3.Distance(door.transform.position, Main.LocalPlayer.Position) > 20f))
|
||||
{
|
||||
door.DoorState = EDoorState.Shut;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void SwitchToThirdPerson()
|
||||
{
|
||||
if (Main.LocalPlayer != null)
|
||||
{
|
||||
Main.LocalPlayer.PointOfView = EPointOfView.ThirdPerson;
|
||||
if (Main.LocalPlayer.CameraPosition != null)
|
||||
{
|
||||
Main.LocalPlayer.CameraPosition.localPosition = new Vector3(0f, 0.5f, -2f);
|
||||
Main.MainCamera.transform.localRotation = Quaternion.identity;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void FreeCameraUpdate()
|
||||
{
|
||||
if (!(Main.LocalPlayer == null) && !(Main.MainCamera == null))
|
||||
{
|
||||
Transform transform = Main.MainCamera.transform;
|
||||
float num = 2f;
|
||||
if (Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl))
|
||||
{
|
||||
num = 10f;
|
||||
}
|
||||
Vector3 zero = Vector3.zero;
|
||||
if (Input.GetKey(KeyCode.UpArrow))
|
||||
{
|
||||
zero += transform.forward;
|
||||
}
|
||||
if (Input.GetKey(KeyCode.DownArrow))
|
||||
{
|
||||
zero -= transform.forward;
|
||||
}
|
||||
if (Input.GetKey(KeyCode.LeftArrow))
|
||||
{
|
||||
zero -= transform.right;
|
||||
}
|
||||
if (Input.GetKey(KeyCode.RightArrow))
|
||||
{
|
||||
zero += transform.right;
|
||||
}
|
||||
if (zero != Vector3.zero)
|
||||
{
|
||||
transform.position += zero.normalized * num * Time.deltaTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void SwitchToFirstPerson()
|
||||
{
|
||||
if (Main.LocalPlayer != null)
|
||||
{
|
||||
Main.LocalPlayer.PointOfView = EPointOfView.FirstPerson;
|
||||
}
|
||||
}
|
||||
|
||||
public static void FlyHack()
|
||||
{
|
||||
if (Main.LocalPlayer != null && Main.LocalPlayer.Transform != null && Main.MainCamera != null)
|
||||
{
|
||||
Main.LocalPlayer.MovementContext.FreefallTime = 0f;
|
||||
Main.LocalPlayer.MovementContext.IsGrounded = true;
|
||||
if (Input.GetKey(KeyCode.Space))
|
||||
{
|
||||
Main.LocalPlayer.MovementContext.FreefallTime = -0.4f;
|
||||
Main.LocalPlayer.Transform.position += Main.LocalPlayer.Transform.up / 5f * Settings.Speed;
|
||||
}
|
||||
if (Input.GetKey(KeyCode.LeftControl))
|
||||
{
|
||||
Main.LocalPlayer.Transform.position -= Main.LocalPlayer.Transform.up / 5f * Settings.Speed;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void SpeedHack()
|
||||
{
|
||||
if (Input.GetKey(KeyCode.W))
|
||||
{
|
||||
Main.LocalPlayer.Transform.position += Main.LocalPlayer.Transform.forward / 5f * Settings.Speed;
|
||||
}
|
||||
if (Input.GetKey(KeyCode.S))
|
||||
{
|
||||
Main.LocalPlayer.Transform.position -= Main.LocalPlayer.Transform.forward / 5f * Settings.Speed;
|
||||
}
|
||||
if (Input.GetKey(KeyCode.A))
|
||||
{
|
||||
Main.LocalPlayer.Transform.position -= Main.LocalPlayer.Transform.right / 5f * Settings.Speed;
|
||||
}
|
||||
if (Input.GetKey(KeyCode.D))
|
||||
{
|
||||
Main.LocalPlayer.Transform.position += Main.LocalPlayer.Transform.right / 5f * Settings.Speed;
|
||||
}
|
||||
}
|
||||
|
||||
public static void InfiniteStamina()
|
||||
{
|
||||
if (Main.LocalPlayer.Physical.Stamina.Current < 75f)
|
||||
{
|
||||
Main.LocalPlayer.Physical.Stamina.Current = Main.LocalPlayer.Physical.Stamina.TotalCapacity.Value;
|
||||
}
|
||||
if (Main.LocalPlayer.Physical.HandsStamina.Current < 75f)
|
||||
{
|
||||
Main.LocalPlayer.Physical.HandsStamina.Current = Main.LocalPlayer.Physical.HandsStamina.TotalCapacity.Value;
|
||||
}
|
||||
if (Main.LocalPlayer.Physical.Oxygen.Current < 75f)
|
||||
{
|
||||
Main.LocalPlayer.Physical.Oxygen.Current = Main.LocalPlayer.Physical.Oxygen.TotalCapacity.Value;
|
||||
}
|
||||
Main.LocalPlayer.RemoveStateSpeedLimit(Player.ESpeedLimit.Weight);
|
||||
Main.LocalPlayer.RemoveStateSpeedLimit(Player.ESpeedLimit.Swamp);
|
||||
Main.LocalPlayer.RemoveStateSpeedLimit(Player.ESpeedLimit.SurfaceNormal);
|
||||
Main.LocalPlayer.RemoveStateSpeedLimit(Player.ESpeedLimit.Shot);
|
||||
Main.LocalPlayer.RemoveStateSpeedLimit(Player.ESpeedLimit.HealthCondition);
|
||||
Main.LocalPlayer.RemoveStateSpeedLimit(Player.ESpeedLimit.Fall);
|
||||
Main.LocalPlayer.RemoveStateSpeedLimit(Player.ESpeedLimit.BarbedWire);
|
||||
Main.LocalPlayer.RemoveStateSpeedLimit(Player.ESpeedLimit.Armor);
|
||||
Main.LocalPlayer.RemoveStateSpeedLimit(Player.ESpeedLimit.Aiming);
|
||||
}
|
||||
|
||||
public static void Instaheal()
|
||||
{
|
||||
if (!Input.GetKey(Settings.Instahealkey) || Settings.allinputdisabled)
|
||||
{
|
||||
return;
|
||||
}
|
||||
foreach (EBodyPart bodyPart in _bodyParts)
|
||||
{
|
||||
if (Main.LocalPlayer.ActiveHealthController.IsBodyPartBroken(bodyPart) || Main.LocalPlayer.ActiveHealthController.IsBodyPartDestroyed(bodyPart))
|
||||
{
|
||||
Main.LocalPlayer.ActiveHealthController.RestoreBodyPart(bodyPart, 1f);
|
||||
}
|
||||
Main.LocalPlayer.ActiveHealthController.RemoveNegativeEffects(bodyPart);
|
||||
Main.LocalPlayer.ActiveHealthController.RemoveNegativeEffects(EBodyPart.Common);
|
||||
Main.LocalPlayer.ActiveHealthController.RestoreFullHealth();
|
||||
Main.LocalPlayer.ActiveHealthController.ChangeHealth(bodyPart, 1000000f, default(_F167));
|
||||
Main.LocalPlayer.ActiveHealthController.ApplyDamage(bodyPart, 0f, default(_F167));
|
||||
}
|
||||
}
|
||||
|
||||
public static void Godmode()
|
||||
{
|
||||
Player localPlayer = Main.LocalPlayer;
|
||||
if (localPlayer != null && localPlayer.ActiveHealthController != null && Settings.Godmode)
|
||||
{
|
||||
Main.fixedgodmode = false;
|
||||
if (localPlayer.ActiveHealthController.DamageCoeff != -1f)
|
||||
{
|
||||
localPlayer.ActiveHealthController.SetDamageCoeff(-1f);
|
||||
localPlayer.ActiveHealthController.RemoveNegativeEffects(EBodyPart.Common);
|
||||
localPlayer.ActiveHealthController.RestoreFullHealth();
|
||||
localPlayer.ActiveHealthController.ChangeEnergy(999f);
|
||||
localPlayer.ActiveHealthController.ChangeHydration(999f);
|
||||
localPlayer.ActiveHealthController.DoPainKiller();
|
||||
}
|
||||
if (localPlayer.ActiveHealthController.FallSafeHeight != 9999999f)
|
||||
{
|
||||
localPlayer.ActiveHealthController.FallSafeHeight = 9999999f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void ResetGodmode()
|
||||
{
|
||||
Player localPlayer = Main.LocalPlayer;
|
||||
if (localPlayer != null && localPlayer.ActiveHealthController != null)
|
||||
{
|
||||
localPlayer.ActiveHealthController.SetDamageCoeff(1f);
|
||||
localPlayer.ActiveHealthController.FallSafeHeight = 1f;
|
||||
localPlayer.ActiveHealthController.ChangeEnergy(100f);
|
||||
localPlayer.ActiveHealthController.ChangeHydration(100f);
|
||||
localPlayer.ActiveHealthController.RemoveMedEffect();
|
||||
localPlayer.ActiveHealthController.DoPermanentHealthBoost(0f);
|
||||
Settings.Godmode = false;
|
||||
}
|
||||
}
|
||||
|
||||
public static void Flares()
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.RightBracket) && !Settings.allinputdisabled)
|
||||
{
|
||||
CallAirdrop(takeNearbyPoint: true, Main.LocalPlayer.Position);
|
||||
}
|
||||
}
|
||||
|
||||
public static void CallAirdrop(bool takeNearbyPoint = false, Vector3 position = default(Vector3))
|
||||
{
|
||||
GameWorld gameWorld = Main.GameWorld;
|
||||
EFTHardSettings.Instance.WindFactor = 0f;
|
||||
if (gameWorld != null)
|
||||
{
|
||||
gameWorld.InitAirdrop(null, takeNearbyPoint, position);
|
||||
ConsoleScreen.Log("Airdrop has been called.");
|
||||
}
|
||||
else
|
||||
{
|
||||
ConsoleScreen.Log("GameWorld is null, cannot initiate airdrop.");
|
||||
}
|
||||
}
|
||||
|
||||
public static void Thermals()
|
||||
{
|
||||
Main._thermalVision.On = Settings.Thermal;
|
||||
ThermalVision thermalVision = Main._thermalVision;
|
||||
thermalVision.IsFpsStuck = false;
|
||||
thermalVision.IsGlitch = false;
|
||||
thermalVision.IsMotionBlurred = false;
|
||||
thermalVision.IsNoisy = false;
|
||||
thermalVision.IsPixelated = false;
|
||||
thermalVision.TextureMask.Color = new Color(0f, 0f, 0f, 0f);
|
||||
thermalVision.TextureMask.Stretch = false;
|
||||
thermalVision.TextureMask.Size = 0f;
|
||||
}
|
||||
|
||||
public static void KillALL()
|
||||
{
|
||||
GameWorld instance = Singleton<GameWorld>.Instance;
|
||||
if (!(instance != null))
|
||||
{
|
||||
return;
|
||||
}
|
||||
foreach (Player item in instance.AllAlivePlayersList.Where((Player x) => !x.IsYourPlayer))
|
||||
{
|
||||
if (!item.IsYourPlayer)
|
||||
{
|
||||
item.ActiveHealthController.Kill(EDamageType.Landmine);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void TPall()
|
||||
{
|
||||
GameWorld instance = Singleton<GameWorld>.Instance;
|
||||
if (!(instance != null))
|
||||
{
|
||||
return;
|
||||
}
|
||||
foreach (Player item in instance.AllAlivePlayersList.Where((Player x) => !x.IsYourPlayer))
|
||||
{
|
||||
bool flag = Main.IsBossByName(item.Profile.Info.Nickname.Localized());
|
||||
WildSpawnType role = item.Profile.Info.Settings.Role;
|
||||
if (!item.IsYourPlayer)
|
||||
{
|
||||
if (!Settings.tpboss && !Settings.tppmc)
|
||||
{
|
||||
Vector3 position = Main.LocalPlayer.gameObject.transform.position;
|
||||
Vector3 forward = Main.LocalPlayer.gameObject.transform.forward;
|
||||
float num = 5f;
|
||||
Vector3 position2 = position + forward * num;
|
||||
item.Teleport(position2, onServerToo: true);
|
||||
}
|
||||
if (Settings.tpboss && flag && role != WildSpawnType.pmcUSEC && role != WildSpawnType.pmcBEAR)
|
||||
{
|
||||
Vector3 position3 = Main.LocalPlayer.gameObject.transform.position;
|
||||
Vector3 forward2 = Main.LocalPlayer.gameObject.transform.forward;
|
||||
float num2 = 5f;
|
||||
Vector3 position4 = position3 + forward2 * num2;
|
||||
item.Teleport(position4, onServerToo: true);
|
||||
}
|
||||
if (role == WildSpawnType.pmcUSEC || (role == WildSpawnType.pmcBEAR && Settings.tppmc))
|
||||
{
|
||||
Vector3 position5 = Main.LocalPlayer.gameObject.transform.position;
|
||||
Vector3 forward3 = Main.LocalPlayer.gameObject.transform.forward;
|
||||
float num3 = 5f;
|
||||
Vector3 position6 = position5 + forward3 * num3;
|
||||
item.Teleport(position6, onServerToo: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void RemoveVisor()
|
||||
{
|
||||
Main._visorEffect.Intensity = (Settings.NoVisor ? 0f : 1f);
|
||||
}
|
||||
|
||||
public static void InstaHit()
|
||||
{
|
||||
if (Main.LocalPlayer.HandsController.Item is Weapon)
|
||||
{
|
||||
Main.LocalPlayerWeapon.Template.Velocity = 1000f;
|
||||
Main.LocalPlayerWeapon.CurrentAmmoTemplate.PenetrationChanceObstacle = 100000f;
|
||||
Main.LocalPlayerWeapon.CurrentAmmoTemplate.PenetrationPower = 1000000;
|
||||
Main.LocalPlayerWeapon.CurrentAmmoTemplate.RicochetChance = 0f;
|
||||
}
|
||||
}
|
||||
|
||||
public static void NoRecoil()
|
||||
{
|
||||
if (!Settings.NoRecoil || Main.LocalPlayer == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
IRecoilShotEffect recoilShotEffect = Main.LocalPlayer.ProceduralWeaponAnimation.Shootingg?.CurrentRecoilEffect;
|
||||
if (recoilShotEffect != null)
|
||||
{
|
||||
recoilShotEffect.CameraRotationRecoilEffect.Intensity = 0f;
|
||||
recoilShotEffect.HandPositionRecoilEffect.Intensity = 0f;
|
||||
recoilShotEffect.HandRotationRecoilEffect.Intensity = 0f;
|
||||
ProceduralWeaponAnimation proceduralWeaponAnimation = Main.LocalPlayer.ProceduralWeaponAnimation;
|
||||
if (!(proceduralWeaponAnimation == null))
|
||||
{
|
||||
MotionEffector motionReact = proceduralWeaponAnimation.MotionReact;
|
||||
motionReact.Intensity = 0f;
|
||||
motionReact.SwayFactors = Vector3.zero;
|
||||
motionReact.Velocity = Vector3.zero;
|
||||
proceduralWeaponAnimation.Breath.Intensity = 0f;
|
||||
proceduralWeaponAnimation.Walk.Intensity = 0f;
|
||||
proceduralWeaponAnimation.ForceReact.Intensity = 0f;
|
||||
proceduralWeaponAnimation.WalkEffectorEnabled = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void RemoveNoRecoil()
|
||||
{
|
||||
if (Main.LocalPlayer == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
Player localPlayer = Main.LocalPlayer;
|
||||
if (!(localPlayer.ProceduralWeaponAnimation == null))
|
||||
{
|
||||
IRecoilShotEffect recoilShotEffect = localPlayer.ProceduralWeaponAnimation.Shootingg?.CurrentRecoilEffect;
|
||||
if (recoilShotEffect != null)
|
||||
{
|
||||
recoilShotEffect.CameraRotationRecoilEffect.Intensity = 1f;
|
||||
recoilShotEffect.HandPositionRecoilEffect.Intensity = 1f;
|
||||
recoilShotEffect.HandRotationRecoilEffect.Intensity = 1f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void NoJam()
|
||||
{
|
||||
if (Main.LocalPlayer.HandsController.Item is Weapon && Main.LocalPlayerWeapon.Template != null && Main.LocalPlayer != null)
|
||||
{
|
||||
Main.LocalPlayerWeapon.Template.AllowOverheat = false;
|
||||
Main.LocalPlayerWeapon.Template.AllowMisfire = false;
|
||||
Main.LocalPlayerWeapon.Template.AllowJam = false;
|
||||
Main.LocalPlayerWeapon.Template.AllowFeed = false;
|
||||
Main.LocalPlayerWeapon.Template.AllowSlide = false;
|
||||
Main.LocalPlayerWeapon.Template.DurabilityBurnRatio = 0f;
|
||||
}
|
||||
}
|
||||
|
||||
public static void RemoveNoJam()
|
||||
{
|
||||
if (Main.LocalPlayer.HandsController.Item is Weapon && Main.LocalPlayerWeapon != null)
|
||||
{
|
||||
Main.LocalPlayerWeapon.Template.AllowOverheat = true;
|
||||
Main.LocalPlayerWeapon.Template.AllowMisfire = true;
|
||||
Main.LocalPlayerWeapon.Template.AllowJam = true;
|
||||
Main.LocalPlayerWeapon.Template.AllowFeed = true;
|
||||
Main.LocalPlayerWeapon.Template.AllowSlide = true;
|
||||
Main.LocalPlayerWeapon.Template.DurabilityBurnRatio = 1f;
|
||||
}
|
||||
}
|
||||
|
||||
public static void ChangeFireRate()
|
||||
{
|
||||
if (!(Main.LocalPlayer.HandsController.Item is Weapon) || !(Main.LocalPlayer.HandsController.Item is Weapon weapon))
|
||||
{
|
||||
return;
|
||||
}
|
||||
Main.LocalPlayerWeapon.Template.bFirerate = 2000;
|
||||
weapon.GetItemComponent<FireModeComponent>().FireMode = Weapon.EFireMode.fullauto;
|
||||
Main.LocalPlayer.GetComponent<Player.FirearmController>().Item.Template.BoltAction = false;
|
||||
if (Main.LocalPlayer.HandsController is Player.FirearmController firearmController)
|
||||
{
|
||||
WeaponTemplate weaponTemplate = firearmController.Item?.Template;
|
||||
if (weaponTemplate != null)
|
||||
{
|
||||
weaponTemplate.BoltAction = false;
|
||||
weaponTemplate.bFirerate = 2000;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void Fullbright()
|
||||
{
|
||||
if (Settings.fullbright)
|
||||
{
|
||||
if (!GameFullBright.LightCalled && GameFullBright.Enabled)
|
||||
{
|
||||
GameFullBright.LightGameObject = new GameObject("Fullbright");
|
||||
GameFullBright.FullBrightLight = GameFullBright.LightGameObject.AddComponent<Light>();
|
||||
GameFullBright.FullBrightLight.color = new Color(1f, 0.96f, 0.91f);
|
||||
GameFullBright.FullBrightLight.range = 2000f;
|
||||
GameFullBright.FullBrightLight.intensity = 0.6f;
|
||||
GameFullBright.LightCalled = true;
|
||||
}
|
||||
GameFullBright.Enabled = true;
|
||||
if (!(GameFullBright.FullBrightLight == null))
|
||||
{
|
||||
Main._tempPosition = Main.LocalPlayer.Transform.position;
|
||||
Main._tempPosition.y += 0.2f;
|
||||
GameFullBright.LightGameObject.transform.position = Main._tempPosition;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void RemoveFullbright()
|
||||
{
|
||||
if (GameFullBright.FullBrightLight != null)
|
||||
{
|
||||
UnityEngine.Object.Destroy(GameFullBright.FullBrightLight);
|
||||
}
|
||||
GameFullBright.LightCalled = false;
|
||||
}
|
||||
|
||||
public static void Minecraftmode()
|
||||
{
|
||||
GameObject gameObject = GameObject.CreatePrimitive(PrimitiveType.Cube);
|
||||
gameObject.transform.localScale = new Vector3(1f, 1f, 1f);
|
||||
Vector3 position = Main.LocalPlayer.gameObject.transform.position;
|
||||
Vector3 forward = Main.LocalPlayer.gameObject.transform.forward;
|
||||
float num = 3f;
|
||||
RaycastHit hitInfo;
|
||||
Vector3 position2 = ((!Physics.Raycast(new Ray(position, forward), out hitInfo, num)) ? (position + forward * num) : hitInfo.point);
|
||||
gameObject.transform.position = position2;
|
||||
Material material = Main.bundle.LoadAsset<Material>("minecraftmaterial");
|
||||
if (material != null)
|
||||
{
|
||||
gameObject.GetComponent<Renderer>().material = material;
|
||||
}
|
||||
AudioClip audioClip = Main.bundle.LoadAsset<AudioClip>("minecraftsound");
|
||||
if (audioClip != null)
|
||||
{
|
||||
AudioSource audioSource = gameObject.AddComponent<AudioSource>();
|
||||
audioSource.clip = audioClip;
|
||||
audioSource.Play();
|
||||
}
|
||||
}
|
||||
|
||||
public static void Invisibletobots()
|
||||
{
|
||||
}
|
||||
|
||||
public static void TestShelling(Vector3 shellingpos)
|
||||
{
|
||||
Main.audioSource.clip = Main.artillerycall;
|
||||
Main.audioSource.volume = 0.1f;
|
||||
Main.audioSource.Play();
|
||||
Main.GameWorld.ServerShellingController.StartShellingPosition(shellingpos);
|
||||
PlayArtilleryAnswerAsync();
|
||||
}
|
||||
|
||||
private static async void PlayArtilleryAnswerAsync()
|
||||
{
|
||||
await Task.Delay(3000);
|
||||
Main.audioSource.clip = Main.artilleryaccept;
|
||||
Main.audioSource.volume = 0.1f;
|
||||
Main.audioSource.Play();
|
||||
}
|
||||
|
||||
public static void AlwaysSurvive()
|
||||
{
|
||||
ConsoleScreen.Log("Hooking alwayssurvived...");
|
||||
Type type = Main.FindType("LocalGame");
|
||||
if (type != null)
|
||||
{
|
||||
MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
|
||||
MethodInfo[] array = methods;
|
||||
for (int i = 0; i < array.Length; i++)
|
||||
{
|
||||
_ = array[i];
|
||||
}
|
||||
MethodInfo methodInfo = methods.FirstOrDefault((MethodInfo m) => m.Name == "Stop");
|
||||
if (methodInfo != null)
|
||||
{
|
||||
ConsoleScreen.Log("Stop method found successfully.");
|
||||
ConsoleScreen.Log($"Stop method details - Name: {methodInfo.Name}, ReturnType: {methodInfo.ReturnType}, IsPublic: {methodInfo.IsPublic}, IsPrivate: {methodInfo.IsPrivate}, IsProtected: {methodInfo.IsFamily}");
|
||||
try
|
||||
{
|
||||
Main.alwayssurvivedhook = new TestHook();
|
||||
Main.alwayssurvivedhook.Init(methodInfo, typeof(StatusManager).GetMethod("Stop_Hook"));
|
||||
Main.alwayssurvivedhook.Hook();
|
||||
ConsoleScreen.Log("alwayssurvived hook applied successfully.");
|
||||
Main.nothooked = false;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ConsoleScreen.Log("Error while hooking method: " + ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ConsoleScreen.Log("Failed to find LocalGame type.");
|
||||
}
|
||||
}
|
||||
|
||||
public static void RemoveFilters1()
|
||||
{
|
||||
ConsoleScreen.Log("Hooking CheckItemFilter...");
|
||||
Type type = Main.FindType("ItemFilter");
|
||||
if (type != null)
|
||||
{
|
||||
MethodInfo methodInfo = type.GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).FirstOrDefault((MethodInfo m) => m.Name == "CheckItemFilter");
|
||||
if (methodInfo != null)
|
||||
{
|
||||
ConsoleScreen.Log("CheckItemFilter method found successfully.");
|
||||
try
|
||||
{
|
||||
Main.checkItemFilterHook = new TestHook();
|
||||
Main.checkItemFilterHook.Init(methodInfo, typeof(StatusManager).GetMethod("CheckItemFilter_Hook"));
|
||||
Main.checkItemFilterHook.Hook();
|
||||
ConsoleScreen.Log("CheckItemFilter hook applied successfully.");
|
||||
Main.hookedCheckItemFilter = true;
|
||||
return;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ConsoleScreen.Log("Error while hooking CheckItemFilter method: " + ex.Message);
|
||||
return;
|
||||
}
|
||||
}
|
||||
ConsoleScreen.Log("CheckItemFilter method not found.");
|
||||
}
|
||||
else
|
||||
{
|
||||
ConsoleScreen.Log("Failed to find ItemFilter type.");
|
||||
}
|
||||
}
|
||||
|
||||
public static void RemoveFilters2()
|
||||
{
|
||||
ConsoleScreen.Log("Hooking CheckItemExcludedFilter...");
|
||||
Type type = Main.FindType("ItemFilter");
|
||||
if (type != null)
|
||||
{
|
||||
MethodInfo methodInfo = type.GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).FirstOrDefault((MethodInfo m) => m.Name == "CheckItemExcludedFilter");
|
||||
if (methodInfo != null)
|
||||
{
|
||||
ConsoleScreen.Log("CheckItemExcludedFilter method found successfully.");
|
||||
try
|
||||
{
|
||||
Main.checkItemExcludedFilterHook = new TestHook();
|
||||
Main.checkItemExcludedFilterHook.Init(methodInfo, typeof(StatusManager).GetMethod("CheckItemExcludedFilter_Hook"));
|
||||
Main.checkItemExcludedFilterHook.Hook();
|
||||
ConsoleScreen.Log("CheckItemExcludedFilter hook applied successfully.");
|
||||
Main.hookedCheckItemExcludedFilter = true;
|
||||
return;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ConsoleScreen.Log("Error while hooking CheckItemExcludedFilter method: " + ex.Message);
|
||||
return;
|
||||
}
|
||||
}
|
||||
ConsoleScreen.Log("CheckItemExcludedFilter method not found.");
|
||||
}
|
||||
else
|
||||
{
|
||||
ConsoleScreen.Log("Failed to find ItemFilter type.");
|
||||
}
|
||||
}
|
||||
|
||||
public static void CheckAndAddAmmoToChamber()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!(Main.LocalPlayer != null) || Main.LocalPlayerWeapon == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
Weapon localPlayerWeapon = Main.LocalPlayerWeapon;
|
||||
if (localPlayerWeapon.IsGrenadeLauncher)
|
||||
{
|
||||
HandleGrenadeAmmo(localPlayerWeapon);
|
||||
return;
|
||||
}
|
||||
_EF1A currentMagazine = localPlayerWeapon.GetCurrentMagazine();
|
||||
string ammoID = Main.ammoID;
|
||||
Item item = new ItemFactory().CreateItem(ammoID);
|
||||
if (item == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (currentMagazine != null && currentMagazine.Count < currentMagazine.MaxCount)
|
||||
{
|
||||
currentMagazine.Cartridges?.Add(item, simulate: false);
|
||||
return;
|
||||
}
|
||||
Slot[] chambers = localPlayerWeapon.Chambers;
|
||||
for (int i = 0; i < chambers.Length; i++)
|
||||
{
|
||||
chambers[i].Add(item, simulate: false);
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private static void HandleGrenadeAmmo(Weapon weapon)
|
||||
{
|
||||
try
|
||||
{
|
||||
ItemFactory itemFactory = new ItemFactory();
|
||||
IEnumerable<Slot> allSlots = weapon.AllSlots;
|
||||
if (allSlots == null || !allSlots.Any())
|
||||
{
|
||||
return;
|
||||
}
|
||||
string grenadeId = Main.ammoID;
|
||||
if (string.IsNullOrEmpty(grenadeId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
foreach (Slot item2 in allSlots)
|
||||
{
|
||||
ItemFilter[] filters = item2.Filters;
|
||||
if (filters != null && filters.Length != 0 && filters.Any((ItemFilter filter) => filter != null && filter.Filter?.Contains(grenadeId) == true))
|
||||
{
|
||||
Item item = itemFactory.CreateItem(grenadeId);
|
||||
if (item != null)
|
||||
{
|
||||
item.SpawnedInSession = true;
|
||||
item2.AddWithoutRestrictions(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public static void Teleport(string tpname)
|
||||
{
|
||||
try
|
||||
{
|
||||
tpname = tpname.ToLower();
|
||||
List<GameLootItem> list = new List<GameLootItem>();
|
||||
foreach (GameLootItem gameLootItem2 in ItemESP._gameLootItems)
|
||||
{
|
||||
ItemCategories itemcat = gameLootItem2.Itemcat;
|
||||
bool flag = false;
|
||||
if (itemcat == ItemCategories.Quest && Settings.questTP)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
else if (itemcat == ItemCategories.Superrare && Settings.superrareTP)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
else if (itemcat == ItemCategories.Kappa && Settings.kappaTP)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
else if (itemcat == ItemCategories.Stim && Settings.StimTP)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
else if (itemcat == ItemCategories.Wishlist && Settings.TPwishlistitem)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
else if (itemcat == ItemCategories.Hideout && Settings.TPhideoutitem)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
else if (gameLootItem2.itemprice > Settings.ESPPRICEfiltervalue && Settings.TPHVitem)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
if ((gameLootItem2.LocalizedName.ToLower().Contains(tpname) || gameLootItem2.ShortName.ToLower().Contains(tpname)) && Settings.searchTP)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
if (flag)
|
||||
{
|
||||
list.Add(gameLootItem2);
|
||||
}
|
||||
}
|
||||
if (Settings.questTP)
|
||||
{
|
||||
List<LootItem> list2 = Main.GameWorld.LootItems.Where((LootItem x) => x.Item.Template.QuestItem).ToList();
|
||||
foreach (LootItem item2 in list2)
|
||||
{
|
||||
GameLootItem item = new GameLootItem(item2);
|
||||
list.Add(item);
|
||||
}
|
||||
ConsoleScreen.Log($"[Teleport] Static spawned quest items found: {list2.Count}");
|
||||
}
|
||||
List<GameLootItem> list3 = list.OrderBy((GameLootItem gameLootItem2) => gameLootItem2.LocalizedName.ToLower()).ToList();
|
||||
int count = list3.Count;
|
||||
if (count > 0)
|
||||
{
|
||||
float num = 360f / (float)count;
|
||||
float loottpradius = Settings.loottpradius;
|
||||
Vector3 position = Main.LocalPlayer.gameObject.transform.position;
|
||||
position.y += 1f;
|
||||
for (int num2 = 0; num2 < count; num2++)
|
||||
{
|
||||
float f = (float)Math.PI / 180f * ((float)num2 * num);
|
||||
float num3 = Mathf.Cos(f) * loottpradius;
|
||||
float num4 = Mathf.Sin(f) * loottpradius;
|
||||
Vector3 position2 = new Vector3(position.x + num3, position.y, position.z + num4);
|
||||
GameLootItem gameLootItem = list3[num2];
|
||||
try
|
||||
{
|
||||
Rigidbody component = gameLootItem.LootItem.gameObject.GetComponent<Rigidbody>();
|
||||
if (component != null)
|
||||
{
|
||||
component.isKinematic = true;
|
||||
}
|
||||
gameLootItem.LootItem.gameObject.transform.position = position2;
|
||||
GameObject obj = GameObject.CreatePrimitive(PrimitiveType.Sphere);
|
||||
obj.GetComponent<SphereCollider>().enabled = false;
|
||||
obj.transform.localScale = new Vector3(0.1f, 0.1f, 0.1f);
|
||||
obj.transform.position = position2;
|
||||
UnityEngine.Object.Destroy(obj, 1f);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ConsoleScreen.Log("[Teleport] Error teleporting item '" + gameLootItem.LocalizedName + "': " + ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
ConsoleScreen.Log("[Teleport] Teleportation complete.");
|
||||
}
|
||||
catch (Exception ex2)
|
||||
{
|
||||
ConsoleScreen.Log("[Teleport] Exception: " + ex2.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public static void BulletsPerShot(int bulletsPerShot)
|
||||
{
|
||||
if (Main.LocalPlayer.HandsController.Item is Weapon)
|
||||
{
|
||||
Main.LocalPlayerWeapon.CurrentAmmoTemplate.ProjectileCount = Settings.bulletspershot;
|
||||
}
|
||||
}
|
||||
|
||||
public static void ExtendItemHitbox(GameLootItem item)
|
||||
{
|
||||
if (item?.LootItem?.gameObject != null)
|
||||
{
|
||||
GameObject obj = item.LootItem.gameObject;
|
||||
obj.transform.localScale *= 5f;
|
||||
Collider component = obj.GetComponent<Collider>();
|
||||
if (component != null)
|
||||
{
|
||||
component.transform.localScale *= 5f;
|
||||
component.enabled = false;
|
||||
component.enabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void HandleBigHeads()
|
||||
{
|
||||
if (Main.OnlineGamePlayers.Count > 0)
|
||||
{
|
||||
foreach (OnlineGamePlayer onlineGamePlayer in Main.OnlineGamePlayers)
|
||||
{
|
||||
if (onlineGamePlayer.role != OnlineGamePlayer.PlayerType.Teammate)
|
||||
{
|
||||
ObservedPlayerView player = onlineGamePlayer.Player;
|
||||
if (player != null && player.PlayerBones != null && player.PlayerBones.Head != null)
|
||||
{
|
||||
int instanceID = player.GetInstanceID();
|
||||
if (!isHeadScaled.ContainsKey(instanceID))
|
||||
{
|
||||
isHeadScaled[instanceID] = false;
|
||||
originalHeadScales[instanceID] = player.PlayerBones.Head.Original.localScale;
|
||||
}
|
||||
float num = 4f;
|
||||
if (Settings.BigHeads)
|
||||
{
|
||||
if (!isHeadScaled[instanceID])
|
||||
{
|
||||
Vector3 localScale = originalHeadScales[instanceID] * num;
|
||||
player.PlayerBones.Head.Original.localScale = localScale;
|
||||
isHeadScaled[instanceID] = true;
|
||||
}
|
||||
}
|
||||
else if (!Settings.BigHeads && isHeadScaled[instanceID])
|
||||
{
|
||||
player.PlayerBones.Head.Original.localScale = originalHeadScales[instanceID];
|
||||
isHeadScaled[instanceID] = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
foreach (GamePlayer gamePlayer in Main.GamePlayers)
|
||||
{
|
||||
Player player2 = gamePlayer.Player;
|
||||
if (!(player2 != null) || !(player2.PlayerBones != null) || player2.PlayerBones.Head == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
int instanceID2 = player2.GetInstanceID();
|
||||
if (!isHeadScaled.ContainsKey(instanceID2))
|
||||
{
|
||||
isHeadScaled[instanceID2] = false;
|
||||
originalHeadScales[instanceID2] = player2.PlayerBones.Head.Original.localScale;
|
||||
}
|
||||
if (Settings.BigHeads)
|
||||
{
|
||||
if (!isHeadScaled[instanceID2])
|
||||
{
|
||||
Vector3 localScale2 = originalHeadScales[instanceID2] * 4f;
|
||||
player2.PlayerBones.Head.Original.localScale = localScale2;
|
||||
isHeadScaled[instanceID2] = true;
|
||||
}
|
||||
}
|
||||
else if (!Settings.BigHeads && isHeadScaled[instanceID2])
|
||||
{
|
||||
player2.PlayerBones.Head.Original.localScale = originalHeadScales[instanceID2];
|
||||
isHeadScaled[instanceID2] = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void FPSExploit()
|
||||
{
|
||||
if (!isPlayHooked)
|
||||
{
|
||||
MethodInfo method = typeof(Player).GetMethod("PlayTripwireInteractionSound", BindingFlags.Instance | BindingFlags.Public);
|
||||
MethodInfo method2 = typeof(TripwireHooks).GetMethod("PlayTripwireInteractionSound_Hook", BindingFlags.Static | BindingFlags.Public);
|
||||
PlayTripwireInteractionHook = new TestHook();
|
||||
PlayTripwireInteractionHook.Init(method, method2);
|
||||
PlayTripwireInteractionHook.Hook();
|
||||
isPlayHooked = true;
|
||||
}
|
||||
ClientPlayer clientPlayer = (ClientPlayer)Main.LocalPlayer;
|
||||
clientPlayer.PlayTripwireInteractionSound(10f, hasMultiTool: false);
|
||||
MethodInfo method3 = typeof(ClientPlayer).GetMethod("SendTripwireInteractionSoundState", BindingFlags.Instance | BindingFlags.NonPublic);
|
||||
if (method3 != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
EInteractionStatus eInteractionStatus = EInteractionStatus.Started;
|
||||
bool flag = false;
|
||||
bool flag2 = false;
|
||||
method3.Invoke(clientPlayer, new object[3] { eInteractionStatus, flag, flag2 });
|
||||
ConsoleScreen.Log("Called SendTripwireInteractionSoundState with parameters: " + $"interactionStatus={eInteractionStatus}, isSuccess={flag}, hasMultiTool={flag2}.");
|
||||
return;
|
||||
}
|
||||
catch (Exception arg)
|
||||
{
|
||||
ConsoleScreen.Log($"Error with sending tripwire interaction : \n {arg}");
|
||||
return;
|
||||
}
|
||||
}
|
||||
ConsoleScreen.Log("Failed to locate SendTripwireInteractionSoundState method.");
|
||||
}
|
||||
|
||||
public static void PreventTripwireSoundExploit()
|
||||
{
|
||||
if (!isantifpshooked)
|
||||
{
|
||||
AntiFPSDropHook = new TestHook();
|
||||
AntiFPSDropHook.Init(typeof(ObservedPlayerAudioController).GetMethod("method_14", BindingFlags.Instance | BindingFlags.NonPublic), typeof(TripwireHooks).GetMethod("AntiTripWire_Hook"));
|
||||
AntiFPSDropHook.Hook();
|
||||
isantifpshooked = true;
|
||||
ConsoleScreen.Log("hooked sound protection");
|
||||
}
|
||||
}
|
||||
|
||||
public static void changeskybox()
|
||||
{
|
||||
cachedskyboxmaterial = Main.levelSettings.skybox;
|
||||
Material skybox = Main.bundle.LoadAsset<Material>("skyboxmaterial.mat");
|
||||
if (cachedskyboxmaterial != null)
|
||||
{
|
||||
Main.levelSettings.skybox = skybox;
|
||||
}
|
||||
}
|
||||
}
|
||||
16
stoopid.raw/stupid.solutions/GameFullBright.cs
Normal file
16
stoopid.raw/stupid.solutions/GameFullBright.cs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
using UnityEngine;
|
||||
|
||||
namespace stupid.solutions;
|
||||
|
||||
public class GameFullBright
|
||||
{
|
||||
public static bool Enabled = false;
|
||||
|
||||
public static GameObject LightGameObject;
|
||||
|
||||
public static Light FullBrightLight;
|
||||
|
||||
public static bool LightEnabled = true;
|
||||
|
||||
public static bool LightCalled;
|
||||
}
|
||||
16
stoopid.raw/stupid.solutions/ItemTemplate.cs
Normal file
16
stoopid.raw/stupid.solutions/ItemTemplate.cs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace stupid.solutions;
|
||||
|
||||
[Serializable]
|
||||
public class ItemTemplate
|
||||
{
|
||||
public int StackMaxSize { get; set; }
|
||||
|
||||
public bool QuestItem { get; set; }
|
||||
|
||||
public string Description { get; set; }
|
||||
|
||||
public Dictionary<string, SlotData> Slots { get; set; }
|
||||
}
|
||||
15
stoopid.raw/stupid.solutions/Loader.cs
Normal file
15
stoopid.raw/stupid.solutions/Loader.cs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
using UnityEngine;
|
||||
|
||||
namespace stupid.solutions;
|
||||
|
||||
public class Loader
|
||||
{
|
||||
public static GameObject HookObject;
|
||||
|
||||
public static void Load()
|
||||
{
|
||||
HookObject = new GameObject();
|
||||
HookObject.AddComponent<Main>();
|
||||
Object.DontDestroyOnLoad(HookObject);
|
||||
}
|
||||
}
|
||||
308
stoopid.raw/stupid.solutions/LocationsFixerV2.cs
Normal file
308
stoopid.raw/stupid.solutions/LocationsFixerV2.cs
Normal file
|
|
@ -0,0 +1,308 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using EFT;
|
||||
using EFT.Interactive;
|
||||
using EFT.UI;
|
||||
using stupid.solutions.Features;
|
||||
using stupid.solutions.Features.ESP;
|
||||
using UnityEngine;
|
||||
|
||||
namespace stupid.solutions;
|
||||
|
||||
internal class LocationsFixerV2 : MonoBehaviour
|
||||
{
|
||||
private static List<object> cachedLocations = new List<object>();
|
||||
|
||||
public static TarkovApplication _tarkovApplication;
|
||||
|
||||
private static TestHook hookGetBoolForProfile;
|
||||
|
||||
private bool hookedpveonline;
|
||||
|
||||
private bool exfilfixtoggle;
|
||||
|
||||
public static List<TransitPoint> transitPoints = new List<TransitPoint>();
|
||||
|
||||
private bool foundtransitpoints;
|
||||
|
||||
private string infoText;
|
||||
|
||||
public static dynamic clientapp;
|
||||
|
||||
public static bool fixlocations = false;
|
||||
|
||||
private static TestHook TransitDataHook;
|
||||
|
||||
private static bool isTransitDataHooked = false;
|
||||
|
||||
private static object transitHandlerInstance;
|
||||
|
||||
private static readonly HashSet<string> loggedDictionaries = new HashSet<string>();
|
||||
|
||||
private bool monitortransit;
|
||||
|
||||
private static List<string> onlinelocationids = new List<string>();
|
||||
|
||||
public bool updatep = true;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (updatep)
|
||||
{
|
||||
_ = monitortransit;
|
||||
Input.GetKeyDown(KeyCode.Home);
|
||||
FixTransitsAndLocations();
|
||||
_ = hookedpveonline;
|
||||
if (Main.GameWorld != null && transitPoints.Count <= 0 && Main.GameWorld.LocationId != "Labyrinth")
|
||||
{
|
||||
GetTransitPoints();
|
||||
}
|
||||
if (Main.GameWorld == null && transitPoints.Count > 0)
|
||||
{
|
||||
transitPoints.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void SetRaidSettings()
|
||||
{
|
||||
foreach (_E6CC.Location value in UnityEngine.Object.FindObjectOfType<TarkovApplication>().GetClientBackEndSession().LocationSettings.locations.Values)
|
||||
{
|
||||
value.ForceOnlineRaidInPVE = false;
|
||||
value.EscapeTimeLimit = 9999;
|
||||
ConsoleScreen.Log("Updated Settings For Location " + value.Id);
|
||||
}
|
||||
}
|
||||
|
||||
private void FixTransitsAndLocations()
|
||||
{
|
||||
if (!TarkovApplication.Exist(out var tarkovApplication) || tarkovApplication == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
_tarkovApplication = tarkovApplication;
|
||||
_EA29 clientBackEndSession = tarkovApplication.GetClientBackEndSession();
|
||||
if (clientBackEndSession?.LocationSettings == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
foreach (_E6CC.Location value in clientBackEndSession.LocationSettings.locations.Values)
|
||||
{
|
||||
if (value.ForceOnlineRaidInPVE)
|
||||
{
|
||||
value.ForceOnlineRaidInPVE = false;
|
||||
ConsoleScreen.Log("[Fix] Patched Location " + value.Name + " → ForceOnlineRaidInPVE = false");
|
||||
if (!onlinelocationids.Contains(value.Id))
|
||||
{
|
||||
onlinelocationids.Add(value.Id);
|
||||
ConsoleScreen.Log(value.Name + " Added to ID list (ID : " + value.Id + ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
_ = _tarkovApplication.CurrentRaidSettings;
|
||||
}
|
||||
|
||||
public void GetTransitPoints()
|
||||
{
|
||||
transitPoints.Clear();
|
||||
infoText = "";
|
||||
TransitPoint[] array = UnityEngine.Object.FindObjectsOfType<TransitPoint>();
|
||||
if (array != null && array.Length != 0)
|
||||
{
|
||||
TransitPoint[] array2 = array;
|
||||
foreach (TransitPoint transitPoint in array2)
|
||||
{
|
||||
transitPoints.Add(transitPoint);
|
||||
string text = "Transit Point Information:\nID: " + transitPoint.parameters.id.ToString().Trim() + "\nTransit Point Name: " + transitPoint.name.Transliterate() + "\n---------------------------";
|
||||
ConsoleScreen.Log(text);
|
||||
infoText = infoText + text + "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void LogTransitPoints()
|
||||
{
|
||||
if (transitPoints == null || transitPoints.Count <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
Debug.Log($"TransitPoints Count: {transitPoints.Count}");
|
||||
foreach (TransitPoint transitPoint in transitPoints)
|
||||
{
|
||||
if (transitPoint == null)
|
||||
{
|
||||
Debug.LogWarning("Null TransitPoint found in list.");
|
||||
continue;
|
||||
}
|
||||
Debug.Log("TransitPoint Instance: " + transitPoint.name);
|
||||
if (transitPoint.Controller != null && transitPoint.Controller.alreadyTransits != null && transitPoint.Controller.alreadyTransits.Count > 0)
|
||||
{
|
||||
Debug.Log($"alreadyTransits Count: {transitPoint.Controller.alreadyTransits.Count}");
|
||||
foreach (KeyValuePair<string, _E98D> alreadyTransit in transitPoint.Controller.alreadyTransits)
|
||||
{
|
||||
Debug.Log($"alreadyTransits Key: {alreadyTransit.Key}, Value: {alreadyTransit.Value}");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("alreadyTransits is empty or null.");
|
||||
}
|
||||
}
|
||||
if (_tarkovApplication != null)
|
||||
{
|
||||
_E869 transitionStatus = _tarkovApplication.transitionStatus;
|
||||
if (transitionStatus.InTransition)
|
||||
{
|
||||
Debug.Log("--- TarkovApplication.transitionStatus (InTransition == true) ---");
|
||||
Debug.Log($"InTransition: {transitionStatus.InTransition}");
|
||||
Debug.Log("Location: " + transitionStatus.Location);
|
||||
Debug.Log($"Training: {transitionStatus.Training}");
|
||||
Debug.Log($"Side: {transitionStatus.Side}");
|
||||
Debug.Log($"Mode: {transitionStatus.Mode}");
|
||||
Debug.Log($"Time: {transitionStatus.Time}");
|
||||
Debug.Log("-----------------------------------------");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("transitionStatus.InTransition is false. Skipping detailed log.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning("_tarkovApplication is null!");
|
||||
}
|
||||
}
|
||||
|
||||
public static void StartTransitByID(int transitId)
|
||||
{
|
||||
if (Main.LocalPlayer == null)
|
||||
{
|
||||
ConsoleScreen.Log("[ERROR] Local player is null.");
|
||||
return;
|
||||
}
|
||||
if (transitPoints == null || transitPoints.Count == 0)
|
||||
{
|
||||
ConsoleScreen.Log("[ERROR] No cached transit points. Did you call GetTransitPoints()?");
|
||||
return;
|
||||
}
|
||||
TransitPoint transitPoint = transitPoints.FirstOrDefault((TransitPoint tp) => tp.parameters.id == transitId);
|
||||
if (transitPoint == null || transitPoint.Controller == null)
|
||||
{
|
||||
ConsoleScreen.Log($"[ERROR] Invalid Transit Point ID or missing controller: {transitId}");
|
||||
return;
|
||||
}
|
||||
ConsoleScreen.Log($"[TRANSIT] Starting Transit -> ID: {transitPoint.parameters.id} | Name: {transitPoint.name.Transliterate()}");
|
||||
int playersCount = 1;
|
||||
string hash = GenerateTransitHash(transitPoint);
|
||||
Dictionary<string, ProfileKey> profileKeys = GetProfileKeys(Main.LocalPlayer.ProfileId);
|
||||
transitPoint.Controller.Transit(transitPoint, playersCount, hash, profileKeys, Main.LocalPlayer);
|
||||
transitPoints.Clear();
|
||||
Main.GamePlayers.Clear();
|
||||
ItemESP._gameLootItems.Clear();
|
||||
CorpseEsp.Corpses.Clear();
|
||||
Main.LocalPlayer = null;
|
||||
Main.LocalPlayerWeapon = null;
|
||||
Main.GameWorld = null;
|
||||
Main.MainCamera = null;
|
||||
}
|
||||
|
||||
private static string GenerateTransitHash(TransitPoint transitPoint)
|
||||
{
|
||||
return $"{transitPoint.parameters.id}_{DateTime.Now.Ticks}";
|
||||
}
|
||||
|
||||
private static Dictionary<string, ProfileKey> GetProfileKeys(string profileId)
|
||||
{
|
||||
return new Dictionary<string, ProfileKey>();
|
||||
}
|
||||
|
||||
public static void TransferItemsFromTempStash(int transitid)
|
||||
{
|
||||
TransitPoint transitPoint = transitPoints.FirstOrDefault((TransitPoint tp) => tp.parameters.id == transitid);
|
||||
if (!(transitPoint == null) && transitPoint.Controller?.TransferItemsController != null)
|
||||
{
|
||||
ConsoleScreen.Log("Sending Items To Stash for Transit Point " + transitPoint.name);
|
||||
transitPoint.Controller.TransferItemsController.MoveItemsFromTempStashToTransferStash(Main.LocalPlayer);
|
||||
}
|
||||
}
|
||||
|
||||
public static void StopTransitCountdown()
|
||||
{
|
||||
if (transitPoints == null || transitPoints.Count == 0)
|
||||
{
|
||||
ConsoleScreen.Log("No Transit Points Available To Stop.");
|
||||
return;
|
||||
}
|
||||
foreach (TransitPoint transitPoint in transitPoints)
|
||||
{
|
||||
if (transitPoint.Controller != null)
|
||||
{
|
||||
transitPoint.Controller.transitPlayers.Clear();
|
||||
ConsoleScreen.Log("Stopped Transit Countdown For: " + transitPoint.name.Localized());
|
||||
}
|
||||
else
|
||||
{
|
||||
ConsoleScreen.Log("Transit Controller Is Null For: " + transitPoint.name.Localized());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static bool GetBoolForProfile_Hook(string variable, bool defaultValue)
|
||||
{
|
||||
foreach (string onlinelocationid in onlinelocationids)
|
||||
{
|
||||
if (variable.Contains(onlinelocationid))
|
||||
{
|
||||
ConsoleScreen.Log("[Hook] Blocking online requirement for location ID: " + onlinelocationid + " in variable '" + variable + "'");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return (bool)hookGetBoolForProfile.OriginalMethod.Invoke(null, new object[2] { variable, defaultValue });
|
||||
}
|
||||
|
||||
private void HookGetBoolForProfile()
|
||||
{
|
||||
if (hookedpveonline)
|
||||
{
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
ConsoleScreen.Log("[Hook] Attempting to hook GetBoolForProfile...");
|
||||
Type type = Aimbot.Find("\ue984");
|
||||
if (type == null)
|
||||
{
|
||||
ConsoleScreen.Log("[Hook Error] Type '\ue984' not found.");
|
||||
return;
|
||||
}
|
||||
ConsoleScreen.Log("[Hook] Found type: " + type.FullName);
|
||||
MethodInfo method = type.GetMethod("GetBoolForProfile", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
|
||||
MethodInfo method2 = typeof(LocationsFixerV2).GetMethod("GetBoolForProfile_Hook", BindingFlags.Static | BindingFlags.Public);
|
||||
if (method == null)
|
||||
{
|
||||
ConsoleScreen.Log("[Hook Error] Method 'GetBoolForProfile' not found in " + type.FullName + ".");
|
||||
return;
|
||||
}
|
||||
if (method2 == null)
|
||||
{
|
||||
ConsoleScreen.Log("[Hook Error] Hook method 'GetBoolForProfile_Hook' not found.");
|
||||
return;
|
||||
}
|
||||
hookGetBoolForProfile = new TestHook();
|
||||
hookGetBoolForProfile.Init(method, method2);
|
||||
hookGetBoolForProfile.Hook();
|
||||
hookedpveonline = true;
|
||||
ConsoleScreen.Log("[Hook] Successfully hooked GetBoolForProfile.");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ConsoleScreen.Log("[Hook Error] " + ex.Message + "\n" + ex.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
926
stoopid.raw/stupid.solutions/Main.cs
Normal file
926
stoopid.raw/stupid.solutions/Main.cs
Normal file
|
|
@ -0,0 +1,926 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Comfort.Common;
|
||||
using EFT;
|
||||
using EFT.Ballistics;
|
||||
using EFT.Hideout;
|
||||
using EFT.Interactive;
|
||||
using EFT.InventoryLogic;
|
||||
using EFT.UI;
|
||||
using EFT.UI.DragAndDrop;
|
||||
using stupid.solutions.Data;
|
||||
using stupid.solutions.Features;
|
||||
using stupid.solutions.Features.ESP;
|
||||
using stupid.solutions.HenryBot;
|
||||
using stupid.solutions.stupid.solutions.Data;
|
||||
using stupid.solutions.stupid.solutions.enums;
|
||||
using stupid.solutions.Utils;
|
||||
using UnityEngine;
|
||||
|
||||
namespace stupid.solutions;
|
||||
|
||||
public class Main : MonoBehaviour
|
||||
{
|
||||
public static List<GamePlayer> GamePlayers = new List<GamePlayer>();
|
||||
|
||||
public static List<OnlineGamePlayer> OnlineGamePlayers = new List<OnlineGamePlayer>();
|
||||
|
||||
public static Player LocalPlayer;
|
||||
|
||||
public static LootItem LootItem;
|
||||
|
||||
public static GameWorld GameWorld;
|
||||
|
||||
public static LevelSettings levelSettings;
|
||||
|
||||
public static Camera MainCamera;
|
||||
|
||||
public static RaidSettings raidSettings;
|
||||
|
||||
public static ERaidMode raidMode;
|
||||
|
||||
public static Weapon LocalPlayerWeapon;
|
||||
|
||||
public static float _nextPlayerCacheTime;
|
||||
|
||||
private static readonly float _cachePlayersInterval = 10f;
|
||||
|
||||
public static NetworkPlayer networkPlayer;
|
||||
|
||||
public static List<Throwable> Grenades = new List<Throwable>();
|
||||
|
||||
public static LocalRaidSettings localRaidSettings;
|
||||
|
||||
public static ThermalVision _thermalVision;
|
||||
|
||||
public static VisorEffect _visorEffect;
|
||||
|
||||
internal static List<GameCorpse> Corpses = new List<GameCorpse>();
|
||||
|
||||
public static ELevelType levelType;
|
||||
|
||||
public static List<Location> locations = new List<Location>();
|
||||
|
||||
public static ItemViewFactory itemViewFactory;
|
||||
|
||||
public static List<IPlayer> Players = new List<IPlayer>();
|
||||
|
||||
private string _logFilePath;
|
||||
|
||||
private BotsController botsController;
|
||||
|
||||
public string soundName = "startup";
|
||||
|
||||
private Vector3 thirdPersonOffset = new Vector3(0f, 2f, -5f);
|
||||
|
||||
public static AudioSource audioSource;
|
||||
|
||||
public static AudioSource audioSourcehit;
|
||||
|
||||
public static TracerController tracerController;
|
||||
|
||||
private static bool isQuestHooked = false;
|
||||
|
||||
public static string ammoID = "";
|
||||
|
||||
public TarkovApplication tarkovApplication;
|
||||
|
||||
private bool shouldrecache;
|
||||
|
||||
public static AudioClip artillerycall;
|
||||
|
||||
public static AudioClip artilleryaccept;
|
||||
|
||||
public static Camera ActiveCamera;
|
||||
|
||||
public static Font TXTFONT;
|
||||
|
||||
public static GamePlayerOwner playerOwner;
|
||||
|
||||
public static TestHook alwayssurvivedhook;
|
||||
|
||||
public static TestHook checkItemFilterHook;
|
||||
|
||||
public static TestHook checkItemExcludedFilterHook;
|
||||
|
||||
public static TestHook transitHook;
|
||||
|
||||
public static TestHook tryGetLocationByIdHook;
|
||||
|
||||
public static TestHook localRaidSettingsHook;
|
||||
|
||||
public static bool hookedCheckItemFilter = false;
|
||||
|
||||
public static bool hookedCheckItemExcludedFilter = false;
|
||||
|
||||
public static bool forcepveofflinehooked = false;
|
||||
|
||||
public static bool Forcepveofflinebool = true;
|
||||
|
||||
public TransferItemsInRaidScreen transferItemsInRaidScreen;
|
||||
|
||||
public static bool nothooked = true;
|
||||
|
||||
public static bool nothooked2 = true;
|
||||
|
||||
public BallisticsCalculator ballisticsCalculator;
|
||||
|
||||
private Dictionary<string, float> OriginalFeedChance = new Dictionary<string, float>();
|
||||
|
||||
private Dictionary<string, float> OriginalMisFireChance = new Dictionary<string, float>();
|
||||
|
||||
private Dictionary<string, float> OriginalBaseMalfunctionChance = new Dictionary<string, float>();
|
||||
|
||||
public static Vector3 _tempPosition;
|
||||
|
||||
public EnemyInfo enemyInfo;
|
||||
|
||||
public static HashSet<string> wishlistitemids = new HashSet<string>();
|
||||
|
||||
public static HashSet<string> hideoutitemids = new HashSet<string>();
|
||||
|
||||
public static Dictionary<string, int> teams = new Dictionary<string, int>();
|
||||
|
||||
public static Dictionary<string, int> teamPlayerCount = new Dictionary<string, int>();
|
||||
|
||||
public static bool fixedgodmode = false;
|
||||
|
||||
private bool _isThirdPerson;
|
||||
|
||||
private bool freecam;
|
||||
|
||||
public static AudioClip hitMarkerSound;
|
||||
|
||||
public static AudioClip headshotsound;
|
||||
|
||||
private static Shader aaShader;
|
||||
|
||||
public static Material AAMaterial;
|
||||
|
||||
public static Material CustomSkybox;
|
||||
|
||||
private bool removednojam;
|
||||
|
||||
private bool removedfb;
|
||||
|
||||
private bool removenr;
|
||||
|
||||
private bool UpdateToggle = true;
|
||||
|
||||
public static bool isinhideout = false;
|
||||
|
||||
private string _lastAlivePlayersHash = string.Empty;
|
||||
|
||||
private string lastGameWorldId;
|
||||
|
||||
public bool updatep = true;
|
||||
|
||||
private void RegisterClasses()
|
||||
{
|
||||
GameObject obj = new GameObject();
|
||||
obj.AddComponent<Menu2>();
|
||||
obj.AddComponent<PlayerESP>();
|
||||
obj.AddComponent<ItemESP>();
|
||||
obj.AddComponent<LootableContainerESP>();
|
||||
obj.AddComponent<ExfiltrationPointsESP>();
|
||||
obj.AddComponent<Aimbot>();
|
||||
obj.AddComponent<Crosshairetc>();
|
||||
obj.AddComponent<CorpseEsp>();
|
||||
obj.AddComponent<Radar>();
|
||||
obj.AddComponent<QuestModule>();
|
||||
obj.AddComponent<PullItemIDs>();
|
||||
obj.AddComponent<PullItemPresets>();
|
||||
obj.AddComponent<GrenadeESP>();
|
||||
obj.AddComponent<TracerESP>();
|
||||
obj.AddComponent<Exploits>();
|
||||
obj.AddComponent<AILister>();
|
||||
obj.AddComponent<PullQuestIDs>();
|
||||
obj.AddComponent<QuestESP>();
|
||||
obj.AddComponent<OnlinePlayerInfo>();
|
||||
obj.AddComponent<WildSpawnTypeManager>();
|
||||
obj.AddComponent<HenryBotNav>();
|
||||
obj.AddComponent<HenryBotBrain>();
|
||||
obj.AddComponent<LocationsFixerV2>();
|
||||
audioSourcehit = obj.AddComponent<AudioSource>();
|
||||
audioSource = obj.AddComponent<AudioSource>();
|
||||
UnityEngine.Object.DontDestroyOnLoad(obj);
|
||||
}
|
||||
public void Start() { }
|
||||
public void OnGUI() { }
|
||||
|
||||
public void Awake()
|
||||
{
|
||||
RegisterClasses();
|
||||
_logFilePath = Path.Combine(Application.persistentDataPath, "log.txt");
|
||||
Settings.LoadSettings();
|
||||
}
|
||||
|
||||
public void Log(string message)
|
||||
{
|
||||
using StreamWriter streamWriter = new StreamWriter(_logFilePath, append: true);
|
||||
streamWriter.WriteLine($"{DateTime.Now}: {message}");
|
||||
}
|
||||
public bool IsGameReady()
|
||||
{
|
||||
GameWorld instance = Singleton<GameWorld>.Instance;
|
||||
return instance != null;
|
||||
}
|
||||
|
||||
public bool IsGameWorldInitialized()
|
||||
{
|
||||
return GameWorld != null;
|
||||
}
|
||||
|
||||
public bool IsCacheAvailable()
|
||||
{
|
||||
return IsGameWorldInitialized() && GamePlayers != null && GamePlayers.Count > 0;
|
||||
}
|
||||
|
||||
public bool GameWorldHasPlayers()
|
||||
{
|
||||
return GameWorld.RegisteredPlayers != null && GameWorld.RegisteredPlayers.Count > 0;
|
||||
}
|
||||
private void UpdateGameWorld()
|
||||
{
|
||||
GameWorld instance = Singleton<GameWorld>.Instance;
|
||||
if (instance == null) // Game is not ready
|
||||
{
|
||||
GameWorld = null;
|
||||
isinhideout = false;
|
||||
lastGameWorldId = null;
|
||||
return;
|
||||
}
|
||||
|
||||
string locationId = instance.LocationId;
|
||||
if (locationId == lastGameWorldId) // No updates required
|
||||
return;
|
||||
|
||||
ConsoleScreen.Log("Map changed : " + lastGameWorldId + " -> " + instance.LocationId);
|
||||
lastGameWorldId = locationId;
|
||||
if (instance.LocationId == null && instance.LocationId.Contains("hideout")) // In hideout
|
||||
{
|
||||
GameWorld = null;
|
||||
isinhideout = true;
|
||||
return;
|
||||
}
|
||||
|
||||
GameWorld = instance; // In raid
|
||||
isinhideout = false;
|
||||
}
|
||||
|
||||
private void UpdatePlayerCache()
|
||||
{
|
||||
// PRECHECKS
|
||||
UpdateGameWorld();
|
||||
MainCamera = Camera.main;
|
||||
ActiveCamera = UpdateActiveCamera();
|
||||
if (!IsGameWorldInitialized()) // Game world not initialized
|
||||
return;
|
||||
|
||||
bool playerAliveAndRegistered = GameWorld.RegisteredPlayers.Any((IPlayer rp) => rp is Player player2 && GameUtils.IsPlayerAlive(player2));
|
||||
bool playerListUpdated = GameWorld.RegisteredPlayers.Count != GamePlayers.Count;
|
||||
if (!playerAliveAndRegistered && !playerListUpdated) // No need to update cache
|
||||
{
|
||||
_nextPlayerCacheTime = Time.time + _cachePlayersInterval;
|
||||
return;
|
||||
}
|
||||
|
||||
GamePlayers.Clear(); // Clean up
|
||||
OnlineGamePlayers.Clear();
|
||||
teams.Clear();
|
||||
if (! GameWorldHasPlayers())
|
||||
return;
|
||||
// END PRECHECKS
|
||||
|
||||
foreach (IPlayer registeredPlayer in GameWorld.RegisteredPlayers)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (registeredPlayer == null) // Skip null players
|
||||
continue;
|
||||
|
||||
if (registeredPlayer is not Player) // Skip non-player entities
|
||||
continue;
|
||||
|
||||
Player player = registeredPlayer as Player;
|
||||
if (player == null) // Skip invalid players
|
||||
continue;
|
||||
|
||||
if (player.Transform == null) // Skip players without transforms
|
||||
continue;
|
||||
|
||||
if (player.IsYourPlayer) // Local player
|
||||
LocalPlayer = player;
|
||||
|
||||
if (GameUtils.IsPlayerAlive(player)) // Alive players
|
||||
{
|
||||
Vector3.Distance(MainCamera.transform.position, player.Transform.position);
|
||||
GamePlayers.Add(new GamePlayer(player));
|
||||
}
|
||||
} catch (Exception) { } // Swallow exceptions for individual players
|
||||
}
|
||||
_nextPlayerCacheTime = Time.time + _cachePlayersInterval; // Finally set next cache time
|
||||
}
|
||||
|
||||
private void DoUpdate()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (Time.time >= _nextPlayerCacheTime)
|
||||
UpdatePlayerCache();
|
||||
}
|
||||
catch (Exception ex2)
|
||||
{
|
||||
ConsoleScreen.Log("Error in Main Loop Player list" + ex2.Message + "-" + ex2.StackTrace);
|
||||
}
|
||||
|
||||
if (IsCacheAvailable())
|
||||
{
|
||||
try
|
||||
{
|
||||
GamePlayers.RemoveAll((GamePlayer gp) => !GameUtils.IsPlayerValid(gp.Player) || !GameUtils.IsPlayerAlive(gp.Player));
|
||||
foreach (GamePlayer gamePlayer in GamePlayers)
|
||||
{
|
||||
gamePlayer.RecalculateDynamics();
|
||||
}
|
||||
}
|
||||
catch (Exception ex3)
|
||||
{
|
||||
ConsoleScreen.Log("Error in Recalculate Dynamics" + ex3.Message + "-" + ex3.StackTrace);
|
||||
}
|
||||
}
|
||||
if (GameWorld != null && OnlineGamePlayers.Count > 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
OnlineGamePlayers.RemoveAll((OnlineGamePlayer gp) => !GameUtils.IsOPlayerValid(gp.Player));
|
||||
foreach (OnlineGamePlayer onlineGamePlayer in OnlineGamePlayers)
|
||||
{
|
||||
onlineGamePlayer.RecalculateDynamics();
|
||||
}
|
||||
}
|
||||
catch (Exception ex4)
|
||||
{
|
||||
ConsoleScreen.Log("Error in Recalculate Dynamics" + ex4.Message + "-" + ex4.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Update()
|
||||
{
|
||||
if (UpdateToggle)
|
||||
DoUpdate();
|
||||
|
||||
if (Input.GetKeyDown(Settings.ClearCache) && !Settings.allinputdisabled)
|
||||
{
|
||||
GamePlayers.Clear();
|
||||
Resources.UnloadUnusedAssets();
|
||||
GC.Collect();
|
||||
}
|
||||
if (LocalPlayer == null || !(GameWorld != null))
|
||||
{
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
if (LocalPlayer != null && LocalPlayer.HandsController != null && LocalPlayer.HandsController.Item != null && LocalPlayer?.HandsController?.Item is Weapon)
|
||||
{
|
||||
LocalPlayerWeapon = (Weapon)(LocalPlayer?.HandsController?.Item);
|
||||
}
|
||||
if ((_thermalVision == null || _visorEffect == null) && MainCamera != null)
|
||||
{
|
||||
_thermalVision = MainCamera.GetComponent<ThermalVision>();
|
||||
_visorEffect = MainCamera.GetComponent<VisorEffect>();
|
||||
}
|
||||
if (Input.GetKeyDown(Settings.UnlockDoors) && !Settings.allinputdisabled)
|
||||
{
|
||||
Exploits.UnlockAllDoors();
|
||||
}
|
||||
if (Input.GetKeyDown(Settings.tpp) && !Settings.allinputdisabled)
|
||||
{
|
||||
_isThirdPerson = !_isThirdPerson;
|
||||
if (!_isThirdPerson)
|
||||
{
|
||||
Exploits.SwitchToFirstPerson();
|
||||
}
|
||||
if (_isThirdPerson)
|
||||
{
|
||||
Exploits.SwitchToThirdPerson();
|
||||
}
|
||||
ConsoleScreen.Log($"Third person toggle is{_isThirdPerson} ");
|
||||
}
|
||||
if (Settings.Flyhack)
|
||||
{
|
||||
Exploits.FlyHack();
|
||||
}
|
||||
if (Settings.Speedhack)
|
||||
{
|
||||
Exploits.SpeedHack();
|
||||
}
|
||||
if (Settings.Infstamina)
|
||||
{
|
||||
Exploits.InfiniteStamina();
|
||||
}
|
||||
if (Settings.Instaheal)
|
||||
{
|
||||
Exploits.Instaheal();
|
||||
}
|
||||
if (Settings.Godmode)
|
||||
{
|
||||
Exploits.Godmode();
|
||||
}
|
||||
if (!Settings.Godmode && !fixedgodmode)
|
||||
{
|
||||
Exploits.ResetGodmode();
|
||||
fixedgodmode = true;
|
||||
}
|
||||
if (Settings.flares)
|
||||
{
|
||||
Exploits.Flares();
|
||||
}
|
||||
if (Settings.InstaSearch && LocalPlayer != null && LocalPlayer.Skills?.AttentionEliteLuckySearch != null)
|
||||
{
|
||||
LocalPlayer.Skills.AttentionEliteLuckySearch.Value = 100000f;
|
||||
}
|
||||
if (Settings.Thermal)
|
||||
{
|
||||
Exploits.Thermals();
|
||||
}
|
||||
else
|
||||
{
|
||||
_thermalVision.On = Settings.Thermal;
|
||||
}
|
||||
if (Input.GetKeyDown(Settings.KillAll) && !Settings.allinputdisabled)
|
||||
{
|
||||
Exploits.KillALL();
|
||||
}
|
||||
if (Input.GetKeyDown(Settings.TPall) && !Settings.allinputdisabled)
|
||||
{
|
||||
Exploits.TPall();
|
||||
}
|
||||
if (Settings.NoVisor)
|
||||
{
|
||||
Exploits.RemoveVisor();
|
||||
}
|
||||
if (Settings.TeleportItems && Input.GetKeyDown(Settings.teleportitem) && !Settings.allinputdisabled)
|
||||
{
|
||||
Exploits.Teleport(Menu2.TPItemInputstring);
|
||||
}
|
||||
if (Settings.instahit)
|
||||
{
|
||||
Exploits.InstaHit();
|
||||
}
|
||||
if (Settings.nojam)
|
||||
{
|
||||
Exploits.NoJam();
|
||||
removednojam = false;
|
||||
}
|
||||
else if (!Settings.nojam && !removednojam)
|
||||
{
|
||||
Exploits.RemoveNoJam();
|
||||
removednojam = true;
|
||||
}
|
||||
if (Settings.NoRecoil)
|
||||
{
|
||||
Exploits.NoRecoil();
|
||||
removenr = false;
|
||||
}
|
||||
else if (!removenr)
|
||||
{
|
||||
Exploits.RemoveNoRecoil();
|
||||
removenr = true;
|
||||
}
|
||||
if (Settings.firerate)
|
||||
{
|
||||
Exploits.ChangeFireRate();
|
||||
}
|
||||
if (Settings.fullbright)
|
||||
{
|
||||
Exploits.Fullbright();
|
||||
removedfb = false;
|
||||
}
|
||||
else if (!Settings.fullbright && !removedfb)
|
||||
{
|
||||
Exploits.RemoveFullbright();
|
||||
removedfb = true;
|
||||
}
|
||||
if (Settings.changemaincamfov)
|
||||
{
|
||||
MainCamera.fieldOfView = Settings.maincamfov;
|
||||
}
|
||||
if (Settings.infammo)
|
||||
{
|
||||
Exploits.CheckAndAddAmmoToChamber();
|
||||
}
|
||||
if (Input.GetKey(KeyCode.F6) && !Settings.allinputdisabled)
|
||||
{
|
||||
Exploits.Minecraftmode();
|
||||
}
|
||||
if (Settings.invisible)
|
||||
{
|
||||
Exploits.Invisibletobots();
|
||||
}
|
||||
if (Settings.farreach)
|
||||
{
|
||||
FarReach();
|
||||
}
|
||||
if (Settings.alwayssurvived && nothooked)
|
||||
{
|
||||
Exploits.AlwaysSurvive();
|
||||
}
|
||||
if (Settings.removefilters)
|
||||
{
|
||||
if (!hookedCheckItemFilter)
|
||||
{
|
||||
Exploits.RemoveFilters1();
|
||||
}
|
||||
if (!hookedCheckItemExcludedFilter)
|
||||
{
|
||||
Exploits.RemoveFilters2();
|
||||
}
|
||||
}
|
||||
if (Input.GetKeyDown(Settings.flyhacktoggle) && !Settings.allinputdisabled)
|
||||
{
|
||||
Settings.Flyhack = !Settings.Flyhack;
|
||||
}
|
||||
if (Input.GetKeyDown(Settings.speedhacktoggle) && !Settings.allinputdisabled)
|
||||
{
|
||||
Settings.Speedhack = !Settings.Speedhack;
|
||||
}
|
||||
Input.GetKey(KeyCode.F8);
|
||||
if (GameWorld != null && LocalPlayerWeapon != null)
|
||||
{
|
||||
shouldrecache = false;
|
||||
if (LocalPlayerWeapon != null && LocalPlayerWeapon.CurrentAmmoTemplate != null)
|
||||
{
|
||||
ammoID = LocalPlayerWeapon.CurrentAmmoTemplate._id.ToString();
|
||||
}
|
||||
}
|
||||
if ((GameWorld == null || LocalPlayerWeapon == null) && !shouldrecache)
|
||||
{
|
||||
GamePlayers.Clear();
|
||||
shouldrecache = true;
|
||||
ammoID = "";
|
||||
}
|
||||
if (Settings.bulletspershottoggle)
|
||||
{
|
||||
Exploits.BulletsPerShot(Settings.bulletspershot);
|
||||
}
|
||||
Exploits.HandleBigHeads();
|
||||
_ = Settings.soundexploit;
|
||||
if (!Settings.makeallbotsfriendly)
|
||||
{
|
||||
return;
|
||||
}
|
||||
foreach (GamePlayer gamePlayer2 in GamePlayers)
|
||||
{
|
||||
EntityManager.MakeBotAlly(gamePlayer2.Player);
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public static void FarReach()
|
||||
{
|
||||
if (!(GameWorld == null) && !(ActiveCamera == null) && !(LocalPlayer == null))
|
||||
{
|
||||
EFTHardSettings instance = EFTHardSettings.Instance;
|
||||
instance.LOOT_RAYCAST_DISTANCE = 12f;
|
||||
instance.DOOR_RAYCAST_DISTANCE = 12f;
|
||||
instance.DelayToOpenContainer = 0f;
|
||||
instance.POSE_CHANGING_SPEED = 15f;
|
||||
}
|
||||
}
|
||||
|
||||
private void Test()
|
||||
{
|
||||
}
|
||||
|
||||
public static Type FindType(string type)
|
||||
{
|
||||
Type[] types = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault((Assembly a) => a.GetName().Name == "Assembly-CSharp").GetTypes();
|
||||
foreach (Type type2 in types)
|
||||
{
|
||||
if (type == type2.Name || type == type2.FullName)
|
||||
{
|
||||
return type2;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static string TranslateBossName(string name)
|
||||
{
|
||||
return name switch
|
||||
{
|
||||
"Килла" => "Killa",
|
||||
"Решала" => "Reshala",
|
||||
"Глухарь" => "Gluhar",
|
||||
"Штурман" => "Shturman",
|
||||
"Санитар" => "Sanitar",
|
||||
"Тагилла" => "Tagilla",
|
||||
"Зрячий" => "Zryachiy",
|
||||
"Кабан" => "Kaban",
|
||||
"Дед Мороз" => "Santa",
|
||||
"Коллонтай" => "Kollontay",
|
||||
"Big Pipe" => "Big Pipe",
|
||||
"Birdeye" => "Birdeye",
|
||||
"Knight" => "Death Knight",
|
||||
"Партизан" => "Partisan",
|
||||
"Гус" => "Gus",
|
||||
"Басмацх" => "Basmach",
|
||||
_ => "Z",
|
||||
};
|
||||
}
|
||||
|
||||
public static string TranslateBossNameBYWST(WildSpawnType? type)
|
||||
{
|
||||
if (!type.HasValue)
|
||||
{
|
||||
return "Unknown";
|
||||
}
|
||||
return type.Value switch
|
||||
{
|
||||
WildSpawnType.bossKilla => "Killa",
|
||||
WildSpawnType.bossBully => "Reshala",
|
||||
WildSpawnType.bossGluhar => "Gluhar",
|
||||
WildSpawnType.bossKojaniy => "Shturman",
|
||||
WildSpawnType.bossSanitar => "Sanitar",
|
||||
WildSpawnType.bossTagilla => "Tagilla",
|
||||
WildSpawnType.bossZryachiy => "Zryachiy",
|
||||
WildSpawnType.bossBoar => "Kaban",
|
||||
WildSpawnType.gifter => "Santa",
|
||||
WildSpawnType.bossKolontay => "Kollontay",
|
||||
WildSpawnType.bossKnight => "Death Knight",
|
||||
WildSpawnType.followerBigPipe => "Big Pipe",
|
||||
WildSpawnType.followerBirdEye => "Bird Eye",
|
||||
WildSpawnType.bossPartisan => "Partisan",
|
||||
WildSpawnType.sectantPredvestnik => "Predvestnik",
|
||||
WildSpawnType.sectantPrizrak => "Prizrak",
|
||||
WildSpawnType.sectantOni => "Oni",
|
||||
_ => "Unknown Boss",
|
||||
};
|
||||
}
|
||||
|
||||
public static bool IsSuperrare(string SuperName)
|
||||
{
|
||||
if (!(SuperName == "TerraGroup Labs keycard (Green)") && !(SuperName == "TerraGroup Labs keycard (Red)") && !(SuperName == "TerraGroup Labs keycard (Blue)") && !(SuperName == "TerraGroup Labs keycard (Violet)") && !(SuperName == "TerraGroup Labs keycard (Yellow)") && !(SuperName == "TerraGroup Labs keycard (Black)") && !(SuperName == "UVSR Taiga-1 survival machete") && !(SuperName == "Red Rebel ice pick") && !(SuperName == "Dorm room 314 marked key") && !(SuperName == "Chekannaya 15 apartment key") && !(SuperName == "Graphics card") && !(SuperName == "Physical Bitcoin") && !(SuperName == "Intelligence folder") && !(SuperName == "LEDX Skin Transilluminator") && !(SuperName == "TerraGroup Labs access keycard") && !(SuperName == "Bottle of Fierce Hatchling moonshine") && !(SuperName == "Portable defibrillator") && !(SuperName == "RB-PKPM marked key") && !(SuperName == "Tetriz portable game console") && !(SuperName == "Bronze lion figurine") && !(SuperName == "Virtex programmable processor") && !(SuperName == "Military power filter") && !(SuperName == "VPX Flash Storage Module") && !(SuperName == "Relaxation room key"))
|
||||
{
|
||||
switch (SuperName)
|
||||
{
|
||||
default:
|
||||
if (!SuperName.Contains("Blue Folders") && !SuperName.Contains("keycard"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case "Phased array element":
|
||||
case "Military COFDM Wireless Signal Transmitter":
|
||||
case "Silicon Optoelectronic Integrated Circuits textbook":
|
||||
case "Gold skull ring":
|
||||
case "Golden Star balm":
|
||||
case "Chain with Prokill medallion":
|
||||
case "GreenBat lithium battery":
|
||||
case "Roler Submariner gold wrist watch":
|
||||
case "Ophthalmoscope":
|
||||
case "Iridium military thermal vision module":
|
||||
case "Car dealership closed section key":
|
||||
case "RB-BK marked key":
|
||||
case "RB-VO marked key":
|
||||
case "Keycard with a blue marking":
|
||||
case "Mysterious room marked key":
|
||||
case "Abandoned factory marked key":
|
||||
case "Health Resort west wing room 216 key":
|
||||
case "Cottage back door key":
|
||||
case "ULTRA medical storage key":
|
||||
case "Kiba Arms outer door key":
|
||||
case "Health Resort office key with a blue tape":
|
||||
case "RB-PKPM marked key":
|
||||
case "Health Resort west wing room 301 key":
|
||||
case "Health Resort east wing room 226 key":
|
||||
case "Health Resort west wing room 218 key":
|
||||
case "TerraGroup Labs weapon testing area key":
|
||||
case "Shared bedroom marked key":
|
||||
case "EMERCOM medical unit key":
|
||||
case "Factory emergency exit key":
|
||||
case "Relaxation room key":
|
||||
case "BEAR operative figurine":
|
||||
case "USEC operative figurine":
|
||||
case "Cultist figurine":
|
||||
case "Ded Moroz figurine":
|
||||
case "Den figurine":
|
||||
case "Killa figurine":
|
||||
case "Tagilla figurine":
|
||||
case "Reshala figurine":
|
||||
case "Politician Multkevich figurine":
|
||||
case "Scav figurine":
|
||||
case "Far-forward GPS Signal Amplifier Unit":
|
||||
case "Advanced current converter":
|
||||
case "Microcontroller board":
|
||||
case "VPX Flash Storage Module":
|
||||
case "Dorm overseer key":
|
||||
case "RB-ORB1 key":
|
||||
case "TerraGroup Labs arsenal storage room key":
|
||||
case "TerraGroup Labs manager's office room key":
|
||||
case "TerraGroup storage room keycard":
|
||||
case "Rusted bloody key":
|
||||
case "Medicine case":
|
||||
case "Grenade case":
|
||||
case "Magazine case":
|
||||
case "Ammunition case":
|
||||
case "Documents case":
|
||||
case "Key tool":
|
||||
case "Injector case":
|
||||
case "Keycard holder case":
|
||||
case "Dogtag case":
|
||||
break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static bool IsKappa(string KappaName)
|
||||
{
|
||||
if (new string[37]
|
||||
{
|
||||
"Old firesteel", "Antique axe", "FireKlean gun lube", "Golden rooster figurine", "Silver Badge", "Deadlyslob's beard oil", "Golden 1GPhone smartphone", "Jar of DevilDog mayo", "Can of sprats", "Fake mustache",
|
||||
"Kotton beanie", "Can of Dr. Lupo's coffee beans", "Pestily plague mask", "Shroud half-mask", "42 Signature Blend English Tea", "Smoke balaclava", "Evasion armband", "Can of RatCola soda", "WZ Wallet", "LVNDMARK's rat poison",
|
||||
"Missam forklift key", "Video cassette with the Cyborg Killer movie", "BakeEzy cook book", "JohnB Liquid DNB glasses", "Glorious E lightweight armored mask", "Baddie's red beard", "DRD body armor", "Gingy keychain", "Press pass (issued for NoiceGuy)", "Veritas guitar pick",
|
||||
"Tamatthi kunai knife replica", "Loot Lord plushie", "Raven figurine", "Axel parrot figurine", "BEAR Buddy plush toy", "Battered antique book", "Golden egg"
|
||||
}.Contains(KappaName))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool SearchedItem(string LocalizedName)
|
||||
{
|
||||
if (LocalizedName.Contains(Menu2.publicSearchString))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool IsStim(string StimName)
|
||||
{
|
||||
switch (StimName)
|
||||
{
|
||||
case "Obdolbos N cocktail injector":
|
||||
case "2A2-(b-TG) stimulant injector":
|
||||
case "3-(b-TG) stimulant injector":
|
||||
case "Adrenaline injector":
|
||||
case "AHF1-M stimulant injector":
|
||||
case "Antitoxin":
|
||||
case "ETG-change regenerative stimulant injector":
|
||||
case "L1 (Norepinephrine) injector":
|
||||
case "M.U.L.E. stimulant injector":
|
||||
case "Meldonin injector":
|
||||
case "Obdolbos 2 cocktail injector":
|
||||
case "Obdolbos cocktail injector":
|
||||
case "P22 (Product 22) stimulant injector":
|
||||
case "Perfotoran (Blue Blood) stimulant injector":
|
||||
case "PNB (Product 16) stimulant injector":
|
||||
case "Propital regenerative stimulant injector":
|
||||
case "SJ1 TGLabs combat stimulant injector":
|
||||
case "SJ12 TGLabs combat stimulant injector":
|
||||
case "SJ15 TGLabs combat stimulant injector":
|
||||
case "SJ6 TGLabs combat stimulant injector":
|
||||
case "SJ9 TGLabs combat stimulant injector":
|
||||
case "Trimadol stimulant injector":
|
||||
case "XTG-12 antidote injector":
|
||||
case "Zagustin hemostatic drug injector":
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private void FPSMODE()
|
||||
{
|
||||
Renderer[] array = UnityEngine.Object.FindObjectsOfType<Renderer>();
|
||||
for (int i = 0; i < array.Length; i++)
|
||||
{
|
||||
Material[] materials = array[i].materials;
|
||||
foreach (Material material in materials)
|
||||
{
|
||||
BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic;
|
||||
FieldInfo[] fields = typeof(Material).GetFields(bindingAttr);
|
||||
foreach (FieldInfo fieldInfo in fields)
|
||||
{
|
||||
if (fieldInfo.FieldType == typeof(Texture))
|
||||
{
|
||||
fieldInfo.SetValue(material, null);
|
||||
}
|
||||
else if (fieldInfo.FieldType == typeof(Color))
|
||||
{
|
||||
fieldInfo.SetValue(material, Color.white);
|
||||
}
|
||||
else if (fieldInfo.FieldType == typeof(float))
|
||||
{
|
||||
fieldInfo.SetValue(material, 0f);
|
||||
}
|
||||
}
|
||||
material.shader = Shader.Find("Standard");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsBossByName(string name)
|
||||
{
|
||||
if (!(name == "Килла") && !(name == "Решала") && !(name == "Глухарь") && !(name == "Штурман") && !(name == "Санитар") && !(name == "Тагилла") && !(name == "Зрячий") && !(name == "Кабан"))
|
||||
{
|
||||
switch (name)
|
||||
{
|
||||
case "Big Pipe":
|
||||
case "Birdeye":
|
||||
case "Knight":
|
||||
case "Дед Мороз":
|
||||
case "Коллонтай":
|
||||
case "Партизан":
|
||||
case "Santa":
|
||||
case "Кабан":
|
||||
case "Зрячий":
|
||||
case "Басмацх":
|
||||
case "Гус":
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static bool IsBoss(WildSpawnType? type)
|
||||
{
|
||||
WildSpawnType[] source = new WildSpawnType[17]
|
||||
{
|
||||
WildSpawnType.bossBully,
|
||||
WildSpawnType.bossKilla,
|
||||
WildSpawnType.bossKojaniy,
|
||||
WildSpawnType.bossGluhar,
|
||||
WildSpawnType.bossSanitar,
|
||||
WildSpawnType.bossTagilla,
|
||||
WildSpawnType.bossKnight,
|
||||
WildSpawnType.followerBigPipe,
|
||||
WildSpawnType.followerBirdEye,
|
||||
WildSpawnType.gifter,
|
||||
WildSpawnType.bossZryachiy,
|
||||
WildSpawnType.bossBoar,
|
||||
WildSpawnType.bossKolontay,
|
||||
WildSpawnType.bossPartisan,
|
||||
WildSpawnType.sectantPredvestnik,
|
||||
WildSpawnType.sectantPrizrak,
|
||||
WildSpawnType.sectantOni
|
||||
};
|
||||
if (!type.HasValue)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return source.Contains(type.Value);
|
||||
}
|
||||
|
||||
public static bool Isdeadbody(string LocalizedName)
|
||||
{
|
||||
if (LocalizedName == "Default Inventory")
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void GetWishlistItems()
|
||||
{
|
||||
if (QuestModule._tarkovApplication == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
_E8D9 wishlistManager = QuestModule._tarkovApplication.GetClientBackEndSession().Profile.WishlistManager;
|
||||
if (wishlistManager == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
wishlistitemids.Clear();
|
||||
hideoutitemids.Clear();
|
||||
foreach (MongoID key in wishlistManager.UserItems.Keys)
|
||||
{
|
||||
wishlistitemids.Add(key);
|
||||
}
|
||||
foreach (MongoID item in wishlistManager.GetWishlist().Keys.Except(wishlistManager.UserItems.Keys))
|
||||
{
|
||||
hideoutitemids.Add(item);
|
||||
}
|
||||
}
|
||||
|
||||
public static Camera UpdateActiveCamera()
|
||||
{
|
||||
return Camera.main;
|
||||
}
|
||||
}
|
||||
88
stoopid.raw/stupid.solutions/PullItemPresets.cs
Normal file
88
stoopid.raw/stupid.solutions/PullItemPresets.cs
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using EFT.UI;
|
||||
using Newtonsoft.Json;
|
||||
using UnityEngine;
|
||||
|
||||
namespace stupid.solutions;
|
||||
|
||||
public class PullItemPresets : MonoBehaviour
|
||||
{
|
||||
public List<TemplateData> templateList;
|
||||
|
||||
public async void Start()
|
||||
{
|
||||
ConsoleScreen.Log("Fetching Item Presets");
|
||||
await LoadPresetsData();
|
||||
ConsoleScreen.Log("Item Presets Loaded");
|
||||
}
|
||||
|
||||
private async Task LoadPresetsData()
|
||||
{
|
||||
string filePath = Path.Combine(Application.persistentDataPath, "itempresetslist.json");
|
||||
if (File.Exists(filePath))
|
||||
{
|
||||
try
|
||||
{
|
||||
Dictionary<string, List<TemplateData>> dictionary = JsonConvert.DeserializeObject<Dictionary<string, List<TemplateData>>>(await Task.Run(() => File.ReadAllText(filePath)));
|
||||
if (dictionary != null && dictionary.ContainsKey("Templates"))
|
||||
{
|
||||
templateList = dictionary["Templates"];
|
||||
ConsoleScreen.Log($"Item presets loaded successfully. Template count: {templateList.Count}");
|
||||
}
|
||||
else
|
||||
{
|
||||
ConsoleScreen.LogError("Error: Deserialized template list is null or malformed.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ConsoleScreen.LogError("Error occurred while loading item presets: " + ex.Message);
|
||||
return;
|
||||
}
|
||||
}
|
||||
ConsoleScreen.LogError("Error: JSON file (" + filePath + ") does not exist.");
|
||||
}
|
||||
|
||||
public void SaveItemToPresetList(dynamic item, string presetName)
|
||||
{
|
||||
Dictionary<string, SlotData> dictionary = new Dictionary<string, SlotData>();
|
||||
foreach (dynamic item3 in item.AllSlots)
|
||||
{
|
||||
if (item3.ContainedItem != null)
|
||||
{
|
||||
dictionary[item3.FullId] = new SlotData
|
||||
{
|
||||
SlotID = item3.FullId,
|
||||
SlotName = item3.Name,
|
||||
ItemId = item3.ContainedItem.TemplateId
|
||||
};
|
||||
}
|
||||
}
|
||||
TemplateData templateData = new TemplateData();
|
||||
templateData.PresetName = presetName;
|
||||
Dictionary<string, ItemTemplate> dictionary2 = new Dictionary<string, ItemTemplate>();
|
||||
dictionary2.Add(item.TemplateId.ToString(), new ItemTemplate
|
||||
{
|
||||
StackMaxSize = 1,
|
||||
QuestItem = false,
|
||||
Description = $"Saved on {DateTime.Now}, Made With Advanced Item Spawner",
|
||||
Slots = dictionary
|
||||
});
|
||||
templateData.ItemTemplate = dictionary2;
|
||||
TemplateData item2 = templateData;
|
||||
string path = Path.Combine(Application.persistentDataPath, "itempresetslist.json");
|
||||
Dictionary<string, List<TemplateData>> dictionary3 = ((!File.Exists(path)) ? new Dictionary<string, List<TemplateData>>() : (JsonConvert.DeserializeObject<Dictionary<string, List<TemplateData>>>(File.ReadAllText(path)) ?? new Dictionary<string, List<TemplateData>>()));
|
||||
if (!dictionary3.ContainsKey("Templates"))
|
||||
{
|
||||
dictionary3["Templates"] = new List<TemplateData>();
|
||||
}
|
||||
dictionary3["Templates"].Add(item2);
|
||||
File.WriteAllText(path, JsonConvert.SerializeObject(dictionary3, Formatting.Indented));
|
||||
ConsoleScreen.Log("Preset saved to list.");
|
||||
Start();
|
||||
}
|
||||
}
|
||||
481
stoopid.raw/stupid.solutions/QuestESP.cs
Normal file
481
stoopid.raw/stupid.solutions/QuestESP.cs
Normal file
|
|
@ -0,0 +1,481 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using EFT;
|
||||
using EFT.Counters;
|
||||
using EFT.Interactive;
|
||||
using EFT.InventoryLogic;
|
||||
using EFT.Quests;
|
||||
using EFT.UI;
|
||||
using stupid.solutions.Data;
|
||||
using stupid.solutions.Features;
|
||||
using stupid.solutions.Features.ESP;
|
||||
using stupid.solutions.stupid.solutions.Data;
|
||||
using stupid.solutions.Utils;
|
||||
using UnityEngine;
|
||||
|
||||
namespace stupid.solutions;
|
||||
|
||||
public class QuestESP : MonoBehaviour
|
||||
{
|
||||
public struct QuestItemsSearched
|
||||
{
|
||||
public string ID { get; set; }
|
||||
}
|
||||
|
||||
private List<PointOfInterest> poiList = new List<PointOfInterest>();
|
||||
|
||||
private List<dynamic> startedQuests = new List<object>();
|
||||
|
||||
private bool shouldRefreshData = true;
|
||||
|
||||
public static List<string> QuestItemIds = new List<string>();
|
||||
|
||||
private List<PlaceItemTrigger> placeItemTriggers = new List<PlaceItemTrigger>();
|
||||
|
||||
private List<ExperienceTrigger> experienceTrigger = new List<ExperienceTrigger>();
|
||||
|
||||
private bool gettriggers = true;
|
||||
|
||||
private bool getquestitems = true;
|
||||
|
||||
private float _nextQuestCacheTime;
|
||||
|
||||
private static readonly float _cacheQuestInterval = 5f;
|
||||
|
||||
public Color Color { get; set; } = Color.magenta;
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (Settings.QuestESP && Time.time >= _nextQuestCacheTime)
|
||||
{
|
||||
if (Main.GameWorld != null && Main.LocalPlayer != null && Main.MainCamera != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
poiList.Clear();
|
||||
RefreshData(poiList);
|
||||
shouldRefreshData = false;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ConsoleScreen.Log("Error refreshing data: " + ex.Message);
|
||||
}
|
||||
}
|
||||
_nextQuestCacheTime = Time.time + _cacheQuestInterval;
|
||||
}
|
||||
if (gettriggers && Main.GameWorld != null && Main.LocalPlayer != null && Main.MainCamera != null)
|
||||
{
|
||||
GetTriggers();
|
||||
}
|
||||
if (Main.GameWorld == null)
|
||||
{
|
||||
gettriggers = true;
|
||||
getquestitems = true;
|
||||
poiList.Clear();
|
||||
QuestItemIds.Clear();
|
||||
placeItemTriggers.Clear();
|
||||
experienceTrigger.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
public void GetTriggers()
|
||||
{
|
||||
if (placeItemTriggers == null)
|
||||
{
|
||||
placeItemTriggers = new List<PlaceItemTrigger>();
|
||||
}
|
||||
if (experienceTrigger == null)
|
||||
{
|
||||
experienceTrigger = new List<ExperienceTrigger>();
|
||||
}
|
||||
gettriggers = false;
|
||||
placeItemTriggers.Clear();
|
||||
experienceTrigger.Clear();
|
||||
placeItemTriggers = UnityEngine.Object.FindObjectsOfType<PlaceItemTrigger>().ToList();
|
||||
experienceTrigger = UnityEngine.Object.FindObjectsOfType<ExperienceTrigger>().ToList();
|
||||
ConsoleScreen.Log($"Got Triggers + {experienceTrigger.Count + placeItemTriggers.Count}");
|
||||
}
|
||||
|
||||
public void RefreshData(List<PointOfInterest> data)
|
||||
{
|
||||
GameWorld gameWorld = Main.GameWorld;
|
||||
if (gameWorld == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
Player localPlayer = Main.LocalPlayer;
|
||||
if (localPlayer == null || Main.MainCamera == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
Profile profile = localPlayer.Profile;
|
||||
if (profile == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
List<_F286> questsData = profile.QuestsData;
|
||||
startedQuests.Clear();
|
||||
foreach (_F286 item in questsData)
|
||||
{
|
||||
if (item.Template != null && item.Template.Conditions != null && profile.Stats != null && profile.Stats.Eft != null && profile.Stats.Eft.OverallCounters != null && item.Status == EQuestStatus.Started)
|
||||
{
|
||||
startedQuests.Add(item);
|
||||
}
|
||||
}
|
||||
if (startedQuests.Any())
|
||||
{
|
||||
RefreshVisitPlaceLocations(startedQuests, profile, data);
|
||||
RefreshFindItemLocations(startedQuests, gameWorld, data);
|
||||
RefreshPlaceOrRepairItemLocations(startedQuests, profile, data);
|
||||
if (getquestitems)
|
||||
{
|
||||
RefreshNonStaticQuestItems(startedQuests, gameWorld, data);
|
||||
getquestitems = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private void RefreshVisitPlaceLocations(List<dynamic> startedQuests, Profile profile, List<PointOfInterest> records)
|
||||
{
|
||||
try
|
||||
{
|
||||
List<ExperienceTrigger> source = this.experienceTrigger.ToList();
|
||||
foreach (dynamic startedQuest in startedQuests)
|
||||
{
|
||||
dynamic val = startedQuest.Template?.Conditions[EQuestStatus.AvailableForFinish];
|
||||
if (val == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
foreach (dynamic item in val)
|
||||
{
|
||||
try
|
||||
{
|
||||
if ((startedQuest.CompletedConditions.Contains(item.id)) || !(item is ConditionCounterCreator conditionCounterCreator))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
foreach (Condition condition in conditionCounterCreator.Conditions)
|
||||
{
|
||||
if (condition is ConditionVisitPlace conditionVisitPlace)
|
||||
{
|
||||
string expectedTriggerId = conditionVisitPlace.target;
|
||||
ExperienceTrigger experienceTrigger = source.FirstOrDefault((ExperienceTrigger t) => t.Id == expectedTriggerId);
|
||||
if (!(experienceTrigger == null) && profile.Stats.Eft.OverallCounters.GetInt(CounterTag.TriggerVisited, experienceTrigger.Id) <= 0)
|
||||
{
|
||||
Vector3 position = experienceTrigger.transform.position;
|
||||
AddQuestRecord(records, conditionCounterCreator, startedQuest, position, Color.cyan);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ConsoleScreen.Log($"Error processing condition {(object)item?.id}: {ex.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private bool IsQuestConditionAvailableForFinish(dynamic quest)
|
||||
{
|
||||
dynamic val = quest.Template?.Conditions[EQuestStatus.AvailableForFinish];
|
||||
return val != null && !quest.CompletedConditions.Contains(val.id);
|
||||
}
|
||||
|
||||
private void RefreshFindItemLocations(List<dynamic> startedQuests, GameWorld world, List<PointOfInterest> records)
|
||||
{
|
||||
try
|
||||
{
|
||||
_E3D7<int, LootItem> lootItems = world.LootItems;
|
||||
for (int i = 0; i < lootItems.Count; i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
LootItem byIndex = lootItems.GetByIndex(i);
|
||||
if (!GameUtils.IsLootItemValid(byIndex))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
bool flag = false;
|
||||
foreach (dynamic startedQuest in startedQuests)
|
||||
{
|
||||
dynamic val = startedQuest.Template?.Conditions[EQuestStatus.AvailableForFinish];
|
||||
if (val == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
foreach (object item in val)
|
||||
{
|
||||
if (!(item is ConditionFindItem conditionFindItem))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
string text = conditionFindItem.target.FirstOrDefault()?.ToString();
|
||||
bool flag2 = text == null || !text.Contains(byIndex.Item.TemplateId.ToString());
|
||||
if (!flag2 && !((flag2 | startedQuest.CompletedConditions.Contains(conditionFindItem.id)) ? true : false))
|
||||
{
|
||||
if (!byIndex.Item.QuestItem && !flag)
|
||||
{
|
||||
QuestItemIds.Add(byIndex.Item.LocalizedName());
|
||||
flag = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Vector3 position = byIndex.transform.position;
|
||||
AddQuestRecord(records, conditionFindItem, startedQuest, position, Color.yellow);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private void RefreshNonStaticQuestItems(List<dynamic> startedQuests, GameWorld world, List<PointOfInterest> records)
|
||||
{
|
||||
try
|
||||
{
|
||||
foreach (GameLootContainer gameLootContainer in LootableContainerESP._gameLootContainers)
|
||||
{
|
||||
if (!GameUtils.IsLootableContainerValid(gameLootContainer.LootableContainer))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
foreach (Item allItem in gameLootContainer.LootableContainer.ItemOwner.RootItem.GetAllItems())
|
||||
{
|
||||
foreach (dynamic startedQuest in startedQuests)
|
||||
{
|
||||
dynamic val = startedQuest.Template?.Conditions[EQuestStatus.AvailableForFinish];
|
||||
if (val == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
bool flag = false;
|
||||
foreach (object item in val)
|
||||
{
|
||||
if (item is ConditionFindItem conditionFindItem)
|
||||
{
|
||||
string text = conditionFindItem.target.FirstOrDefault()?.ToString();
|
||||
bool flag2 = text == null || !text.Contains(allItem.TemplateId.ToString());
|
||||
if (!flag2 && !((flag2 | startedQuest.CompletedConditions.Contains(conditionFindItem.id)) ? true : false) && !allItem.QuestItem && !flag)
|
||||
{
|
||||
QuestItemIds.Add(allItem.LocalizedName());
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Main.OnlineGamePlayers.Count > 0)
|
||||
{
|
||||
foreach (OnlineGamePlayer onlineGamePlayer in Main.OnlineGamePlayers)
|
||||
{
|
||||
IEnumerator<Item> enumerator6 = onlineGamePlayer.Player.ObservedPlayerController.EquipmentViewController.Equipment.GetAllItems().GetEnumerator();
|
||||
while (enumerator6.MoveNext())
|
||||
{
|
||||
if (enumerator6.Current != null)
|
||||
{
|
||||
foreach (Item allItem2 in enumerator6.Current.GetAllItems())
|
||||
{
|
||||
foreach (dynamic startedQuest2 in startedQuests)
|
||||
{
|
||||
dynamic val2 = startedQuest2.Template?.Conditions[EQuestStatus.AvailableForFinish];
|
||||
if (!((val2 == null) ? true : false))
|
||||
{
|
||||
bool flag3 = false;
|
||||
foreach (object item2 in val2)
|
||||
{
|
||||
if (item2 is ConditionFindItem conditionFindItem2)
|
||||
{
|
||||
string text2 = conditionFindItem2.target.FirstOrDefault()?.ToString();
|
||||
bool flag2 = text2 == null || !text2.Contains(allItem2.TemplateId.ToString());
|
||||
if (!flag2 && !((flag2 | startedQuest2.CompletedConditions.Contains(conditionFindItem2.id)) ? true : false) && !allItem2.QuestItem && !flag3)
|
||||
{
|
||||
QuestItemIds.Add(allItem2.LocalizedName());
|
||||
flag3 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
foreach (GamePlayer gamePlayer in Main.GamePlayers)
|
||||
{
|
||||
IEnumerator<Item> enumerator8 = gamePlayer.Player.Profile.Inventory.Equipment.GetAllItems().GetEnumerator();
|
||||
while (enumerator8.MoveNext())
|
||||
{
|
||||
if (enumerator8.Current == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
foreach (Item allItem3 in enumerator8.Current.GetAllItems())
|
||||
{
|
||||
foreach (dynamic startedQuest3 in startedQuests)
|
||||
{
|
||||
dynamic val3 = startedQuest3.Template?.Conditions[EQuestStatus.AvailableForFinish];
|
||||
if (val3 == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
bool flag4 = false;
|
||||
foreach (object item3 in val3)
|
||||
{
|
||||
if (item3 is ConditionFindItem conditionFindItem3)
|
||||
{
|
||||
string text3 = conditionFindItem3.target.FirstOrDefault()?.ToString();
|
||||
bool flag2 = text3 == null || !text3.Contains(allItem3.TemplateId.ToString());
|
||||
if (!flag2 && !((flag2 | startedQuest3.CompletedConditions.Contains(conditionFindItem3.id)) ? true : false) && !allItem3.QuestItem && !flag4)
|
||||
{
|
||||
QuestItemIds.Add(allItem3.LocalizedName());
|
||||
flag4 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private void RefreshPlaceOrRepairItemLocations(List<dynamic> startedQuests, Profile profile, List<PointOfInterest> records)
|
||||
{
|
||||
try
|
||||
{
|
||||
Item[] source = profile.Inventory.GetPlayerItems()?.ToArray();
|
||||
List<PlaceItemTrigger> source2 = placeItemTriggers;
|
||||
foreach (dynamic startedQuest in startedQuests)
|
||||
{
|
||||
try
|
||||
{
|
||||
dynamic val = startedQuest.Template?.Conditions[EQuestStatus.AvailableForFinish];
|
||||
if (val == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
foreach (object item in val)
|
||||
{
|
||||
ConditionZone zoneCondition = item as ConditionZone;
|
||||
if (zoneCondition == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (startedQuest.CompletedConditions.Contains(zoneCondition.id))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
string zoneconditionstring = zoneCondition.target.FirstOrDefault()?.ToString();
|
||||
if (zoneconditionstring != null && source.FirstOrDefault((Item x) => zoneconditionstring.Contains(x.TemplateId.ToString())) != null)
|
||||
{
|
||||
PlaceItemTrigger placeItemTrigger = source2.FirstOrDefault((PlaceItemTrigger t) => t.Id == zoneCondition.zoneId);
|
||||
if (!(placeItemTrigger == null))
|
||||
{
|
||||
Vector3 position = placeItemTrigger.transform.position;
|
||||
AddQuestRecord(records, zoneCondition, startedQuest, position, Color);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private void AddQuestRecord(List<PointOfInterest> records, dynamic condition, dynamic quest, Vector3 position, Color color)
|
||||
{
|
||||
PointOfInterest item = new PointOfInterest
|
||||
{
|
||||
Name = $" {(object)quest.Template.Name} ",
|
||||
Description = $" {(object)condition.FormattedDescription} ",
|
||||
Position = position,
|
||||
Color = color,
|
||||
Quest = quest
|
||||
};
|
||||
records.Add(item);
|
||||
}
|
||||
|
||||
public void OnGUI()
|
||||
{
|
||||
if (!(Main.GameWorld != null) || !Settings.QuestESP)
|
||||
{
|
||||
return;
|
||||
}
|
||||
foreach (var item in (from poi in poiList
|
||||
group poi by new { poi.Position, poi.Name }).ToDictionary(g => g.Key, g => g.ToList()))
|
||||
{
|
||||
List<PointOfInterest> value = item.Value;
|
||||
Vector3 position = item.Key.Position;
|
||||
Vector3 vector = GameUtils.WorldPointToScreenPoint(position);
|
||||
float num = Vector3.Distance(Main.MainCamera.transform.position, position);
|
||||
bool num2 = vector.z > 0f && vector.x > 0f && vector.x < (float)Screen.width && vector.y > 0f && vector.y < (float)Screen.height;
|
||||
bool flag = Aimbot.CaulculateInFov2(position) <= Settings.SimpleStringsFOV;
|
||||
if (!num2)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (Settings.DrawSimpleStrings)
|
||||
{
|
||||
string label = (flag ? $"{item.Key.Name} [{num:F0}m]" : "[Q]");
|
||||
Render.DrawString(new Vector2(vector.x - 50f, vector.y), label, value[0].Color);
|
||||
if (!flag || !Settings.DrawDescription)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
float num3 = 15f;
|
||||
foreach (PointOfInterest item2 in value)
|
||||
{
|
||||
Render.DrawString(new Vector2(vector.x - 50f, vector.y + num3), item2.Description, Color.white);
|
||||
num3 += 15f;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
string label2 = $"{item.Key.Name} [{num:F0}m]";
|
||||
Render.DrawString(new Vector2(vector.x - 50f, vector.y), label2, value[0].Color);
|
||||
if (!Settings.DrawDescription)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
float num4 = 15f;
|
||||
foreach (PointOfInterest item3 in value)
|
||||
{
|
||||
Render.DrawString(new Vector2(vector.x - 50f, vector.y + num4), item3.Description, Color.white);
|
||||
num4 += 15f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
13
stoopid.raw/stupid.solutions/SlotData.cs
Normal file
13
stoopid.raw/stupid.solutions/SlotData.cs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
using System;
|
||||
|
||||
namespace stupid.solutions;
|
||||
|
||||
[Serializable]
|
||||
public class SlotData
|
||||
{
|
||||
public string SlotID { get; set; }
|
||||
|
||||
public string SlotName { get; set; }
|
||||
|
||||
public string ItemId { get; set; }
|
||||
}
|
||||
12
stoopid.raw/stupid.solutions/TemplateData.cs
Normal file
12
stoopid.raw/stupid.solutions/TemplateData.cs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace stupid.solutions;
|
||||
|
||||
[Serializable]
|
||||
public class TemplateData
|
||||
{
|
||||
public string PresetName { get; set; }
|
||||
|
||||
public Dictionary<string, ItemTemplate> ItemTemplate { get; set; }
|
||||
}
|
||||
135
stoopid.raw/stupid.solutions/TestHook.cs
Normal file
135
stoopid.raw/stupid.solutions/TestHook.cs
Normal file
|
|
@ -0,0 +1,135 @@
|
|||
using System;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace stupid.solutions;
|
||||
|
||||
public class TestHook
|
||||
{
|
||||
internal class Import
|
||||
{
|
||||
[DllImport("kernel32.dll", SetLastError = true)]
|
||||
internal static extern bool VirtualProtect(IntPtr address, uint size, uint newProtect, out uint oldProtect);
|
||||
}
|
||||
|
||||
private byte[] original;
|
||||
|
||||
private const uint HOOK_SIZE_X64 = 12u;
|
||||
|
||||
private const uint HOOK_SIZE_X86 = 7u;
|
||||
|
||||
public MethodInfo OriginalMethod { get; private set; }
|
||||
|
||||
public MethodInfo HookMethod { get; private set; }
|
||||
|
||||
public TestHook()
|
||||
{
|
||||
original = null;
|
||||
OriginalMethod = (HookMethod = null);
|
||||
}
|
||||
|
||||
public TestHook(MethodInfo orig, MethodInfo hook)
|
||||
{
|
||||
original = null;
|
||||
Init(orig, hook);
|
||||
}
|
||||
|
||||
public MethodInfo GetMethodByName(Type typeOrig, string nameOrig)
|
||||
{
|
||||
return typeOrig.GetMethod(nameOrig);
|
||||
}
|
||||
|
||||
public TestHook(Type typeOrig, string nameOrig, Type typeHook, string nameHook)
|
||||
{
|
||||
original = null;
|
||||
Init(GetMethodByName(typeOrig, nameOrig), GetMethodByName(typeHook, nameHook));
|
||||
}
|
||||
|
||||
public void Init(MethodInfo orig, MethodInfo hook)
|
||||
{
|
||||
if (orig == null || hook == null)
|
||||
{
|
||||
throw new ArgumentException("Both original and hook need to be valid methods");
|
||||
}
|
||||
RuntimeHelpers.PrepareMethod(orig.MethodHandle);
|
||||
RuntimeHelpers.PrepareMethod(hook.MethodHandle);
|
||||
OriginalMethod = orig;
|
||||
HookMethod = hook;
|
||||
}
|
||||
|
||||
public unsafe void Hook()
|
||||
{
|
||||
if (OriginalMethod == null || HookMethod == null)
|
||||
{
|
||||
throw new ArgumentException("Hook has to be properly Init'd before use");
|
||||
}
|
||||
try
|
||||
{
|
||||
IntPtr functionPointer = OriginalMethod.MethodHandle.GetFunctionPointer();
|
||||
IntPtr functionPointer2 = HookMethod.MethodHandle.GetFunctionPointer();
|
||||
if (IntPtr.Size == 8)
|
||||
{
|
||||
original = new byte[12];
|
||||
if (Import.VirtualProtect(functionPointer, 12u, 64u, out var _))
|
||||
{
|
||||
byte* ptr = (byte*)(void*)functionPointer;
|
||||
for (int i = 0; (long)i < 12L; i++)
|
||||
{
|
||||
original[i] = ptr[i];
|
||||
}
|
||||
*ptr = 72;
|
||||
ptr[1] = 184;
|
||||
*(IntPtr*)(ptr + 2) = functionPointer2;
|
||||
ptr[10] = byte.MaxValue;
|
||||
ptr[11] = 224;
|
||||
}
|
||||
return;
|
||||
}
|
||||
original = new byte[7];
|
||||
if (Import.VirtualProtect(functionPointer, 7u, 64u, out var _))
|
||||
{
|
||||
byte* ptr2 = (byte*)(void*)functionPointer;
|
||||
for (int j = 0; (long)j < 7L; j++)
|
||||
{
|
||||
original[j] = ptr2[j];
|
||||
}
|
||||
*ptr2 = 184;
|
||||
*(IntPtr*)(ptr2 + 1) = functionPointer2;
|
||||
ptr2[5] = byte.MaxValue;
|
||||
ptr2[6] = 224;
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe void Unhook()
|
||||
{
|
||||
if (original == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
IntPtr functionPointer = OriginalMethod.MethodHandle.GetFunctionPointer();
|
||||
uint num = (uint)original.Length;
|
||||
if (Import.VirtualProtect(functionPointer, num, 64u, out var _))
|
||||
{
|
||||
byte* ptr = (byte*)(void*)functionPointer;
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
ptr[i] = original[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
finally
|
||||
{
|
||||
original = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
27
stoopid.raw/stupid.solutions/TripwireHooks.cs
Normal file
27
stoopid.raw/stupid.solutions/TripwireHooks.cs
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
using System.Reflection;
|
||||
using EFT;
|
||||
using EFT.UI;
|
||||
|
||||
namespace stupid.solutions;
|
||||
|
||||
public static class TripwireHooks
|
||||
{
|
||||
public static void PlayTripwireInteractionSound_Hook(object instance, float plantTime, bool hasMultiTool)
|
||||
{
|
||||
Player player = instance as Player;
|
||||
if (!(player == null))
|
||||
{
|
||||
typeof(Player).GetMethod("SendTripwireInteractionSoundState", BindingFlags.Instance | BindingFlags.NonPublic)?.Invoke(player, new object[3]
|
||||
{
|
||||
EInteractionStatus.Started,
|
||||
true,
|
||||
hasMultiTool
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public static void AntiTripWire_Hook(object instance, object tripwireSoundMessage)
|
||||
{
|
||||
ConsoleScreen.Log("TripWire sound blocked");
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue