zenken

Untitled

May 11th, 2025
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 33.58 KB | None | 0 0
  1. // Decompiled with JetBrains decompiler
  2. // Type: DeadFrontier2.Main
  3. // Assembly: DeadFrontier2, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
  4. // MVID: 57159255-1C65-4522-9248-74105B082B80
  5. // Assembly location: C:\Users\Zenken\Desktop\df2\b\DeadFrontier2.dll
  6.  
  7. using System;
  8. using System.Collections;
  9. using System.Collections.Generic;
  10. using System.Linq;
  11. using System.Reflection;
  12. using System.Text.RegularExpressions;
  13. using UnityEngine;
  14.  
  15. #nullable disable
  16. namespace DeadFrontier2;
  17.  
  18. internal class Main : MonoBehaviour
  19. {
  20. private bool TransformMovement;
  21. private bool OHK;
  22. private bool Enemyesp = true;
  23. private bool Containeresp;
  24. private bool Playeresp;
  25. private bool Chamsesp;
  26. private bool MobVac;
  27. private bool ConVac;
  28. private bool ShowHealthbar;
  29. private GameObject player;
  30. private CF_da92fcabfd58f8b78e136d77571bcd5fa6b83ebd_Corpsefuscated comp;
  31. private static bool footstepRangeActive = false;
  32. private static bool incomingDamageActive = false;
  33. private static bool visibilityRangeActive = false;
  34. private static bool espActive = false;
  35. private static bool isVisible = true;
  36. public static bool enemyEspActive = false;
  37. public static bool playerEspActive = false;
  38. public static bool npcEspActive = false;
  39. public static bool instantLootActive = false;
  40. public bool aimbotEnabled;
  41. public float maxAimbotDistance = 15550f;
  42. public Camera cameraController;
  43. public float aimSmooth = 10f;
  44. public float aimDistance = 50f;
  45. public Vector3 rotationOffset = Vector3.zero;
  46. public bool DoorEsp;
  47. private Vector3 targetPosition;
  48. private bool isNoClipEnabled;
  49. private CharacterController characterController;
  50. private Dictionary<GameObject, float> playerHealthCache = new Dictionary<GameObject, float>();
  51. public static bool weaponColliders = false;
  52. private bool weaponCollidersLastState;
  53. public static bool freezePlayer = false;
  54. private Vector3 frozenPosition;
  55. public static List<CF_901297a6fc58add3c63fb6a8009b435c56f6fbf4_Corpsefuscated> ContainerBase = new List<CF_901297a6fc58add3c63fb6a8009b435c56f6fbf4_Corpsefuscated>();
  56. public static List<CF_60f299bc78d66f622f93c69da2a0e4195c7775c0_Corpsefuscated> EnemyBase = new List<CF_60f299bc78d66f622f93c69da2a0e4195c7775c0_Corpsefuscated>();
  57. public static List<CF_2e995b97571a12ff09fb17b2c53dc5ae7dd3498d_Corpsefuscated> Playerst = new List<CF_2e995b97571a12ff09fb17b2c53dc5ae7dd3498d_Corpsefuscated>();
  58. public static List<CF_0705e1f8dcbd51041af0cd432b9e2e45e681a7a4_Corpsefuscated> PlayerHealthbar = new List<CF_0705e1f8dcbd51041af0cd432b9e2e45e681a7a4_Corpsefuscated>();
  59. public static List<Transform> Offices = new List<Transform>();
  60. private string[] doorKeywords = new string[4]
  61. {
  62. "basicdoubledoor 3m",
  63. "BasicHallDoubleDoor 5M",
  64. "basicdoor 3m",
  65. "stairexit"
  66. };
  67. private float natNextUpdateTime;
  68. private static Material chamsMaterial;
  69. private static Material headChamsMaterial;
  70. public static Camera cam;
  71. private bool showMenu = true;
  72. private Rect menuRect = new Rect(10f, 10f, 259f, 225f);
  73. private int selectedTab;
  74. private string[] tabNames = new string[2]
  75. {
  76. nameof (Main),
  77. "Esp"
  78. };
  79. private CF_3980daa940efe5d6b70f20f72753354dc6b9ad14_Corpsefuscated _cachedPlayer;
  80.  
  81. public static Color TestColor => new Color(1f, 0.0f, 1f, 1f);
  82.  
  83. private void SaveConfig()
  84. {
  85. PlayerPrefs.SetInt("TransformMovement", this.TransformMovement ? 1 : 0);
  86. PlayerPrefs.SetInt("OHK", this.OHK ? 1 : 0);
  87. PlayerPrefs.SetInt("MobVac", this.MobVac ? 1 : 0);
  88. PlayerPrefs.SetInt("ConVac", this.ConVac ? 1 : 0);
  89. PlayerPrefs.SetInt("Playeresp", this.Playeresp ? 1 : 0);
  90. PlayerPrefs.SetInt("Enemyesp", this.Enemyesp ? 1 : 0);
  91. PlayerPrefs.SetInt("Containeresp", this.Containeresp ? 1 : 0);
  92. PlayerPrefs.SetInt("Chamsesp", this.Chamsesp ? 1 : 0);
  93. PlayerPrefs.Save();
  94. Debug.Log((object) "Config saved.");
  95. }
  96.  
  97. private void LoadConfig()
  98. {
  99. if (!PlayerPrefs.HasKey("TransformMovement"))
  100. return;
  101. this.TransformMovement = PlayerPrefs.GetInt("TransformMovement") == 1;
  102. this.OHK = PlayerPrefs.GetInt("OHK") == 1;
  103. this.MobVac = PlayerPrefs.GetInt("MobVac") == 1;
  104. this.ConVac = PlayerPrefs.GetInt("ConVac") == 1;
  105. this.Playeresp = PlayerPrefs.GetInt("Playeresp") == 1;
  106. this.Enemyesp = PlayerPrefs.GetInt("Enemyesp") == 1;
  107. this.Containeresp = PlayerPrefs.GetInt("Containeresp") == 1;
  108. this.Chamsesp = PlayerPrefs.GetInt("Chamsesp") == 1;
  109. Debug.Log((object) "Config loaded.");
  110. }
  111.  
  112. private void DrawMenu(int windowID)
  113. {
  114. GUILayout.BeginHorizontal(new GUILayoutOption[0]);
  115. for (int index = 0; index < this.tabNames.Length; ++index)
  116. {
  117. if (GUILayout.Toggle((this.selectedTab == index ? 1 : 0) != 0, this.tabNames[index], GUIStyle.op_Implicit("Button"), new GUILayoutOption[1]
  118. {
  119. GUILayout.ExpandWidth(true)
  120. }))
  121. this.selectedTab = index;
  122. }
  123. GUILayout.EndHorizontal();
  124. switch (this.selectedTab)
  125. {
  126. case 0:
  127. GUILayout.BeginVertical(GUI.skin.box, new GUILayoutOption[0]);
  128. GUILayout.BeginHorizontal(new GUILayoutOption[0]);
  129. GUILayout.BeginVertical(new GUILayoutOption[0]);
  130. this.OHK = GUILayout.Toggle(this.OHK, "1 HP Zombies", new GUILayoutOption[0]);
  131. this.MobVac = GUILayout.Toggle(this.MobVac, "Zombie Vac", new GUILayoutOption[0]);
  132. Main.incomingDamageActive = GUILayout.Toggle(Main.incomingDamageActive, "God Mode", new GUILayoutOption[0]);
  133. Main.footstepRangeActive = GUILayout.Toggle(Main.footstepRangeActive, "Visibility Range", new GUILayoutOption[0]);
  134. Main.visibilityRangeActive = GUILayout.Toggle(Main.visibilityRangeActive, "Footstep Range", new GUILayoutOption[0]);
  135. Main.freezePlayer = GUILayout.Toggle(Main.freezePlayer, "Freeze Player", new GUILayoutOption[0]);
  136. GUILayout.EndVertical();
  137. GUILayout.Space(10f);
  138. GUILayout.BeginVertical(new GUILayoutOption[0]);
  139. this.ConVac = GUILayout.Toggle(this.ConVac, "LongLOOT", new GUILayoutOption[0]);
  140. this.ShowHealthbar = GUILayout.Toggle(this.ShowHealthbar, "df1 Hitbox", new GUILayoutOption[0]);
  141. this.aimbotEnabled = GUILayout.Toggle(this.aimbotEnabled, "Aimbot", new GUILayoutOption[0]);
  142. this.isNoClipEnabled = GUILayout.Toggle(this.isNoClipEnabled, "No-Clip", new GUILayoutOption[0]);
  143. Main.instantLootActive = GUILayout.Toggle(Main.instantLootActive, "FastLoot", new GUILayoutOption[0]);
  144. Main.weaponColliders = GUILayout.Toggle(Main.weaponColliders, "Titbox", new GUILayoutOption[0]);
  145. GUILayout.EndVertical();
  146. GUILayout.EndHorizontal();
  147. GUILayout.EndVertical();
  148. break;
  149. case 1:
  150. GUILayout.BeginVertical(GUI.skin.box, new GUILayoutOption[0]);
  151. GUILayout.BeginHorizontal(new GUILayoutOption[0]);
  152. GUILayout.BeginVertical(new GUILayoutOption[0]);
  153. this.Enemyesp = GUILayout.Toggle(this.Enemyesp, "Zombies", new GUILayoutOption[0]);
  154. this.Playeresp = GUILayout.Toggle(this.Playeresp, "Players", new GUILayoutOption[0]);
  155. this.DoorEsp = GUILayout.Toggle(this.DoorEsp, "Doors", new GUILayoutOption[0]);
  156. GUILayout.EndVertical();
  157. GUILayout.Space(10f);
  158. GUILayout.BeginVertical(new GUILayoutOption[0]);
  159. this.Containeresp = GUILayout.Toggle(this.Containeresp, "Container", new GUILayoutOption[0]);
  160. this.Chamsesp = GUILayout.Toggle(this.Chamsesp, "Chams", new GUILayoutOption[0]);
  161. GUILayout.EndVertical();
  162. GUILayout.EndHorizontal();
  163. GUILayout.EndVertical();
  164. break;
  165. }
  166. GUILayout.BeginArea(new Rect(10f, ((Rect) ref this.menuRect).height - 30f, ((Rect) ref this.menuRect).width - 20f, 40f));
  167. GUILayout.BeginHorizontal(new GUILayoutOption[0]);
  168. if (GUILayout.Button("Save Config", new GUILayoutOption[0]))
  169. this.SaveConfig();
  170. if (GUILayout.Button("Load Config", new GUILayoutOption[0]))
  171. this.LoadConfig();
  172. GUILayout.EndHorizontal();
  173. GUILayout.EndArea();
  174. GUI.DragWindow();
  175. }
  176.  
  177. public static List<Transform> GetAllBones(Animator a)
  178. {
  179. return new List<Transform>()
  180. {
  181. a.GetBoneTransform((HumanBodyBones) 10),
  182. a.GetBoneTransform((HumanBodyBones) 9),
  183. a.GetBoneTransform((HumanBodyBones) 7),
  184. a.GetBoneTransform((HumanBodyBones) 0),
  185. a.GetBoneTransform((HumanBodyBones) 11),
  186. a.GetBoneTransform((HumanBodyBones) 13),
  187. a.GetBoneTransform((HumanBodyBones) 15),
  188. a.GetBoneTransform((HumanBodyBones) 17),
  189. a.GetBoneTransform((HumanBodyBones) 12),
  190. a.GetBoneTransform((HumanBodyBones) 14),
  191. a.GetBoneTransform((HumanBodyBones) 16 /*0x10*/),
  192. a.GetBoneTransform((HumanBodyBones) 18),
  193. a.GetBoneTransform((HumanBodyBones) 1),
  194. a.GetBoneTransform((HumanBodyBones) 3),
  195. a.GetBoneTransform((HumanBodyBones) 5),
  196. a.GetBoneTransform((HumanBodyBones) 2),
  197. a.GetBoneTransform((HumanBodyBones) 4),
  198. a.GetBoneTransform((HumanBodyBones) 6)
  199. };
  200. }
  201.  
  202. public static string GetLootContainerNames(string pText)
  203. {
  204. pText = pText.Replace("BarrelA_Barrel1 (1)3_Optimized", "Barrel").Replace("BarrelA_Barrel2 (1)2_Optimized", "Barrel").Replace("PowerboxA_Powerbox20_Optimized", "Powerbox").Replace("PowerboxA_Powerbox31_Optimized", "Powerbox").Replace("PowerboxA_Powerbox12_Optimized", "Powerbox").Replace("BarrelA_Barrel1 (1)3_Optimized", "Barrel").Replace("BarrelA_Barrel21_Optimized", "Barrel").Replace("BarrelA_Barrel10_Optimized", "Barrel").Replace("CarTruckA_Car1A0_Optimized", "Truck").Replace("CarTruckA_Car1B1_Optimized", "Truck").Replace("Cupboard_kitch_down1 (2)", "Kitchen Cupboard").Replace("Cupboard_kitch_down1 (5)", "Kitchen Cupboard").Replace("Cupboard_kitch_down1 (1)", "Kitchen Cupboard").Replace("Cupboard_kitch_down3 (3)", "Kitchen Cupboard").Replace("Cupboard_kitch_down1 (4)", "Kitchen Cupboard").Replace("Cupboard_kitch_down3 (2)", "Kitchen Cupboard").Replace("Cupboard_kitch_down3 (1)", "Kitchen Cupboard").Replace("CarBusA_Bus20_Optimized", "Bus").Replace("CarBusA_Bus11_Optimized", "Bus").Replace("Cupboard_kitch_up3 (2)", "Kitchen Cupboard").Replace("Cupboard_kitch_up2 (1)", "Kitchen Cupboard").Replace("Desk_large_Simple_Grid", "Desk Large").Replace("ZombieWoman_B_v01 (1)", "Zombie Woman").Replace("CarB_Car3B0_Optimized", "Car").Replace("CarB_Car3A1_Optimized", "Car").Replace("CarA_Car4B1_Optimized", "Car").Replace("Bathroom_Furniture_02", "Bathroom Furniture").Replace("Bathroom_Furniture_01", "Bathroom Furniture").Replace("ZombieMan_D_V1 (1)", "Zombie Man").Replace("Cupboard_kitch_down2", "Kitchen Cupboard").Replace("Cupboard_kitch_down3", "Kitchen Cupboard").Replace("CarA_Car40_Optimized", "Car").Replace("FemaleCorpseDecayed", "Female Corpse Decayed").Replace("ZombieWoman_A01 (1)", "Zombie Woman").Replace("ZombieWomanC_V1 (1)", "Zombie Woman").Replace("ZombieWomanD_V1 (1)", "Zombie Woman").Replace("Bed_Cabinet_Medical", "Bed Cabinet Medical").Replace("ZombieMan_C_V1 (1)", "Zombie Man").Replace("Cupboard_kitch_up1", "Kitchen Cupboard").Replace("Cupboard_kitch_up3", "Kitchen Cupboard").Replace("ZombieMan_D_V1 (1)", "Zombie Man").Replace("ZombieWoman_B_v01", "Zombie Woman").Replace("ZombieMan_B01 (1)", "Zombie Man").Replace("ZombieWoman_A01", "Zombie Woman").Replace("ZombieWomanC_V1", "Zombie Woman").Replace("ZombieWomanD_V1", "Zombie Woman").Replace("ZombieManA (1)", "Zombie Man").Replace("ZombieMan_C_V1", "Zombie Man").Replace("ZombieMan_D_V1", "Zombie Man").Replace("FemaleCorpseA", "Female Corpse").Replace("FemaleCorpseB", "Female Corpse").Replace("FemaleCorpseC", "Female Corpse").Replace("FemaleCorpseD", "Female Corpse").Replace("FemaleCorpseE", "Female Corpse").Replace("Cupboard_old1", "Old Cupboard").Replace("Cupboard_old2", "Old Cupboard").Replace("Cupboard_old3", "Old Cupboard").Replace("Cupboard_old4", "Old Cupboard").Replace("Cupboard_old5", "Old Cupboard").Replace("ZombieMan_B01", "Zombie Man").Replace("Sideboard_1", "Sideboard").Replace("Sideboard_2", "Sideboard").Replace("Sideboard_3", "Sideboard").Replace("MaleCorpseA", "Male Corpse").Replace("MaleCorpseB", "Male Corpse").Replace("MaleCorpseC", "Male Corpse").Replace("MaleCorpseD", "Male Corpse").Replace("MaleCorpseE", "Male Corpse").Replace("MaleCorpseF", "Male Corpse").Replace("MaleCorpseG", "Male Corpse").Replace("Wardrobe3_B", "Wardrobe").Replace("Wardrobe3_A", "Wardrobe").Replace("ZombieManA", "Zombie Man").Replace("ZombieManB", "Zombie Man").Replace("Desk_Large", "Desk Large").Replace("PowerboxA", "Powerbox").Replace("PowerboxB", "Powerbox").Replace("CarTruckA", "Truck").Replace("DumpsterA", "Dumpster").Replace("Cupboard1", "Cupboard").Replace("Wardrobe1", "Wardrobe").Replace("Wardrobe2", "Wardrobe").Replace("Cupboard2", "Cupboard").Replace("Cabinet_2", "Cabinet").Replace("TractorA", "Tractor").Replace("Cupboard", "Cupboard").Replace("CarBusA", "Bus").Replace("CarVanA", "Van").Replace("BarrelA", "Barrel").Replace("BarrelB", "Barrel").Replace("Cabinet", "Cabinet").Replace("Desk_1", "Desk").Replace("Desk_2", "Desk").Replace("Desk_3", "Desk").Replace("BinA", "Trash Bin").Replace("BinB", "Trash Bin").Replace("CarA", "Car").Replace("CarB", "Car").Replace("ShelfBase01", "Shelf").Replace("Enemy1", "Boss Loot").Replace("cardboard_boxes", "Cardboard Boxes B").Replace("cardboard_boxes_small", "Cardboard Boxes Small").Replace("cardboard_boxes_small_2", "Cardboard Boxes Small").Replace("Cupboard_Old_Paint1", "Cardboard Boxes Small");
  205. return new Regex("\\([\\d-]\\)").Replace(pText, string.Empty);
  206. }
  207.  
  208. public static string GetDoorNames(string pText)
  209. {
  210. pText = pText.Replace("BasicDoor 3M(Clone)", "Basic Door").Replace("BasicDoor 3M", "Basic Door").Replace("BasicDoubleDoor 3M", "Double Door").Replace("BasicHallDoubleDoor 5M", "Double Door").Replace("BasicHallDoubleDoor 5M(Clone)", "Double Door").Replace("StairExit", "Stair Exit");
  211. return new Regex("\\([\\d-]\\)").Replace(pText, string.Empty);
  212. }
  213.  
  214. public void OnGUI()
  215. {
  216. if (this.showMenu)
  217. {
  218. GUI.backgroundColor = Color.black;
  219. // ISSUE: method pointer
  220. this.menuRect = GUI.Window(0, this.menuRect, new GUI.WindowFunction((object) this, __methodptr(DrawMenu)), "DeadFrontierz by Dreamz");
  221. }
  222. if (this.aimbotEnabled)
  223. this.Aimbot();
  224. if (Main.instantLootActive)
  225. this.ApplyInstantLootModification(true);
  226. else
  227. this.ApplyInstantLootModification(false);
  228. if (Main.footstepRangeActive)
  229. this.ApplyFootstepRangeModification();
  230. if (Main.incomingDamageActive)
  231. this.ApplyIncomingDamageModification();
  232. if (Main.visibilityRangeActive)
  233. this.ApplyVisibilityRangeModification();
  234. if (this.Enemyesp)
  235. {
  236. foreach (CF_60f299bc78d66f622f93c69da2a0e4195c7775c0_Corpsefuscated obj in Main.EnemyBase)
  237. {
  238. Vector3 screenPoint = Main.cam.WorldToScreenPoint(((Component) obj).transform.position);
  239. Animator component = ((Component) obj).GetComponent<Animator>();
  240. if (ESPUtils.IsOnScreen(screenPoint) && CF_46a7199999cccef739e5a3aeb80ad6c602868f5c_Corpsefuscated.op_GreaterThan(obj.health, 0.0f) && this.Enemyesp)
  241. {
  242. ESPUtils.DrawAllBones(Main.GetAllBones(component), ESPUtils.GetHealthColour(CF_46a7199999cccef739e5a3aeb80ad6c602868f5c_Corpsefuscated.op_Implicit(obj.health), 99999f));
  243. ESPUtils.DrawString(new Vector2(screenPoint.x, (float) ((double) Screen.height - (double) screenPoint.y + 8.0)), $"Zombie\nHP: {obj.health.ToString()}\n", Color.red);
  244. }
  245. }
  246. }
  247. if (this.Playeresp)
  248. {
  249. foreach (CF_2e995b97571a12ff09fb17b2c53dc5ae7dd3498d_Corpsefuscated obj in Main.Playerst)
  250. {
  251. Vector3 screenPoint = Main.cam.WorldToScreenPoint(((Component) obj).transform.position);
  252. Animator component = ((Component) obj).GetComponent<Animator>();
  253. if (ESPUtils.IsOnScreen(screenPoint) && this.Playeresp)
  254. {
  255. ESPUtils.DrawAllBones(Main.GetAllBones(component), Color.green);
  256. ESPUtils.DrawString(new Vector2(screenPoint.x, (float) ((double) Screen.height - (double) screenPoint.y + 8.0)), $"{obj.characterName}\nCharID: {obj.characterID.ToString()}", Color.green);
  257. }
  258. }
  259. }
  260. if (this.Containeresp)
  261. {
  262. foreach (CF_901297a6fc58add3c63fb6a8009b435c56f6fbf4_Corpsefuscated obj in Main.ContainerBase)
  263. {
  264. Vector3 screenPoint = Main.cam.WorldToScreenPoint(((Component) obj).transform.position);
  265. if (ESPUtils.IsOnScreen(screenPoint) && obj.requireLootAllowed && this.Containeresp)
  266. ESPUtils.DrawString(new Vector2(screenPoint.x, (float) ((double) Screen.height - (double) screenPoint.y + 8.0)), Main.GetLootContainerNames(((Object) ((Component) obj).gameObject).name) + "\n", Color.cyan);
  267. }
  268. }
  269. if (!this.DoorEsp)
  270. return;
  271. foreach (Transform office in Main.Offices)
  272. {
  273. Vector3 screenPoint = Main.cam.WorldToScreenPoint(office.position);
  274. if (ESPUtils.IsOnScreen(screenPoint))
  275. ESPUtils.DrawString(new Vector2(screenPoint.x, (float) ((double) Screen.height - (double) screenPoint.y + 8.0)), Main.GetDoorNames(((Object) ((Component) office).gameObject).name) + "\n", Color.yellow);
  276. }
  277. }
  278.  
  279. private void Start()
  280. {
  281. Material material = new Material(Shader.Find("Hidden/Internal-Colored"));
  282. ((Object) material).hideFlags = (HideFlags) 5;
  283. Main.headChamsMaterial = material;
  284. Main.headChamsMaterial.SetInt("_ZTest", 8);
  285. Main.headChamsMaterial.SetColor("_Color", Color.blue);
  286. Main.headChamsMaterial.SetInt("_SrcBlend", 1);
  287. Main.headChamsMaterial.SetInt("_DstBlend", 0);
  288. Main.headChamsMaterial.SetInt("_Cull", 0);
  289. Main.headChamsMaterial.SetInt("_Blend", 0);
  290. Main.headChamsMaterial.SetInt("_Mode", 0);
  291. Main.headChamsMaterial.SetFloat("_Glossiness", 0.0f);
  292. Main.headChamsMaterial.SetFloat("_Metallic", 0.0f);
  293. }
  294.  
  295. public void Update()
  296. {
  297. if (Input.GetKeyDown((KeyCode) 277))
  298. this.showMenu = !this.showMenu;
  299. this.natNextUpdateTime += Time.deltaTime;
  300. if ((double) this.natNextUpdateTime >= 4.0)
  301. {
  302. Main.ContainerBase = ((IEnumerable<CF_901297a6fc58add3c63fb6a8009b435c56f6fbf4_Corpsefuscated>) Object.FindObjectsOfType<CF_901297a6fc58add3c63fb6a8009b435c56f6fbf4_Corpsefuscated>()).ToList<CF_901297a6fc58add3c63fb6a8009b435c56f6fbf4_Corpsefuscated>();
  303. Main.EnemyBase = ((IEnumerable<CF_60f299bc78d66f622f93c69da2a0e4195c7775c0_Corpsefuscated>) Object.FindObjectsOfType<CF_60f299bc78d66f622f93c69da2a0e4195c7775c0_Corpsefuscated>()).ToList<CF_60f299bc78d66f622f93c69da2a0e4195c7775c0_Corpsefuscated>();
  304. Main.Playerst = ((IEnumerable<CF_2e995b97571a12ff09fb17b2c53dc5ae7dd3498d_Corpsefuscated>) Object.FindObjectsOfType<CF_2e995b97571a12ff09fb17b2c53dc5ae7dd3498d_Corpsefuscated>()).ToList<CF_2e995b97571a12ff09fb17b2c53dc5ae7dd3498d_Corpsefuscated>();
  305. Main.Offices = ((IEnumerable<Transform>) Object.FindObjectsOfType<Transform>()).Where<Transform>((Func<Transform, bool>) (t => ((IEnumerable<string>) this.doorKeywords).Any<string>((Func<string, bool>) (keyword => ((Object) ((Component) t).gameObject).name.ToLower().Contains(keyword))))).ToList<Transform>();
  306. this.natNextUpdateTime = 0.0f;
  307. }
  308. if (Main.weaponColliders != this.weaponCollidersLastState)
  309. {
  310. if (Main.weaponColliders)
  311. this.InflateWeaponColliders(90f);
  312. else
  313. this.InflateWeaponColliders(0.6f);
  314. this.weaponCollidersLastState = Main.weaponColliders;
  315. }
  316. if (Main.freezePlayer && Object.op_Inequality((Object) this.player, (Object) null))
  317. {
  318. if (Vector3.op_Equality(this.frozenPosition, Vector3.zero))
  319. this.frozenPosition = this.player.transform.position;
  320. this.player.transform.position = this.frozenPosition;
  321. }
  322. else
  323. this.frozenPosition = Vector3.zero;
  324. if (Object.op_Equality((Object) this.player, (Object) null))
  325. {
  326. this.player = GameObject.Find("Player");
  327. if (Object.op_Inequality((Object) this.player, (Object) null))
  328. this.characterController = this.player.GetComponent<CharacterController>();
  329. }
  330. if (Object.op_Inequality((Object) this.player, (Object) null) && Object.op_Inequality((Object) this.characterController, (Object) null))
  331. ((Collider) this.characterController).enabled = !this.isNoClipEnabled;
  332. if (this.ShowHealthbar)
  333. {
  334. string[] strArray = new string[2]
  335. {
  336. "CrawlingHitbox",
  337. "HitCollider4 (1)"
  338. };
  339. Vector3 vector3;
  340. // ISSUE: explicit constructor call
  341. ((Vector3) ref vector3).\u002Ector(153f, 153f, 153f);
  342. foreach (string str in strArray)
  343. {
  344. GameObject gameObject = GameObject.Find(str);
  345. if (Object.op_Inequality((Object) gameObject, (Object) null))
  346. gameObject.transform.localScale = vector3;
  347. }
  348. }
  349. int num = this.TransformMovement ? 1 : 0;
  350. if (this.OHK)
  351. {
  352. foreach (CF_60f299bc78d66f622f93c69da2a0e4195c7775c0_Corpsefuscated obj in Main.EnemyBase)
  353. {
  354. if (CF_46a7199999cccef739e5a3aeb80ad6c602868f5c_Corpsefuscated.op_GreaterThan(obj.health, 0.0f))
  355. obj.health = CF_46a7199999cccef739e5a3aeb80ad6c602868f5c_Corpsefuscated.op_Implicit(0.1f);
  356. }
  357. }
  358. if (this.MobVac)
  359. {
  360. foreach (Component component in Main.EnemyBase)
  361. component.transform.position = new Vector3(CF_10d9cd501e6ef4ddd7208995c3c7092f303b98d1_Corpsefuscated.player.transform.position.x, CF_10d9cd501e6ef4ddd7208995c3c7092f303b98d1_Corpsefuscated.player.transform.position.y, CF_10d9cd501e6ef4ddd7208995c3c7092f303b98d1_Corpsefuscated.player.transform.position.z + 3f);
  362. }
  363. if (this.ConVac)
  364. {
  365. if (Object.op_Equality((Object) this._cachedPlayer, (Object) null))
  366. {
  367. this._cachedPlayer = Object.FindObjectOfType<CF_3980daa940efe5d6b70f20f72753354dc6b9ad14_Corpsefuscated>();
  368. if (Object.op_Equality((Object) this._cachedPlayer, (Object) null))
  369. return;
  370. }
  371. if ((double) this._cachedPlayer.CF_45a7bf455e4c74ec498129616ce8f23e98873571_Corpsefuscated != 200.0)
  372. this._cachedPlayer.CF_45a7bf455e4c74ec498129616ce8f23e98873571_Corpsefuscated = 200f;
  373. }
  374. Main.cam = Camera.main;
  375. }
  376.  
  377. public void ApplyFootstepRangeModification()
  378. {
  379. this.player = GameObject.Find("Player");
  380. if (!Object.op_Inequality((Object) this.player, (Object) null))
  381. return;
  382. this.comp = this.player.GetComponent<CF_da92fcabfd58f8b78e136d77571bcd5fa6b83ebd_Corpsefuscated>();
  383. if (!Object.op_Inequality((Object) this.comp, (Object) null))
  384. return;
  385. IDictionary dictionary = (IDictionary) this.comp.GetType().GetField("CF_8d765dc5047c985ba4298a9abf20fa6e55cf798d_Corpsefuscated", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).GetValue((object) this.comp);
  386. if (dictionary == null)
  387. return;
  388. foreach (DictionaryEntry dictionaryEntry in dictionary)
  389. {
  390. if (dictionaryEntry.Key.ToString() == "footstepRange")
  391. {
  392. dictionary[dictionaryEntry.Key] = (object) -30;
  393. break;
  394. }
  395. }
  396. }
  397.  
  398. public void ApplyIncomingDamageModification()
  399. {
  400. this.player = GameObject.Find("Player");
  401. if (!Object.op_Inequality((Object) this.player, (Object) null))
  402. return;
  403. this.comp = this.player.GetComponent<CF_da92fcabfd58f8b78e136d77571bcd5fa6b83ebd_Corpsefuscated>();
  404. if (!Object.op_Inequality((Object) this.comp, (Object) null))
  405. return;
  406. IDictionary dictionary = (IDictionary) this.comp.GetType().GetField("CF_8d765dc5047c985ba4298a9abf20fa6e55cf798d_Corpsefuscated", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).GetValue((object) this.comp);
  407. if (dictionary == null)
  408. return;
  409. List<object> objectList = new List<object>();
  410. int num = 0;
  411. foreach (DictionaryEntry dictionaryEntry in dictionary)
  412. {
  413. object key = dictionaryEntry.Key;
  414. object obj = dictionaryEntry.Value;
  415. if (key.ToString() == "incomingDamageMulti")
  416. objectList.Add(key);
  417. ++num;
  418. }
  419. foreach (object key in objectList)
  420. dictionary[key] = (object) 0.0f;
  421. }
  422.  
  423. public void ApplyVisibilityRangeModification()
  424. {
  425. this.player = GameObject.Find("Player");
  426. if (!Object.op_Inequality((Object) this.player, (Object) null))
  427. return;
  428. this.comp = this.player.GetComponent<CF_da92fcabfd58f8b78e136d77571bcd5fa6b83ebd_Corpsefuscated>();
  429. if (!Object.op_Inequality((Object) this.comp, (Object) null))
  430. return;
  431. IDictionary dictionary = (IDictionary) this.comp.GetType().GetField("CF_8d765dc5047c985ba4298a9abf20fa6e55cf798d_Corpsefuscated", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).GetValue((object) this.comp);
  432. if (dictionary == null)
  433. return;
  434. foreach (DictionaryEntry dictionaryEntry in dictionary)
  435. {
  436. if (dictionaryEntry.Key.ToString() == "visibilityRange")
  437. {
  438. dictionary[dictionaryEntry.Key] = (object) -30.0;
  439. break;
  440. }
  441. }
  442. }
  443.  
  444. public void ApplyInstantLootModification(bool state)
  445. {
  446. GameObject gameObject = GameObject.Find("Player");
  447. if (!Object.op_Inequality((Object) gameObject, (Object) null))
  448. return;
  449. Component component = gameObject.GetComponent("CF_3980daa940efe5d6b70f20f72753354dc6b9ad14_Corpsefuscated");
  450. if (!Object.op_Inequality((Object) component, (Object) null))
  451. return;
  452. float num = state ? 0.9f : 0.1f;
  453. component.GetType().GetField("CF_f4455094146c9892600b95431ba2cf48819dc675_Corpsefuscated", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.SetValue((object) component, (object) num);
  454. }
  455.  
  456. private void Aimbot()
  457. {
  458. float radius = 150f;
  459. Vector2 screenCenter;
  460. // ISSUE: explicit constructor call
  461. ((Vector2) ref screenCenter).\u002Ector((float) Screen.width / 2f, (float) Screen.height / 2f);
  462. this.DrawFOVCircle(radius, screenCenter);
  463. GameObject closestEnemy = this.GetClosestEnemy();
  464. if (!Object.op_Inequality((Object) closestEnemy, (Object) null))
  465. return;
  466. Transform targetBone = this.GetTargetBone(closestEnemy.GetComponent<Animator>());
  467. if (!Object.op_Inequality((Object) targetBone, (Object) null))
  468. return;
  469. this.player.transform.rotation = Quaternion.Slerp(this.player.transform.rotation, Quaternion.LookRotation(Vector3.op_Subtraction(targetBone.position, this.player.transform.position)), Time.deltaTime * 10f);
  470. }
  471.  
  472. private void DrawFOVCircle(float radius, Vector2 screenCenter)
  473. {
  474. ESPUtils.DrawCircle(Color.white, screenCenter, radius);
  475. }
  476.  
  477. public void Aim()
  478. {
  479. if (Application.isPlaying)
  480. {
  481. GameObject closestEnemy = this.GetClosestEnemy();
  482. if (!Object.op_Inequality((Object) closestEnemy, (Object) null))
  483. return;
  484. Transform targetBone = this.GetTargetBone(closestEnemy.GetComponent<Animator>());
  485. if (!Object.op_Inequality((Object) targetBone, (Object) null))
  486. return;
  487. ((Component) this).transform.rotation = Quaternion.RotateTowards(((Component) this).transform.rotation, Quaternion.LookRotation(Vector3.op_Subtraction(targetBone.position, ((Component) this).transform.position)), this.aimSmooth * Time.deltaTime);
  488. }
  489. else
  490. {
  491. this.targetPosition = Vector3.op_Addition(((Component) this.cameraController).transform.position, Vector3.op_Multiply(((Component) this.cameraController).transform.forward, this.aimDistance));
  492. Transform transform = ((Component) this).transform;
  493. Vector3 vector3 = Vector3.op_Subtraction(this.targetPosition, ((Component) this).transform.position);
  494. Quaternion quaternion = Quaternion.op_Multiply(Quaternion.LookRotation(((Vector3) ref vector3).normalized, Vector3.up), Quaternion.Euler(this.rotationOffset));
  495. transform.rotation = quaternion;
  496. }
  497. }
  498.  
  499. private GameObject GetClosestEnemy()
  500. {
  501. GameObject closestEnemy = (GameObject) null;
  502. float num1 = this.maxAimbotDistance;
  503. foreach (CF_60f299bc78d66f622f93c69da2a0e4195c7775c0_Corpsefuscated obj in Main.EnemyBase)
  504. {
  505. if (Object.op_Inequality((Object) obj, (Object) null))
  506. {
  507. float num2 = Vector3.Distance(((Component) this).transform.position, ((Component) obj).transform.position);
  508. if ((double) num2 < (double) num1)
  509. {
  510. num1 = num2;
  511. closestEnemy = ((Component) obj).gameObject;
  512. }
  513. }
  514. }
  515. return closestEnemy;
  516. }
  517.  
  518. private Transform GetTargetBone(Animator animator)
  519. {
  520. Transform boneTransform = animator.GetBoneTransform((HumanBodyBones) 10);
  521. if (Object.op_Equality((Object) boneTransform, (Object) null))
  522. boneTransform = ((Component) animator).transform.Find("Geo/Zombie_Parts/Head");
  523. return boneTransform;
  524. }
  525.  
  526. public void MouseMove(Vector3 screenPos)
  527. {
  528. float num1 = 10f;
  529. float num2 = (screenPos.x - (float) (Screen.width / 2)) / num1;
  530. float num3 = (screenPos.y - (float) (Screen.height / 2)) / num1;
  531. Cursor.lockState = (CursorLockMode) 1;
  532. Cursor.visible = false;
  533. Vector3 vector3;
  534. // ISSUE: explicit constructor call
  535. ((Vector3) ref vector3).\u002Ector(num2, num3, 0.0f);
  536. Cursor.SetCursor((Texture2D) null, Vector2.op_Implicit(vector3), (CursorMode) 0);
  537. }
  538.  
  539. private void AimAtClosestEnemyHead()
  540. {
  541. GameObject[] gameObjectsWithTag = GameObject.FindGameObjectsWithTag("Enemy");
  542. GameObject enemy = (GameObject) null;
  543. float num1 = this.maxAimbotDistance;
  544. foreach (GameObject gameObject in gameObjectsWithTag)
  545. {
  546. float num2 = Vector3.Distance(this.player.transform.position, gameObject.transform.position);
  547. if ((double) num2 < (double) num1)
  548. {
  549. enemy = gameObject;
  550. num1 = num2;
  551. }
  552. }
  553. if (!Object.op_Inequality((Object) enemy, (Object) null))
  554. return;
  555. Transform headTransform = this.GetHeadTransform(enemy);
  556. if (!Object.op_Inequality((Object) headTransform, (Object) null))
  557. return;
  558. ((Component) this.cameraController).transform.rotation = Quaternion.Slerp(((Component) this.cameraController).transform.rotation, Quaternion.LookRotation(Vector3.op_Subtraction(headTransform.position, ((Component) this.cameraController).transform.position)), Time.deltaTime * this.aimSmooth);
  559. }
  560.  
  561. private Transform GetHeadTransform(GameObject enemy)
  562. {
  563. Transform transform1 = enemy.transform.Find("Geo");
  564. if (Object.op_Inequality((Object) transform1, (Object) null))
  565. {
  566. Transform transform2 = transform1.Find("Zombie_Parts");
  567. if (Object.op_Inequality((Object) transform2, (Object) null))
  568. return transform2.Find("Head");
  569. }
  570. return (Transform) null;
  571. }
  572.  
  573. public void ToggleNoClip()
  574. {
  575. if (Object.op_Equality((Object) this.player, (Object) null))
  576. {
  577. this.player = GameObject.Find("Player");
  578. if (Object.op_Inequality((Object) this.player, (Object) null))
  579. this.characterController = this.player.GetComponent<CharacterController>();
  580. }
  581. if (!Object.op_Inequality((Object) this.player, (Object) null) || !Object.op_Inequality((Object) this.characterController, (Object) null))
  582. return;
  583. if (this.isNoClipEnabled)
  584. ((Collider) this.characterController).enabled = false;
  585. else
  586. ((Collider) this.characterController).enabled = true;
  587. }
  588.  
  589. public void ApplyHeadChamsToZombies()
  590. {
  591. GameObject[] gameObjectsWithTag = GameObject.FindGameObjectsWithTag("Enemy");
  592. if (gameObjectsWithTag.Length == 0)
  593. return;
  594. for (int index = 0; index < gameObjectsWithTag.Length; ++index)
  595. {
  596. GameObject gameObject = gameObjectsWithTag[index];
  597. string name = ((Object) gameObject).name;
  598. Transform transform = gameObject.transform;
  599. Transform headInHierarchy = this.FindHeadInHierarchy(gameObject.transform);
  600. if (Object.op_Inequality((Object) headInHierarchy, (Object) null))
  601. {
  602. Renderer component = ((Component) headInHierarchy).GetComponent<Renderer>();
  603. if (Object.op_Inequality((Object) component, (Object) null))
  604. component.material = Main.headChamsMaterial;
  605. }
  606. }
  607. }
  608.  
  609. private Transform FindHeadInHierarchy(Transform enemyTransform)
  610. {
  611. foreach (Transform enemyTransform1 in enemyTransform)
  612. {
  613. if (((Object) enemyTransform1).name.ToLower().Contains("head"))
  614. return enemyTransform1;
  615. Transform headInHierarchy = this.FindHeadInHierarchy(enemyTransform1);
  616. if (Object.op_Inequality((Object) headInHierarchy, (Object) null))
  617. return headInHierarchy;
  618. }
  619. return (Transform) null;
  620. }
  621.  
  622. public void InflateWeaponColliders(float radius)
  623. {
  624. foreach (CF_2b9256c0fb7ef387d0256374eb46b0b30bf3a47e_Corpsefuscated obj1 in Object.FindObjectsOfType<CF_2b9256c0fb7ef387d0256374eb46b0b30bf3a47e_Corpsefuscated>())
  625. {
  626. FieldInfo field1 = obj1.GetType().GetField("CF_378dccbb010019c8067cf0ba0e3fd321c60a7393_Corpsefuscated", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
  627. if ((object) field1 != null && field1.GetValue((object) obj1) is IEnumerable<object> objects)
  628. {
  629. foreach (object obj2 in objects)
  630. {
  631. FieldInfo field2 = obj2.GetType().GetField("weapon", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
  632. if ((object) field2 != null)
  633. {
  634. object obj3 = field2.GetValue(obj2);
  635. if (obj3 != null)
  636. {
  637. FieldInfo field3 = obj3.GetType().GetField("colliders", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
  638. if ((object) field3 != null && field3.GetValue(obj3) is IEnumerable<Collider> colliders)
  639. {
  640. foreach (Collider collider in colliders)
  641. {
  642. if (collider is SphereCollider sphereCollider)
  643. sphereCollider.radius = radius;
  644. }
  645. }
  646. }
  647. }
  648. }
  649. }
  650. }
  651. }
  652. }
  653.  
Add Comment
Please, Sign In to add comment