├── Screenshots └── menu.png ├── .gitignore ├── DevourClient ├── Properties │ └── AssemblyInfo.cs ├── Settings │ └── Settings.cs ├── Helpers │ ├── Map.cs │ ├── GUIHelper.cs │ ├── Render.cs │ └── StateHelper.cs ├── MelonMain.cs ├── DevourClient.csproj ├── Hooks │ └── Hooks.cs ├── Hacks │ ├── Unlock.cs │ └── Misc.cs └── ClientMain.cs ├── Scripts └── generate_achievements.py ├── DevourClient.sln ├── README.md └── LICENSE.txt /Screenshots/menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ALittlePatate/DevourClient/HEAD/Screenshots/menu.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | #Visual studio stuff 2 | .vs 3 | .git 4 | DevourClient/DevourClient.csproj 5 | DevourClient/bin 6 | DevourClient/obj -------------------------------------------------------------------------------- /DevourClient/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reflection; 3 | 4 | [assembly: System.Reflection.AssemblyCompanyAttribute("DevourClient")] 5 | [assembly: System.Reflection.AssemblyConfigurationAttribute("Release")] 6 | [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] 7 | [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] 8 | [assembly: System.Reflection.AssemblyProductAttribute("DevourClient")] 9 | [assembly: System.Reflection.AssemblyTitleAttribute("DevourClient")] 10 | [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] -------------------------------------------------------------------------------- /Scripts/generate_achievements.py: -------------------------------------------------------------------------------- 1 | """ 2 | This file will generate a list of achievements that can be used by the Unlock.Achievements function of the cheat. 3 | 4 | files : 5 | script.json -> all the functions/strings/data in the game, generated by https://github.com/Perfare/Il2CppDumper 6 | out.cs -> final list of achievements in the form : string[] achievements = { "XXX" ...}; 7 | """ 8 | import json 9 | 10 | # Opening JSON file 11 | f = open('script.json') 12 | data = json.load(f) 13 | 14 | o = open('out.cs', 'w') 15 | o.write("string[] achievements = {") 16 | tot_ach = 0 17 | for i in data['ScriptString']: 18 | v = i["Value"] 19 | if "ACH_" in v : 20 | o.write('"'+v+'", ') 21 | tot_ach+=1 22 | o.write("};\n") 23 | 24 | tot_stat = 0 25 | o.write("string[] stats = {") 26 | for j in data['ScriptString']: 27 | v = j["Value"] 28 | if "STAT_" in v : 29 | o.write('"'+v+'", ') 30 | tot_stat+=1 31 | o.write("};\n") 32 | 33 | print(f"{tot_ach} achievements, {tot_stat} stats") 34 | 35 | # Closing files 36 | o.close() 37 | f.close() -------------------------------------------------------------------------------- /DevourClient.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.1.32407.343 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevourClient", "DevourClient\DevourClient.csproj", "{87349803-31DC-462A-87A3-677CD23AFBA7}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {87349803-31DC-462A-87A3-677CD23AFBA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {87349803-31DC-462A-87A3-677CD23AFBA7}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {87349803-31DC-462A-87A3-677CD23AFBA7}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {87349803-31DC-462A-87A3-677CD23AFBA7}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {CC319521-F66A-4BE0-9D8F-BD285A35C847} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /DevourClient/Settings/Settings.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace DevourClient.Settings 4 | { 5 | public class Settings 6 | { 7 | public static bool menu_enable = false; 8 | public static float width = Screen.width / 2f; 9 | public static float height = Screen.height / 2f; 10 | public static float x = 0; 11 | public static float y = 0; 12 | public static Color flashlight_color = new Color(1.00f, 1.00f, 1.00f, 1); 13 | public static Color player_esp_color = new Color(0.00f, 1.00f, 0.00f, 1); 14 | public static Color azazel_esp_color = new Color(1.00f, 0.00f, 0.00f, 1); 15 | public static float speed = 1f; 16 | public const string message_to_spam = "Deez Nutz"; 17 | public static KeyCode flyKey = KeyCode.None; 18 | public static Vector2 itemsScrollPosition = Vector2.zero; 19 | public static Vector2 rituelObjectsScrollPosition = Vector2.zero; 20 | public static Vector2 stuffsScrollPosition = Vector2.zero; 21 | 22 | public static KeyCode GetKey() 23 | { 24 | Thread.Sleep(50); //TOFIX tried using anyKeydown, no success 25 | foreach (KeyCode vkey in System.Enum.GetValues(typeof(KeyCode))) 26 | { 27 | if (Input.GetKey(vkey)) 28 | { 29 | if (vkey != KeyCode.Delete) 30 | { 31 | return vkey; 32 | } 33 | } 34 | } 35 | 36 | return KeyCode.None; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /DevourClient/Helpers/Map.cs: -------------------------------------------------------------------------------- 1 | namespace DevourClient.Helpers 2 | { 3 | class Map 4 | { 5 | public static string GetActiveScene() 6 | { 7 | return UnityEngine.SceneManagement.SceneManager.GetActiveScene().name; 8 | } 9 | 10 | public static string GetMapName(string sceneName) 11 | { 12 | switch (sceneName) 13 | { 14 | case "Anna": 15 | return "Farmhouse"; 16 | case "Molly": 17 | return "Asylum"; 18 | case "Inn": 19 | return "Inn"; 20 | case "Town": 21 | return "Town"; 22 | case "Slaughterhouse": 23 | return "Slaughterhouse"; 24 | case "Manor": 25 | return "Manor"; 26 | case "Carnival": 27 | return "Carnival"; 28 | default: 29 | return "Menu"; 30 | } 31 | } 32 | 33 | public static UnityEngine.GameObject GetAzazel() 34 | { 35 | return Helpers.Entities.Azazels[0].gameObject; 36 | } 37 | 38 | public static void LoadMap(string mapName) 39 | { 40 | if (Il2CppPhoton.Bolt.BoltNetwork.IsServer) 41 | { 42 | Il2CppPhoton.Bolt.BoltNetwork.LoadScene(mapName); 43 | 44 | MelonLoader.MelonLogger.Warning("Please press the button only once, it may take some time for the map to load."); 45 | } 46 | else 47 | { 48 | MelonLoader.MelonLogger.Warning("You must be the host to use this command!"); 49 | } 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /DevourClient/MelonMain.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Note about license. As stated in the GPL FAQ : 3 | You are allowed to sell copies of the modified program commercially, but only under the terms of the GNU GPL. 4 | Thus, for instance, you must make the source code available to the users of the program as described in the GPL, 5 | and they must be allowed to redistribute and modify it as described in the GPL. 6 | 7 | If you decide to modify and then sell this software you have to agree with the GPL 3 license thus making the source code available. 8 | */ 9 | 10 | using UnityEngine; 11 | using Il2CppInterop.Runtime.Injection; 12 | 13 | [assembly: MelonLoader.VerifyLoaderVersion(0, 6, 0, true)] //Minimum MelonLoader version is V6.0.0, sanity check for people who use 5.7 and wonder why it crashes :) 14 | [assembly: MelonLoader.MelonInfo(typeof(DevourClient.Load), "DevourClient", "2", "ALittlePatate & Jadis0x")] 15 | [assembly: MelonLoader.MelonGame("Straight Back Games", "DEVOUR")] 16 | 17 | namespace DevourClient 18 | { 19 | public class Load : MelonLoader.MelonMod 20 | { 21 | public static ClientMain ClientMainInstance { get; private set; } = default!; 22 | public static GameObject DevourClientGO { get; private set; } = default!; 23 | public static void Init() 24 | { 25 | ClassInjector.RegisterTypeInIl2Cpp(); 26 | 27 | DevourClientGO = new GameObject("DevourClient"); 28 | UnityEngine.Object.DontDestroyOnLoad(DevourClientGO); 29 | DevourClientGO.hideFlags |= HideFlags.HideAndDontSave; 30 | 31 | ClientMainInstance = DevourClientGO.AddComponent(); 32 | } 33 | 34 | public override void OnInitializeMelon() 35 | { 36 | Init(); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /DevourClient/DevourClient.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net6.0 4 | false 5 | enable 6 | enable 7 | Library 8 | 9 | 10 | 0 11 | 12 | 13 | 0 14 | 15 | 16 | 17 | E:\SteamLibrary\steamapps\common\Devour\MelonLoader\net6\0Harmony.dll 18 | 19 | 20 | E:\SteamLibrary\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\Assembly-CSharp.dll 21 | 22 | 23 | E:\SteamLibrary\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\Il2CppBehaviorDesigner.Runtime.dll 24 | 25 | 26 | E:\SteamLibrary\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\Il2Cppbolt.dll 27 | 28 | 29 | E:\SteamLibrary\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\Il2Cppbolt.user.dll 30 | 31 | 32 | E:\SteamLibrary\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\Il2Cppcom.rlabrecque.steamworks.net.dll 33 | 34 | 35 | E:\SteamLibrary\steamapps\common\Devour\MelonLoader\net6\Il2CppInterop.Runtime.dll 36 | 37 | 38 | E:\SteamLibrary\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\Il2Cppmscorlib.dll 39 | 40 | 41 | E:\SteamLibrary\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\Il2CppOpsive.UltimateCharacterController.dll 42 | 43 | 44 | E:\SteamLibrary\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\Il2Cppudpkit.dll 45 | 46 | 47 | E:\SteamLibrary\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\Il2Cppudpkit.common.dll 48 | 49 | 50 | E:\SteamLibrary\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\Il2Cppudpkit.platform.photon.dll 51 | 52 | 53 | E:\SteamLibrary\steamapps\common\Devour\MelonLoader\net6\MelonLoader.dll 54 | 55 | 56 | E:\SteamLibrary\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\UnityEngine.dll 57 | 58 | 59 | E:\SteamLibrary\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\UnityEngine.AnimationModule.dll 60 | 61 | 62 | E:\SteamLibrary\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\UnityEngine.CoreModule.dll 63 | 64 | 65 | E:\SteamLibrary\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\UnityEngine.HotReloadModule.dll 66 | 67 | 68 | E:\SteamLibrary\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\UnityEngine.IMGUIModule.dll 69 | 70 | 71 | E:\SteamLibrary\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\UnityEngine.InputLegacyModule.dll 72 | 73 | 74 | E:\SteamLibrary\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\UnityEngine.InputModule.dll 75 | 76 | 77 | E:\SteamLibrary\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\UnityEngine.PhysicsModule.dll 78 | 79 | 80 | E:\SteamLibrary\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\UnityEngine.UI.dll 81 | 82 | 83 | E:\SteamLibrary\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\UnityEngine.UIModule.dll 84 | 85 | 86 | E:\SteamLibrary\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\Unity.TextMeshPro.dll 87 | 88 | 89 | -------------------------------------------------------------------------------- /DevourClient/Hooks/Hooks.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | using Il2Cpp; 3 | 4 | namespace DevourClient.Hooks 5 | { 6 | public class Hooks 7 | { 8 | [HarmonyPatch(typeof(Il2Cpp.NolanBehaviour), "OnAttributeUpdateValue")] 9 | static class NolanBehaviour_UV 10 | { 11 | [HarmonyPrefix] 12 | static void Prefix(ref Il2CppOpsive.UltimateCharacterController.Traits.Attribute attribute) 13 | { 14 | if (ClientMain.unlimitedUV && attribute.m_Name == "Battery") 15 | { 16 | attribute.m_Value = 100.0f; 17 | return; 18 | } 19 | } 20 | } 21 | 22 | [HarmonyPatch(typeof(Il2Cpp.RankHelpers))] 23 | [HarmonyPatch(nameof(Il2Cpp.RankHelpers.CalculateExpGain))] //annotation boiler plate to tell Harmony what to patch. Refer to docs. 24 | static class RankHelpers_CalculateExpGain 25 | { 26 | static void Postfix(ref Il2Cpp.RankHelpers.ExpGainInfo __result) 27 | { 28 | if (ClientMain.exp_modifier) 29 | { 30 | __result.totalExp = (int)ClientMain.exp; 31 | } 32 | return; 33 | } 34 | } 35 | 36 | 37 | [HarmonyPatch(typeof(Il2CppHorror.Menu))] 38 | [HarmonyPatch(nameof(Il2CppHorror.Menu.SetupPerk))] //annotation boiler plate to tell Harmony what to patch. Refer to docs. 39 | static class Horror_Menu_SetupPerk_Patch 40 | { 41 | static void Prefix(ref Il2Cpp.CharacterPerk perk) 42 | { 43 | /* 44 | public int cost { get; set; } 45 | public bool isOwned { get; set; } 46 | public bool isHidden { get; set; } 47 | */ 48 | 49 | //MelonLoader.MelonLogger.Msg("cost : " + perk.cost); 50 | //MelonLoader.MelonLogger.Msg("isOwned : " + perk.isOwned); 51 | //MelonLoader.MelonLogger.Msg("isHidden : " + perk.isHidden); 52 | perk.cost = 0; 53 | perk.isOwned = true; 54 | perk.isHidden = false; 55 | return; 56 | } 57 | } 58 | 59 | [HarmonyPatch(typeof(Il2CppHorror.Menu))] 60 | [HarmonyPatch(nameof(Il2CppHorror.Menu.SetupOutfit))] //annotation boiler plate to tell Harmony what to patch. Refer to docs. 61 | static class Horror_Menu_SetupOutfit_Patch 62 | { 63 | static void Prefix(ref Il2Cpp.CharacterOutfit outfit) 64 | { 65 | /* 66 | public ulong currentPrice; 67 | public ulong basePrice; 68 | public bool isOwned; 69 | public bool isHidden; 70 | */ 71 | 72 | //MelonLoader.MelonLogger.Msg("basePrice : " + outfit.basePrice); 73 | //MelonLoader.MelonLogger.Msg("currentPrice : " + outfit.currentPrice); 74 | //MelonLoader.MelonLogger.Msg("isOwned : " + outfit.isOwned); 75 | //MelonLoader.MelonLogger.Msg("isHidden : " + outfit.isHidden); 76 | outfit.isOwned = true; 77 | outfit.isHidden = false; 78 | return; 79 | } 80 | } 81 | 82 | [HarmonyPatch(typeof(Il2Cpp.OptionsHelpers))] 83 | [HarmonyPatch(nameof(Il2Cpp.OptionsHelpers.IsRobeUnlocked))] //annotation boiler plate to tell Harmony what to patch. Refer to docs. 84 | static class OptionsHelpers_IsRobeUnlocked_Patch 85 | { 86 | static bool Prefix(ref string robe) 87 | { 88 | //MelonLoader.MelonLogger.Msg("robe : " + robe); 89 | 90 | robe = "Default"; 91 | return true; 92 | } 93 | } 94 | 95 | [HarmonyPatch(typeof(Il2CppHorror.Menu))] 96 | [HarmonyPatch(nameof(Il2CppHorror.Menu.SetupFlashlight))] //annotation boiler plate to tell Harmony what to patch. Refer to docs. 97 | static class Horror_Menu_SetLocked_Patch 98 | { 99 | static void Prefix(Il2Cpp.CharacterFlashlight flashlight) 100 | { 101 | /* 102 | public bool isHidden { get; set; } 103 | public int cost { get; set; } 104 | public bool requiresPurchase { get; set; } 105 | public bool isOwned { get; set; } 106 | */ 107 | 108 | //MelonLoader.MelonLogger.Msg("isHidden : " + flashlight.isHidden); 109 | //MelonLoader.MelonLogger.Msg("cost : " + flashlight.cost); 110 | //MelonLoader.MelonLogger.Msg("requiresPurchase : " + flashlight.requiresPurchase); 111 | //MelonLoader.MelonLogger.Msg("isOwned : " + flashlight.isOwned); 112 | 113 | flashlight.isHidden = false; 114 | flashlight.cost = 0; 115 | flashlight.requiresPurchase = false; 116 | flashlight.isOwned = true; 117 | return; 118 | } 119 | } 120 | 121 | [HarmonyPatch(typeof(ManorMirrorController))] 122 | [HarmonyPatch(nameof(ManorMirrorController.IsBroken))] //annotation boiler plate to tell Harmony what to patch. Refer to docs. 123 | static class ManorMirrorController_IsBroken 124 | { 125 | static void Postfix(ref bool __result) 126 | { 127 | if (ClientMain.infinite_mirrors) 128 | __result = false; 129 | } 130 | } 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /DevourClient/Hacks/Unlock.cs: -------------------------------------------------------------------------------- 1 | using Il2CppSteamworks; 2 | 3 | namespace DevourClient.Hacks 4 | { 5 | public class Unlock 6 | { 7 | public static void Achievements() 8 | { 9 | //Il2Cpp.AchievementHelpers ah = UnityEngine.Object.FindObjectOfType(); 10 | 11 | string[] achievements = { "ACH_WON_Manor_NIGHTMARE_SP", "ACH_WON_NIGHTMARE_", "ACH_WON_TOWN_HARD", "ACH_WON_MANOR_NIGHTMARE_SP", "ACH_WON_INN_HARD_SP", "ACH_WON_SLAUGHTERHOUSE_COOP", "ACH_ALL_FEATHERS", "ACH_WON_INN_HARD", "ACH_ALL_BARBED_WIRES", "ACH_ALL_HORSESHOES", "ACH_WON_MOLLY_HARD", "ACH_WON_TOWN_NIGHTMARE_SP", "ACH_WON_MOLLY_HARD_SP", "ACH_WON_INN_SP", "ACH_100_GASOLINE_USED", "ACH_WON_MANOR_HARD_SP", "ACH_WON_MOLLY_SP", "ACH_100_EGGS_DESTROYED", "ACH_1000_PIGS_DESTROYED", "ACH_WON_TOWN_COOP", "ACH_WON_SLAUGHTERHOUSE_HARD_SP", "ACH_WON_MOLLY_COOP", "ACH_100_FUSES_USED", "ACH_1000_BOOKS_DESTROYED", "ACH_WON_MOLLY_NIGHTMARE_SP", "ACH_WON_SLAUGHTERHOUSE_SP", "ACH_ALL_PATCHES", "ACH_WON_INN_COOP", "ACH_WON_TOWN_NIGHTMARE", "ACH_ALL_CHERRY_BLOSSOM", "ACH_WON_MOLLY_NIGHTMARE", "ACH_WON_TOWN_HARD_SP", "ACH_ALL_ROSES", "ACH_WON_INN_NIGHTMARE_SP", "ACH_1000_HEADS_BURIED", "ACH_WON_SLAUGHTERHOUSE_NIGHTMARE_SP", "ACH_WON_TOWN_SP", "ACH_WON_INN_NIGHTMARE", "ACH_WON_SLAUGHTERHOUSE_HARD", "ACH_WON_MANOR_COOP", "ACH_WON_MANOR_HARD", "ACH_WON_SLAUGHTERHOUSE_NIGHTMARE", "ACH_WON_MANOR_SP", "ACH_WON_MANOR_NIGHTMARE", "ACH_ALL_CLIPBOARDS_READ", "ACH_ALL_NOTES_READ", "ACH_UNLOCKED_ATTIC_CAGE", "ACH_UNLOCKED_CAGE", "ACH_CALMED_ANNA", "ACH_FRIED_RAT", "ACH_BURNT_GOAT", "ACH_KNOCKED_OUT_BY_ANNA", "ACH_KNOCKOUT_OUT_BY_DEMON", "ACH_KNOCKED_OUT_IN_HIDING", "STAT_NUM_BLEACH_USED", "ACH_WON_SP", "ACH_WIN_NIGHTMARE", "ACH_WON_HARD_SP", "ACH_WON_COOP", "ACH_WON_HARD", "ACH_WIN_NIGHTMARE_SP", "ACH_LOST", "ACH_NEVER_KNOCKED_OUT", "ACH_ONLY_ONE_KNOCKED_OUT", "ACH_WON_HARD_NO_MEDKITS", "ACH_WON_NO_MEDKITS", "ACH_WON_NO_BATTERIES", "ACH_WON_NIGHTMARE_NO_MEDKITS", "ACH_WON_NO_KNOCKOUT_COOP", "ACH_WON_HARD_NO_BATTERIES", "ACH_WON_HARD_{0}", "ACH_WON_NIGHTMARE_{0}", "ACH_WON_NIGHTMARE_NO_BATTERIES", "ACH_SURVIVED_TO_7_GOATS", "ACH_SURVIVED_TO_5_GOATS", "ACH_SURVIVED_TO_3_GOATS", }; 12 | string[] stats = { "STAT_ROSES_COLLECTED", "STAT_BARBED_WIRES_COLLECTED", "STAT_HORSESHOES_COLLECTED", "STAT_PATCHES_COLLECTED", "STAT_CHERRY_BLOSSOM_COLLECTED", "STAT_FEATHERS_COLLECTED", "STAT_NUM_CORPSES_FRIED", "STAT_NUM_GHOSTS_FRIED", "STAT_NUM_MOLLY_CALMED_DOWN", "STAT_NUM_ANNA_CALMED_DOWN", "STAT_NUM_ANNA_STAGGERS", "STAT_NUM_NATHAN_STAGGERS", "STAT_NUM_APRIL_STAGGERS", "STAT_NUM_ZARA_STAGGERS", "STAT_NUM_SAM_STAGGERS", "STAT_NUM_MOLLY_STAGGERS", "STAT_NUM_CROWS_FRIED", "STAT_NUM_BOARS_FRIED", "STAT_NUM_SPIDERS_FRIED", "STAT_NUM_INMATES_FRIED", "STAT_NUM_DEMONS_FRIED", "STAT_NUM_KNOCKOUTS", "STAT_KNOCKOUTS_BY_", "STAT_NUM_BOOKS_CURSED", "STAT_NUM_ALCOHOL_USED", "STAT_NUM_BLEACH_USED", "STAT_NUM_HEADS_BURIED", "STAT_POOPS_SEARCHED", "STAT_EXP", "STAT_NUM_PIGS_DESTROYED", "STAT_NUM_WON_HARD", "STAT_NUM_WON_NIGHTMARE", "STAT_NUM_WON", "STAT_NUM_BOOKS_DESTROYED", "STAT_NUM_GASOLINE_USED", "STAT_NUM_GOATS_DESTROYED", "STAT_NUM_RATS_DESTROYED", "STAT_NUM_FUSES_USED", "STAT_KNOCKOUTS_BY_NATHAN", "STAT_KNOCKOUTS_BY_GHOST", "STAT_INMATES", "STAT_NUM_REVIVES", "STAT_GHOSTS", "STAT_HEADS", "STAT_GOATS_LURED", "STAT_KNOCKOUTS_BY_MOLLY", "STAT_KNOCKOUTS_BY_BOAR", "STAT_NUM_EGGS_DESTROYED", "STAT_DEMONS", "STAT_KNOCKOUTS_BY_SPIDER", "STAT_CATEGORY_MISC", "STAT_BOOKS", "STAT_CATEGORY_WINS", "STAT_KNOCKOUTS_BY_SAM", "STAT_HEADS_CLEANSED", "STAT_BOARS", "STAT_KNOCKOUTS_BY_APRIL", "STAT_RATS", "STAT_HEADS_LURED", "STAT_CATEGORY_MINIONS_BANISHED", "STAT_CROWS", "STAT_PIGS", "STAT_PIGS_LURED", "STAT_CATEGORY_AZAZEL_STAGGERS", "STAT_GOATS", "STAT_KNOCKOUTS_BY_ZARA", "STAT_KNOCKOUTS_BY_DEMON", "STAT_KNOCKOUTS_BY_ANNA", "STAT_EGGS", "STAT_CATEGORY_ANIMALS_LURED", "STAT_CORPSES_FREED", "STAT_KNOCKOUTS_BY_INMATE", "STAT_SPIDERS", "STAT_RATS_LURED", "STAT_CATEGORY_RITUAL_ITEMS_DESTROYED", "STAT_CATEGORY_ITEMS_USED", "STAT_KNOCKOUTS_BY_CROW", "STAT_CATEGORY_KNOCKOUTS", "STAT_NUM_WON_NORMAL", "STAT_TOTAL", "STAT_TRASH_CANS_KICKED", }; 13 | for (int i = 0; i < achievements.Length; i++) 14 | { 15 | Il2CppSteamworks.SteamUserStats.SetAchievement(achievements[i]); 16 | //ah.Unlock(achievements[i]); 17 | } 18 | 19 | for (int j = 0; j < stats.Length; j++) 20 | { 21 | Il2CppSteamworks.SteamUserStats.SetStat(stats[j], 666); 22 | } 23 | 24 | MelonLoader.MelonLogger.Warning("You need to restart your game for the achievements to be unlocked !!!"); 25 | MelonLoader.MelonLogger.Warning("You need to restart your game for the achievements to be unlocked !!!"); 26 | MelonLoader.MelonLogger.Warning("You need to restart your game for the achievements to be unlocked !!!"); 27 | MelonLoader.MelonLogger.Warning("You need to restart your game for the achievements to be unlocked !!!"); 28 | } 29 | 30 | public static void Doors() 31 | { 32 | //Pour chaques portes, on les ouvre 33 | foreach (Il2CppHorror.DoorBehaviour doorBehaviour in UnityEngine.Object.FindObjectsOfType()) 34 | { 35 | doorBehaviour.state.Locked = false; 36 | if (doorBehaviour.IsOpen()) 37 | { 38 | doorBehaviour.m_DoorGraphUpdate.DoorOpening(); 39 | } 40 | else 41 | { 42 | doorBehaviour.m_DoorGraphUpdate.DoorClosed(); 43 | } 44 | doorBehaviour.Unlock(); 45 | } 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /DevourClient/Helpers/GUIHelper.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections.Generic; 3 | 4 | namespace DevourClient.Helpers 5 | { 6 | class GUIHelper 7 | { 8 | private static float R; 9 | private static float G; 10 | private static float B; 11 | 12 | private static Texture2D previewTexture = null; 13 | private static Dictionary colorTextureCache = new Dictionary(); 14 | private static Dictionary circularTextureCache = new Dictionary(); 15 | 16 | private static Color lastPreviewColor = Color.clear; 17 | private static GUIStyle cachedBoxStyle = null; 18 | 19 | public static Color ColorPick(string title, Color color) 20 | { 21 | GUI.Label(new Rect(Settings.Settings.x + 195, Settings.Settings.y + 70, 250, 30), title); 22 | 23 | R = GUI.VerticalSlider(new Rect(Settings.Settings.x + 240, Settings.Settings.y + 100, 30, 90), color.r, 0f, 1f); 24 | G = GUI.VerticalSlider(new Rect(Settings.Settings.x + 270, Settings.Settings.y + 100, 30, 90), color.g, 0f, 1f); 25 | B = GUI.VerticalSlider(new Rect(Settings.Settings.x + 300, Settings.Settings.y + 100, 30, 90), color.b, 0f, 1f); 26 | 27 | GUI.Label(new Rect(Settings.Settings.x + 240, Settings.Settings.y + 190, 30, 30), "R"); 28 | GUI.Label(new Rect(Settings.Settings.x + 270, Settings.Settings.y + 190, 30, 30), "G"); 29 | GUI.Label(new Rect(Settings.Settings.x + 300, Settings.Settings.y + 190, 30, 30), "B"); 30 | 31 | color = new Color(R, G, B, 1); 32 | 33 | void DrawPreview(Rect position, Color color_to_draw) 34 | { 35 | if (previewTexture == null || lastPreviewColor != color_to_draw) 36 | { 37 | if (previewTexture == null) 38 | { 39 | previewTexture = new Texture2D(1, 1); 40 | } 41 | 42 | previewTexture.SetPixel(0, 0, color_to_draw); 43 | previewTexture.Apply(); 44 | lastPreviewColor = color_to_draw; 45 | } 46 | 47 | if (cachedBoxStyle == null) 48 | { 49 | cachedBoxStyle = new GUIStyle(GUI.skin.box); 50 | } 51 | cachedBoxStyle.normal.background = previewTexture; 52 | GUI.Box(position, GUIContent.none, cachedBoxStyle); 53 | } 54 | 55 | DrawPreview(new Rect(Settings.Settings.x + 195, Settings.Settings.y + 100, 20, 90), color); 56 | 57 | return color; 58 | } 59 | 60 | public static Texture2D MakeTex(int width, int height, Color col) 61 | { 62 | if (colorTextureCache.TryGetValue(col, out Texture2D cachedTexture)) 63 | { 64 | if (cachedTexture != null) 65 | { 66 | return cachedTexture; 67 | } 68 | } 69 | 70 | Color[] pix = new Color[width * height]; 71 | for (int i = 0; i < pix.Length; ++i) 72 | { 73 | pix[i] = col; 74 | } 75 | Texture2D result = new Texture2D(width, height); 76 | result.SetPixels(pix); 77 | result.Apply(); 78 | 79 | colorTextureCache[col] = result; 80 | 81 | return result; 82 | } 83 | 84 | public static Texture2D GetCircularTexture(int width, int height) 85 | { 86 | int cacheKey = width; 87 | 88 | if (circularTextureCache.TryGetValue(cacheKey, out Texture2D cachedTexture)) 89 | { 90 | if (cachedTexture != null) 91 | { 92 | return cachedTexture; 93 | } 94 | } 95 | 96 | Texture2D texture = new Texture2D(width, height); 97 | for (int x = 0; x < texture.width; x++) 98 | { 99 | for (int y = 0; y < texture.height; y++) 100 | { 101 | if (Vector2.Distance(new Vector2(x, y), new Vector2(texture.width / 2, texture.height / 2)) <= texture.width / 2) 102 | { 103 | texture.SetPixel(x, y, Color.white); 104 | } 105 | else 106 | { 107 | texture.SetPixel(x, y, Color.clear); 108 | } 109 | } 110 | } 111 | 112 | texture.Apply(); 113 | 114 | circularTextureCache[cacheKey] = texture; 115 | 116 | return texture; 117 | } 118 | 119 | public static void Cleanup() 120 | { 121 | if (previewTexture != null) 122 | { 123 | UnityEngine.Object.Destroy(previewTexture); 124 | previewTexture = null; 125 | } 126 | 127 | foreach (var texture in colorTextureCache.Values) 128 | { 129 | if (texture != null) 130 | { 131 | UnityEngine.Object.Destroy(texture); 132 | } 133 | } 134 | colorTextureCache.Clear(); 135 | 136 | foreach (var texture in circularTextureCache.Values) 137 | { 138 | if (texture != null) 139 | { 140 | UnityEngine.Object.Destroy(texture); 141 | } 142 | } 143 | circularTextureCache.Clear(); 144 | } 145 | } 146 | } 147 | -------------------------------------------------------------------------------- /DevourClient/Helpers/Render.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using UnityEngine; 7 | using MelonLoader; 8 | 9 | namespace DevourClient.Render 10 | { 11 | public class Render 12 | { 13 | public static GUIStyle StringStyle { get; set; } = new GUIStyle(GUI.skin.label); 14 | 15 | private static GUIContent cachedContent = new GUIContent(); 16 | private static Dictionary sizeCache = new Dictionary(); 17 | private static int frameCacheClearCounter = 0; 18 | private const int CACHE_CLEAR_INTERVAL = 1800; 19 | 20 | public static void DrawString(Vector2 position, Color color, string label, bool centered = true) 21 | { 22 | cachedContent.text = label; 23 | 24 | if (!sizeCache.TryGetValue(label, out Vector2 size)) 25 | { 26 | size = StringStyle.CalcSize(cachedContent); 27 | sizeCache[label] = size; 28 | 29 | frameCacheClearCounter++; 30 | if (frameCacheClearCounter >= CACHE_CLEAR_INTERVAL) 31 | { 32 | sizeCache.Clear(); 33 | frameCacheClearCounter = 0; 34 | } 35 | } 36 | 37 | var upperLeft = centered ? position - size / 2f : position; 38 | Color color2 = GUI.color; 39 | GUI.color = color; 40 | GUI.Label(new Rect(upperLeft, size), cachedContent); 41 | GUI.color = color2; 42 | } 43 | 44 | public static Texture2D lineTex = default!; 45 | public static void DrawLine(Vector2 pointA, Vector2 pointB, Color color, float width) 46 | { 47 | Matrix4x4 matrix = GUI.matrix; 48 | if (!lineTex) 49 | lineTex = new Texture2D(1, 1); 50 | 51 | Color color2 = GUI.color; 52 | GUI.color = color; 53 | float num = Vector3.Angle(pointB - pointA, Vector2.right); 54 | 55 | if (pointA.y > pointB.y) 56 | num = -num; 57 | 58 | GUIUtility.ScaleAroundPivot(new Vector2((pointB - pointA).magnitude, width), new Vector2(pointA.x, pointA.y + 0.5f)); 59 | GUIUtility.RotateAroundPivot(num, pointA); 60 | GUI.DrawTexture(new Rect(pointA.x, pointA.y, 1f, 1f), lineTex); 61 | GUI.matrix = matrix; 62 | GUI.color = color2; 63 | } 64 | 65 | public static void DrawNameESP(Vector3 pos, string name, Color color) 66 | { 67 | if (Camera.main == null) 68 | { 69 | return; 70 | } 71 | 72 | Vector3 vector = Camera.main.WorldToScreenPoint(pos); 73 | if (vector.z > 0f) 74 | { 75 | vector.y = (float)Screen.height - (vector.y + 1f); 76 | GUI.color = color; 77 | GUI.DrawTexture(new Rect(new Vector2(vector.x, vector.y), new Vector2(5f, 5f)), Texture2D.whiteTexture, 0); 78 | GUI.Label(new Rect(new Vector2(vector.x, vector.y), new Vector2(100f, 100f)), name); 79 | GUI.color = Color.white; 80 | } 81 | } 82 | public static void DrawBones(Transform bone1, Transform bone2, Color c) 83 | { 84 | if (!Camera.main) 85 | { 86 | return; 87 | } 88 | 89 | if (!bone1 || !bone2) 90 | { 91 | return; 92 | } 93 | 94 | Vector3 w1 = Camera.main.WorldToScreenPoint(bone1.position); 95 | Vector3 w2 = Camera.main.WorldToScreenPoint(bone2.position); 96 | if (w1.z > 0.0f && w2.z > 0.0f) 97 | { 98 | DrawLine(new Vector2(w1.x, Screen.height - w1.y), new Vector2(w2.x, Screen.height - w2.y), c, 2f); 99 | } 100 | } 101 | 102 | public static void DrawAllBones(List b, Color c) 103 | { 104 | DrawBones(b[0], b[1], c); //head, neck 105 | DrawBones(b[1], b[2], c); //neck, spine 106 | DrawBones(b[2], b[3], c); //spine, hips 107 | 108 | DrawBones(b[1], b[4], c); //neck, left shoulder 109 | DrawBones(b[4], b[5], c); //left shoulder, left upper arm 110 | DrawBones(b[5], b[6], c); //left upper arm, left lower arm 111 | DrawBones(b[6], b[7], c); //left lower arm, left hand 112 | 113 | DrawBones(b[1], b[8], c); //neck, right shoulder 114 | DrawBones(b[8], b[9], c); //right shoulder, right upper arm 115 | DrawBones(b[9], b[10], c); //right upper arm, right lower arm 116 | DrawBones(b[10], b[11], c); //right lower arm, right hand 117 | 118 | DrawBones(b[3], b[12], c); //hips, left upper leg 119 | DrawBones(b[12], b[13], c); //left upper leg, left lower leg 120 | DrawBones(b[13], b[14], c); //left lower leg, left foot 121 | 122 | DrawBones(b[3], b[15], c); //hips, right upper leg 123 | DrawBones(b[15], b[16], c); //right upper leg, right lower leg 124 | DrawBones(b[16], b[17], c); //right lower leg, right foot 125 | } 126 | 127 | static void DrawBox(float x, float y, float w, float h, Color color, float thickness) 128 | { 129 | Render.DrawLine(new Vector2(x, y), new Vector2(x + w, y), color, thickness); 130 | Render.DrawLine(new Vector2(x, y), new Vector2(x, y + h), color, thickness); 131 | Render.DrawLine(new Vector2(x + w, y), new Vector2(x + w, y + h), color, thickness); 132 | Render.DrawLine(new Vector2(x, y + h), new Vector2(x + w, y + h), color, thickness); 133 | } 134 | 135 | public static void DrawBoxESP(GameObject it, float footOffset, float headOffset, string name, Color color, bool snapline = false, bool esp = false, float nameOffset = -0.5f, float widthOffset = 2.0f) 136 | { 137 | if (!it || !Camera.main) 138 | { 139 | return; 140 | } 141 | 142 | Vector3 footpos = Camera.main.WorldToScreenPoint(new Vector3(it.transform.position.x, it.transform.position.y + footOffset, it.transform.position.z)); 143 | Vector3 headpos = Camera.main.WorldToScreenPoint(new Vector3(it.transform.position.x, it.transform.position.y + headOffset, it.transform.position.z)); 144 | Vector3 namepos = Camera.main.WorldToScreenPoint(new Vector3(it.transform.position.x, it.transform.position.y + nameOffset, it.transform.position.z)); 145 | 146 | if (esp && footpos.z > 0.0f) 147 | { 148 | float height = (headpos.y - footpos.y); 149 | float width = height / widthOffset; 150 | 151 | DrawBox(footpos.x - (width / 2), (float)Screen.height - footpos.y - height, width, height, color, 2.0f); 152 | DrawString(new Vector2(namepos.x, (float)Screen.height - namepos.y), color, name); 153 | } 154 | 155 | if (snapline && footpos.z > 0f) 156 | { 157 | Render.DrawLine(new Vector2((float)(Screen.width / 2), (float)(Screen.height / 2)), new Vector2(footpos.x, (float)Screen.height - footpos.y), color, 2f); 158 | } 159 | } 160 | } 161 | } 162 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # No longer on GitHub, moved [HERE](https://git.patate.dev) 2 | 3 | # DevourClient 4 | 5 | Very based cheat for the game Devour. 6 | 7 | ## Detection rate 8 | 9 | Well at this point i don't really know, i think there is some sort of native Unity anti cheat template but it doesn't seem active. You're fine, no anti cheat ! 10 | 11 | ## Menu 12 | ![menu screenshot](Screenshots/menu.png) 13 | 14 | ## Features 15 | Everything about spoofing ehre (steam name, server name, level...) will persist if you don't uncheck it (it will be reseted when you'll restart the game obv). 16 | * An IMGUI menu thanks to UnityEngine 17 | * Fully compatible with the new IL2CPP version of the game 18 | * Detects if you're in game (with bad code lol), so no chances of crashing on main menu by activating features 19 | * Detects the map you are playing on (useful for the instant win) 20 | * Big Flashlight (allows your flashlight to light a lot more) 21 | * Flashlight color customization (with a home made color picker) 22 | * Unlimited UV light (thanks to [@jadis0x](https://github.com/jadis0x)) 23 | * A chat spammer for Lobby and InGame chat (i couldn't do a text entry because of the limitations of [Il2CppAssemblyUnhollower](https://github.com/knah/Il2CppAssemblyUnhollower)) 24 | * Achievements unlocker (couldn't do all of them, my code is crashing for some reasons at some point, i may fix it, for now it's commented out) 25 | * Doors unlocker (should work fine, though it doesn't seem to work sometimes) 26 | * Keys teleporter 27 | * LV spoofer 28 | * Fly 29 | * Unlock all, including flashlights, perks, outfits. Active by default, can't be turned off, no persistance. 30 | * Instant Win (allows you to win instantaniously on any map, works in singleplayer, but not as a client. May be working as host) 31 | * Random Sound (make your character play a random acting sound) 32 | * Always carrying a medkit 33 | * Change your exp at the end of the game, changing it is permanant ! 34 | * Player ESP (with a home made color picker) 35 | * Player skeleton ESP 36 | * Player snaplines (with a home made color picker) 37 | * Azazel ESP (with a home made color picker) 38 | * Azazel Skeleton ESP 39 | * Azazel snapline (with a home made color picker) 40 | * Item ESP 41 | * Demon ESP 42 | * Goat/Rat ESP 43 | * TP all the items to your position ! (thanks to [@jadis0x](https://github.com/jadis0x)) 44 | * Spawn any item/entity to your position 45 | * Walk in the lobby 46 | * Change the player's speed 47 | * Fullbright 48 | * Infinite mirrors (Manor update) 49 | * Switch between realms (Manor update) 50 | * Due to the game update, I deleted "Steam name spoofer", "Server name spoofer" and "Create a lobby with no player limit" these three functions.For "steam name spoofer", even changed your name by this function, your teamates can still see your name by steam profile, escape button, and your message in game. For "create a lobby with no player limit", if create a lobby with more than four players, the ghost will be stuck or some of the players will not be able to move. So I have to delete this function.(by manafeng) 51 | 52 | ## English Installation Tutorial 53 | 54 | Raz did a great job at writing a guide on how to install the mod, link here : [link](https://docs.google.com/presentation/d/1YdIE5wwGWiJZ2RVughFYrlXUnFrxol-HI7QyLY_m0zc)
55 | 56 | ## French Installation Tutorial 57 | 58 | For my French fellas out there, 1tap2times made a French video tutorial for the installation of the Mod : [link](https://vimeo.com/789315436)
59 | 60 | ## German Video Installation Tutorial 61 | 62 | For my German friends, KiwiJuice02 made a german video tutorial right here : [link](https://www.youtube.com/watch?v=Ntablvo6y-I)
63 | 64 | In order to get all of this working you need to generate the DevourClient.dll file by building the source code.
65 | 66 | 0. Install [.NET 6 SDK and runtime](https://dotnet.microsoft.com/en-us/download/dotnet/6.0). 67 | 1. [Build the cheat from source](https://github.com/ALittlePatate/DevourClient#building-from-source). 68 | 2. Put the DevourClient.dll file located in `DevourClient\bin\Release\net6.0` inside `C:\Program Files (x86)\Steam\steamapps\common\Devour\Mods` folder. 69 | 3. Start the game, now you have successfully installed DevourClient. Use INSERT to open the menu 70 | 71 | ## 中文安装指南 72 | 如果你只是想要安装这个插件,直接在游戏里使用的话 73 | 74 | 1、安装 .net 6 的运行环境 → (https://dotnet.microsoft.com/en-us/download/dotnet/6.0) 75 | 76 | 2、安装melonloader → (https://github.com/LavaGang/MelonLoader/releases) 77 | 版本无限制,尽量选择新版即可。打开melonloader页面后,点击devour进入安装界面,全部默认即可,无需勾选或修改其他选项,点击install进行安装(安装过程中可能需要vpn支持) 78 | 79 | 3、安装dll文件 → 从本项目的release中下载最新的dll文件,然后将此文件添加到你的devour的安装目录中的mods文件夹里(不知道目录的情况下,可以在steam中右键devour,选择“管理”-“浏览本地文件”即可) 80 | 81 | 4、运行devour → 如果安装成功,你会看到一个windows窗口进行各类安装提示后,自动进入游戏。点击insert键即可打开和关闭devourclient窗口 82 | 83 | ps:有些电脑在安装melonloader之后,会出现fatal error的提示,这个我目前并没有碰到过。但是出现这个提示的主要原因,基本是melonloader安装过程中,提取到devour根目录的melonloader文件夹里的文件出现了问题,比较简单的解决办法就是(1)在别人的同系统同位宽(x86,x32)的电脑里拷贝出来他的melonloader文件夹,然后直接粘贴到自己的电脑里。(2)将melonloader文件夹完全删除,然后重装。 84 | 85 | 如果你想要对代码进行修改和开发,请按照下面的”building from source“的步骤,逐步进行 86 | 87 | 88 | ## Uninstallation 89 | 90 | 0. Delete the folders `MelonLoader`, `Mods`, `Plugins`, `UserData`, and the file `version.dll` from `C:\Program Files (x86)\Steam\steamapps\common\Devour` 91 | 92 | ## Building from source 93 | 94 | 0. Clone the repository (or Code -> Download Zip) 95 | 1. Install [.NET 6 SDK and runtime](https://dotnet.microsoft.com/en-us/download/dotnet/6.0). 96 | 2. Install [MelonLoader](https://github.com/LavaGang/MelonLoader/releases) V0.6.4 (go to Settings -> tick "Show ALPHA Pre-Releases") to Devour. 97 | 3. Start your game. A cmd should appear, don't close it, MelonLoader is installing and decompiling Devour's game assemblies. 98 | 4. Wait for the process to finish, once it's done close the game. 99 | 5. Open the solution file (DevourClient.sln) in Visual Studio 100 | 6. Go to : Project --> Add a reference --> Browse --> Click on the browse button in the down right corner of the window. 101 | 7. Add those files : 102 | * `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\net6\MelonLoader.dll` 103 | * `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\net6\0Harmony.dll` 104 | * `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\net6\Il2CppInterop.Runtime.dll` 105 | * `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\Assembly-CSharp.dll` 106 | * `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\Il2CppOpsive.UltimateCharacterController.dll` 107 | * `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\Il2CppBehaviorDesigner.Runtime.dll` 108 | * `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\Il2Cppbolt.user.dll` 109 | * `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\Il2Cppbolt.dll` 110 | * `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\Il2Cppmscorlib.dll` 111 | * `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\UnityEngine.IMGUIModule.dll` 112 | * `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\UnityEngine.InputLegacyModule.dll` 113 | * `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\UnityEngine.HotReloadModule.dll` 114 | * `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\UnityEngine.UI.dll` 115 | * `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\UnityEngine.UIModule.dll` 116 | * `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\UnityEngine.dll` 117 | * `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\UnityEngine.CoreModule.dll` 118 | * `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\UnityEngine.InputModule.dll` 119 | * `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\Il2Cppudpkit.common.dll` 120 | * `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\Il2Cppudpkit.dll` 121 | * `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\Il2Cppudpkit.platform.photon.dll` 122 | * `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\UnityEngine.AnimationModule.dll` 123 | * `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\UnityEngine.PhysicsModule.dll` 124 | * `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\Il2Cppcom.rlabrecque.steamworks.net.dll` 125 | * `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\unity.TextMeshPro.dll` 126 | 8. Build the solutions in Release | Any CPU 127 | 128 | ## Contact 129 | 130 | You can add me on discord at _.patate or on the [discord server](https://discord.gg/2amMFvqjYd) 131 | 132 | ## Code used 133 | 134 | For teaching me the basics : 135 | * [A Begginner's Guide To Hacking Unity Games](https://www.unknowncheats.me/wiki/A_Beginner%27s_Guide_To_Hacking_Unity_Games) 136 | 137 | For teaching me about the MelonLoader mods API and Il2Cpp specifications : 138 | * [MelonLoader's quickstart documentation](https://melonwiki.xyz/#/modders/quickstart) 139 | * [MelonLoader's Il2Cpp differences chapter in the documentation](https://melonwiki.xyz/#/modders/il2cppdifferences) 140 | 141 | For teaching me about the UnityEngine API : 142 | * [Unity User Manual 2020.3 (LTS)](https://docs.unity3d.com/Manual/index.html) 143 | 144 | For decompiling and looking in the source code of the game : 145 | * [dnSpy : a .NET debugger and assembly editor](https://github.com/dnSpy/dnSpy) 146 | 147 | For teaching me the basics about Devour game hacking, and i pasted the Key TP hack and the non working part of the Achievements Unlocker from it : 148 | * [DevourCheatMonoInjector](https://github.com/Glatrix/DevourCheatMonoInjector) 149 | 150 | Game's last update before il2cpp : 151 | * https://steamdb.info/depot/1274571/history/?changeid=M:1960656865974212833 152 | 153 | ## Contributing 154 | 155 | Open an [issue](https://github.com/ALittlePatate/DevourClient/issues/new) or make a [pull request](https://github.com/ALittlePatate/DevourClient/pulls), i'll be glad to improve my project with you ! 156 | 157 | ## License 158 | 159 | [GPL 3.0](https://www.gnu.org/licenses/gpl-3.0.md) 160 | 161 | 162 | -------------------------------------------------------------------------------- /DevourClient/Helpers/StateHelper.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using Il2CppOpsive.UltimateCharacterController.Character; 3 | using System.Collections.Generic; 4 | using System.Collections; 5 | using MelonLoader; 6 | using Il2CppPhoton.Bolt; 7 | 8 | namespace DevourClient.Helpers 9 | { 10 | public class BasePlayer 11 | { 12 | public GameObject p_GameObject { get; set; } = default!; 13 | public string Name { get; set; } = default!; 14 | public string Id { get; set; } = default!; 15 | 16 | public void Kill() 17 | { 18 | if (p_GameObject == null) 19 | { 20 | return; 21 | } 22 | 23 | Il2Cpp.SurvivalAzazelBehaviour sab = Il2Cpp.SurvivalAzazelBehaviour.FindObjectOfType(); 24 | 25 | if (sab == null) 26 | { 27 | return; 28 | } 29 | 30 | sab.OnKnockout(sab.gameObject, p_GameObject); 31 | } 32 | 33 | public void Revive() 34 | { 35 | if (p_GameObject == null) 36 | { 37 | return; 38 | } 39 | 40 | Il2Cpp.NolanBehaviour nb = p_GameObject.GetComponent(); 41 | Il2Cpp.SurvivalReviveInteractable _reviveInteractable = UnityEngine.Object.FindObjectOfType(); 42 | 43 | if (_reviveInteractable.CanInteract(nb.gameObject) == true) { _reviveInteractable.Interact(nb.gameObject); } 44 | 45 | } 46 | 47 | public void Jumpscare() 48 | { 49 | if (!BoltNetwork.IsServer) 50 | { 51 | MelonLogger.Msg("You need to be server !"); 52 | return; 53 | } 54 | 55 | if (p_GameObject == null) 56 | { 57 | return; 58 | } 59 | 60 | Il2Cpp.SurvivalAzazelBehaviour sab = Il2Cpp.SurvivalAzazelBehaviour.FindObjectOfType(); 61 | 62 | if (sab == null) 63 | { 64 | return; 65 | } 66 | 67 | sab.OnPickedUpPlayer(sab.gameObject, p_GameObject, false); 68 | 69 | /* 70 | MelonLogger.Msg(Name); 71 | Il2Cpp.JumpScare _jumpscare = UnityEngine.Object.FindObjectOfType(); 72 | _jumpscare.player = p_GameObject; 73 | _jumpscare.Activate(p_GameObject.GetComponent()); 74 | */ 75 | } 76 | 77 | public void LockInCage() 78 | { 79 | if (p_GameObject == null) 80 | { 81 | return; 82 | } 83 | 84 | BoltNetwork.Instantiate(BoltPrefabs.Cage, p_GameObject.transform.position, Quaternion.identity); 85 | } 86 | 87 | public void TP() 88 | { 89 | if (p_GameObject == null) 90 | { 91 | return; 92 | } 93 | 94 | Il2Cpp.NolanBehaviour nb = Player.GetPlayer(); 95 | nb.TeleportTo(p_GameObject.transform.position, Quaternion.identity); 96 | } 97 | 98 | public void TPAzazel() 99 | { 100 | if (p_GameObject == null) 101 | { 102 | return; 103 | } 104 | 105 | UltimateCharacterLocomotion ucl = Helpers.Map.GetAzazel().GetComponent(); 106 | 107 | if (ucl) 108 | { 109 | ucl.SetPosition(p_GameObject.transform.position); 110 | } 111 | else 112 | { 113 | MelonLogger.Error("Azazel not found!"); 114 | return; 115 | } 116 | } 117 | 118 | public void ShootPlayer() 119 | { 120 | if (!BoltNetwork.IsServer) 121 | { 122 | MelonLogger.Msg("You need to be server !"); 123 | return; 124 | } 125 | 126 | if (p_GameObject == null) 127 | { 128 | return; 129 | } 130 | 131 | Il2Cpp.AzazelSamBehaviour _azazelSam = UnityEngine.Object.FindObjectOfType(); 132 | 133 | if (_azazelSam) 134 | { 135 | _azazelSam.OnShootPlayer(p_GameObject, true); 136 | } 137 | } 138 | } 139 | public class Player 140 | { 141 | public static bool IsInGame() 142 | { 143 | Il2Cpp.OptionsHelpers optionsHelpers = UnityEngine.Object.FindObjectOfType(); 144 | return optionsHelpers.inGame; 145 | } 146 | 147 | public static bool IsInGameOrLobby() 148 | { 149 | return GetPlayer() != null; 150 | } 151 | 152 | public static Il2Cpp.NolanBehaviour GetPlayer() 153 | { 154 | if (Entities.LocalPlayer_.p_GameObject == null) 155 | { 156 | return null!; 157 | } 158 | 159 | return Entities.LocalPlayer_.p_GameObject.GetComponent(); 160 | } 161 | 162 | public static bool IsPlayerCrawling() 163 | { 164 | Il2Cpp.NolanBehaviour nb = Player.GetPlayer(); 165 | 166 | if (nb == null) 167 | { 168 | return false; 169 | } 170 | 171 | return nb.IsCrawling(); 172 | } 173 | 174 | } 175 | 176 | public class Entities 177 | { 178 | public static int MAX_PLAYERS = 4; //will change by calling CreateCustomizedLobby 179 | 180 | public static BasePlayer LocalPlayer_ = new BasePlayer(); 181 | public static BasePlayer[] Players = default!; 182 | public static Il2Cpp.GoatBehaviour[] GoatsAndRats = default!; 183 | public static Il2Cpp.SurvivalInteractable[] SurvivalInteractables = default!; 184 | public static Il2Cpp.KeyBehaviour[] Keys = default!; 185 | public static Il2Cpp.SurvivalDemonBehaviour[] Demons = default!; 186 | public static Il2Cpp.SpiderBehaviour[] Spiders = default!; 187 | public static Il2Cpp.GhostBehaviour[] Ghosts = default!; 188 | public static Il2Cpp.SurvivalAzazelBehaviour[] Azazels = default!; 189 | public static Il2Cpp.BoarBehaviour[] Boars = default!; 190 | public static Il2Cpp.CorpseBehaviour[] Corpses = default!; 191 | public static Il2Cpp.CrowBehaviour[] Crows = default!; 192 | public static Il2Cpp.ManorLumpController[] Lumps = default!; 193 | public static Il2Cpp.MonkeyBehaviour[] Monkeys = default!; 194 | 195 | // 协程生命周期管理 196 | private static List activeCoroutines = new List(); 197 | private static bool isRunning = false; 198 | 199 | public static IEnumerator GetLocalPlayer() 200 | { 201 | while (isRunning) 202 | { 203 | GameObject[] currentPlayers = GameObject.FindGameObjectsWithTag("Player"); 204 | 205 | for (int i = 0; i < currentPlayers.Length; i++) 206 | { 207 | if (currentPlayers[i].GetComponent().entity.IsOwner) 208 | { 209 | LocalPlayer_.p_GameObject = currentPlayers[i]; 210 | break; 211 | } 212 | } 213 | 214 | // Wait 5 seconds before caching objects again. 215 | yield return new WaitForSeconds(5f); 216 | } 217 | } 218 | 219 | public static IEnumerator GetAllPlayers() 220 | { 221 | while (isRunning) 222 | { 223 | GameObject[] players = GameObject.FindGameObjectsWithTag("Player"); 224 | Players = new BasePlayer[players.Length]; 225 | 226 | int i = 0; 227 | foreach (GameObject p in players) 228 | { 229 | string player_name = ""; 230 | string player_id = "-1"; 231 | 232 | Il2Cpp.DissonancePlayerTracking dpt = p.gameObject.GetComponent(); 233 | if (dpt != null) 234 | { 235 | player_name = dpt.state.PlayerName; 236 | player_id = dpt.state.PlayerId; 237 | } 238 | 239 | if (Players[i] == null) 240 | { 241 | Players[i] = new BasePlayer(); 242 | } 243 | 244 | Players[i].Id = player_id; 245 | Players[i].Name = player_name; 246 | Players[i].p_GameObject = p; 247 | 248 | i++; 249 | } 250 | 251 | 252 | // Wait 5 seconds before caching objects again. 253 | yield return new WaitForSeconds(5f); 254 | } 255 | } 256 | public static IEnumerator GetGoatsAndRats() 257 | { 258 | while (isRunning) 259 | { 260 | GoatsAndRats = Il2Cpp.GoatBehaviour.FindObjectsOfType(); 261 | 262 | // Wait 5 seconds before caching objects again. 263 | yield return new WaitForSeconds(5f); 264 | } 265 | } 266 | 267 | public static IEnumerator GetSurvivalInteractables() 268 | { 269 | while (isRunning) 270 | { 271 | SurvivalInteractables = Il2Cpp.SurvivalInteractable.FindObjectsOfType(); 272 | 273 | // Wait 5 seconds before caching objects again. 274 | yield return new WaitForSeconds(5f); 275 | } 276 | } 277 | 278 | public static IEnumerator GetKeys() 279 | { 280 | while (isRunning) 281 | { 282 | Keys = Il2Cpp.KeyBehaviour.FindObjectsOfType(); 283 | 284 | // Wait 5 seconds before caching objects again. 285 | yield return new WaitForSeconds(5f); 286 | } 287 | } 288 | 289 | public static IEnumerator GetDemons() 290 | { 291 | while (isRunning) 292 | { 293 | Demons = Il2Cpp.SurvivalDemonBehaviour.FindObjectsOfType(); 294 | 295 | // Wait 5 seconds before caching objects again. 296 | yield return new WaitForSeconds(5f); 297 | } 298 | } 299 | 300 | public static IEnumerator GetSpiders() 301 | { 302 | while (isRunning) 303 | { 304 | Spiders = Il2Cpp.SpiderBehaviour.FindObjectsOfType(); 305 | 306 | // Wait 5 seconds before caching objects again. 307 | yield return new WaitForSeconds(5f); 308 | } 309 | } 310 | 311 | public static IEnumerator GetGhosts() 312 | { 313 | while (isRunning) 314 | { 315 | Ghosts = Il2Cpp.GhostBehaviour.FindObjectsOfType(); 316 | 317 | // Wait 5 seconds before caching objects again. 318 | yield return new WaitForSeconds(5f); 319 | } 320 | } 321 | 322 | public static IEnumerator GetBoars() 323 | { 324 | while (isRunning) 325 | { 326 | Boars = Il2Cpp.BoarBehaviour.FindObjectsOfType(); 327 | 328 | // Wait 5 seconds before caching objects again. 329 | yield return new WaitForSeconds(5f); 330 | } 331 | } 332 | 333 | public static IEnumerator GetCorpses() 334 | { 335 | while (isRunning) 336 | { 337 | Corpses = Il2Cpp.CorpseBehaviour.FindObjectsOfType(); 338 | 339 | // Wait 5 seconds before caching objects again. 340 | yield return new WaitForSeconds(5f); 341 | } 342 | } 343 | 344 | public static IEnumerator GetCrows() 345 | { 346 | while (isRunning) 347 | { 348 | Crows = Il2Cpp.CrowBehaviour.FindObjectsOfType(); 349 | 350 | // Wait 5 seconds before caching objects again. 351 | yield return new WaitForSeconds(5f); 352 | } 353 | } 354 | 355 | public static IEnumerator GetLumps() 356 | { 357 | while (isRunning) 358 | { 359 | Lumps = Il2Cpp.ManorLumpController.FindObjectsOfType(); 360 | 361 | // Wait 5 seconds before caching objects again. 362 | yield return new WaitForSeconds(5f); 363 | } 364 | } 365 | 366 | public static IEnumerator GetMonkeys() 367 | { 368 | while (isRunning) 369 | { 370 | Monkeys = Il2Cpp.MonkeyBehaviour.FindObjectsOfType(); 371 | 372 | // Wait 5 seconds before caching objects again. 373 | yield return new WaitForSeconds(5f); 374 | } 375 | } 376 | 377 | public static IEnumerator GetAzazels() 378 | { 379 | /* 380 | * ikr AzazelS, because in case we spawn multiple we want the esp to render all of them 381 | */ 382 | while (isRunning) 383 | { 384 | Azazels = Il2Cpp.SurvivalAzazelBehaviour.FindObjectsOfType(); 385 | 386 | // Wait 5 seconds before caching objects again. 387 | yield return new WaitForSeconds(5f); 388 | } 389 | } 390 | 391 | /// 392 | /// 启动所有协程 393 | /// 394 | public static void StartAllCoroutines() 395 | { 396 | isRunning = true; 397 | } 398 | 399 | /// 400 | /// 停止所有协程并清理协程引用 401 | /// 402 | public static void StopAllCoroutines() 403 | { 404 | try 405 | { 406 | // 设置标志,让所有协程循环自然退出 407 | isRunning = false; 408 | 409 | // 停止所有记录的协程 410 | foreach (var coroutine in activeCoroutines) 411 | { 412 | if (coroutine != null) 413 | { 414 | MelonCoroutines.Stop(coroutine); 415 | } 416 | } 417 | 418 | // 清空协程引用列表 419 | activeCoroutines.Clear(); 420 | 421 | // 清理缓存对象 422 | CleanupCachedObjects(); 423 | 424 | MelonLogger.Msg("All coroutines stopped and cleaned up successfully."); 425 | } 426 | catch (System.Exception ex) 427 | { 428 | MelonLogger.Error($"Error stopping coroutines: {ex.Message}"); 429 | } 430 | } 431 | 432 | /// 433 | /// 清理所有缓存的游戏对象引用 434 | /// 435 | public static void CleanupCachedObjects() 436 | { 437 | try 438 | { 439 | // 清理玩家对象引用 440 | if (Players != null) 441 | { 442 | foreach (var player in Players) 443 | { 444 | if (player != null) 445 | { 446 | player.p_GameObject = null; 447 | } 448 | } 449 | } 450 | 451 | // 将所有实体数组设为null,释放对游戏对象的引用 452 | Players = null; 453 | GoatsAndRats = null; 454 | SurvivalInteractables = null; 455 | Keys = null; 456 | Demons = null; 457 | Spiders = null; 458 | Ghosts = null; 459 | Azazels = null; 460 | Boars = null; 461 | Corpses = null; 462 | Crows = null; 463 | Lumps = null; 464 | Monkeys = null; 465 | 466 | // 清理本地玩家引用 467 | if (LocalPlayer_ != null) 468 | { 469 | LocalPlayer_.p_GameObject = null; 470 | } 471 | 472 | MelonLogger.Msg("Cached objects cleaned up successfully."); 473 | } 474 | catch (System.Exception ex) 475 | { 476 | MelonLogger.Error($"Error cleaning up cached objects: {ex.Message}"); 477 | } 478 | } 479 | 480 | /// 481 | /// 注册协程引用用于后续管理 482 | /// 483 | public static void RegisterCoroutine(object coroutine) 484 | { 485 | if (coroutine != null && !activeCoroutines.Contains(coroutine)) 486 | { 487 | activeCoroutines.Add(coroutine); 488 | } 489 | } 490 | } 491 | } 492 | -------------------------------------------------------------------------------- /DevourClient/Hacks/Misc.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using MelonLoader; 3 | using UnityEngine.UI; 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | using DevourClient.Helpers; 7 | using System.Linq; 8 | using System.Collections.Generic; 9 | using Il2CppOpsive.UltimateCharacterController.Character; 10 | using Il2CppPhoton.Bolt; 11 | 12 | namespace DevourClient.Hacks 13 | { 14 | public class Misc 15 | { 16 | public static void Fly(float speed) //normal speed 5f 17 | { 18 | Il2Cpp.NolanBehaviour nb = Player.GetPlayer(); 19 | Vector3 pos = nb.transform.position; 20 | Il2Cpp.RewiredHelpers helpers = UnityEngine.Object.FindObjectOfType(); 21 | if (Input.GetKey((KeyCode)System.Enum.Parse(typeof(KeyCode), helpers.GetCurrentBinding("Move Up").ToString().Replace(" ", "")))) 22 | { 23 | pos += nb.transform.forward * speed * Time.deltaTime; 24 | } 25 | if (Input.GetKey((KeyCode)System.Enum.Parse(typeof(KeyCode), helpers.GetCurrentBinding("Move Down").ToString().Replace(" ", "")))) 26 | { 27 | pos += -nb.transform.forward * speed * Time.deltaTime; 28 | } 29 | if (Input.GetKey((KeyCode)System.Enum.Parse(typeof(KeyCode), helpers.GetCurrentBinding("Move Right").ToString().Replace(" ", "")))) 30 | { 31 | pos += nb.transform.right * speed * Time.deltaTime; 32 | } 33 | if (Input.GetKey((KeyCode)System.Enum.Parse(typeof(KeyCode), helpers.GetCurrentBinding("Move Left").ToString().Replace(" ", "")))) 34 | { 35 | pos += -nb.transform.right * speed * Time.deltaTime; 36 | } 37 | if (Input.GetKey(KeyCode.Space)) 38 | { 39 | pos += nb.transform.up * speed * Time.deltaTime; 40 | } 41 | if (Input.GetKey(KeyCode.LeftControl)) 42 | { 43 | pos += -nb.transform.up * speed * Time.deltaTime; 44 | } 45 | nb.locomotion.SetPosition(pos, false); 46 | } 47 | 48 | public static void WalkInLobby(bool walk) 49 | { 50 | GameObject LocalPlayer = Helpers.Entities.LocalPlayer_.p_GameObject; 51 | if (LocalPlayer == null) 52 | { 53 | return; 54 | } 55 | 56 | //GetComponent called only once as AddComponent returns a component 57 | UltimateCharacterLocomotionHandler cmp = Helpers.Entities.LocalPlayer_.p_GameObject.GetComponent(); 58 | 59 | if (cmp == null) 60 | { 61 | cmp = LocalPlayer.AddComponent(); 62 | cmp.enabled = false; 63 | } 64 | 65 | cmp.enabled = walk; 66 | } 67 | 68 | public static void BurnRitualObj(string map, bool burnAll) 69 | { 70 | switch (map) 71 | { 72 | case "Inn": 73 | Il2Cpp.InnMapController _innMapController = UnityEngine.Object.FindObjectOfType(); 74 | if (!_innMapController) { 75 | return; 76 | } 77 | 78 | if (burnAll){ 79 | _innMapController.SetProgressTo(10); 80 | } 81 | else{ 82 | _innMapController.IncreaseProgress(); 83 | } 84 | break; 85 | 86 | case "Slaughterhouse": 87 | Il2Cpp.SlaughterhouseAltarController _slaughterhouseAltarController = UnityEngine.Object.FindObjectOfType(); 88 | if (!_slaughterhouseAltarController) { 89 | return; 90 | } 91 | 92 | if (burnAll) 93 | { 94 | _slaughterhouseAltarController.BurnGoat(); 95 | } 96 | else 97 | { 98 | _slaughterhouseAltarController.SkipToGoat(10); 99 | } 100 | break; 101 | 102 | case "Manor": 103 | Il2Cpp.MapController mapc = UnityEngine.Object.FindObjectOfType(); 104 | if (!mapc) 105 | { 106 | return; 107 | } 108 | 109 | if (burnAll) 110 | { 111 | mapc.SetProgressTo(10); 112 | } 113 | else 114 | { 115 | mapc.SetProgressTo(mapc.GetMapProgress() + 1); 116 | } 117 | break; 118 | 119 | default: 120 | Il2Cpp.SurvivalObjectBurnController _altar = UnityEngine.Object.FindObjectOfType(); 121 | if (!_altar) { 122 | return; 123 | } 124 | 125 | if (burnAll) 126 | { 127 | _altar.SkipToGoat(10); 128 | } 129 | else 130 | { 131 | _altar.BurnGoat(); 132 | } 133 | break; 134 | } 135 | } 136 | 137 | public static void SpawnAzazel(PrefabId _azazelPrefabId) 138 | { 139 | if (!Il2CppPhoton.Bolt.BoltNetwork.IsServer) 140 | { 141 | Hacks.Misc.ShowMessageBox("You need to be host to spawn stuff !"); 142 | return; 143 | } 144 | 145 | GameObject _localPlayer = Helpers.Entities.LocalPlayer_.p_GameObject; 146 | 147 | if (_localPlayer != null) 148 | { 149 | Vector3 pos = _localPlayer.transform.position; 150 | 151 | GameObject _azazel; 152 | 153 | _azazel = BoltNetwork.Instantiate(_azazelPrefabId, new Vector3(pos.x, pos.y, pos.z + 1f), Quaternion.identity); 154 | Il2Cpp.SurvivalAzazelBehaviour? azazelBehaviour = _azazel?.GetComponent(); 155 | 156 | if (_azazel != null) 157 | { 158 | if (azazelBehaviour != null) 159 | { 160 | _azazel.gameObject.GetComponent().Spawn(); 161 | } 162 | else 163 | { 164 | MelonLogger.Error("azazelBehaviour is null!"); 165 | } 166 | } 167 | else 168 | { 169 | MelonLogger.Error("azazel is null!"); 170 | } 171 | } 172 | } 173 | 174 | public static void CarryObject(string name) 175 | { 176 | Il2Cpp.NolanBehaviour nb = Helpers.Entities.LocalPlayer_.p_GameObject.GetComponent(); 177 | 178 | nb.StartCarry(name); 179 | } 180 | 181 | public static void CleanFountain() 182 | { 183 | GameObject[] fountains = GameObject.FindGameObjectsWithTag("InnFountain"); 184 | 185 | foreach (GameObject fountain in fountains) 186 | { 187 | fountain.GetComponent().Clean(); 188 | } 189 | } 190 | 191 | public static void AutoRespawn() 192 | { 193 | Il2Cpp.NolanBehaviour nb = Player.GetPlayer(); 194 | 195 | Il2Cpp.SurvivalReviveInteractable _reviveInteractable = UnityEngine.Object.FindObjectOfType(); //probably can't be null 196 | 197 | _reviveInteractable.Interact(nb.gameObject); 198 | } 199 | public static void TPItems() 200 | { 201 | Il2Cpp.NolanBehaviour Nolan = Player.GetPlayer(); 202 | 203 | foreach (Il2Cpp.SurvivalInteractable item in Helpers.Entities.SurvivalInteractables) 204 | { 205 | item.transform.position = Nolan.transform.position + Nolan.transform.forward * UnityEngine.Random.RandomRange(1f, 3f); 206 | } 207 | } 208 | 209 | public static void CreateCustomizedLobby(int lobbySize = 4, bool isPrivate = false, Il2CppUdpKit.Platform.Photon.PhotonRegion.Regions __region = Il2CppUdpKit.Platform.Photon.PhotonRegion.Regions.BEST_REGION) 210 | { 211 | //TODO : make it so we can specify a password for a private lobby 212 | 213 | Il2CppHorror.Menu _menu = UnityEngine.Object.FindObjectOfType(); 214 | 215 | Il2CppUdpKit.Platform.PhotonPlatformConfig __photonPlatformConfig = new Il2CppUdpKit.Platform.PhotonPlatformConfig(); 216 | __photonPlatformConfig.Region = Il2CppUdpKit.Platform.Photon.PhotonRegion.regions[__region]; 217 | 218 | BoltLauncher.SetUdpPlatform(new Il2CppUdpKit.Platform.PhotonPlatform(__photonPlatformConfig)); 219 | 220 | BoltConfig __config = UnityEngine.Object.FindObjectOfType().boltConfig; 221 | Toggle __toggle = _menu.hostPrivateServer; 222 | 223 | __toggle.isOn = isPrivate; 224 | __config.serverConnectionLimit = lobbySize; 225 | 226 | BoltLauncher.StartServer(__config, null); 227 | 228 | _menu.ShowCanvasGroup(_menu.loadingCanvasGroup, true); 229 | _menu.ShowCanvasGroup(_menu.hostCanvasGroup, false); 230 | _menu.ShowCanvasGroup(_menu.mainMenuCanvasGroup, false); 231 | } 232 | 233 | 234 | public static void BigFlashlight(bool reset) 235 | { 236 | Il2Cpp.NolanBehaviour Nolan = Player.GetPlayer(); 237 | if (Nolan == null) 238 | { 239 | return; 240 | } 241 | 242 | Light flashlightSpot = Nolan.flashlightSpot; 243 | if (flashlightSpot == null) 244 | { 245 | return; 246 | } 247 | 248 | if (reset) 249 | { 250 | flashlightSpot.intensity = 1.4f; 251 | flashlightSpot.range = 9f; 252 | flashlightSpot.spotAngle = 70f; 253 | } 254 | else 255 | { 256 | flashlightSpot.intensity = 1.1f; 257 | flashlightSpot.range = 200f; 258 | flashlightSpot.spotAngle = 90f; 259 | } 260 | 261 | } 262 | 263 | public static List GetAllBones(Animator a) 264 | { 265 | List Bones = new List 266 | { 267 | a.GetBoneTransform(HumanBodyBones.Head), // 0 268 | a.GetBoneTransform(HumanBodyBones.Neck), // 1 269 | a.GetBoneTransform(HumanBodyBones.Spine), // 2 270 | a.GetBoneTransform(HumanBodyBones.Hips), // 3 271 | 272 | a.GetBoneTransform(HumanBodyBones.LeftShoulder), // 4 273 | a.GetBoneTransform(HumanBodyBones.LeftUpperArm), // 5 274 | a.GetBoneTransform(HumanBodyBones.LeftLowerArm), // 6 275 | a.GetBoneTransform(HumanBodyBones.LeftHand), // 7 276 | 277 | a.GetBoneTransform(HumanBodyBones.RightShoulder), // 8 278 | a.GetBoneTransform(HumanBodyBones.RightUpperArm), // 9 279 | a.GetBoneTransform(HumanBodyBones.RightLowerArm), // 10 280 | a.GetBoneTransform(HumanBodyBones.RightHand), // 11 281 | 282 | a.GetBoneTransform(HumanBodyBones.LeftUpperLeg), // 12 283 | a.GetBoneTransform(HumanBodyBones.LeftLowerLeg), // 13 284 | a.GetBoneTransform(HumanBodyBones.LeftFoot), // 14 285 | 286 | a.GetBoneTransform(HumanBodyBones.RightUpperLeg), // 15 287 | a.GetBoneTransform(HumanBodyBones.RightLowerLeg), // 16 288 | a.GetBoneTransform(HumanBodyBones.RightFoot) // 17 289 | }; 290 | 291 | return Bones; 292 | } 293 | 294 | public static void Fullbright(bool reset) 295 | { 296 | Il2Cpp.NolanBehaviour Nolan = Player.GetPlayer(); 297 | if (Nolan == null) 298 | { 299 | return; 300 | } 301 | 302 | Light flashlightSpot = Nolan.flashlightSpot; 303 | if (flashlightSpot == null) 304 | { 305 | return; 306 | } 307 | 308 | if (reset) 309 | { 310 | flashlightSpot.intensity = 1.4f; 311 | flashlightSpot.range = 9f; 312 | flashlightSpot.spotAngle = 70f; 313 | flashlightSpot.type = LightType.Spot; 314 | flashlightSpot.shadows = LightShadows.Soft; 315 | } 316 | else 317 | { 318 | flashlightSpot.intensity = 1.1f; 319 | flashlightSpot.range = 200f; 320 | flashlightSpot.spotAngle = 179f; 321 | flashlightSpot.type = LightType.Point; 322 | flashlightSpot.shadows = LightShadows.None; 323 | } 324 | 325 | } 326 | public static void FlashlightColor(Color color) 327 | { 328 | Il2Cpp.NolanBehaviour Nolan = Player.GetPlayer(); 329 | Light flashlightSpot = Nolan.flashlightSpot; 330 | 331 | flashlightSpot.color = color; 332 | } 333 | 334 | public static void TPKeys() 335 | { 336 | //TOFIX: spawn manually the missing key in slaughterhouse 337 | Il2Cpp.NolanBehaviour Nolan = Player.GetPlayer(); 338 | 339 | foreach (Il2Cpp.KeyBehaviour keyBehaviour in Helpers.Entities.Keys) 340 | { 341 | if (keyBehaviour == null) 342 | { 343 | return; 344 | } 345 | keyBehaviour.transform.position = Nolan.transform.position + Nolan.transform.forward * 1.5f; 346 | } 347 | } 348 | 349 | public static void SetRank(int rank) 350 | { 351 | Il2Cpp.NolanRankController NolanRank = UnityEngine.Object.FindObjectOfType(); 352 | if (NolanRank == null) 353 | { 354 | return; 355 | } 356 | NolanRank.SetRank(rank); 357 | } 358 | 359 | 360 | public static void DespawnDemons() 361 | { 362 | foreach (Il2Cpp.SurvivalDemonBehaviour demon in Helpers.Entities.Demons) 363 | { 364 | if (demon != null) 365 | { 366 | demon.Despawn(); 367 | } 368 | } 369 | } 370 | 371 | public static void DespawnSpiders() 372 | { 373 | foreach (Il2Cpp.SpiderBehaviour spider in Helpers.Entities.Spiders) 374 | { 375 | if (spider != null) 376 | { 377 | spider.Despawn(); 378 | } 379 | } 380 | } 381 | 382 | public static void DespawnGhosts() 383 | { 384 | foreach (Il2Cpp.GhostBehaviour ghost in Helpers.Entities.Ghosts) 385 | { 386 | if (ghost != null) 387 | { 388 | ghost.Despawn(); 389 | } 390 | } 391 | } 392 | 393 | public static void DespawnBoars() 394 | { 395 | foreach (Il2Cpp.BoarBehaviour boar in Helpers.Entities.Boars) 396 | { 397 | if (boar != null) 398 | { 399 | boar.Despawn(); 400 | } 401 | } 402 | } 403 | 404 | public static void DespawnCorpses() 405 | { 406 | foreach (Il2Cpp.CorpseBehaviour corpse in Helpers.Entities.Corpses) 407 | { 408 | if (corpse != null) 409 | { 410 | corpse.Despawn(); 411 | } 412 | } 413 | } 414 | 415 | public static void DespawnCrows() 416 | { 417 | foreach (Il2Cpp.CrowBehaviour crow in Helpers.Entities.Crows) 418 | { 419 | if (crow != null) 420 | { 421 | crow.Despawn(); 422 | } 423 | } 424 | } 425 | 426 | public static void DespawnLumps() 427 | { 428 | foreach (Il2Cpp.ManorLumpController lump in Helpers.Entities.Lumps) 429 | { 430 | if (lump != null) 431 | { 432 | lump.Dissolve(); 433 | } 434 | } 435 | } 436 | 437 | public static void DespawnMonkeys() 438 | { 439 | foreach (Il2Cpp.MonkeyBehaviour monkey in Helpers.Entities.Monkeys) 440 | { 441 | if (monkey != null) 442 | { 443 | monkey.Despawn(); 444 | } 445 | } 446 | } 447 | 448 | public static int ShowMessageBox(string message) 449 | { 450 | //not used, might be useful, some day 451 | Il2CppHorror.Menu menu = UnityEngine.Object.FindObjectOfType(); 452 | if (menu == null) 453 | return 1; 454 | menu.ShowMessageModal(message); 455 | return 0; 456 | } 457 | 458 | public static void PlaySound() 459 | { 460 | Il2Cpp.PlayRandomAudioClip playRandomAudioClip = UnityEngine.Object.FindObjectOfType(); 461 | Il2Cpp.NolanVoiceOvers nolanVoiceOvers = UnityEngine.Object.FindObjectOfType(); 462 | playRandomAudioClip.delay = 0f; 463 | 464 | int num = UnityEngine.Random.RandomRangeInt(0, 10); 465 | switch (num) 466 | { 467 | case 0: 468 | nolanVoiceOvers.yesClips.Play(); 469 | return; 470 | case 1: 471 | nolanVoiceOvers.noClips.Play(); 472 | return; 473 | case 2: 474 | nolanVoiceOvers.beckonClips.Play(); 475 | return; 476 | case 3: 477 | nolanVoiceOvers.showOffClips.Play(); 478 | return; 479 | case 4: 480 | nolanVoiceOvers.screamClips.Play(); 481 | return; 482 | case 5: 483 | nolanVoiceOvers.pickupClips.Play(); 484 | return; 485 | case 6: 486 | nolanVoiceOvers.burnGoatClips.Play(); 487 | return; 488 | case 7: 489 | nolanVoiceOvers.laughClips.Play(); 490 | return; 491 | case 8: 492 | nolanVoiceOvers.PlayMoan(); 493 | return; 494 | case 9: 495 | nolanVoiceOvers.Scream(); 496 | return; 497 | default: 498 | return; 499 | } 500 | } 501 | 502 | public static void FreezeAzazel() 503 | { 504 | if (Helpers.Map.GetActiveScene() == "Menu") 505 | { 506 | return; 507 | } 508 | 509 | if (Helpers.Map.GetAzazel() == null) { 510 | return; 511 | } 512 | 513 | UltimateCharacterLocomotion _azazelLocomotion = Helpers.Map.GetAzazel().GetComponent(); 514 | 515 | if (_azazelLocomotion == null) 516 | { 517 | return; 518 | } 519 | 520 | if (_azazelLocomotion.TimeScale > 0.0f) 521 | { 522 | _azazelLocomotion.TimeScale = 0f; //host only (?) 523 | } 524 | else 525 | { 526 | _azazelLocomotion.TimeScale = 1.0f; 527 | } 528 | } 529 | 530 | public static void InstantWin() 531 | { 532 | Il2Cpp.Survival survival_class = UnityEngine.Object.FindObjectOfType(); 533 | string map_name = Map.GetMapName(Map.GetActiveScene()); 534 | 535 | if (map_name == "Menu") 536 | { 537 | return; 538 | } 539 | 540 | if (map_name == "Farmhouse") 541 | { 542 | survival_class.PlayEnding("Win"); 543 | return; 544 | } 545 | 546 | survival_class.PlayEnding(map_name+"Win"); 547 | } 548 | } 549 | } 550 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . -------------------------------------------------------------------------------- /DevourClient/ClientMain.cs: -------------------------------------------------------------------------------- 1 | using DevourClient.Helpers; 2 | using MelonLoader; 3 | using System.Threading.Tasks; 4 | using Il2CppPhoton.Bolt; 5 | using UnityEngine; 6 | using Il2Cpp; 7 | using System; 8 | using System.Collections; 9 | using System.Collections.Generic; 10 | 11 | namespace DevourClient 12 | { 13 | public class ClientMain : MonoBehaviour, IDisposable 14 | { 15 | public ClientMain(IntPtr ptr) 16 | : base(ptr) 17 | { 18 | } 19 | 20 | enum CurrentTab : int 21 | { 22 | Visuals = 0, 23 | Entities = 1, 24 | Map = 2, 25 | ESP = 3, 26 | Items = 4, 27 | Misc = 5, 28 | Players = 6 29 | } 30 | 31 | static Rect windowRect = new Rect(Settings.Settings.x + 10, Settings.Settings.y + 10, 800, 750); 32 | static CurrentTab current_tab = CurrentTab.Visuals; 33 | 34 | static bool flashlight_toggle = false; 35 | static bool flashlight_colorpick = false; 36 | static bool player_esp_colorpick = false; 37 | static bool azazel_esp_colorpick = false; 38 | static bool spoofLevel = false; 39 | static float spoofLevelValue = 0; 40 | 41 | // UI variables 42 | static bool fly = false; 43 | static float fly_speed = 5; 44 | static bool fastMove = false; 45 | static float _PlayerSpeedMultiplier = 1; 46 | public static bool _IsAutoRespawn = false; 47 | public static bool unlimitedUV = false; 48 | public static bool exp_modifier = false; 49 | public static float exp = 1000f; 50 | public static bool _walkInLobby = false; 51 | public static bool infinite_mirrors = false; 52 | static bool player_esp = false; 53 | static bool player_skel_esp = false; 54 | static bool player_snapline = false; 55 | static bool azazel_esp = false; 56 | static bool azazel_skel_esp = false; 57 | static bool azazel_snapline = false; 58 | static bool item_esp = false; 59 | static bool goat_rat_esp = false; 60 | static bool demon_esp = false; 61 | static bool fullbright = false; 62 | static bool need_fly_reset = false; 63 | static bool crosshair = false; 64 | static bool in_game_cache = false; 65 | static bool should_show_start_message = true; 66 | static Texture2D crosshairTexture = default!; 67 | 68 | private static int frameCount = 0; 69 | private static int lastMemoryLog = 0; 70 | private const int GC_GEN0_INTERVAL = 300; 71 | private const int GC_FULL_INTERVAL = 3600; 72 | private const int MEMORY_LOG_INTERVAL = 1800; 73 | 74 | public void Start() 75 | { 76 | MelonLogger.Msg("For the Queen !"); 77 | MelonLogger.Warning("Made with <3 by patate and Jadis."); 78 | MelonLogger.Warning("Github : https://github.com/ALittlePatate/DevourClient"); 79 | MelonLogger.Warning("Note : if you payed for this you most likely got scammed."); 80 | 81 | long startMemory = GC.GetTotalMemory(false); 82 | MelonLogger.Msg($"[Memory Monitor] Startup managed memory: {startMemory / 1024 / 1024} MB"); 83 | 84 | crosshairTexture = Helpers.GUIHelper.GetCircularTexture(5, 5); 85 | 86 | Helpers.Entities.StartAllCoroutines(); 87 | 88 | Helpers.Entities.RegisterCoroutine(MelonCoroutines.Start(Helpers.Entities.GetLocalPlayer())); 89 | Helpers.Entities.RegisterCoroutine(MelonCoroutines.Start(Helpers.Entities.GetGoatsAndRats())); 90 | Helpers.Entities.RegisterCoroutine(MelonCoroutines.Start(Helpers.Entities.GetSurvivalInteractables())); 91 | Helpers.Entities.RegisterCoroutine(MelonCoroutines.Start(Helpers.Entities.GetKeys())); 92 | Helpers.Entities.RegisterCoroutine(MelonCoroutines.Start(Helpers.Entities.GetDemons())); 93 | Helpers.Entities.RegisterCoroutine(MelonCoroutines.Start(Helpers.Entities.GetSpiders())); 94 | Helpers.Entities.RegisterCoroutine(MelonCoroutines.Start(Helpers.Entities.GetGhosts())); 95 | Helpers.Entities.RegisterCoroutine(MelonCoroutines.Start(Helpers.Entities.GetBoars())); 96 | Helpers.Entities.RegisterCoroutine(MelonCoroutines.Start(Helpers.Entities.GetCorpses())); 97 | Helpers.Entities.RegisterCoroutine(MelonCoroutines.Start(Helpers.Entities.GetCrows())); 98 | Helpers.Entities.RegisterCoroutine(MelonCoroutines.Start(Helpers.Entities.GetLumps())); 99 | Helpers.Entities.RegisterCoroutine(MelonCoroutines.Start(Helpers.Entities.GetAzazels())); 100 | Helpers.Entities.RegisterCoroutine(MelonCoroutines.Start(Helpers.Entities.GetAllPlayers())); 101 | Helpers.Entities.RegisterCoroutine(MelonCoroutines.Start(Helpers.Entities.GetMonkeys())); 102 | } 103 | 104 | public void Update() 105 | { 106 | if (Input.GetKeyDown(KeyCode.Insert)) 107 | { 108 | try 109 | { 110 | Il2Cpp.GameUI gameUI = UnityEngine.Object.FindObjectOfType(); 111 | if (Settings.Settings.menu_enable) 112 | { 113 | gameUI.HideMouseCursor(); 114 | } 115 | else 116 | { 117 | gameUI.ShowMouseCursor(); 118 | } 119 | } 120 | catch { } 121 | 122 | Settings.Settings.menu_enable = !Settings.Settings.menu_enable; 123 | } 124 | 125 | if (Player.IsInGame()) 126 | { 127 | if (flashlight_toggle && !fullbright) 128 | { 129 | Hacks.Misc.BigFlashlight(false); 130 | } 131 | else if (!flashlight_toggle && !fullbright) 132 | { 133 | Hacks.Misc.BigFlashlight(true); 134 | } 135 | 136 | if (fullbright && !flashlight_toggle) 137 | { 138 | Hacks.Misc.Fullbright(false); 139 | } 140 | else if (!fullbright && !flashlight_toggle) 141 | { 142 | Hacks.Misc.Fullbright(true); 143 | } 144 | 145 | if (_IsAutoRespawn && Helpers.Player.IsPlayerCrawling()) 146 | { 147 | Hacks.Misc.AutoRespawn(); 148 | } 149 | 150 | if (crosshair && !in_game_cache) 151 | { 152 | in_game_cache = true; 153 | } 154 | } 155 | else 156 | { 157 | 158 | if (crosshair && in_game_cache) 159 | { 160 | in_game_cache = false; 161 | } 162 | } 163 | 164 | if (Input.GetKeyDown(Settings.Settings.flyKey)) 165 | { 166 | fly = !fly; 167 | } 168 | 169 | if (Player.IsInGameOrLobby()) 170 | { 171 | if (fly && !need_fly_reset) 172 | { 173 | Il2Cpp.NolanBehaviour nb = Player.GetPlayer(); 174 | if (nb) 175 | { 176 | Collider coll = nb.GetComponentInChildren(); 177 | if (coll) 178 | { 179 | coll.enabled = false; 180 | need_fly_reset = true; 181 | } 182 | } 183 | } 184 | 185 | else if (!fly && need_fly_reset) 186 | { 187 | Il2Cpp.NolanBehaviour nb = Player.GetPlayer(); 188 | if (nb) 189 | { 190 | Collider coll = nb.GetComponentInChildren(); 191 | if (coll) 192 | { 193 | coll.enabled = true; 194 | need_fly_reset = false; 195 | } 196 | } 197 | } 198 | 199 | if (fly) 200 | { 201 | Hacks.Misc.Fly(fly_speed); 202 | } 203 | 204 | } 205 | 206 | if (Helpers.Map.GetActiveScene() == "Menu") 207 | { 208 | Hacks.Misc.WalkInLobby(_walkInLobby); 209 | } 210 | 211 | if (fastMove) 212 | { 213 | try 214 | { 215 | Helpers.Entities.LocalPlayer_.p_GameObject.GetComponent().TimeScale = _PlayerSpeedMultiplier; 216 | } 217 | catch { return; } 218 | } 219 | 220 | 221 | frameCount++; 222 | 223 | if (frameCount % GC_GEN0_INTERVAL == 0) 224 | { 225 | GC.Collect(0, GCCollectionMode.Optimized); 226 | } 227 | 228 | if (frameCount % GC_FULL_INTERVAL == 0) 229 | { 230 | GC.Collect(); 231 | GC.WaitForPendingFinalizers(); 232 | GC.Collect(); 233 | frameCount = 0; 234 | } 235 | 236 | if (frameCount - lastMemoryLog >= MEMORY_LOG_INTERVAL) 237 | { 238 | long memoryUsed = GC.GetTotalMemory(false); 239 | MelonLogger.Msg($"[Memory Monitor] Current managed memory: {memoryUsed / 1024 / 1024} MB | Frame: {frameCount}"); 240 | lastMemoryLog = frameCount; 241 | } 242 | } 243 | 244 | public void OnGUI() 245 | { 246 | if (should_show_start_message) 247 | { 248 | if (DevourClient.Hacks.Misc.ShowMessageBox("Welcome to DevourClient.\n\nPress the INS key to open the menu.") == 0) 249 | should_show_start_message = false; 250 | } 251 | 252 | // 保存原始GUI状态 253 | Color originalBackgroundColor = GUI.backgroundColor; 254 | GUISkin originalSkin = GUI.skin; 255 | 256 | try 257 | { 258 | GUI.backgroundColor = Color.grey; 259 | 260 | // 设置按钮样式 261 | GUI.skin.button.normal.background = GUIHelper.MakeTex(2, 2, Color.black); 262 | GUI.skin.button.normal.textColor = Color.white; 263 | GUI.skin.button.hover.background = GUIHelper.MakeTex(2, 2, Color.green); 264 | GUI.skin.button.hover.textColor = Color.black; 265 | 266 | // 设置切换按钮样式 267 | GUI.skin.toggle.onNormal.textColor = Color.yellow; 268 | 269 | // 设置文本框样式 - 这是关键修复 270 | GUI.skin.textField.normal.background = GUIHelper.MakeTex(2, 2, new Color(0.2f, 0.2f, 0.2f, 0.8f)); 271 | GUI.skin.textField.normal.textColor = Color.white; 272 | GUI.skin.textField.focused.background = GUIHelper.MakeTex(2, 2, new Color(0.3f, 0.3f, 0.3f, 0.9f)); 273 | GUI.skin.textField.focused.textColor = Color.yellow; 274 | GUI.skin.textField.border = new RectOffset(2, 2, 2, 2); 275 | 276 | // 设置标签样式 277 | GUI.skin.label.normal.textColor = Color.white; 278 | 279 | // 设置滑块样式 280 | GUI.skin.horizontalSlider.normal.background = GUIHelper.MakeTex(2, 2, new Color(0.3f, 0.3f, 0.3f, 0.8f)); 281 | GUI.skin.horizontalSliderThumb.normal.background = GUIHelper.MakeTex(2, 2, Color.white); 282 | 283 | if (UnityEngine.Event.current.type == EventType.Repaint) 284 | { 285 | if (player_esp || player_snapline || player_skel_esp) 286 | { 287 | foreach (Helpers.BasePlayer p in Helpers.Entities.Players) 288 | { 289 | if (p == null) 290 | { 291 | continue; 292 | } 293 | 294 | GameObject player = p.p_GameObject; 295 | if (player != null) 296 | { 297 | Il2Cpp.NolanBehaviour nb = player.GetComponent(); 298 | if (nb.entity.IsOwner) 299 | { 300 | continue; 301 | } 302 | 303 | if (player_skel_esp) 304 | { 305 | Render.Render.DrawAllBones(Hacks.Misc.GetAllBones(nb.animator), Settings.Settings.player_esp_color); 306 | } 307 | 308 | Render.Render.DrawBoxESP(player, -0.25f, 1.75f, p.Name, Settings.Settings.player_esp_color, player_snapline, player_esp); 309 | } 310 | } 311 | } 312 | 313 | if (goat_rat_esp) 314 | { 315 | foreach (Il2Cpp.GoatBehaviour goat in Helpers.Entities.GoatsAndRats) 316 | { 317 | if (goat != null) 318 | { 319 | Render.Render.DrawNameESP(goat.transform.position, goat.name.Replace("Survival", "").Replace("(Clone)", ""), new Color(0.94f, 0.61f, 0.18f, 1.0f)); 320 | } 321 | } 322 | } 323 | 324 | if (item_esp) 325 | { 326 | foreach (Il2Cpp.SurvivalInteractable obj in Helpers.Entities.SurvivalInteractables) 327 | { 328 | if (obj != null) 329 | { 330 | Render.Render.DrawNameESP(obj.transform.position, obj.prefabName.Replace("Survival", ""), new Color(1.0f, 1.0f, 1.0f)); 331 | } 332 | } 333 | 334 | foreach (Il2Cpp.KeyBehaviour key in Helpers.Entities.Keys) 335 | { 336 | if (key != null) 337 | { 338 | Render.Render.DrawNameESP(key.transform.position, "Key", new Color(1.0f, 1.0f, 1.0f)); 339 | } 340 | } 341 | } 342 | 343 | if (demon_esp) 344 | { 345 | foreach (Il2Cpp.SurvivalDemonBehaviour demon in Helpers.Entities.Demons) 346 | { 347 | if (demon != null) 348 | { 349 | Render.Render.DrawNameESP(demon.transform.position, demon.name.Replace("Survival", "").Replace("(Clone)", ""), new Color(1.0f, 0.0f, 0.0f, 1.0f)); 350 | } 351 | } 352 | 353 | foreach (Il2Cpp.SpiderBehaviour spider in Helpers.Entities.Spiders) 354 | { 355 | if (spider != null) 356 | { 357 | Render.Render.DrawNameESP(spider.transform.position, "Spider", new Color(1.0f, 0.0f, 0.0f, 1.0f)); 358 | } 359 | } 360 | 361 | foreach (Il2Cpp.GhostBehaviour ghost in Helpers.Entities.Ghosts) 362 | { 363 | if (ghost != null) 364 | { 365 | Render.Render.DrawNameESP(ghost.transform.position, "Ghost", new Color(1.0f, 0.0f, 0.0f, 1.0f)); 366 | } 367 | } 368 | 369 | foreach (Il2Cpp.BoarBehaviour boar in Helpers.Entities.Boars) 370 | { 371 | if (boar != null) 372 | { 373 | Render.Render.DrawNameESP(boar.transform.position, "Boar", new Color(1.0f, 0.0f, 0.0f, 1.0f)); 374 | } 375 | } 376 | 377 | foreach (Il2Cpp.CorpseBehaviour corpse in Helpers.Entities.Corpses) 378 | { 379 | if (corpse != null) 380 | { 381 | Render.Render.DrawNameESP(corpse.transform.position, "Corpse", new Color(1.0f, 0.0f, 0.0f, 1.0f)); 382 | } 383 | } 384 | 385 | foreach (Il2Cpp.CrowBehaviour crow in Helpers.Entities.Crows) 386 | { 387 | if (crow != null) 388 | { 389 | Render.Render.DrawNameESP(crow.transform.position, "Crow", new Color(1.0f, 0.0f, 0.0f, 1.0f)); 390 | } 391 | } 392 | 393 | foreach (Il2Cpp.ManorLumpController lump in Helpers.Entities.Lumps) 394 | { 395 | if (lump != null) 396 | { 397 | Render.Render.DrawNameESP(lump.transform.position, "Lump", new Color(1.0f, 0.0f, 0.0f, 1.0f)); 398 | } 399 | } 400 | foreach (Il2Cpp.MonkeyBehaviour monkey in Helpers.Entities.Monkeys) 401 | { 402 | if (monkey != null) 403 | { 404 | Render.Render.DrawNameESP(monkey.transform.position, "Monkey", new Color(1.0f, 0.0f, 0.0f, 1.0f)); 405 | } 406 | } 407 | } 408 | 409 | if (azazel_esp || azazel_snapline || azazel_skel_esp) 410 | { 411 | foreach (Il2Cpp.SurvivalAzazelBehaviour survivalAzazel in Helpers.Entities.Azazels) 412 | { 413 | if (survivalAzazel != null) 414 | { 415 | if (azazel_skel_esp) 416 | { 417 | Render.Render.DrawAllBones(Hacks.Misc.GetAllBones(survivalAzazel.animator), Settings.Settings.azazel_esp_color); 418 | } 419 | 420 | Render.Render.DrawBoxESP(survivalAzazel.gameObject, -0.25f, 2.0f, "Azazel", Settings.Settings.azazel_esp_color, azazel_snapline, azazel_esp); 421 | } 422 | } 423 | } 424 | 425 | if (crosshair && in_game_cache) 426 | { 427 | const float crosshairSize = 4; 428 | 429 | float xMin = (Settings.Settings.width) - (crosshairSize / 2); 430 | float yMin = (Settings.Settings.height) - (crosshairSize / 2); 431 | 432 | if (crosshairTexture == null) 433 | { 434 | crosshairTexture = Helpers.GUIHelper.GetCircularTexture(5, 5); 435 | } 436 | 437 | GUI.DrawTexture(new Rect(xMin, yMin, crosshairSize, crosshairSize), crosshairTexture); 438 | } 439 | } 440 | 441 | if (Settings.Settings.menu_enable) 442 | { 443 | windowRect = GUI.Window(0, windowRect, (GUI.WindowFunction)Tabs, "DevourClient"); 444 | } 445 | } 446 | catch (System.Exception ex) 447 | { 448 | MelonLogger.Msg($"OnGUI Error: {ex.Message}"); 449 | } 450 | finally 451 | { 452 | // 恢复原始GUI状态 453 | GUI.backgroundColor = originalBackgroundColor; 454 | GUI.skin = originalSkin; 455 | } 456 | } 457 | 458 | public static void Tabs(int windowID) 459 | { 460 | GUILayout.BeginHorizontal(); 461 | 462 | if (GUILayout.Button("Visual", GUILayout.Height(40)) || Input.GetKeyDown(KeyCode.F1)) 463 | { 464 | current_tab = CurrentTab.Visuals; 465 | } 466 | 467 | if (GUILayout.Button("Entites", GUILayout.Height(40)) || Input.GetKeyDown(KeyCode.F2)) 468 | { 469 | current_tab = CurrentTab.Entities; 470 | } 471 | 472 | if (GUILayout.Button("Map Specific", GUILayout.Height(40)) || Input.GetKeyDown(KeyCode.F3)) 473 | { 474 | current_tab = CurrentTab.Map; 475 | } 476 | 477 | if (GUILayout.Button("ESP", GUILayout.Height(40)) || Input.GetKeyDown(KeyCode.F4)) 478 | { 479 | current_tab = CurrentTab.ESP; 480 | } 481 | 482 | if (GUILayout.Button("Items", GUILayout.Height(40)) || Input.GetKeyDown(KeyCode.F5)) 483 | { 484 | current_tab = CurrentTab.Items; 485 | } 486 | 487 | if (GUILayout.Button("Misc", GUILayout.Height(40)) || Input.GetKeyDown(KeyCode.F6)) 488 | { 489 | current_tab = CurrentTab.Misc; 490 | } 491 | 492 | if (GUILayout.Button("Player", GUILayout.Height(40)) || Input.GetKeyDown(KeyCode.F7)) 493 | { 494 | current_tab = CurrentTab.Players; 495 | } 496 | 497 | GUILayout.EndHorizontal(); 498 | 499 | switch (current_tab) 500 | { 501 | case CurrentTab.Visuals: 502 | VisualsTab(); 503 | break; 504 | case CurrentTab.Entities: 505 | EntitiesTab(); 506 | break; 507 | case CurrentTab.Map: 508 | MapSpecificTab(); 509 | break; 510 | case CurrentTab.ESP: 511 | EspTab(); 512 | break; 513 | case CurrentTab.Items: 514 | ItemsTab(); 515 | break; 516 | case CurrentTab.Misc: 517 | MiscTab(); 518 | break; 519 | case CurrentTab.Players: 520 | PlayersTab(); 521 | break; 522 | 523 | } 524 | 525 | GUI.DragWindow(); 526 | } 527 | 528 | private static void VisualsTab() 529 | { 530 | // draw visuals 531 | 532 | flashlight_toggle = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 70, 120, 30), flashlight_toggle, "Big Flashlight"); 533 | fullbright = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 100, 120, 30), fullbright, "Fullbright"); 534 | unlimitedUV = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 130, 130, 30), unlimitedUV, "Unlimited UV Light"); 535 | crosshair = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 160, 130, 30), crosshair, "Crosshair"); 536 | 537 | 538 | if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 190, 130, 30), "Flashlight Color")) 539 | { 540 | flashlight_colorpick = !flashlight_colorpick; 541 | MelonLogger.Msg("Flashlight color picker : " + flashlight_colorpick.ToString()); 542 | 543 | } 544 | 545 | if (flashlight_colorpick) 546 | { 547 | Color flashlight_color_input = DevourClient.Helpers.GUIHelper.ColorPick("Flashlight Color", Settings.Settings.flashlight_color); 548 | Settings.Settings.flashlight_color = flashlight_color_input; 549 | 550 | if (Player.IsInGame()) 551 | { 552 | Hacks.Misc.FlashlightColor(flashlight_color_input); 553 | } 554 | } 555 | } 556 | 557 | private static void EntitiesTab() 558 | { 559 | //draw entities 560 | 561 | if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 70, 130, 30), "TP items to you")) 562 | { 563 | Hacks.Misc.TPItems(); 564 | MelonLogger.Msg("TP Items!"); 565 | } 566 | 567 | if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 110, 130, 30), "Freeze azazel")) 568 | { 569 | Hacks.Misc.FreezeAzazel(); 570 | } 571 | 572 | GUI.Label(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 150, 120, 30), "Azazel & Demons"); 573 | 574 | if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 180, 60, 25), "Sam") && Player.IsInGameOrLobby() && BoltNetwork.IsServer) 575 | { 576 | Hacks.Misc.SpawnAzazel((PrefabId)BoltPrefabs.AzazelSam); 577 | } 578 | 579 | if (GUI.Button(new Rect(Settings.Settings.x + 80, Settings.Settings.y + 180, 60, 25), "Molly") && Player.IsInGameOrLobby() && BoltNetwork.IsServer) 580 | { 581 | Hacks.Misc.SpawnAzazel((PrefabId)BoltPrefabs.SurvivalAzazelMolly); 582 | } 583 | 584 | if (GUI.Button(new Rect(Settings.Settings.x + 150, Settings.Settings.y + 180, 60, 25), "Anna") && Player.IsInGameOrLobby() && BoltNetwork.IsServer) 585 | { 586 | BoltNetwork.Instantiate(BoltPrefabs.SurvivalAnnaNew, Player.GetPlayer().transform.position, Quaternion.identity); 587 | } 588 | 589 | if (GUI.Button(new Rect(Settings.Settings.x + 220, Settings.Settings.y + 180, 60, 25), "Zara") && Player.IsInGameOrLobby() && BoltNetwork.IsServer) 590 | { 591 | BoltNetwork.Instantiate(BoltPrefabs.AzazelZara, Player.GetPlayer().transform.position, Quaternion.identity); 592 | } 593 | 594 | if (GUI.Button(new Rect(Settings.Settings.x + 290, Settings.Settings.y + 180, 60, 25), "Nathan") && Player.IsInGameOrLobby() && BoltNetwork.IsServer) 595 | { 596 | BoltNetwork.Instantiate(BoltPrefabs.AzazelNathan, Player.GetPlayer().transform.position, Quaternion.identity); 597 | } 598 | 599 | if (GUI.Button(new Rect(Settings.Settings.x + 360, Settings.Settings.y + 180, 60, 25), "April") && Player.IsInGameOrLobby() && BoltNetwork.IsServer) 600 | { 601 | BoltNetwork.Instantiate(BoltPrefabs.AzazelApril, Player.GetPlayer().transform.position, Quaternion.identity); 602 | } 603 | 604 | if (GUI.Button(new Rect(Settings.Settings.x + 430, Settings.Settings.y + 180, 60, 25), "Kai") && Player.IsInGameOrLobby() && BoltNetwork.IsServer) 605 | { 606 | BoltNetwork.Instantiate(BoltPrefabs.AzazelKai, Player.GetPlayer().transform.position, Quaternion.identity); 607 | } 608 | 609 | if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 220, 60, 25), "Ghost") && Player.IsInGameOrLobby() && BoltNetwork.IsServer) 610 | { 611 | BoltNetwork.Instantiate(BoltPrefabs.Ghost, Player.GetPlayer().transform.position, Quaternion.identity); 612 | } 613 | 614 | if (GUI.Button(new Rect(Settings.Settings.x + 80, Settings.Settings.y + 220, 60, 25), "Inmate") && Player.IsInGameOrLobby() && BoltNetwork.IsServer) 615 | { 616 | BoltNetwork.Instantiate(BoltPrefabs.SurvivalInmate, Player.GetPlayer().transform.position, Quaternion.identity); 617 | } 618 | 619 | if (GUI.Button(new Rect(Settings.Settings.x + 150, Settings.Settings.y + 220, 60, 25), "Demon") && Player.IsInGameOrLobby() && BoltNetwork.IsServer) 620 | { 621 | BoltNetwork.Instantiate(BoltPrefabs.SurvivalDemon, Player.GetPlayer().transform.position, Quaternion.identity); 622 | } 623 | 624 | if (GUI.Button(new Rect(Settings.Settings.x + 220, Settings.Settings.y + 220, 60, 25), "Boar") && Player.IsInGameOrLobby() && BoltNetwork.IsServer) 625 | { 626 | BoltNetwork.Instantiate(BoltPrefabs.Boar, Player.GetPlayer().transform.position, Quaternion.identity); 627 | } 628 | 629 | if (GUI.Button(new Rect(Settings.Settings.x + 290, Settings.Settings.y + 220, 60, 25), "Corpse") && BoltNetwork.IsServer && Player.IsInGameOrLobby()) 630 | { 631 | BoltNetwork.Instantiate(BoltPrefabs.Corpse, Player.GetPlayer().transform.position, Quaternion.identity); 632 | } 633 | 634 | if (GUI.Button(new Rect(Settings.Settings.x + 360, Settings.Settings.y + 220, 60, 25), "Crow") && BoltNetwork.IsServer && Player.IsInGameOrLobby()) 635 | { 636 | BoltNetwork.Instantiate(BoltPrefabs.Crow, Player.GetPlayer().transform.position, Quaternion.identity); 637 | } 638 | 639 | if (GUI.Button(new Rect(Settings.Settings.x + 430, Settings.Settings.y + 220, 60, 25), "Lump") && BoltNetwork.IsServer && Player.IsInGameOrLobby()) 640 | { 641 | BoltNetwork.Instantiate(BoltPrefabs.ManorLump, Player.GetPlayer().transform.position, Quaternion.identity); 642 | } 643 | 644 | if (GUI.Button(new Rect(Settings.Settings.x + 500, Settings.Settings.y + 220, 60, 25), "Monkey") && BoltNetwork.IsServer && Player.IsInGameOrLobby()) 645 | { 646 | BoltNetwork.Instantiate(BoltPrefabs.Monkey, Player.GetPlayer().transform.position, Quaternion.identity); 647 | } 648 | 649 | if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 260, 60, 25), "Rat")) 650 | { 651 | if (BoltNetwork.IsServer && !Player.IsInGame()) 652 | { 653 | BoltNetwork.Instantiate(BoltPrefabs.SurvivalRat, Player.GetPlayer().transform.position, Quaternion.identity); 654 | } 655 | 656 | if (Player.IsInGame() && !Player.IsPlayerCrawling()) 657 | { 658 | Hacks.Misc.CarryObject("SurvivalRat"); 659 | } 660 | } 661 | 662 | if (GUI.Button(new Rect(Settings.Settings.x + 80, Settings.Settings.y + 260, 60, 25), "Goat")) 663 | { 664 | if (BoltNetwork.IsServer && !Player.IsInGame()) 665 | { 666 | BoltNetwork.Instantiate(BoltPrefabs.SurvivalGoat, Player.GetPlayer().transform.position, Quaternion.identity); 667 | } 668 | 669 | if (Player.IsInGame() && !Player.IsPlayerCrawling()) 670 | { 671 | Hacks.Misc.CarryObject("SurvivalGoat"); 672 | } 673 | } 674 | 675 | if (GUI.Button(new Rect(Settings.Settings.x + 150, Settings.Settings.y + 260, 60, 25), "Spider") && BoltNetwork.IsServer && Player.IsInGameOrLobby()) 676 | { 677 | BoltNetwork.Instantiate(BoltPrefabs.Spider, Player.GetPlayer().transform.position, Quaternion.identity); 678 | } 679 | 680 | if (GUI.Button(new Rect(Settings.Settings.x + 220, Settings.Settings.y + 260, 60, 25), "Pig")) 681 | { 682 | if (BoltNetwork.IsServer && !Player.IsInGame()) 683 | { 684 | BoltNetwork.Instantiate(BoltPrefabs.SurvivalPig, Player.GetPlayer().transform.position, Quaternion.identity); 685 | } 686 | 687 | if (Player.IsInGame() && !Player.IsPlayerCrawling()) 688 | { 689 | Hacks.Misc.CarryObject("SurvivalPig"); 690 | } 691 | } 692 | } 693 | 694 | private static void MapSpecificTab() 695 | { 696 | if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 70, 150, 30), "Instant Win") && Player.IsInGame() && BoltNetwork.IsSinglePlayer) 697 | { 698 | Hacks.Misc.InstantWin(); 699 | MelonLogger.Msg("EZ Win"); 700 | } 701 | 702 | if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 110, 150, 30), "Burn a ritual object")) 703 | { 704 | Hacks.Misc.BurnRitualObj(Helpers.Map.GetActiveScene(), false); 705 | } 706 | 707 | if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 150, 150, 30), "Burn all ritual objects")) 708 | { 709 | Hacks.Misc.BurnRitualObj(Helpers.Map.GetActiveScene(), true); 710 | } 711 | 712 | switch (Helpers.Map.GetActiveScene()) 713 | { 714 | case "Menu": 715 | if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 70, 150, 30), "Force Start Game") && BoltNetwork.IsServer && !Player.IsInGame()) 716 | { 717 | Il2CppHorror.Menu menu = UnityEngine.Object.FindObjectOfType(); 718 | menu.OnLobbyStartButtonClick(); 719 | } 720 | break; 721 | 722 | case "Devour": 723 | if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 70, 150, 30), "TP to Azazel")) 724 | { 725 | try 726 | { 727 | Il2Cpp.NolanBehaviour nb = Player.GetPlayer(); 728 | 729 | nb.TeleportTo(Helpers.Map.GetAzazel().transform.position, Quaternion.identity); 730 | } 731 | catch 732 | { 733 | MelonLogger.Msg("Azazel not found !"); 734 | } 735 | } 736 | 737 | if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 110, 150, 30), "Despawn Demons")) 738 | { 739 | Hacks.Misc.DespawnDemons(); 740 | } 741 | break; 742 | case "Molly": 743 | if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 70, 150, 30), "TP to Azazel")) 744 | { 745 | try 746 | { 747 | Il2Cpp.NolanBehaviour nb = Player.GetPlayer(); 748 | 749 | nb.TeleportTo(Helpers.Map.GetAzazel().transform.position, Quaternion.identity); 750 | } 751 | catch 752 | { 753 | MelonLogger.Msg("Azazel not found !"); 754 | } 755 | } 756 | 757 | if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 110, 150, 30), "Despawn Inmates")) 758 | { 759 | Hacks.Misc.DespawnDemons(); 760 | } 761 | break; 762 | case "Inn": 763 | if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 70, 150, 30), "TP to Azazel")) 764 | { 765 | try 766 | { 767 | Il2Cpp.NolanBehaviour nb = Player.GetPlayer(); 768 | 769 | nb.TeleportTo(Helpers.Map.GetAzazel().transform.position, Quaternion.identity); 770 | } 771 | catch 772 | { 773 | MelonLogger.Msg("Azazel not found !"); 774 | } 775 | } 776 | 777 | if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 110, 150, 30), "Clean The Fountains")) 778 | { 779 | Hacks.Misc.CleanFountain(); 780 | } 781 | 782 | if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 150, 150, 30), "Despawn Spiders")) 783 | { 784 | Hacks.Misc.DespawnSpiders(); 785 | } 786 | break; 787 | 788 | case "Town": 789 | if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 70, 150, 30), "TP to Azazel")) 790 | { 791 | try 792 | { 793 | Il2Cpp.NolanBehaviour nb = Player.GetPlayer(); 794 | 795 | nb.TeleportTo(Helpers.Map.GetAzazel().transform.position, Quaternion.identity); 796 | } 797 | catch 798 | { 799 | MelonLogger.Msg("Azazel not found !"); 800 | } 801 | } 802 | 803 | if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 110, 150, 30), "Despawn Ghosts")) 804 | { 805 | Hacks.Misc.DespawnGhosts(); 806 | } 807 | break; 808 | 809 | case "Slaughterhouse": 810 | if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 70, 150, 30), "TP to Azazel")) 811 | { 812 | try 813 | { 814 | Il2Cpp.NolanBehaviour nb = Player.GetPlayer(); 815 | 816 | nb.TeleportTo(Helpers.Map.GetAzazel().transform.position, Quaternion.identity); 817 | } 818 | catch 819 | { 820 | MelonLogger.Msg("Azazel not found !"); 821 | } 822 | } 823 | 824 | if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 110, 150, 30), "Despawn Boars")) 825 | { 826 | Hacks.Misc.DespawnBoars(); 827 | } 828 | 829 | if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 150, 150, 30), "Despawn Corpses")) 830 | { 831 | Hacks.Misc.DespawnCorpses(); 832 | } 833 | break; 834 | 835 | case "Manor": 836 | if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 70, 150, 30), "TP to Azazel")) 837 | { 838 | try 839 | { 840 | Il2Cpp.NolanBehaviour nb = Player.GetPlayer(); 841 | 842 | nb.TeleportTo(Helpers.Map.GetAzazel().transform.position, Quaternion.identity); 843 | } 844 | catch 845 | { 846 | MelonLogger.Msg("Azazel not found !"); 847 | } 848 | } 849 | 850 | if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 110, 150, 30), "Despawn Crows")) 851 | { 852 | Hacks.Misc.DespawnCrows(); 853 | } 854 | 855 | if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 150, 150, 30), "Despawn Lumps")) 856 | { 857 | Hacks.Misc.DespawnLumps(); 858 | } 859 | 860 | if (GUI.Button(new Rect(Settings.Settings.x + 370, Settings.Settings.y + 70, 150, 30), "Switch realm")) 861 | { 862 | Il2Cpp.NolanBehaviour nb = Player.GetPlayer(); 863 | Vector3 pos = nb.transform.position; 864 | 865 | ManorDeadRealmTrigger realm = Il2Cpp.ManorDeadRealmTrigger.FindObjectOfType(); 866 | if (realm == null) 867 | { 868 | MelonLogger.Warning("realm was null."); 869 | return; 870 | } 871 | 872 | if (realm.IsInDeadRealm) 873 | { 874 | // normal dimension 875 | pos.x += 150f;// -10.216758f; 876 | //pos.y = 0.009999979f; 877 | //pos.z = -7.632657f; 878 | 879 | } 880 | else 881 | { 882 | // other dimension 883 | pos.x -= 150f;//-160.03688f; 884 | //pos.y = 0.010014875f; 885 | //pos.z = -7.5686994f; 886 | } 887 | 888 | nb.locomotion.SetPosition(pos, false); 889 | } 890 | 891 | if (GUI.Button(new Rect(Settings.Settings.x + 370, Settings.Settings.y + 110, 150, 30), "Switch realm (house)")) 892 | { 893 | Il2Cpp.NolanBehaviour nb = Player.GetPlayer(); 894 | Vector3 pos = nb.transform.position; 895 | 896 | ManorDeadRealmTrigger realm = Il2Cpp.ManorDeadRealmTrigger.FindObjectOfType(); 897 | if (realm == null) 898 | { 899 | MelonLogger.Warning("realm was null."); 900 | return; 901 | } 902 | 903 | if (realm.IsInDeadRealm) 904 | { 905 | // normal dimension 906 | pos.x = -10.216758f; 907 | pos.y = 0.009999979f; 908 | pos.z = -7.632657f; 909 | 910 | } 911 | else 912 | { 913 | // other dimension 914 | pos.x = -160.03688f; 915 | pos.y = 0.010014875f; 916 | pos.z = -7.5686994f; 917 | } 918 | 919 | nb.locomotion.SetPosition(pos, false); 920 | } 921 | 922 | infinite_mirrors = GUI.Toggle(new Rect(Settings.Settings.x + 370, Settings.Settings.y + 150, 150, 20), infinite_mirrors, "Infinite mirrors"); 923 | break; 924 | 925 | case "Carnival": 926 | if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 70, 150, 30), "TP to Azazel")) 927 | { 928 | try 929 | { 930 | Il2Cpp.NolanBehaviour nb = Player.GetPlayer(); 931 | 932 | nb.TeleportTo(Helpers.Map.GetAzazel().transform.position, Quaternion.identity); 933 | } 934 | catch 935 | { 936 | MelonLogger.Msg("Azazel not found !"); 937 | } 938 | } 939 | 940 | if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 110, 150, 30), "Despawn Monkeys")) 941 | { 942 | Hacks.Misc.DespawnMonkeys(); 943 | } 944 | break; 945 | } 946 | 947 | GUI.Label(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 210, 100, 30), "Load Map: "); 948 | 949 | if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 240, 90, 30), "Farmhouse") && BoltNetwork.IsServer) 950 | { 951 | Helpers.Map.LoadMap("Devour"); 952 | } 953 | 954 | if (GUI.Button(new Rect(Settings.Settings.x + 110, Settings.Settings.y + 240, 90, 30), "Asylum") && BoltNetwork.IsServer) 955 | { 956 | Helpers.Map.LoadMap("Molly"); 957 | } 958 | 959 | if (GUI.Button(new Rect(Settings.Settings.x + 210, Settings.Settings.y + 240, 90, 30), "Inn") && BoltNetwork.IsServer) 960 | { 961 | Helpers.Map.LoadMap("Inn"); 962 | } 963 | 964 | if (GUI.Button(new Rect(Settings.Settings.x + 310, Settings.Settings.y + 240, 90, 30), "Town") && BoltNetwork.IsServer) 965 | { 966 | Helpers.Map.LoadMap("Town"); 967 | } 968 | 969 | if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 280, 90, 30), "Slaughterhouse") && BoltNetwork.IsServer) 970 | { 971 | Helpers.Map.LoadMap("Slaughterhouse"); 972 | } 973 | 974 | if (GUI.Button(new Rect(Settings.Settings.x + 110, Settings.Settings.y + 280, 90, 30), "Manor") && BoltNetwork.IsServer) 975 | { 976 | Helpers.Map.LoadMap("Manor"); 977 | } 978 | 979 | if (GUI.Button(new Rect(Settings.Settings.x + 210, Settings.Settings.y + 280, 90, 30), "Carnival") && BoltNetwork.IsServer) 980 | { 981 | Helpers.Map.LoadMap("Carnival"); 982 | } 983 | 984 | } 985 | 986 | private static void EspTab() 987 | { 988 | player_esp = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 70, 150, 20), player_esp, "Player ESP"); 989 | player_skel_esp = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 100, 150, 20), player_skel_esp, "Skeleton ESP"); 990 | player_snapline = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 130, 150, 20), player_snapline, "Player Snapline"); 991 | if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 160, 130, 30), "Player ESP Color")) 992 | { 993 | player_esp_colorpick = !player_esp_colorpick; 994 | } 995 | 996 | if (player_esp_colorpick) 997 | { 998 | Color player_esp_color_input = GUIHelper.ColorPick("Player ESP Color", Settings.Settings.player_esp_color); 999 | Settings.Settings.player_esp_color = player_esp_color_input; 1000 | } 1001 | 1002 | azazel_esp = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 200, 150, 20), azazel_esp, "Azazel ESP"); 1003 | azazel_skel_esp = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 230, 150, 20), azazel_skel_esp, "Skeleton ESP"); 1004 | azazel_snapline = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 260, 150, 20), azazel_snapline, "Azazel Snapline"); 1005 | if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 290, 130, 30), "Azazel ESP Color")) 1006 | { 1007 | azazel_esp_colorpick = !azazel_esp_colorpick; 1008 | } 1009 | 1010 | if (azazel_esp_colorpick) 1011 | { 1012 | Color azazel_esp_color_input = GUIHelper.ColorPick("Azazel ESP Color", Settings.Settings.azazel_esp_color); 1013 | Settings.Settings.azazel_esp_color = azazel_esp_color_input; 1014 | } 1015 | 1016 | item_esp = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 330, 150, 20), item_esp, "Item ESP"); 1017 | goat_rat_esp = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 360, 150, 20), goat_rat_esp, "Goat/Rat ESP"); 1018 | demon_esp = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 390, 150, 20), demon_esp, "Demon ESP"); 1019 | } 1020 | 1021 | private static void ItemsTab() 1022 | { 1023 | GUILayout.BeginHorizontal(); 1024 | 1025 | GUILayout.BeginVertical(); 1026 | 1027 | GUILayout.Label("Items"); 1028 | 1029 | Settings.Settings.itemsScrollPosition = GUILayout.BeginScrollView(Settings.Settings.itemsScrollPosition, GUILayout.Width(220), GUILayout.Height(190)); 1030 | 1031 | if (GUILayout.Button("Hay")) 1032 | { 1033 | if (BoltNetwork.IsServer && !Player.IsInGame()) 1034 | { 1035 | BoltNetwork.Instantiate(BoltPrefabs.SurvivalHay, Player.GetPlayer().transform.position, Quaternion.identity); 1036 | } 1037 | else 1038 | { 1039 | Hacks.Misc.CarryObject("SurvivalHay"); 1040 | } 1041 | } 1042 | 1043 | if (GUILayout.Button("First aid")) 1044 | { 1045 | if (BoltNetwork.IsServer && !Player.IsInGame()) 1046 | { 1047 | BoltNetwork.Instantiate(BoltPrefabs.SurvivalFirstAid, Player.GetPlayer().transform.position, Quaternion.identity); 1048 | } 1049 | else 1050 | { 1051 | Hacks.Misc.CarryObject("SurvivalFirstAid"); 1052 | } 1053 | } 1054 | 1055 | if (GUILayout.Button("Battery")) 1056 | { 1057 | if (BoltNetwork.IsServer && !Player.IsInGame()) 1058 | { 1059 | BoltNetwork.Instantiate(BoltPrefabs.SurvivalBattery, Player.GetPlayer().transform.position, Quaternion.identity); 1060 | } 1061 | else 1062 | { 1063 | Hacks.Misc.CarryObject("SurvivalBattery"); 1064 | } 1065 | } 1066 | 1067 | if (GUILayout.Button("Gasoline")) 1068 | { 1069 | if (BoltNetwork.IsServer && !Player.IsInGame()) 1070 | { 1071 | BoltNetwork.Instantiate(BoltPrefabs.SurvivalGasoline, Player.GetPlayer().transform.position, Quaternion.identity); 1072 | } 1073 | else 1074 | { 1075 | Hacks.Misc.CarryObject("SurvivalGasoline"); 1076 | } 1077 | } 1078 | 1079 | if (GUILayout.Button("Fuse")) 1080 | { 1081 | if (BoltNetwork.IsServer && !Player.IsInGame()) 1082 | { 1083 | BoltNetwork.Instantiate(BoltPrefabs.SurvivalFuse, Player.GetPlayer().transform.position, Quaternion.identity); 1084 | } 1085 | else 1086 | { 1087 | Hacks.Misc.CarryObject("SurvivalFuse"); 1088 | } 1089 | } 1090 | 1091 | if (GUILayout.Button("Food")) 1092 | { 1093 | if (BoltNetwork.IsServer && !Player.IsInGame()) 1094 | { 1095 | BoltNetwork.Instantiate(BoltPrefabs.SurvivalRottenFood, Player.GetPlayer().transform.position, Quaternion.identity); 1096 | } 1097 | else 1098 | { 1099 | Hacks.Misc.CarryObject("SurvivalRottenFood"); 1100 | } 1101 | } 1102 | 1103 | if (GUILayout.Button("Bone")) 1104 | { 1105 | 1106 | if (BoltNetwork.IsServer && !Player.IsInGame()) 1107 | { 1108 | BoltNetwork.Instantiate(BoltPrefabs.SurvivalBone, Player.GetPlayer().transform.position, Quaternion.identity); 1109 | } 1110 | else 1111 | { 1112 | Hacks.Misc.CarryObject("SurvivalBone"); 1113 | } 1114 | } 1115 | 1116 | if (GUILayout.Button("Bleach")) 1117 | { 1118 | if (BoltNetwork.IsServer && !Player.IsInGame()) 1119 | { 1120 | BoltNetwork.Instantiate(BoltPrefabs.SurvivalBleach, Player.GetPlayer().transform.position, Quaternion.identity); 1121 | } 1122 | else 1123 | { 1124 | Hacks.Misc.CarryObject("SurvivalBleach"); 1125 | } 1126 | } 1127 | 1128 | if (GUILayout.Button("Matchbox")) 1129 | { 1130 | if (BoltNetwork.IsServer && !Player.IsInGame()) 1131 | { 1132 | BoltNetwork.Instantiate(BoltPrefabs.SurvivalMatchbox, Player.GetPlayer().transform.position, Quaternion.identity); 1133 | } 1134 | else 1135 | { 1136 | Hacks.Misc.CarryObject("Matchbox-3"); 1137 | } 1138 | } 1139 | 1140 | if (GUILayout.Button("Spade")) 1141 | { 1142 | if (BoltNetwork.IsServer && !Player.IsInGame()) 1143 | { 1144 | BoltNetwork.Instantiate(BoltPrefabs.SurvivalSpade, Player.GetPlayer().transform.position, Quaternion.identity); 1145 | } 1146 | else 1147 | { 1148 | Hacks.Misc.CarryObject("SurvivalSpade"); 1149 | } 1150 | } 1151 | 1152 | if (GUILayout.Button("Cake")) 1153 | { 1154 | if (BoltNetwork.IsServer && !Player.IsInGame()) 1155 | { 1156 | BoltNetwork.Instantiate(BoltPrefabs.SurvivalCake, Player.GetPlayer().transform.position, Quaternion.identity); 1157 | } 1158 | else 1159 | { 1160 | Hacks.Misc.CarryObject("SurvivalCake"); 1161 | } 1162 | } 1163 | if (GUILayout.Button("MusicBox")) 1164 | { 1165 | if (BoltNetwork.IsServer && !Player.IsInGame()) 1166 | { 1167 | BoltNetwork.Instantiate(BoltPrefabs.SurvivalMusicBox, Player.GetPlayer().transform.position, Quaternion.identity); 1168 | } 1169 | else 1170 | { 1171 | Hacks.Misc.CarryObject("MusicBox-Idle"); 1172 | } 1173 | } 1174 | if (GUILayout.Button("Coin")) 1175 | { 1176 | if (BoltNetwork.IsServer && !Player.IsInGame()) 1177 | { 1178 | BoltNetwork.Instantiate(BoltPrefabs.SurvivalCoin, Player.GetPlayer().transform.position, Quaternion.identity); 1179 | } 1180 | else 1181 | { 1182 | Hacks.Misc.CarryObject("SurvivalCoin"); 1183 | } 1184 | } 1185 | 1186 | 1187 | GUILayout.EndScrollView(); 1188 | GUILayout.EndVertical(); 1189 | 1190 | GUILayout.BeginVertical(); 1191 | 1192 | GUILayout.Label("Ritual Objects"); 1193 | 1194 | Settings.Settings.rituelObjectsScrollPosition = GUILayout.BeginScrollView(Settings.Settings.rituelObjectsScrollPosition, GUILayout.Width(220), GUILayout.Height(190)); 1195 | 1196 | if (GUILayout.Button("Egg-1")) 1197 | { 1198 | Hacks.Misc.CarryObject("Egg-Clean-1"); 1199 | } 1200 | 1201 | if (GUILayout.Button("Egg-2")) 1202 | { 1203 | Hacks.Misc.CarryObject("Egg-Clean-2"); 1204 | } 1205 | 1206 | if (GUILayout.Button("Egg-3")) 1207 | { 1208 | Hacks.Misc.CarryObject("Egg-Clean-3"); 1209 | } 1210 | 1211 | if (GUILayout.Button("Egg-4")) 1212 | { 1213 | Hacks.Misc.CarryObject("Egg-Clean-4"); 1214 | } 1215 | 1216 | if (GUILayout.Button("Egg-5")) 1217 | { 1218 | Hacks.Misc.CarryObject("Egg-Clean-5"); 1219 | } 1220 | 1221 | if (GUILayout.Button("Egg-6")) 1222 | { 1223 | Hacks.Misc.CarryObject("Egg-Clean-6"); 1224 | } 1225 | 1226 | if (GUILayout.Button("Egg-7")) 1227 | { 1228 | Hacks.Misc.CarryObject("Egg-Clean-7"); 1229 | } 1230 | 1231 | if (GUILayout.Button("Egg-8")) 1232 | { 1233 | Hacks.Misc.CarryObject("Egg-Clean-8"); 1234 | } 1235 | 1236 | if (GUILayout.Button("Egg-9")) 1237 | { 1238 | Hacks.Misc.CarryObject("Egg-Clean-9"); 1239 | } 1240 | 1241 | if (GUILayout.Button("Egg-10")) 1242 | { 1243 | Hacks.Misc.CarryObject("Egg-Clean-10"); 1244 | } 1245 | 1246 | if (GUILayout.Button("Ritual Book")) 1247 | { 1248 | if (BoltNetwork.IsServer && !Player.IsInGame()) 1249 | { 1250 | BoltNetwork.Instantiate(BoltPrefabs.SurvivalRitualBook, Player.GetPlayer().transform.position, Quaternion.identity); 1251 | } 1252 | else 1253 | { 1254 | Hacks.Misc.CarryObject("RitualBook-Active-1"); 1255 | } 1256 | } 1257 | 1258 | // if (GUILayout.Button("Dirty head")) 1259 | // { 1260 | // if (BoltNetwork.IsServer && !Player.IsInGame()) 1261 | // { 1262 | // BoltNetwork.Instantiate(BoltPrefabs.SurvivalHead, Player.GetPlayer().transform.position, Quaternion.identity); 1263 | // } 1264 | // else 1265 | // { 1266 | // Hacks.Misc.CarryObject("SurvivalHead"); 1267 | // } 1268 | // } 1269 | 1270 | // if (GUILayout.Button("Clean head")) 1271 | // { 1272 | // if (BoltNetwork.IsServer && !Player.IsInGame()) 1273 | // { 1274 | // BoltNetwork.Instantiate(BoltPrefabs.SurvivalCleanHead, Player.GetPlayer().transform.position, Quaternion.identity); 1275 | // } 1276 | // else 1277 | // { 1278 | // Hacks.Misc.CarryObject("SurvivalCleanHead"); 1279 | // } 1280 | // } 1281 | if (GUILayout.Button("Doll Head")) 1282 | { 1283 | if (BoltNetwork.IsServer && !Player.IsInGame()) 1284 | { 1285 | BoltNetwork.Instantiate(BoltPrefabs.SurvivalDollHead, Player.GetPlayer().transform.position, Quaternion.identity); 1286 | } 1287 | else 1288 | { 1289 | Hacks.Misc.CarryObject("SurvivalDollHead"); 1290 | } 1291 | } 1292 | 1293 | GUILayout.EndScrollView(); 1294 | GUILayout.EndVertical(); 1295 | 1296 | GUILayout.BeginVertical(); 1297 | 1298 | GUILayout.Label("Spawnable Prefabs"); 1299 | 1300 | Settings.Settings.stuffsScrollPosition = GUILayout.BeginScrollView(Settings.Settings.stuffsScrollPosition, GUILayout.Width(220), GUILayout.Height(190)); 1301 | 1302 | if (GUILayout.Button("Animal_Gate")) 1303 | { 1304 | if (BoltNetwork.IsServer) 1305 | { 1306 | BoltNetwork.Instantiate(BoltPrefabs.Animal_Gate, Player.GetPlayer().transform.position, Quaternion.identity); 1307 | } 1308 | } 1309 | 1310 | if (GUILayout.Button("AsylumDoor")) 1311 | { 1312 | if (BoltNetwork.IsServer) 1313 | { 1314 | BoltNetwork.Instantiate(BoltPrefabs.AsylumDoor, Player.GetPlayer().transform.position, Quaternion.identity); 1315 | } 1316 | } 1317 | 1318 | if (GUILayout.Button("AsylumDoubleDoor")) 1319 | { 1320 | if (BoltNetwork.IsServer) 1321 | { 1322 | BoltNetwork.Instantiate(BoltPrefabs.AsylumDoubleDoor, Player.GetPlayer().transform.position, Quaternion.identity); 1323 | } 1324 | } 1325 | 1326 | if (GUILayout.Button("AsylumWhiteDoor")) 1327 | { 1328 | if (BoltNetwork.IsServer) 1329 | { 1330 | BoltNetwork.Instantiate(BoltPrefabs.AsylumWhiteDoor, Player.GetPlayer().transform.position, Quaternion.identity); 1331 | } 1332 | } 1333 | 1334 | 1335 | if (GUILayout.Button("DevourDoorBack")) 1336 | { 1337 | if (BoltNetwork.IsServer) 1338 | { 1339 | BoltNetwork.Instantiate(BoltPrefabs.DevourDoorBack, Player.GetPlayer().transform.position, Quaternion.identity); 1340 | } 1341 | } 1342 | 1343 | if (GUILayout.Button("DevourDoorMain")) 1344 | { 1345 | if (BoltNetwork.IsServer) 1346 | { 1347 | BoltNetwork.Instantiate(BoltPrefabs.DevourDoorMain, Player.GetPlayer().transform.position, Quaternion.identity); 1348 | } 1349 | } 1350 | 1351 | if (GUILayout.Button("DevourDoorRoom")) 1352 | { 1353 | if (BoltNetwork.IsServer) 1354 | { 1355 | BoltNetwork.Instantiate(BoltPrefabs.DevourDoorRoom, Player.GetPlayer().transform.position, Quaternion.identity); 1356 | } 1357 | } 1358 | 1359 | if (GUILayout.Button("Elevator_Door")) 1360 | { 1361 | if (BoltNetwork.IsServer) 1362 | { 1363 | BoltNetwork.Instantiate(BoltPrefabs.Elevator_Door, Player.GetPlayer().transform.position, Quaternion.identity); 1364 | } 1365 | } 1366 | 1367 | if (GUILayout.Button("InnDoor")) 1368 | { 1369 | if (BoltNetwork.IsServer) 1370 | { 1371 | BoltNetwork.Instantiate(BoltPrefabs.InnDoor, Player.GetPlayer().transform.position, Quaternion.identity); 1372 | } 1373 | } 1374 | 1375 | if (GUILayout.Button("InnDoubleDoor")) 1376 | { 1377 | if (BoltNetwork.IsServer) 1378 | { 1379 | BoltNetwork.Instantiate(BoltPrefabs.InnDoubleDoor, Player.GetPlayer().transform.position, Quaternion.identity); 1380 | } 1381 | } 1382 | 1383 | if (GUILayout.Button("InnShojiDoor")) 1384 | { 1385 | if (BoltNetwork.IsServer) 1386 | { 1387 | BoltNetwork.Instantiate(BoltPrefabs.InnShojiDoor, Player.GetPlayer().transform.position, Quaternion.identity); 1388 | } 1389 | } 1390 | 1391 | if (GUILayout.Button("InnShrine")) 1392 | { 1393 | if (BoltNetwork.IsServer) 1394 | { 1395 | BoltNetwork.Instantiate(BoltPrefabs.InnShrine, Player.GetPlayer().transform.position, Quaternion.identity); 1396 | } 1397 | } 1398 | 1399 | if (GUILayout.Button("InnWardrobe")) 1400 | { 1401 | if (BoltNetwork.IsServer) 1402 | { 1403 | BoltNetwork.Instantiate(BoltPrefabs.InnWardrobe, Player.GetPlayer().transform.position, Quaternion.identity); 1404 | } 1405 | } 1406 | 1407 | if (GUILayout.Button("InnWoodenDoor")) 1408 | { 1409 | if (BoltNetwork.IsServer) 1410 | { 1411 | BoltNetwork.Instantiate(BoltPrefabs.InnWoodenDoor, Player.GetPlayer().transform.position, Quaternion.identity); 1412 | } 1413 | } 1414 | 1415 | if (GUILayout.Button("PigExcrement")) 1416 | { 1417 | if (BoltNetwork.IsServer) 1418 | { 1419 | BoltNetwork.Instantiate(BoltPrefabs.PigExcrement, Player.GetPlayer().transform.position, Quaternion.identity); 1420 | } 1421 | } 1422 | 1423 | if (GUILayout.Button("SlaughterhouseFireEscapeDoor")) 1424 | { 1425 | if (BoltNetwork.IsServer) 1426 | { 1427 | BoltNetwork.Instantiate(BoltPrefabs.SlaughterhouseFireEscapeDoor, Player.GetPlayer().transform.position, Quaternion.identity); 1428 | } 1429 | } 1430 | 1431 | if (GUILayout.Button("SurvivalAltarMolly")) 1432 | { 1433 | if (BoltNetwork.IsServer) 1434 | { 1435 | BoltNetwork.Instantiate(BoltPrefabs.SurvivalAltarMolly, Player.GetPlayer().transform.position, Quaternion.identity); 1436 | } 1437 | } 1438 | 1439 | if (GUILayout.Button("SurvivalAltarSlaughterhouse")) 1440 | { 1441 | if (BoltNetwork.IsServer) 1442 | { 1443 | BoltNetwork.Instantiate(BoltPrefabs.SurvivalAltarSlaughterhouse, Player.GetPlayer().transform.position, Quaternion.identity); 1444 | } 1445 | } 1446 | 1447 | if (GUILayout.Button("SurvivalAltarTown")) 1448 | { 1449 | if (BoltNetwork.IsServer) 1450 | { 1451 | BoltNetwork.Instantiate(BoltPrefabs.SurvivalAltarTown, Player.GetPlayer().transform.position, Quaternion.identity); 1452 | } 1453 | } 1454 | 1455 | 1456 | if (GUILayout.Button("SurvivalCultist")) 1457 | { 1458 | if (BoltNetwork.IsServer) 1459 | { 1460 | BoltNetwork.Instantiate(BoltPrefabs.SurvivalCultist, Player.GetPlayer().transform.position, Quaternion.identity); 1461 | } 1462 | } 1463 | 1464 | if (GUILayout.Button("SurvivalKai")) 1465 | { 1466 | if (BoltNetwork.IsServer) 1467 | { 1468 | BoltNetwork.Instantiate(BoltPrefabs.SurvivalKai, Player.GetPlayer().transform.position, Quaternion.identity); 1469 | } 1470 | } 1471 | 1472 | if (GUILayout.Button("SurvivalNathan")) 1473 | { 1474 | if (BoltNetwork.IsServer) 1475 | { 1476 | BoltNetwork.Instantiate(BoltPrefabs.SurvivalNathan, Player.GetPlayer().transform.position, Quaternion.identity); 1477 | } 1478 | } 1479 | 1480 | if (GUILayout.Button("SurvivalMolly")) 1481 | { 1482 | if (BoltNetwork.IsServer) 1483 | { 1484 | BoltNetwork.Instantiate(BoltPrefabs.SurvivalMolly, Player.GetPlayer().transform.position, Quaternion.identity); 1485 | } 1486 | } 1487 | 1488 | if (GUILayout.Button("SurvivalApril")) 1489 | { 1490 | if (BoltNetwork.IsServer) 1491 | { 1492 | BoltNetwork.Instantiate(BoltPrefabs.SurvivalApril, Player.GetPlayer().transform.position, Quaternion.identity); 1493 | } 1494 | } 1495 | 1496 | if (GUILayout.Button("SurvivalFrank")) 1497 | { 1498 | if (BoltNetwork.IsServer) 1499 | { 1500 | BoltNetwork.Instantiate(BoltPrefabs.SurvivalFrank, Player.GetPlayer().transform.position, Quaternion.identity); 1501 | } 1502 | } 1503 | 1504 | if (GUILayout.Button("SurvivalRose")) 1505 | { 1506 | if (BoltNetwork.IsServer) 1507 | { 1508 | BoltNetwork.Instantiate(BoltPrefabs.SurvivalRose, Player.GetPlayer().transform.position, Quaternion.identity); 1509 | } 1510 | } 1511 | 1512 | if (GUILayout.Button("SurvivalSmashableWindow")) 1513 | { 1514 | if (BoltNetwork.IsServer) 1515 | { 1516 | BoltNetwork.Instantiate(BoltPrefabs.SurvivalSmashableWindow, Player.GetPlayer().transform.position, Quaternion.identity); 1517 | } 1518 | } 1519 | 1520 | if (GUILayout.Button("TownDoor")) 1521 | { 1522 | if (BoltNetwork.IsServer) 1523 | { 1524 | BoltNetwork.Instantiate(BoltPrefabs.TownDoor, Player.GetPlayer().transform.position, Quaternion.identity); 1525 | } 1526 | } 1527 | 1528 | if (GUILayout.Button("TownDoor2")) 1529 | { 1530 | if (BoltNetwork.IsServer) 1531 | { 1532 | BoltNetwork.Instantiate(BoltPrefabs.TownDoor2, Player.GetPlayer().transform.position, Quaternion.identity); 1533 | } 1534 | } 1535 | 1536 | if (GUILayout.Button("TownPentagram")) 1537 | { 1538 | if (BoltNetwork.IsServer) 1539 | { 1540 | BoltNetwork.Instantiate(BoltPrefabs.TownPentagram, Player.GetPlayer().transform.position, Quaternion.identity); 1541 | } 1542 | } 1543 | 1544 | if (GUILayout.Button("TrashCan")) 1545 | { 1546 | if (BoltNetwork.IsServer) 1547 | { 1548 | BoltNetwork.Instantiate(BoltPrefabs.TrashCan, Player.GetPlayer().transform.position, Quaternion.identity); 1549 | } 1550 | } 1551 | 1552 | if (GUILayout.Button("Truck_Shutter")) 1553 | { 1554 | if (BoltNetwork.IsServer) 1555 | { 1556 | BoltNetwork.Instantiate(BoltPrefabs.Truck_Shutter, Player.GetPlayer().transform.position, Quaternion.identity); 1557 | } 1558 | } 1559 | 1560 | if (GUILayout.Button("TV")) 1561 | { 1562 | if (BoltNetwork.IsServer) 1563 | { 1564 | BoltNetwork.Instantiate(BoltPrefabs.TV, Player.GetPlayer().transform.position, Quaternion.identity); 1565 | } 1566 | } 1567 | 1568 | if (GUILayout.Button("Mirror")) 1569 | { 1570 | if (BoltNetwork.IsServer) 1571 | { 1572 | BoltNetwork.Instantiate(BoltPrefabs.ManorMirror, Player.GetPlayer().transform.position, Quaternion.identity); 1573 | } 1574 | } 1575 | 1576 | GUILayout.EndScrollView(); 1577 | GUILayout.EndVertical(); 1578 | GUILayout.EndHorizontal(); 1579 | } 1580 | 1581 | private static void MiscTab() 1582 | { 1583 | // === 游戏功能按钮区域 (左上) === 1584 | if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 70, 140, 25), "Unlock Achievements")) 1585 | { 1586 | Thread AchievementsThread = new Thread(new ThreadStart(Hacks.Unlock.Achievements)); 1587 | AchievementsThread.Start(); 1588 | 1589 | MelonLogger.Msg("Achievements unlocked!"); 1590 | Hacks.Misc.ShowMessageBox("Achievements unlocked!"); 1591 | } 1592 | 1593 | if (GUI.Button(new Rect(Settings.Settings.x + 160, Settings.Settings.y + 70, 140, 25), "Unlock Doors")) 1594 | { 1595 | Hacks.Unlock.Doors(); 1596 | 1597 | MelonLogger.Msg("Doors unlocked!"); 1598 | Hacks.Misc.ShowMessageBox("Doors unlocked!"); 1599 | } 1600 | 1601 | if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 105, 140, 25), "Teleport Keys") && Player.IsInGame()) 1602 | { 1603 | Hacks.Misc.TPKeys(); 1604 | MelonLogger.Msg("Keys teleported!"); 1605 | Hacks.Misc.ShowMessageBox("Keys teleported!"); 1606 | } 1607 | 1608 | if (GUI.Button(new Rect(Settings.Settings.x + 160, Settings.Settings.y + 105, 140, 25), "Play Random Sound")) 1609 | { 1610 | Hacks.Misc.PlaySound(); 1611 | MelonLogger.Msg("Playing random sound!"); 1612 | Hacks.Misc.ShowMessageBox("Playing random sound!"); 1613 | } 1614 | 1615 | // === 基础开关区域 (左中) === 1616 | _walkInLobby = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 150, 140, 20), _walkInLobby, "Walk In Lobby"); 1617 | _IsAutoRespawn = GUI.Toggle(new Rect(Settings.Settings.x + 160, Settings.Settings.y + 150, 140, 20), _IsAutoRespawn, "Auto Respawn"); 1618 | 1619 | // === 飞行控制区域 (左中下) === 1620 | fly = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 180, 40, 20), fly, "Fly"); 1621 | if (GUI.Button(new Rect(Settings.Settings.x + 60, Settings.Settings.y + 180, 50, 20), Settings.Settings.flyKey.ToString())) 1622 | { 1623 | Settings.Settings.flyKey = Settings.Settings.GetKey(); 1624 | } 1625 | GUI.Label(new Rect(Settings.Settings.x + 120, Settings.Settings.y + 180, 80, 20), "Speed:"); 1626 | fly_speed = GUI.HorizontalSlider(new Rect(Settings.Settings.x + 170, Settings.Settings.y + 185, 80, 10), fly_speed, 5f, 20f); 1627 | GUI.Label(new Rect(Settings.Settings.x + 260, Settings.Settings.y + 180, 40, 20), ((int)fly_speed).ToString()); 1628 | 1629 | // === 等级欺骗区域 (左下) === 1630 | spoofLevel = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 210, 100, 20), spoofLevel, "Spoof Level"); 1631 | spoofLevelValue = GUI.HorizontalSlider(new Rect(Settings.Settings.x + 120, Settings.Settings.y + 215, 80, 10), spoofLevelValue, 0f, 666f); 1632 | GUI.Label(new Rect(Settings.Settings.x + 210, Settings.Settings.y + 210, 50, 20), ((int)spoofLevelValue).ToString()); 1633 | 1634 | // === 经验修改区域 (左下) === 1635 | exp_modifier = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 240, 100, 20), exp_modifier, "Exp Modifier"); 1636 | exp = GUI.HorizontalSlider(new Rect(Settings.Settings.x + 120, Settings.Settings.y + 245, 80, 10), exp, 1000f, 6000f); 1637 | GUI.Label(new Rect(Settings.Settings.x + 210, Settings.Settings.y + 240, 50, 20), ((int)exp).ToString()); 1638 | 1639 | // === 速度修改区域 (左下) === 1640 | fastMove = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 270, 100, 20), fastMove, "Player Speed"); 1641 | _PlayerSpeedMultiplier = GUI.HorizontalSlider(new Rect(Settings.Settings.x + 120, Settings.Settings.y + 275, 80, 10), _PlayerSpeedMultiplier, (int)1f, (int)10f); 1642 | GUI.Label(new Rect(Settings.Settings.x + 210, Settings.Settings.y + 270, 50, 20), ((int)_PlayerSpeedMultiplier).ToString()); 1643 | 1644 | } 1645 | 1646 | private static void PlayersTab() 1647 | { 1648 | if (Helpers.Map.GetActiveScene() != "Menu") 1649 | { 1650 | GUI.Label(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 70, 150, 30), "Player list:"); 1651 | int i = 0; 1652 | foreach (BasePlayer bp in Entities.Players) 1653 | { 1654 | if (bp == null || bp.Name == "") 1655 | { 1656 | MelonLogger.Warning("players is null"); 1657 | continue; 1658 | } 1659 | 1660 | GUI.Label(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 110 + i, 150, 30), bp.Name); 1661 | 1662 | if (GUI.Button(new Rect(Settings.Settings.x + 70, Settings.Settings.y + 105 + i, 60, 30), "Kill")) 1663 | { 1664 | bp.Kill(); 1665 | } 1666 | 1667 | if (GUI.Button(new Rect(Settings.Settings.x + 140, Settings.Settings.y + 105 + i, 60, 30), "Revive")) 1668 | { 1669 | bp.Revive(); 1670 | } 1671 | 1672 | if (GUI.Button(new Rect(Settings.Settings.x + 210, Settings.Settings.y + 105 + i, 90, 30), "Jumpscare")) 1673 | { 1674 | bp.Jumpscare(); 1675 | } 1676 | 1677 | if (GUI.Button(new Rect(Settings.Settings.x + 310, Settings.Settings.y + 105 + i, 60, 30), "TP to")) 1678 | { 1679 | bp.TP(); 1680 | } 1681 | 1682 | if (GUI.Button(new Rect(Settings.Settings.x + 380, Settings.Settings.y + 105 + i, 100, 30), "Lock in cage")) 1683 | { 1684 | bp.LockInCage(); 1685 | } 1686 | 1687 | if (GUI.Button(new Rect(Settings.Settings.x + 490, Settings.Settings.y + 105 + i, 90, 30), "TP Azazel")) 1688 | { 1689 | bp.TPAzazel(); 1690 | } 1691 | 1692 | if (Helpers.Map.GetActiveScene() == "Town") 1693 | { 1694 | if (GUI.Button(new Rect(Settings.Settings.x + 590, Settings.Settings.y + 105 + i, 90, 30), "Shoot Player")) 1695 | { 1696 | bp.ShootPlayer(); 1697 | } 1698 | } 1699 | 1700 | i += 30; 1701 | } 1702 | } 1703 | else 1704 | { 1705 | GUI.Label(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 70, 150, 30), "Waiting for the game to start."); 1706 | } 1707 | } 1708 | 1709 | private void OnDestroy() 1710 | { 1711 | try 1712 | { 1713 | base.StopAllCoroutines(); 1714 | 1715 | Dispose(); 1716 | } 1717 | catch (Exception ex) 1718 | { 1719 | MelonLogger.Error($"Error in OnDestroy: {ex.Message}"); 1720 | } 1721 | } 1722 | 1723 | private void OnApplicationQuit() 1724 | { 1725 | try 1726 | { 1727 | Dispose(); 1728 | } 1729 | catch (Exception ex) 1730 | { 1731 | MelonLogger.Error($"Error in OnApplicationQuit: {ex.Message}"); 1732 | } 1733 | } 1734 | 1735 | public void Dispose() 1736 | { 1737 | try 1738 | { 1739 | MelonLogger.Msg("Starting ClientMain cleanup..."); 1740 | 1741 | long memoryBeforeCleanup = GC.GetTotalMemory(false); 1742 | MelonLogger.Msg($"[Memory Monitor] Pre-cleanup managed memory: {memoryBeforeCleanup / 1024 / 1024} MB"); 1743 | 1744 | Helpers.Entities.StopAllCoroutines(); 1745 | 1746 | if (crosshairTexture != null) 1747 | { 1748 | UnityEngine.Object.DestroyImmediate(crosshairTexture); 1749 | crosshairTexture = null; 1750 | } 1751 | 1752 | Helpers.GUIHelper.Cleanup(); 1753 | 1754 | Helpers.Entities.CleanupCachedObjects(); 1755 | 1756 | GC.Collect(); 1757 | GC.WaitForPendingFinalizers(); 1758 | GC.Collect(); 1759 | 1760 | long memoryAfterCleanup = GC.GetTotalMemory(true); 1761 | long memoryFreed = memoryBeforeCleanup - memoryAfterCleanup; 1762 | MelonLogger.Msg($"[Memory Monitor] Post-cleanup managed memory: {memoryAfterCleanup / 1024 / 1024} MB"); 1763 | MelonLogger.Msg($"[Memory Monitor] Memory freed: {memoryFreed / 1024 / 1024} MB"); 1764 | 1765 | MelonLogger.Msg("ClientMain disposed successfully."); 1766 | } 1767 | catch (Exception ex) 1768 | { 1769 | MelonLogger.Error($"Error disposing ClientMain: {ex.Message}"); 1770 | } 1771 | } 1772 | } 1773 | } 1774 | 1775 | --------------------------------------------------------------------------------