From 84fc72ab599f759e9a33d37443dce53c23181d14 Mon Sep 17 00:00:00 2001 From: manafeng <123635537+mana-feng@users.noreply.github.com> Date: Sun, 8 Jun 2025 02:58:12 +1000 Subject: [PATCH 01/17] Update ClientMain.cs --- DevourClient/ClientMain.cs | 173 ++++++++++++++++++++++++++++++------- 1 file changed, 140 insertions(+), 33 deletions(-) diff --git a/DevourClient/ClientMain.cs b/DevourClient/ClientMain.cs index dad866d..2676dbf 100644 --- a/DevourClient/ClientMain.cs +++ b/DevourClient/ClientMain.cs @@ -1,4 +1,4 @@ -using DevourClient.Helpers; +using DevourClient.Helpers; using MelonLoader; using System.Threading.Tasks; using Il2CppPhoton.Bolt; @@ -64,28 +64,42 @@ namespace DevourClient static bool should_show_start_message = true; static Texture2D crosshairTexture = default!; + private static string spamMessageText = "Deez Nutz"; + private static string steamNameText = "patate"; + private static string serverNameText = "patate on top !"; + private static float spamMessageInterval = 5f; // Default send interval in seconds + private static float spamMessageTimer = 0f; // Timer + public void Start() { MelonLogger.Msg("For the Queen !"); + Hacks.Misc.ShowMessageBox("For the Queen !"); MelonLogger.Warning("Made with <3 by patate and Jadis."); + Hacks.Misc.ShowMessageBox("Made with <3 by patate and Jadis."); MelonLogger.Warning("Github : https://github.com/ALittlePatate/DevourClient"); + Hacks.Misc.ShowMessageBox("Github : https://github.com/ALittlePatate/DevourClient"); MelonLogger.Warning("Note : if you payed for this you most likely got scammed."); + Hacks.Misc.ShowMessageBox("Note : if you payed for this you most likely got scammed."); crosshairTexture = Helpers.GUIHelper.GetCircularTexture(5, 5); - MelonCoroutines.Start(Helpers.Entities.GetLocalPlayer()); - MelonCoroutines.Start(Helpers.Entities.GetGoatsAndRats()); - MelonCoroutines.Start(Helpers.Entities.GetSurvivalInteractables()); - MelonCoroutines.Start(Helpers.Entities.GetKeys()); - MelonCoroutines.Start(Helpers.Entities.GetDemons()); - MelonCoroutines.Start(Helpers.Entities.GetSpiders()); - MelonCoroutines.Start(Helpers.Entities.GetGhosts()); - MelonCoroutines.Start(Helpers.Entities.GetBoars()); - MelonCoroutines.Start(Helpers.Entities.GetCorpses()); - MelonCoroutines.Start(Helpers.Entities.GetCrows()); - MelonCoroutines.Start(Helpers.Entities.GetLumps()); - MelonCoroutines.Start(Helpers.Entities.GetAzazels()); - MelonCoroutines.Start(Helpers.Entities.GetAllPlayers()); + Helpers.Entities.StartAllCoroutines(); + } + + public void OnDestroy() + { + Helpers.Entities.StopAllCoroutines(); + + if (crosshairTexture != null) + { + UnityEngine.Object.Destroy(crosshairTexture); + crosshairTexture = null; + } + } + + public void OnApplicationQuit() + { + Helpers.Entities.StopAllCoroutines(); } public void Update() @@ -141,16 +155,6 @@ namespace DevourClient } else { - if (change_server_name) - { - Hacks.Misc.SetServerName("patate on top !"); - } - - if (change_steam_name) - { - Hacks.Misc.SetSteamName("patate"); - } - if (crosshair && in_game_cache) { in_game_cache = false; @@ -159,8 +163,16 @@ namespace DevourClient if (spam_message) { - MelonLogger.Msg("done"); - Hacks.Misc.MessageSpam(Settings.Settings.message_to_spam); + spamMessageTimer += Time.deltaTime; + if (spamMessageTimer >= spamMessageInterval) + { + Hacks.Misc.MessageSpam(spamMessageText); + spamMessageTimer = 0f; // Reset timer + } + } + else + { + spamMessageTimer = 0f; // Reset timer when disabled } if (spoofLevel) @@ -233,15 +245,65 @@ namespace DevourClient should_show_start_message = false; } + // Update error message display time + if (Settings.Settings.showErrorMessage) + { + Settings.Settings.errorMessageDisplayTime += Time.deltaTime; + if (Settings.Settings.errorMessageDisplayTime >= Settings.Settings.errorMessageMaxDisplayTime) + { + Settings.Settings.showErrorMessage = false; + } + } + + + if (Settings.Settings.showErrorMessage) + { + GUIStyle errorBoxStyle = new GUIStyle(GUI.skin.box); + errorBoxStyle.normal.background = GUIHelper.MakeTex(2, 2, new Color(0.8f, 0.2f, 0.2f, 0.9f)); + errorBoxStyle.normal.textColor = Color.white; + errorBoxStyle.fontSize = 14; + errorBoxStyle.padding = new RectOffset(10, 10, 10, 10); + errorBoxStyle.wordWrap = true; + errorBoxStyle.clipping = TextClipping.Overflow; + + + float boxWidth = 400f; + float boxHeight = 60f; + float boxX = (Screen.width - boxWidth) / 2f; + float boxY = Screen.height - boxHeight - 20f; + + GUI.Box(new Rect(boxX, boxY, boxWidth, boxHeight), Settings.Settings.errorMessage, errorBoxStyle); + } + GUI.backgroundColor = Color.grey; - GUI.skin.button.normal.background = GUIHelper.MakeTex(2, 2, Color.black); - GUI.skin.button.normal.textColor = Color.white; - GUI.skin.button.hover.background = GUIHelper.MakeTex(2, 2, Color.green); - GUI.skin.button.hover.textColor = Color.black; + var buttonStyle = new GUIStyle(GUI.skin.button); + buttonStyle.normal.background = GUIHelper.MakeTex(2, 2, Color.black); + buttonStyle.normal.textColor = Color.white; + buttonStyle.border = new RectOffset(2, 2, 2, 2); + GUI.skin.button = buttonStyle; - GUI.skin.toggle.onNormal.textColor = Color.yellow; + var labelStyle = new GUIStyle(GUI.skin.label); + labelStyle.normal.textColor = Color.white; + labelStyle.border = new RectOffset(2, 2, 2, 2); + GUI.skin.label = labelStyle; + + + var textFieldStyle = new GUIStyle(GUI.skin.textField); + textFieldStyle.normal.textColor = Color.white; + textFieldStyle.border = new RectOffset(2, 2, 2, 2); + GUI.skin.textField = textFieldStyle; + + var sliderStyle = new GUIStyle(GUI.skin.horizontalSlider); + sliderStyle.border = new RectOffset(2, 2, 2, 2); + GUI.skin.horizontalSlider = sliderStyle; + + var toggleStyle = new GUIStyle(GUI.skin.toggle); + toggleStyle.normal.textColor = Color.white; + toggleStyle.border = new RectOffset(2, 2, 2, 2); + toggleStyle.onNormal.textColor = Color.yellow; + GUI.skin.toggle = toggleStyle; //from https://www.unknowncheats.me/forum/unity/437277-mono-internal-optimisation-tips.html if (UnityEngine.Event.current.type == EventType.Repaint) @@ -399,6 +461,7 @@ namespace DevourClient { windowRect = GUI.Window(0, windowRect, (GUI.WindowFunction)Tabs, "DevourClient"); } + } public static void Tabs(int windowID) @@ -485,7 +548,7 @@ namespace DevourClient { flashlight_colorpick = !flashlight_colorpick; MelonLogger.Msg("Flashlight color picker : " + flashlight_colorpick.ToString()); - + Hacks.Misc.ShowMessageBox("Flashlight color picker : " + flashlight_colorpick.ToString()); } if (flashlight_colorpick) @@ -508,6 +571,7 @@ namespace DevourClient { Hacks.Misc.TPItems(); MelonLogger.Msg("TP Items!"); + Hacks.Misc.ShowMessageBox("TP Items!"); } if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 110, 130, 30), "Freeze azazel")) @@ -639,6 +703,7 @@ namespace DevourClient { Hacks.Misc.InstantWin(); MelonLogger.Msg("EZ Win"); + Hacks.Misc.ShowMessageBox("EZ Win"); } if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 110, 150, 30), "Burn a ritual object")) @@ -673,6 +738,7 @@ namespace DevourClient catch { MelonLogger.Msg("Azazel not found !"); + Hacks.Misc.ShowMessageBox("Azazel not found !"); } } @@ -693,6 +759,7 @@ namespace DevourClient catch { MelonLogger.Msg("Azazel not found !"); + Hacks.Misc.ShowMessageBox("Azazel not found !"); } } @@ -713,6 +780,7 @@ namespace DevourClient catch { MelonLogger.Msg("Azazel not found !"); + Hacks.Misc.ShowMessageBox("Azazel not found !"); } } @@ -739,6 +807,7 @@ namespace DevourClient catch { MelonLogger.Msg("Azazel not found !"); + Hacks.Misc.ShowMessageBox("Azazel not found !"); } } @@ -760,6 +829,7 @@ namespace DevourClient catch { MelonLogger.Msg("Azazel not found !"); + Hacks.Misc.ShowMessageBox("Azazel not found !"); } } @@ -786,6 +856,7 @@ namespace DevourClient catch { MelonLogger.Msg("Azazel not found !"); + Hacks.Misc.ShowMessageBox("Azazel not found !"); } } @@ -808,6 +879,7 @@ namespace DevourClient if (realm == null) { MelonLogger.Warning("realm was null."); + Hacks.Misc.ShowMessageBox("realm was null."); return; } @@ -839,6 +911,7 @@ namespace DevourClient if (realm == null) { MelonLogger.Warning("realm was null."); + Hacks.Misc.ShowMessageBox("realm was null."); return; } @@ -1469,6 +1542,7 @@ namespace DevourClient AchievementsThread.Start(); MelonLogger.Msg("Achievements Unlocked!"); + Hacks.Misc.ShowMessageBox("Achievements Unlocked!"); } if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 110, 150, 30), "Unlock Doors")) @@ -1476,23 +1550,52 @@ namespace DevourClient Hacks.Unlock.Doors(); MelonLogger.Msg("Doors Unlocked!"); + Hacks.Misc.ShowMessageBox("Doors Unlocked!"); } if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 150, 150, 30), "TP Keys") && Player.IsInGame()) { Hacks.Misc.TPKeys(); MelonLogger.Msg("Here are your keys!"); + Hacks.Misc.ShowMessageBox("Here are your keys!"); } if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 190, 150, 30), "Make Random Noise")) { Hacks.Misc.PlaySound(); MelonLogger.Msg("Playing a random sound!"); + Hacks.Misc.ShowMessageBox("Playing a random sound!"); } spam_message = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 240, 140, 30), spam_message, "Chat spam"); + if (spam_message) + { + spamMessageText = GUI.TextField(new Rect(Settings.Settings.x + 160, Settings.Settings.y + 240, 200, 30), spamMessageText); + GUI.Label(new Rect(Settings.Settings.x + 370, Settings.Settings.y + 240, 60, 30), "Send Interval(s):"); + spamMessageInterval = GUI.HorizontalSlider(new Rect(Settings.Settings.x + 440, Settings.Settings.y + 240, 100, 30), spamMessageInterval, 1f, 30f); + GUI.Label(new Rect(Settings.Settings.x + 550, Settings.Settings.y + 240, 60, 30), ((int)spamMessageInterval).ToString()); + } + change_steam_name = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 270, 140, 30), change_steam_name, "Change Steam Name"); + if (change_steam_name) + { + steamNameText = GUI.TextField(new Rect(Settings.Settings.x + 160, Settings.Settings.y + 270, 200, 30), steamNameText); + if (GUI.Button(new Rect(Settings.Settings.x + 370, Settings.Settings.y + 270, 60, 30), "Apply")) + { + Hacks.Misc.SetSteamName(steamNameText); + } + } + change_server_name = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 300, 140, 30), change_server_name, "Change Server Name"); + if (change_server_name) + { + serverNameText = GUI.TextField(new Rect(Settings.Settings.x + 160, Settings.Settings.y + 300, 200, 30), serverNameText); + if (GUI.Button(new Rect(Settings.Settings.x + 370, Settings.Settings.y + 300, 60, 30), "Apply")) + { + Hacks.Misc.SetServerName(serverNameText); + } + } + _walkInLobby = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 330, 140, 30), _walkInLobby, "Walk In Lobby"); _IsAutoRespawn = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 360, 140, 30), _IsAutoRespawn, "Auto Respawn"); @@ -1512,7 +1615,7 @@ namespace DevourClient exp_modifier = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 540, 150, 20), exp_modifier, "EXP Modifier"); - exp = GUI.HorizontalSlider(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 570, 100, 10), exp, 1000f, 3000f); + exp = GUI.HorizontalSlider(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 570, 100, 10), exp, 1000f, 6000f); GUI.Label(new Rect(Settings.Settings.x + 120, Settings.Settings.y + 565, 100, 30), ((int)exp).ToString()); @@ -1527,8 +1630,10 @@ namespace DevourClient if (GUI.Button(new Rect(Settings.Settings.x + 285, Settings.Settings.y + 110, 150, 30), "Create server")) { MelonLogger.Msg("Creating the server..."); + Hacks.Misc.ShowMessageBox("Creating the server..."); Hacks.Misc.CreateCustomizedLobby((int)lobbySize); MelonLogger.Msg("Done !"); + Hacks.Misc.ShowMessageBox("Done !"); } } @@ -1543,6 +1648,7 @@ namespace DevourClient if (bp == null || bp.Name == "") { MelonLogger.Warning("players is null"); + Hacks.Misc.ShowMessageBox("players is null"); continue; } @@ -1597,3 +1703,4 @@ namespace DevourClient } } + From cfb3235a9708d762d92267f167cc6beab03a7933 Mon Sep 17 00:00:00 2001 From: manafeng <123635537+mana-feng@users.noreply.github.com> Date: Sun, 8 Jun 2025 03:01:34 +1000 Subject: [PATCH 02/17] Add files via upload --- ClientMain.cs | 1714 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1714 insertions(+) create mode 100644 ClientMain.cs diff --git a/ClientMain.cs b/ClientMain.cs new file mode 100644 index 0000000..01c320e --- /dev/null +++ b/ClientMain.cs @@ -0,0 +1,1714 @@ +using DevourClient.Helpers; +using MelonLoader; +using System.Threading.Tasks; +using Il2CppPhoton.Bolt; +using UnityEngine; +using Il2Cpp; + +namespace DevourClient +{ + public class ClientMain : MonoBehaviour + { + public ClientMain(IntPtr ptr) + : base(ptr) + { + } + + enum CurrentTab : int + { + Visuals = 0, + Entities = 1, + Map = 2, + ESP = 3, + Items = 4, + Misc = 5, + Players = 6 + } + + static Rect windowRect = new Rect(Settings.Settings.x + 10, Settings.Settings.y + 10, 700, 700); + static CurrentTab current_tab = CurrentTab.Visuals; + + static bool flashlight_toggle = false; + static bool flashlight_colorpick = false; + static bool player_esp_colorpick = false; + static bool azazel_esp_colorpick = false; + static bool spoofLevel = false; + static float spoofLevelValue = 0; + static bool change_server_name = false; + static bool change_steam_name = false; + static bool fly = false; + static float fly_speed = 5; + static bool fastMove = false; + static float _PlayerSpeedMultiplier = 1; + public static float lobbySize = 4; + public static bool _IsAutoRespawn = false; + public static bool unlimitedUV = false; + public static bool exp_modifier = false; + public static float exp = 1000f; + public static bool _walkInLobby = false; + public static bool infinite_mirrors = false; + static bool player_esp = false; + static bool player_skel_esp = false; + static bool player_snapline = false; + static bool azazel_esp = false; + static bool azazel_skel_esp = false; + static bool azazel_snapline = false; + static bool spam_message = false; + static bool item_esp = false; + static bool goat_rat_esp = false; + static bool demon_esp = false; + static bool fullbright = false; + static bool need_fly_reset = false; + static bool crosshair = false; + static bool in_game_cache = false; + static bool should_show_start_message = true; + static Texture2D crosshairTexture = default!; + + private static string spamMessageText = "Deez Nutz"; + private static string steamNameText = "patate"; + private static string serverNameText = "patate on top !"; + private static float spamMessageInterval = 5f; // Default send interval in seconds + private static float spamMessageTimer = 0f; // Timer + + public void Start() + { + MelonLogger.Msg("For the Queen !"); + Hacks.Misc.ShowMessageBox("For the Queen !"); + MelonLogger.Warning("Made with <3 by patate and Jadis."); + Hacks.Misc.ShowMessageBox("Made with <3 by patate and Jadis."); + MelonLogger.Warning("Github : https://github.com/ALittlePatate/DevourClient"); + Hacks.Misc.ShowMessageBox("Github : https://github.com/ALittlePatate/DevourClient"); + MelonLogger.Warning("Note : if you payed for this you most likely got scammed."); + Hacks.Misc.ShowMessageBox("Note : if you payed for this you most likely got scammed."); + + crosshairTexture = Helpers.GUIHelper.GetCircularTexture(5, 5); + + // Start all coroutines using new coroutine management mechanism + Helpers.Entities.StartAllCoroutines(); + } + + public void OnDestroy() + { + // Stop all coroutines when component is destroyed + Helpers.Entities.StopAllCoroutines(); + + // Clean up other resources + if (crosshairTexture != null) + { + UnityEngine.Object.Destroy(crosshairTexture); + crosshairTexture = null; + } + } + + public void OnApplicationQuit() + { + // Stop all coroutines when application quits + Helpers.Entities.StopAllCoroutines(); + } + + public void Update() + { + if (Input.GetKeyDown(KeyCode.Insert)) + { + try + { + Il2Cpp.GameUI gameUI = UnityEngine.Object.FindObjectOfType(); + if (Settings.Settings.menu_enable) + { + gameUI.HideMouseCursor(); + } + else + { + gameUI.ShowMouseCursor(); + } + } + catch { } + + Settings.Settings.menu_enable = !Settings.Settings.menu_enable; + } + + if (Player.IsInGame()) + { + if (flashlight_toggle && !fullbright) + { + Hacks.Misc.BigFlashlight(false); + } + else if (!flashlight_toggle && !fullbright) + { + Hacks.Misc.BigFlashlight(true); + } + + if (fullbright && !flashlight_toggle) + { + Hacks.Misc.Fullbright(false); + } + else if (!fullbright && !flashlight_toggle) + { + Hacks.Misc.Fullbright(true); + } + + if (_IsAutoRespawn && Helpers.Player.IsPlayerCrawling()) + { + Hacks.Misc.AutoRespawn(); + } + + if (crosshair && !in_game_cache) + { + in_game_cache = true; + } + } + else + { + if (crosshair && in_game_cache) + { + in_game_cache = false; + } + } + + if (spam_message) + { + spamMessageTimer += Time.deltaTime; + if (spamMessageTimer >= spamMessageInterval) + { + Hacks.Misc.MessageSpam(spamMessageText); + spamMessageTimer = 0f; // Reset timer + } + } + else + { + spamMessageTimer = 0f; // Reset timer when disabled + } + + if (spoofLevel) + { + Hacks.Misc.SetRank((int)spoofLevelValue); + } + + if (Input.GetKeyDown(Settings.Settings.flyKey)) + { + fly = !fly; + } + + if (Player.IsInGameOrLobby()) + { + if (fly && !need_fly_reset) + { + Il2Cpp.NolanBehaviour nb = Player.GetPlayer(); + if (nb) + { + Collider coll = nb.GetComponentInChildren(); + if (coll) + { + coll.enabled = false; + need_fly_reset = true; + } + } + } + + else if (!fly && need_fly_reset) + { + Il2Cpp.NolanBehaviour nb = Player.GetPlayer(); + if (nb) + { + Collider coll = nb.GetComponentInChildren(); + if (coll) + { + coll.enabled = true; + need_fly_reset = false; + } + } + } + + if (fly) + { + Hacks.Misc.Fly(fly_speed); + } + + } + + if (Helpers.Map.GetActiveScene() == "Menu") + { + Hacks.Misc.WalkInLobby(_walkInLobby); + } + + if (fastMove) + { + try + { + Helpers.Entities.LocalPlayer_.p_GameObject.GetComponent().TimeScale = _PlayerSpeedMultiplier; + } + catch { return; } + } + } + + public void OnGUI() + { + if (should_show_start_message) + { + if (DevourClient.Hacks.Misc.ShowMessageBox("Welcome to DevourClient.\n\nPress the INS key to open the menu.") == 0) + should_show_start_message = false; + } + + // Update error message display time + if (Settings.Settings.showErrorMessage) + { + Settings.Settings.errorMessageDisplayTime += Time.deltaTime; + if (Settings.Settings.errorMessageDisplayTime >= Settings.Settings.errorMessageMaxDisplayTime) + { + Settings.Settings.showErrorMessage = false; + } + } + + // Render error message box + if (Settings.Settings.showErrorMessage) + { + // Set message box style + GUIStyle errorBoxStyle = new GUIStyle(GUI.skin.box); + errorBoxStyle.normal.background = GUIHelper.MakeTex(2, 2, new Color(0.8f, 0.2f, 0.2f, 0.9f)); + errorBoxStyle.normal.textColor = Color.white; + errorBoxStyle.fontSize = 14; + errorBoxStyle.padding = new RectOffset(10, 10, 10, 10); + errorBoxStyle.wordWrap = true; + errorBoxStyle.clipping = TextClipping.Overflow; + + // Calculate message box position (bottom center) + float boxWidth = 400f; + float boxHeight = 60f; + float boxX = (Screen.width - boxWidth) / 2f; + float boxY = Screen.height - boxHeight - 20f; + + // Draw message box + GUI.Box(new Rect(boxX, boxY, boxWidth, boxHeight), Settings.Settings.errorMessage, errorBoxStyle); + } + + GUI.backgroundColor = Color.grey; + + // Set button style + var buttonStyle = new GUIStyle(GUI.skin.button); + buttonStyle.normal.background = GUIHelper.MakeTex(2, 2, Color.black); + buttonStyle.normal.textColor = Color.white; + buttonStyle.border = new RectOffset(2, 2, 2, 2); + GUI.skin.button = buttonStyle; + + // Set label style + var labelStyle = new GUIStyle(GUI.skin.label); + labelStyle.normal.textColor = Color.white; + labelStyle.border = new RectOffset(2, 2, 2, 2); + GUI.skin.label = labelStyle; + + // Set text field style + var textFieldStyle = new GUIStyle(GUI.skin.textField); + textFieldStyle.normal.textColor = Color.white; + textFieldStyle.border = new RectOffset(2, 2, 2, 2); + GUI.skin.textField = textFieldStyle; + + // Set slider style + var sliderStyle = new GUIStyle(GUI.skin.horizontalSlider); + sliderStyle.border = new RectOffset(2, 2, 2, 2); + GUI.skin.horizontalSlider = sliderStyle; + + // Set toggle style + var toggleStyle = new GUIStyle(GUI.skin.toggle); + toggleStyle.normal.textColor = Color.white; + toggleStyle.border = new RectOffset(2, 2, 2, 2); + toggleStyle.onNormal.textColor = Color.yellow; + GUI.skin.toggle = toggleStyle; + + //from https://www.unknowncheats.me/forum/unity/437277-mono-internal-optimisation-tips.html + if (UnityEngine.Event.current.type == EventType.Repaint) + { + if (player_esp || player_snapline || player_skel_esp) + { + foreach (Helpers.BasePlayer p in Helpers.Entities.Players) + { + if (p == null) + { + continue; + } + + GameObject player = p.p_GameObject; + if (player != null) + { + Il2Cpp.NolanBehaviour nb = player.GetComponent(); + if (nb.entity.IsOwner) + { + continue; + } + + if (player_skel_esp) + { + Render.Render.DrawAllBones(Hacks.Misc.GetAllBones(nb.animator), Settings.Settings.player_esp_color); + } + + Render.Render.DrawBoxESP(player, -0.25f, 1.75f, p.Name, Settings.Settings.player_esp_color, player_snapline, player_esp); + } + } + } + + if (goat_rat_esp) + { + foreach (Il2Cpp.GoatBehaviour goat in Helpers.Entities.GoatsAndRats) + { + if (goat != null) + { + Render.Render.DrawNameESP(goat.transform.position, goat.name.Replace("Survival", "").Replace("(Clone)", ""), new Color(0.94f, 0.61f, 0.18f, 1.0f)); + } + } + } + + if (item_esp) + { + foreach (Il2Cpp.SurvivalInteractable obj in Helpers.Entities.SurvivalInteractables) + { + if (obj != null) + { + Render.Render.DrawNameESP(obj.transform.position, obj.prefabName.Replace("Survival", ""), new Color(1.0f, 1.0f, 1.0f)); + } + } + + foreach (Il2Cpp.KeyBehaviour key in Helpers.Entities.Keys) + { + if (key != null) + { + Render.Render.DrawNameESP(key.transform.position, "Key", new Color(1.0f, 1.0f, 1.0f)); + } + } + } + + if (demon_esp) + { + foreach (Il2Cpp.SurvivalDemonBehaviour demon in Helpers.Entities.Demons) + { + if (demon != null) + { + Render.Render.DrawNameESP(demon.transform.position, demon.name.Replace("Survival", "").Replace("(Clone)", ""), new Color(1.0f, 0.0f, 0.0f, 1.0f)); + } + } + + foreach (Il2Cpp.SpiderBehaviour spider in Helpers.Entities.Spiders) + { + if (spider != null) + { + Render.Render.DrawNameESP(spider.transform.position, "Spider", new Color(1.0f, 0.0f, 0.0f, 1.0f)); + } + } + + foreach (Il2Cpp.GhostBehaviour ghost in Helpers.Entities.Ghosts) + { + if (ghost != null) + { + Render.Render.DrawNameESP(ghost.transform.position, "Ghost", new Color(1.0f, 0.0f, 0.0f, 1.0f)); + } + } + + foreach (Il2Cpp.BoarBehaviour boar in Helpers.Entities.Boars) + { + if (boar != null) + { + Render.Render.DrawNameESP(boar.transform.position, "Boar", new Color(1.0f, 0.0f, 0.0f, 1.0f)); + } + } + + foreach (Il2Cpp.CorpseBehaviour corpse in Helpers.Entities.Corpses) + { + if (corpse != null) + { + Render.Render.DrawNameESP(corpse.transform.position, "Corpse", new Color(1.0f, 0.0f, 0.0f, 1.0f)); + } + } + + foreach (Il2Cpp.CrowBehaviour crow in Helpers.Entities.Crows) + { + if (crow != null) + { + Render.Render.DrawNameESP(crow.transform.position, "Crow", new Color(1.0f, 0.0f, 0.0f, 1.0f)); + } + } + + foreach (Il2Cpp.ManorLumpController lump in Helpers.Entities.Lumps) + { + if (lump != null) + { + Render.Render.DrawNameESP(lump.transform.position, "Lump", new Color(1.0f, 0.0f, 0.0f, 1.0f)); + } + } + } + + if (azazel_esp || azazel_snapline || azazel_skel_esp) + { + foreach (Il2Cpp.SurvivalAzazelBehaviour survivalAzazel in Helpers.Entities.Azazels) + { + if (survivalAzazel != null) + { + if (azazel_skel_esp) + { + Render.Render.DrawAllBones(Hacks.Misc.GetAllBones(survivalAzazel.animator), Settings.Settings.azazel_esp_color); + } + + Render.Render.DrawBoxESP(survivalAzazel.gameObject, -0.25f, 2.0f, "Azazel", Settings.Settings.azazel_esp_color, azazel_snapline, azazel_esp); + } + } + } + + if (crosshair && in_game_cache) //&& !Player.IsPlayerCrawling()) + { + const float crosshairSize = 4; + + float xMin = (Settings.Settings.width) - (crosshairSize / 2); + float yMin = (Settings.Settings.height) - (crosshairSize / 2); + + if (crosshairTexture == null) + { + crosshairTexture = Helpers.GUIHelper.GetCircularTexture(5, 5); + } + + GUI.DrawTexture(new Rect(xMin, yMin, crosshairSize, crosshairSize), crosshairTexture); + } + } + + if (Settings.Settings.menu_enable) //Si on appuie sur INSERT + { + windowRect = GUI.Window(0, windowRect, (GUI.WindowFunction)Tabs, "DevourClient"); + } + + } + + public static void Tabs(int windowID) + { + GUILayout.BeginHorizontal(); + + if (GUILayout.Button("Visual", GUILayout.Height(40)) || Input.GetKeyDown(KeyCode.F1)) + { + current_tab = CurrentTab.Visuals; + } + + if (GUILayout.Button("Entites", GUILayout.Height(40)) || Input.GetKeyDown(KeyCode.F2)) + { + current_tab = CurrentTab.Entities; + } + + if (GUILayout.Button("Map Specific", GUILayout.Height(40)) || Input.GetKeyDown(KeyCode.F3)) + { + current_tab = CurrentTab.Map; + } + + if (GUILayout.Button("ESP", GUILayout.Height(40)) || Input.GetKeyDown(KeyCode.F4)) + { + current_tab = CurrentTab.ESP; + } + + if (GUILayout.Button("Items", GUILayout.Height(40)) || Input.GetKeyDown(KeyCode.F5)) + { + current_tab = CurrentTab.Items; + } + + if (GUILayout.Button("Misc", GUILayout.Height(40)) || Input.GetKeyDown(KeyCode.F6)) + { + current_tab = CurrentTab.Misc; + } + + if (GUILayout.Button("Player", GUILayout.Height(40)) || Input.GetKeyDown(KeyCode.F7)) + { + current_tab = CurrentTab.Players; + } + + GUILayout.EndHorizontal(); + + switch (current_tab) + { + case CurrentTab.Visuals: + VisualsTab(); + break; + case CurrentTab.Entities: + EntitiesTab(); + break; + case CurrentTab.Map: + MapSpecificTab(); + break; + case CurrentTab.ESP: + EspTab(); + break; + case CurrentTab.Items: + ItemsTab(); + break; + case CurrentTab.Misc: + MiscTab(); + break; + case CurrentTab.Players: + PlayersTab(); + break; + + } + + GUI.DragWindow(); + } + + private static void VisualsTab() + { + // draw visuals + + flashlight_toggle = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 70, 120, 30), flashlight_toggle, "Big Flashlight"); + fullbright = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 100, 120, 30), fullbright, "Fullbright"); + unlimitedUV = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 130, 130, 30), unlimitedUV, "Unlimited UV Light"); + crosshair = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 160, 130, 30), crosshair, "Crosshair"); + + + if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 190, 130, 30), "Flashlight Color")) + { + flashlight_colorpick = !flashlight_colorpick; + MelonLogger.Msg("Flashlight color picker : " + flashlight_colorpick.ToString()); + Hacks.Misc.ShowMessageBox("Flashlight color picker : " + flashlight_colorpick.ToString()); + } + + if (flashlight_colorpick) + { + Color flashlight_color_input = DevourClient.Helpers.GUIHelper.ColorPick("Flashlight Color", Settings.Settings.flashlight_color); + Settings.Settings.flashlight_color = flashlight_color_input; + + if (Player.IsInGame()) + { + Hacks.Misc.FlashlightColor(flashlight_color_input); + } + } + } + + private static void EntitiesTab() + { + //draw entities + + if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 70, 130, 30), "TP items to you")) + { + Hacks.Misc.TPItems(); + MelonLogger.Msg("TP Items!"); + Hacks.Misc.ShowMessageBox("TP Items!"); + } + + if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 110, 130, 30), "Freeze azazel")) + { + Hacks.Misc.FreezeAzazel(); + } + + GUI.Label(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 150, 120, 30), "Azazel & Demons"); + + // azazel + + if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 180, 60, 25), "Sam") && Player.IsInGameOrLobby() && BoltNetwork.IsServer) + { + Hacks.Misc.SpawnAzazel((PrefabId)BoltPrefabs.AzazelSam); + } + + if (GUI.Button(new Rect(Settings.Settings.x + 80, Settings.Settings.y + 180, 60, 25), "Molly") && Player.IsInGameOrLobby() && BoltNetwork.IsServer) + { + Hacks.Misc.SpawnAzazel((PrefabId)BoltPrefabs.SurvivalAzazelMolly); + } + + if (GUI.Button(new Rect(Settings.Settings.x + 150, Settings.Settings.y + 180, 60, 25), "Anna") && Player.IsInGameOrLobby() && BoltNetwork.IsServer) + { + BoltNetwork.Instantiate(BoltPrefabs.SurvivalAnnaNew, Player.GetPlayer().transform.position, Quaternion.identity); + } + + if (GUI.Button(new Rect(Settings.Settings.x + 220, Settings.Settings.y + 180, 60, 25), "Zara") && Player.IsInGameOrLobby() && BoltNetwork.IsServer) + { + BoltNetwork.Instantiate(BoltPrefabs.AzazelZara, Player.GetPlayer().transform.position, Quaternion.identity); + } + + if (GUI.Button(new Rect(Settings.Settings.x + 290, Settings.Settings.y + 180, 60, 25), "Nathan") && Player.IsInGameOrLobby() && BoltNetwork.IsServer) + { + BoltNetwork.Instantiate(BoltPrefabs.AzazelNathan, Player.GetPlayer().transform.position, Quaternion.identity); + } + + if (GUI.Button(new Rect(Settings.Settings.x + 360, Settings.Settings.y + 180, 60, 25), "April") && Player.IsInGameOrLobby() && BoltNetwork.IsServer) + { + BoltNetwork.Instantiate(BoltPrefabs.AzazelApril, Player.GetPlayer().transform.position, Quaternion.identity); + } + + // demon + + if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 220, 60, 25), "Ghost") && Player.IsInGameOrLobby() && BoltNetwork.IsServer) + { + BoltNetwork.Instantiate(BoltPrefabs.Ghost, Player.GetPlayer().transform.position, Quaternion.identity); + } + + if (GUI.Button(new Rect(Settings.Settings.x + 80, Settings.Settings.y + 220, 60, 25), "Inmate") && Player.IsInGameOrLobby() && BoltNetwork.IsServer) + { + BoltNetwork.Instantiate(BoltPrefabs.SurvivalInmate, Player.GetPlayer().transform.position, Quaternion.identity); + } + + if (GUI.Button(new Rect(Settings.Settings.x + 150, Settings.Settings.y + 220, 60, 25), "Demon") && Player.IsInGameOrLobby() && BoltNetwork.IsServer) + { + BoltNetwork.Instantiate(BoltPrefabs.SurvivalDemon, Player.GetPlayer().transform.position, Quaternion.identity); + } + + if (GUI.Button(new Rect(Settings.Settings.x + 220, Settings.Settings.y + 220, 60, 25), "Boar") && Player.IsInGameOrLobby() && BoltNetwork.IsServer) + { + BoltNetwork.Instantiate(BoltPrefabs.Boar, Player.GetPlayer().transform.position, Quaternion.identity); + } + + if (GUI.Button(new Rect(Settings.Settings.x + 290, Settings.Settings.y + 220, 60, 25), "Corpse") && BoltNetwork.IsServer && Player.IsInGameOrLobby()) + { + BoltNetwork.Instantiate(BoltPrefabs.Corpse, Player.GetPlayer().transform.position, Quaternion.identity); + } + + if (GUI.Button(new Rect(Settings.Settings.x + 360, Settings.Settings.y + 220, 60, 25), "Crow") && BoltNetwork.IsServer && Player.IsInGameOrLobby()) + { + BoltNetwork.Instantiate(BoltPrefabs.Crow, Player.GetPlayer().transform.position, Quaternion.identity); + } + + if (GUI.Button(new Rect(Settings.Settings.x + 430, Settings.Settings.y + 220, 60, 25), "Lump") && BoltNetwork.IsServer && Player.IsInGameOrLobby()) + { + BoltNetwork.Instantiate(BoltPrefabs.ManorLump, Player.GetPlayer().transform.position, Quaternion.identity); + } + + // Animal + + if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 260, 60, 25), "Rat")) + { + if (BoltNetwork.IsServer && !Player.IsInGame()) + { + BoltNetwork.Instantiate(BoltPrefabs.SurvivalRat, Player.GetPlayer().transform.position, Quaternion.identity); + } + + if (Player.IsInGame() && !Player.IsPlayerCrawling()) + { + Hacks.Misc.CarryObject("SurvivalRat"); + } + } + + if (GUI.Button(new Rect(Settings.Settings.x + 80, Settings.Settings.y + 260, 60, 25), "Goat")) + { + if (BoltNetwork.IsServer && !Player.IsInGame()) + { + BoltNetwork.Instantiate(BoltPrefabs.SurvivalGoat, Player.GetPlayer().transform.position, Quaternion.identity); + } + + if (Player.IsInGame() && !Player.IsPlayerCrawling()) + { + Hacks.Misc.CarryObject("SurvivalGoat"); + } + } + + if (GUI.Button(new Rect(Settings.Settings.x + 150, Settings.Settings.y + 260, 60, 25), "Spider") && BoltNetwork.IsServer && Player.IsInGameOrLobby()) + { + BoltNetwork.Instantiate(BoltPrefabs.Spider, Player.GetPlayer().transform.position, Quaternion.identity); + } + + if (GUI.Button(new Rect(Settings.Settings.x + 220, Settings.Settings.y + 260, 60, 25), "Pig")) + { + if (BoltNetwork.IsServer && !Player.IsInGame()) + { + BoltNetwork.Instantiate(BoltPrefabs.SurvivalPig, Player.GetPlayer().transform.position, Quaternion.identity); + } + + if (Player.IsInGame() && !Player.IsPlayerCrawling()) + { + Hacks.Misc.CarryObject("SurvivalPig"); + } + } + } + + private static void MapSpecificTab() + { + if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 70, 150, 30), "Instant Win") && Player.IsInGame() && BoltNetwork.IsSinglePlayer) + { + Hacks.Misc.InstantWin(); + MelonLogger.Msg("EZ Win"); + Hacks.Misc.ShowMessageBox("EZ Win"); + } + + if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 110, 150, 30), "Burn a ritual object")) + { + Hacks.Misc.BurnRitualObj(Helpers.Map.GetActiveScene(), false); + } + + if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 150, 150, 30), "Burn all ritual objects")) + { + Hacks.Misc.BurnRitualObj(Helpers.Map.GetActiveScene(), true); + } + + switch (Helpers.Map.GetActiveScene()) + { + case "Menu": + if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 70, 150, 30), "Force Start Game") && BoltNetwork.IsServer && !Player.IsInGame()) + { + Il2CppHorror.Menu menu = UnityEngine.Object.FindObjectOfType(); + menu.OnLobbyStartButtonClick(); + } + break; + + case "Devour": + if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 70, 150, 30), "TP to Azazel")) + { + try + { + Il2Cpp.NolanBehaviour nb = Player.GetPlayer(); + + nb.TeleportTo(Helpers.Map.GetAzazel().transform.position, Quaternion.identity); + } + catch + { + MelonLogger.Msg("Azazel not found !"); + Hacks.Misc.ShowMessageBox("Azazel not found !"); + } + } + + if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 110, 150, 30), "Despawn Demons")) + { + Hacks.Misc.DespawnDemons(); + } + break; + case "Molly": + if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 70, 150, 30), "TP to Azazel")) + { + try + { + Il2Cpp.NolanBehaviour nb = Player.GetPlayer(); + + nb.TeleportTo(Helpers.Map.GetAzazel().transform.position, Quaternion.identity); + } + catch + { + MelonLogger.Msg("Azazel not found !"); + Hacks.Misc.ShowMessageBox("Azazel not found !"); + } + } + + if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 110, 150, 30), "Despawn Inmates")) + { + Hacks.Misc.DespawnDemons(); + } + break; + case "Inn": + if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 70, 150, 30), "TP to Azazel")) + { + try + { + Il2Cpp.NolanBehaviour nb = Player.GetPlayer(); + + nb.TeleportTo(Helpers.Map.GetAzazel().transform.position, Quaternion.identity); + } + catch + { + MelonLogger.Msg("Azazel not found !"); + Hacks.Misc.ShowMessageBox("Azazel not found !"); + } + } + + if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 110, 150, 30), "Clean The Fountains")) + { + Hacks.Misc.CleanFountain(); + } + + if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 150, 150, 30), "Despawn Spiders")) + { + Hacks.Misc.DespawnSpiders(); + } + break; + + case "Town": + if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 70, 150, 30), "TP to Azazel")) + { + try + { + Il2Cpp.NolanBehaviour nb = Player.GetPlayer(); + + nb.TeleportTo(Helpers.Map.GetAzazel().transform.position, Quaternion.identity); + } + catch + { + MelonLogger.Msg("Azazel not found !"); + Hacks.Misc.ShowMessageBox("Azazel not found !"); + } + } + + if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 110, 150, 30), "Despawn Ghosts")) + { + Hacks.Misc.DespawnGhosts(); + } + break; + + case "Slaughterhouse": + if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 70, 150, 30), "TP to Azazel")) + { + try + { + Il2Cpp.NolanBehaviour nb = Player.GetPlayer(); + + nb.TeleportTo(Helpers.Map.GetAzazel().transform.position, Quaternion.identity); + } + catch + { + MelonLogger.Msg("Azazel not found !"); + Hacks.Misc.ShowMessageBox("Azazel not found !"); + } + } + + if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 110, 150, 30), "Despawn Boars")) + { + Hacks.Misc.DespawnBoars(); + } + + if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 150, 150, 30), "Despawn Corpses")) + { + Hacks.Misc.DespawnCorpses(); + } + break; + + case "Manor": + if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 70, 150, 30), "TP to Azazel")) + { + try + { + Il2Cpp.NolanBehaviour nb = Player.GetPlayer(); + + nb.TeleportTo(Helpers.Map.GetAzazel().transform.position, Quaternion.identity); + } + catch + { + MelonLogger.Msg("Azazel not found !"); + Hacks.Misc.ShowMessageBox("Azazel not found !"); + } + } + + if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 110, 150, 30), "Despawn Crows")) + { + Hacks.Misc.DespawnCrows(); + } + + if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 150, 150, 30), "Despawn Lumps")) + { + Hacks.Misc.DespawnLumps(); + } + + if (GUI.Button(new Rect(Settings.Settings.x + 370, Settings.Settings.y + 70, 150, 30), "Switch realm")) + { + Il2Cpp.NolanBehaviour nb = Player.GetPlayer(); + Vector3 pos = nb.transform.position; + + ManorDeadRealmTrigger realm = Il2Cpp.ManorDeadRealmTrigger.FindObjectOfType(); + if (realm == null) + { + MelonLogger.Warning("realm was null."); + Hacks.Misc.ShowMessageBox("realm was null."); + return; + } + + if (realm.IsInDeadRealm) + { + // normal dimension + pos.x += 150f;// -10.216758f; + //pos.y = 0.009999979f; + //pos.z = -7.632657f; + + } + else + { + // other dimension + pos.x -= 150f;//-160.03688f; + //pos.y = 0.010014875f; + //pos.z = -7.5686994f; + } + + nb.locomotion.SetPosition(pos, false); + } + + if (GUI.Button(new Rect(Settings.Settings.x + 370, Settings.Settings.y + 110, 150, 30), "Switch realm (house)")) + { + Il2Cpp.NolanBehaviour nb = Player.GetPlayer(); + Vector3 pos = nb.transform.position; + + ManorDeadRealmTrigger realm = Il2Cpp.ManorDeadRealmTrigger.FindObjectOfType(); + if (realm == null) + { + MelonLogger.Warning("realm was null."); + Hacks.Misc.ShowMessageBox("realm was null."); + return; + } + + if (realm.IsInDeadRealm) + { + // normal dimension + pos.x = -10.216758f; + pos.y = 0.009999979f; + pos.z = -7.632657f; + + } + else + { + // other dimension + pos.x = -160.03688f; + pos.y = 0.010014875f; + pos.z = -7.5686994f; + } + + nb.locomotion.SetPosition(pos, false); + } + + infinite_mirrors = GUI.Toggle(new Rect(Settings.Settings.x + 370, Settings.Settings.y + 150, 150, 20), infinite_mirrors, "Infinite mirrors"); + break; + } + + // load map + GUI.Label(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 210, 100, 30), "Load Map: "); + + if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 240, 100, 30), "Farmhouse") && BoltNetwork.IsServer) + { + Helpers.Map.LoadMap("Devour"); + } + + if (GUI.Button(new Rect(Settings.Settings.x + 120, Settings.Settings.y + 240, 100, 30), "Asylum") && BoltNetwork.IsServer) + { + Helpers.Map.LoadMap("Molly"); + } + + if (GUI.Button(new Rect(Settings.Settings.x + 230, Settings.Settings.y + 240, 100, 30), "Inn") && BoltNetwork.IsServer) + { + Helpers.Map.LoadMap("Inn"); + } + + if (GUI.Button(new Rect(Settings.Settings.x + 340, Settings.Settings.y + 240, 100, 30), "Town") && BoltNetwork.IsServer) + { + Helpers.Map.LoadMap("Town"); + } + + if (GUI.Button(new Rect(Settings.Settings.x + 450, Settings.Settings.y + 240, 100, 30), "Slaughterhouse") && BoltNetwork.IsServer) + { + Helpers.Map.LoadMap("Slaughterhouse"); + } + + if (GUI.Button(new Rect(Settings.Settings.x + 560, Settings.Settings.y + 240, 100, 30), "Manor") && BoltNetwork.IsServer) + { + Helpers.Map.LoadMap("Manor"); + } + + } + + private static void EspTab() + { + player_esp = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 70, 150, 20), player_esp, "Player ESP"); + player_skel_esp = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 100, 150, 20), player_skel_esp, "Skeleton ESP"); + player_snapline = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 130, 150, 20), player_snapline, "Player Snapline"); + if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 160, 130, 30), "Player ESP Color")) + { + player_esp_colorpick = !player_esp_colorpick; + } + + if (player_esp_colorpick) + { + Color player_esp_color_input = GUIHelper.ColorPick("Player ESP Color", Settings.Settings.player_esp_color); + Settings.Settings.player_esp_color = player_esp_color_input; + } + + azazel_esp = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 200, 150, 20), azazel_esp, "Azazel ESP"); + azazel_skel_esp = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 230, 150, 20), azazel_skel_esp, "Skeleton ESP"); + azazel_snapline = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 260, 150, 20), azazel_snapline, "Azazel Snapline"); + if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 290, 130, 30), "Azazel ESP Color")) + { + azazel_esp_colorpick = !azazel_esp_colorpick; + } + + if (azazel_esp_colorpick) + { + Color azazel_esp_color_input = GUIHelper.ColorPick("Azazel ESP Color", Settings.Settings.azazel_esp_color); + Settings.Settings.azazel_esp_color = azazel_esp_color_input; + } + + item_esp = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 330, 150, 20), item_esp, "Item ESP"); + goat_rat_esp = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 360, 150, 20), goat_rat_esp, "Goat/Rat ESP"); + demon_esp = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 390, 150, 20), demon_esp, "Demon ESP"); + } + + private static void ItemsTab() + { + GUILayout.BeginHorizontal(); + + GUILayout.BeginVertical(); + + GUILayout.Label("Items"); + + Settings.Settings.itemsScrollPosition = GUILayout.BeginScrollView(Settings.Settings.itemsScrollPosition, GUILayout.Width(220), GUILayout.Height(190)); + + if (GUILayout.Button("Hay")) + { + if (BoltNetwork.IsServer && !Player.IsInGame()) + { + BoltNetwork.Instantiate(BoltPrefabs.SurvivalHay, Player.GetPlayer().transform.position, Quaternion.identity); + } + else + { + Hacks.Misc.CarryObject("SurvivalHay"); + } + } + + if (GUILayout.Button("First aid")) + { + if (BoltNetwork.IsServer && !Player.IsInGame()) + { + BoltNetwork.Instantiate(BoltPrefabs.SurvivalFirstAid, Player.GetPlayer().transform.position, Quaternion.identity); + } + else + { + Hacks.Misc.CarryObject("SurvivalFirstAid"); + } + } + + if (GUILayout.Button("Battery")) + { + if (BoltNetwork.IsServer && !Player.IsInGame()) + { + BoltNetwork.Instantiate(BoltPrefabs.SurvivalBattery, Player.GetPlayer().transform.position, Quaternion.identity); + } + else + { + Hacks.Misc.CarryObject("SurvivalBattery"); + } + } + + if (GUILayout.Button("Gasoline")) + { + if (BoltNetwork.IsServer && !Player.IsInGame()) + { + BoltNetwork.Instantiate(BoltPrefabs.SurvivalGasoline, Player.GetPlayer().transform.position, Quaternion.identity); + } + else + { + Hacks.Misc.CarryObject("SurvivalGasoline"); + } + } + + if (GUILayout.Button("Fuse")) + { + if (BoltNetwork.IsServer && !Player.IsInGame()) + { + BoltNetwork.Instantiate(BoltPrefabs.SurvivalFuse, Player.GetPlayer().transform.position, Quaternion.identity); + } + else + { + Hacks.Misc.CarryObject("SurvivalFuse"); + } + } + + if (GUILayout.Button("Food")) + { + if (BoltNetwork.IsServer && !Player.IsInGame()) + { + BoltNetwork.Instantiate(BoltPrefabs.SurvivalRottenFood, Player.GetPlayer().transform.position, Quaternion.identity); + } + else + { + Hacks.Misc.CarryObject("SurvivalRottenFood"); + } + } + + if (GUILayout.Button("Bone")) + { + + if (BoltNetwork.IsServer && !Player.IsInGame()) + { + BoltNetwork.Instantiate(BoltPrefabs.SurvivalBone, Player.GetPlayer().transform.position, Quaternion.identity); + } + else + { + Hacks.Misc.CarryObject("SurvivalBone"); + } + } + + if (GUILayout.Button("Bleach")) + { + if (BoltNetwork.IsServer && !Player.IsInGame()) + { + BoltNetwork.Instantiate(BoltPrefabs.SurvivalBleach, Player.GetPlayer().transform.position, Quaternion.identity); + } + else + { + Hacks.Misc.CarryObject("SurvivalBleach"); + } + } + + if (GUILayout.Button("Matchbox")) + { + if (BoltNetwork.IsServer && !Player.IsInGame()) + { + BoltNetwork.Instantiate(BoltPrefabs.SurvivalMatchbox, Player.GetPlayer().transform.position, Quaternion.identity); + } + else + { + Hacks.Misc.CarryObject("Matchbox-3"); + } + } + + if (GUILayout.Button("Shovel")) + { + if (BoltNetwork.IsServer && !Player.IsInGame()) + { + BoltNetwork.Instantiate(BoltPrefabs.SurvivalSpade, Player.GetPlayer().transform.position, Quaternion.identity); + } + else + { + Hacks.Misc.CarryObject("SurvivalSpade"); + } + } + + if (GUILayout.Button("Cake")) + { + if (BoltNetwork.IsServer && !Player.IsInGame()) + { + BoltNetwork.Instantiate(BoltPrefabs.SurvivalCake, Player.GetPlayer().transform.position, Quaternion.identity); + } + else + { + Hacks.Misc.CarryObject("SurvivalCake"); + } + } + + GUILayout.EndScrollView(); + GUILayout.EndVertical(); + + GUILayout.BeginVertical(); + + GUILayout.Label("Ritual Objects"); + + Settings.Settings.rituelObjectsScrollPosition = GUILayout.BeginScrollView(Settings.Settings.rituelObjectsScrollPosition, GUILayout.Width(220), GUILayout.Height(190)); + + if (GUILayout.Button("Egg-1")) + { + Hacks.Misc.CarryObject("Egg-Clean-1"); + } + + if (GUILayout.Button("Egg-2")) + { + Hacks.Misc.CarryObject("Egg-Clean-2"); + } + + if (GUILayout.Button("Egg-3")) + { + Hacks.Misc.CarryObject("Egg-Clean-3"); + } + + if (GUILayout.Button("Egg-4")) + { + Hacks.Misc.CarryObject("Egg-Clean-4"); + } + + if (GUILayout.Button("Egg-5")) + { + Hacks.Misc.CarryObject("Egg-Clean-5"); + } + + if (GUILayout.Button("Egg-6")) + { + Hacks.Misc.CarryObject("Egg-Clean-6"); + } + + if (GUILayout.Button("Egg-7")) + { + Hacks.Misc.CarryObject("Egg-Clean-7"); + } + + if (GUILayout.Button("Egg-8")) + { + Hacks.Misc.CarryObject("Egg-Clean-8"); + } + + if (GUILayout.Button("Egg-9")) + { + Hacks.Misc.CarryObject("Egg-Clean-9"); + } + + if (GUILayout.Button("Egg-10")) + { + Hacks.Misc.CarryObject("Egg-Clean-10"); + } + + if (GUILayout.Button("Ritual Book")) + { + if (BoltNetwork.IsServer && !Player.IsInGame()) + { + BoltNetwork.Instantiate(BoltPrefabs.SurvivalRitualBook, Player.GetPlayer().transform.position, Quaternion.identity); + } + else + { + Hacks.Misc.CarryObject("RitualBook-Active-1"); + } + } + + if (GUILayout.Button("Dirty head")) + { + if (BoltNetwork.IsServer && !Player.IsInGame()) + { + BoltNetwork.Instantiate(BoltPrefabs.SurvivalHead, Player.GetPlayer().transform.position, Quaternion.identity); + } + else + { + Hacks.Misc.CarryObject("SurvivalHead"); + } + } + + if (GUILayout.Button("Clean head")) + { + if (BoltNetwork.IsServer && !Player.IsInGame()) + { + BoltNetwork.Instantiate(BoltPrefabs.SurvivalCleanHead, Player.GetPlayer().transform.position, Quaternion.identity); + } + else + { + Hacks.Misc.CarryObject("SurvivalCleanHead"); + } + } + + GUILayout.EndScrollView(); + GUILayout.EndVertical(); + + GUILayout.BeginVertical(); + + GUILayout.Label("Spawnable Prefabs"); + + Settings.Settings.stuffsScrollPosition = GUILayout.BeginScrollView(Settings.Settings.stuffsScrollPosition, GUILayout.Width(220), GUILayout.Height(190)); + + if (GUILayout.Button("Animal_Gate")) + { + if (BoltNetwork.IsServer) + { + BoltNetwork.Instantiate(BoltPrefabs.Animal_Gate, Player.GetPlayer().transform.position, Quaternion.identity); + } + } + + if (GUILayout.Button("AsylumDoor")) + { + if (BoltNetwork.IsServer) + { + BoltNetwork.Instantiate(BoltPrefabs.AsylumDoor, Player.GetPlayer().transform.position, Quaternion.identity); + } + } + + if (GUILayout.Button("AsylumDoubleDoor")) + { + if (BoltNetwork.IsServer) + { + BoltNetwork.Instantiate(BoltPrefabs.AsylumDoubleDoor, Player.GetPlayer().transform.position, Quaternion.identity); + } + } + + if (GUILayout.Button("AsylumWhiteDoor")) + { + if (BoltNetwork.IsServer) + { + BoltNetwork.Instantiate(BoltPrefabs.AsylumWhiteDoor, Player.GetPlayer().transform.position, Quaternion.identity); + } + } + + + if (GUILayout.Button("DevourDoorBack")) + { + if (BoltNetwork.IsServer) + { + BoltNetwork.Instantiate(BoltPrefabs.DevourDoorBack, Player.GetPlayer().transform.position, Quaternion.identity); + } + } + + if (GUILayout.Button("DevourDoorMain")) + { + if (BoltNetwork.IsServer) + { + BoltNetwork.Instantiate(BoltPrefabs.DevourDoorMain, Player.GetPlayer().transform.position, Quaternion.identity); + } + } + + if (GUILayout.Button("DevourDoorRoom")) + { + if (BoltNetwork.IsServer) + { + BoltNetwork.Instantiate(BoltPrefabs.DevourDoorRoom, Player.GetPlayer().transform.position, Quaternion.identity); + } + } + + if (GUILayout.Button("Elevator_Door")) + { + if (BoltNetwork.IsServer) + { + BoltNetwork.Instantiate(BoltPrefabs.Elevator_Door, Player.GetPlayer().transform.position, Quaternion.identity); + } + } + + if (GUILayout.Button("InnDoor")) + { + if (BoltNetwork.IsServer) + { + BoltNetwork.Instantiate(BoltPrefabs.InnDoor, Player.GetPlayer().transform.position, Quaternion.identity); + } + } + + if (GUILayout.Button("InnDoubleDoor")) + { + if (BoltNetwork.IsServer) + { + BoltNetwork.Instantiate(BoltPrefabs.InnDoubleDoor, Player.GetPlayer().transform.position, Quaternion.identity); + } + } + + if (GUILayout.Button("InnShojiDoor")) + { + if (BoltNetwork.IsServer) + { + BoltNetwork.Instantiate(BoltPrefabs.InnShojiDoor, Player.GetPlayer().transform.position, Quaternion.identity); + } + } + + if (GUILayout.Button("InnShrine")) + { + if (BoltNetwork.IsServer) + { + BoltNetwork.Instantiate(BoltPrefabs.InnShrine, Player.GetPlayer().transform.position, Quaternion.identity); + } + } + + if (GUILayout.Button("InnWardrobe")) + { + if (BoltNetwork.IsServer) + { + BoltNetwork.Instantiate(BoltPrefabs.InnWardrobe, Player.GetPlayer().transform.position, Quaternion.identity); + } + } + + if (GUILayout.Button("InnWoodenDoor")) + { + if (BoltNetwork.IsServer) + { + BoltNetwork.Instantiate(BoltPrefabs.InnWoodenDoor, Player.GetPlayer().transform.position, Quaternion.identity); + } + } + + if (GUILayout.Button("PigExcrement")) + { + if (BoltNetwork.IsServer) + { + BoltNetwork.Instantiate(BoltPrefabs.PigExcrement, Player.GetPlayer().transform.position, Quaternion.identity); + } + } + + if (GUILayout.Button("SlaughterhouseFireEscapeDoor")) + { + if (BoltNetwork.IsServer) + { + BoltNetwork.Instantiate(BoltPrefabs.SlaughterhouseFireEscapeDoor, Player.GetPlayer().transform.position, Quaternion.identity); + } + } + + if (GUILayout.Button("SurvivalAltarMolly")) + { + if (BoltNetwork.IsServer) + { + BoltNetwork.Instantiate(BoltPrefabs.SurvivalAltarMolly, Player.GetPlayer().transform.position, Quaternion.identity); + } + } + + if (GUILayout.Button("SurvivalAltarSlaughterhouse")) + { + if (BoltNetwork.IsServer) + { + BoltNetwork.Instantiate(BoltPrefabs.SurvivalAltarSlaughterhouse, Player.GetPlayer().transform.position, Quaternion.identity); + } + } + + if (GUILayout.Button("SurvivalAltarTown")) + { + if (BoltNetwork.IsServer) + { + BoltNetwork.Instantiate(BoltPrefabs.SurvivalAltarTown, Player.GetPlayer().transform.position, Quaternion.identity); + } + } + + + if (GUILayout.Button("SurvivalCultist")) + { + if (BoltNetwork.IsServer) + { + BoltNetwork.Instantiate(BoltPrefabs.SurvivalCultist, Player.GetPlayer().transform.position, Quaternion.identity); + } + } + + if (GUILayout.Button("SurvivalKai")) + { + if (BoltNetwork.IsServer) + { + BoltNetwork.Instantiate(BoltPrefabs.SurvivalKai, Player.GetPlayer().transform.position, Quaternion.identity); + } + } + + if (GUILayout.Button("SurvivalNathan")) + { + if (BoltNetwork.IsServer) + { + BoltNetwork.Instantiate(BoltPrefabs.SurvivalNathan, Player.GetPlayer().transform.position, Quaternion.identity); + } + } + + if (GUILayout.Button("SurvivalMolly")) + { + if (BoltNetwork.IsServer) + { + BoltNetwork.Instantiate(BoltPrefabs.SurvivalMolly, Player.GetPlayer().transform.position, Quaternion.identity); + } + } + + if (GUILayout.Button("SurvivalApril")) + { + if (BoltNetwork.IsServer) + { + BoltNetwork.Instantiate(BoltPrefabs.SurvivalApril, Player.GetPlayer().transform.position, Quaternion.identity); + } + } + + if (GUILayout.Button("SurvivalFrank")) + { + if (BoltNetwork.IsServer) + { + BoltNetwork.Instantiate(BoltPrefabs.SurvivalFrank, Player.GetPlayer().transform.position, Quaternion.identity); + } + } + + if (GUILayout.Button("SurvivalRose")) + { + if (BoltNetwork.IsServer) + { + BoltNetwork.Instantiate(BoltPrefabs.SurvivalRose, Player.GetPlayer().transform.position, Quaternion.identity); + } + } + + if (GUILayout.Button("SurvivalSmashableWindow")) + { + if (BoltNetwork.IsServer) + { + BoltNetwork.Instantiate(BoltPrefabs.SurvivalSmashableWindow, Player.GetPlayer().transform.position, Quaternion.identity); + } + } + + if (GUILayout.Button("TownDoor")) + { + if (BoltNetwork.IsServer) + { + BoltNetwork.Instantiate(BoltPrefabs.TownDoor, Player.GetPlayer().transform.position, Quaternion.identity); + } + } + + if (GUILayout.Button("TownDoor2")) + { + if (BoltNetwork.IsServer) + { + BoltNetwork.Instantiate(BoltPrefabs.TownDoor2, Player.GetPlayer().transform.position, Quaternion.identity); + } + } + + if (GUILayout.Button("TownPentagram")) + { + if (BoltNetwork.IsServer) + { + BoltNetwork.Instantiate(BoltPrefabs.TownPentagram, Player.GetPlayer().transform.position, Quaternion.identity); + } + } + + if (GUILayout.Button("TrashCan")) + { + if (BoltNetwork.IsServer) + { + BoltNetwork.Instantiate(BoltPrefabs.TrashCan, Player.GetPlayer().transform.position, Quaternion.identity); + } + } + + if (GUILayout.Button("Truck_Shutter")) + { + if (BoltNetwork.IsServer) + { + BoltNetwork.Instantiate(BoltPrefabs.Truck_Shutter, Player.GetPlayer().transform.position, Quaternion.identity); + } + } + + if (GUILayout.Button("TV")) + { + if (BoltNetwork.IsServer) + { + BoltNetwork.Instantiate(BoltPrefabs.TV, Player.GetPlayer().transform.position, Quaternion.identity); + } + } + + if (GUILayout.Button("Mirror")) + { + if (BoltNetwork.IsServer) + { + BoltNetwork.Instantiate(BoltPrefabs.ManorMirror, Player.GetPlayer().transform.position, Quaternion.identity); + } + } + + GUILayout.EndScrollView(); + GUILayout.EndVertical(); + GUILayout.EndHorizontal(); + } + + private static void MiscTab() + { + if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 70, 150, 30), "Unlock Achievements")) + { + Thread AchievementsThread = new Thread(new ThreadStart(Hacks.Unlock.Achievements)); + AchievementsThread.Start(); + + MelonLogger.Msg("Achievements Unlocked!"); + Hacks.Misc.ShowMessageBox("Achievements Unlocked!"); + } + + if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 110, 150, 30), "Unlock Doors")) + { + Hacks.Unlock.Doors(); + + MelonLogger.Msg("Doors Unlocked!"); + Hacks.Misc.ShowMessageBox("Doors Unlocked!"); + } + + if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 150, 150, 30), "TP Keys") && Player.IsInGame()) + { + Hacks.Misc.TPKeys(); + MelonLogger.Msg("Here are your keys!"); + Hacks.Misc.ShowMessageBox("Here are your keys!"); + } + + if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 190, 150, 30), "Make Random Noise")) + { + Hacks.Misc.PlaySound(); + MelonLogger.Msg("Playing a random sound!"); + Hacks.Misc.ShowMessageBox("Playing a random sound!"); + } + + spam_message = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 240, 140, 30), spam_message, "Chat spam"); + if (spam_message) + { + spamMessageText = GUI.TextField(new Rect(Settings.Settings.x + 160, Settings.Settings.y + 240, 200, 30), spamMessageText); + GUI.Label(new Rect(Settings.Settings.x + 370, Settings.Settings.y + 240, 60, 30), "Send Interval(s):"); + spamMessageInterval = GUI.HorizontalSlider(new Rect(Settings.Settings.x + 440, Settings.Settings.y + 240, 100, 30), spamMessageInterval, 1f, 30f); + GUI.Label(new Rect(Settings.Settings.x + 550, Settings.Settings.y + 240, 60, 30), ((int)spamMessageInterval).ToString()); + } + + change_steam_name = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 270, 140, 30), change_steam_name, "Change Steam Name"); + if (change_steam_name) + { + steamNameText = GUI.TextField(new Rect(Settings.Settings.x + 160, Settings.Settings.y + 270, 200, 30), steamNameText); + if (GUI.Button(new Rect(Settings.Settings.x + 370, Settings.Settings.y + 270, 60, 30), "Apply")) + { + Hacks.Misc.SetSteamName(steamNameText); + } + } + + change_server_name = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 300, 140, 30), change_server_name, "Change Server Name"); + if (change_server_name) + { + serverNameText = GUI.TextField(new Rect(Settings.Settings.x + 160, Settings.Settings.y + 300, 200, 30), serverNameText); + if (GUI.Button(new Rect(Settings.Settings.x + 370, Settings.Settings.y + 300, 60, 30), "Apply")) + { + Hacks.Misc.SetServerName(serverNameText); + } + } + + _walkInLobby = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 330, 140, 30), _walkInLobby, "Walk In Lobby"); + _IsAutoRespawn = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 360, 140, 30), _IsAutoRespawn, "Auto Respawn"); + + fly = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 400, 40, 20), fly, "Fly"); + if (GUI.Button(new Rect(Settings.Settings.x + 60, Settings.Settings.y + 400, 40, 20), Settings.Settings.flyKey.ToString())) + { + Settings.Settings.flyKey = Settings.Settings.GetKey(); + } + + fly_speed = GUI.HorizontalSlider(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 430, 100, 10), fly_speed, 5f, 20f); + GUI.Label(new Rect(Settings.Settings.x + 120, Settings.Settings.y + 425, 100, 30), ((int)fly_speed).ToString()); + + + spoofLevel = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 470, 150, 20), spoofLevel, "Spoof Level"); + spoofLevelValue = GUI.HorizontalSlider(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 500, 100, 10), spoofLevelValue, 0f, 666f); + GUI.Label(new Rect(Settings.Settings.x + 120, Settings.Settings.y + 495, 100, 30), ((int)spoofLevelValue).ToString()); + + + exp_modifier = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 540, 150, 20), exp_modifier, "EXP Modifier"); + exp = GUI.HorizontalSlider(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 570, 100, 10), exp, 1000f, 6000f); + GUI.Label(new Rect(Settings.Settings.x + 120, Settings.Settings.y + 565, 100, 30), ((int)exp).ToString()); + + + fastMove = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 610, 150, 20), fastMove, "Player Speed"); + _PlayerSpeedMultiplier = GUI.HorizontalSlider(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 640, 100, 10), _PlayerSpeedMultiplier, (int)1f, (int)10f); + GUI.Label(new Rect(Settings.Settings.x + 120, Settings.Settings.y + 635, 100, 30), ((int)_PlayerSpeedMultiplier).ToString()); + + GUI.Label(new Rect(Settings.Settings.x + 295, Settings.Settings.y + 70, 150, 30), "Max players"); + lobbySize = GUI.HorizontalSlider(new Rect(Settings.Settings.x + 295, Settings.Settings.y + 90, 100, 10), lobbySize, (int)0f, (int)30f); + GUI.Label(new Rect(Settings.Settings.x + 405, Settings.Settings.y + 85, 100, 30), ((int)lobbySize).ToString()); + + if (GUI.Button(new Rect(Settings.Settings.x + 285, Settings.Settings.y + 110, 150, 30), "Create server")) + { + MelonLogger.Msg("Creating the server..."); + Hacks.Misc.ShowMessageBox("Creating the server..."); + Hacks.Misc.CreateCustomizedLobby((int)lobbySize); + MelonLogger.Msg("Done !"); + Hacks.Misc.ShowMessageBox("Done !"); + } + } + + private static void PlayersTab() + { + if (Helpers.Map.GetActiveScene() != "Menu") + { + GUI.Label(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 70, 150, 30), "Player list:"); + int i = 0; + foreach (BasePlayer bp in Entities.Players) + { + if (bp == null || bp.Name == "") + { + MelonLogger.Warning("players is null"); + Hacks.Misc.ShowMessageBox("players is null"); + continue; + } + + GUI.Label(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 110 + i, 150, 30), bp.Name); + + if (GUI.Button(new Rect(Settings.Settings.x + 70, Settings.Settings.y + 105 + i, 60, 30), "Kill")) + { + bp.Kill(); + } + + if (GUI.Button(new Rect(Settings.Settings.x + 140, Settings.Settings.y + 105 + i, 60, 30), "Revive")) + { + bp.Revive(); + } + + if (GUI.Button(new Rect(Settings.Settings.x + 210, Settings.Settings.y + 105 + i, 90, 30), "Jumpscare")) + { + bp.Jumpscare(); + } + + if (GUI.Button(new Rect(Settings.Settings.x + 310, Settings.Settings.y + 105 + i, 60, 30), "TP to")) + { + bp.TP(); + } + + if (GUI.Button(new Rect(Settings.Settings.x + 380, Settings.Settings.y + 105 + i, 100, 30), "Lock in cage")) + { + bp.LockInCage(); + } + + if (GUI.Button(new Rect(Settings.Settings.x + 490, Settings.Settings.y + 105 + i, 90, 30), "TP Azazel")) + { + bp.TPAzazel(); + } + + if (Helpers.Map.GetActiveScene() == "Town") + { + if (GUI.Button(new Rect(Settings.Settings.x + 590, Settings.Settings.y + 105 + i, 90, 30), "Shoot Player")) + { + bp.ShootPlayer(); + } + } + + i += 30; + } + } + else + { + GUI.Label(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 70, 150, 30), "Waiting for the game to start."); + } + } + + } +} From 64e6fd785d065385e6b51164ee48c6b874f3b417 Mon Sep 17 00:00:00 2001 From: manafeng <123635537+mana-feng@users.noreply.github.com> Date: Sun, 8 Jun 2025 03:02:35 +1000 Subject: [PATCH 03/17] Delete ClientMain.cs --- ClientMain.cs | 1714 ------------------------------------------------- 1 file changed, 1714 deletions(-) delete mode 100644 ClientMain.cs diff --git a/ClientMain.cs b/ClientMain.cs deleted file mode 100644 index 01c320e..0000000 --- a/ClientMain.cs +++ /dev/null @@ -1,1714 +0,0 @@ -using DevourClient.Helpers; -using MelonLoader; -using System.Threading.Tasks; -using Il2CppPhoton.Bolt; -using UnityEngine; -using Il2Cpp; - -namespace DevourClient -{ - public class ClientMain : MonoBehaviour - { - public ClientMain(IntPtr ptr) - : base(ptr) - { - } - - enum CurrentTab : int - { - Visuals = 0, - Entities = 1, - Map = 2, - ESP = 3, - Items = 4, - Misc = 5, - Players = 6 - } - - static Rect windowRect = new Rect(Settings.Settings.x + 10, Settings.Settings.y + 10, 700, 700); - static CurrentTab current_tab = CurrentTab.Visuals; - - static bool flashlight_toggle = false; - static bool flashlight_colorpick = false; - static bool player_esp_colorpick = false; - static bool azazel_esp_colorpick = false; - static bool spoofLevel = false; - static float spoofLevelValue = 0; - static bool change_server_name = false; - static bool change_steam_name = false; - static bool fly = false; - static float fly_speed = 5; - static bool fastMove = false; - static float _PlayerSpeedMultiplier = 1; - public static float lobbySize = 4; - public static bool _IsAutoRespawn = false; - public static bool unlimitedUV = false; - public static bool exp_modifier = false; - public static float exp = 1000f; - public static bool _walkInLobby = false; - public static bool infinite_mirrors = false; - static bool player_esp = false; - static bool player_skel_esp = false; - static bool player_snapline = false; - static bool azazel_esp = false; - static bool azazel_skel_esp = false; - static bool azazel_snapline = false; - static bool spam_message = false; - static bool item_esp = false; - static bool goat_rat_esp = false; - static bool demon_esp = false; - static bool fullbright = false; - static bool need_fly_reset = false; - static bool crosshair = false; - static bool in_game_cache = false; - static bool should_show_start_message = true; - static Texture2D crosshairTexture = default!; - - private static string spamMessageText = "Deez Nutz"; - private static string steamNameText = "patate"; - private static string serverNameText = "patate on top !"; - private static float spamMessageInterval = 5f; // Default send interval in seconds - private static float spamMessageTimer = 0f; // Timer - - public void Start() - { - MelonLogger.Msg("For the Queen !"); - Hacks.Misc.ShowMessageBox("For the Queen !"); - MelonLogger.Warning("Made with <3 by patate and Jadis."); - Hacks.Misc.ShowMessageBox("Made with <3 by patate and Jadis."); - MelonLogger.Warning("Github : https://github.com/ALittlePatate/DevourClient"); - Hacks.Misc.ShowMessageBox("Github : https://github.com/ALittlePatate/DevourClient"); - MelonLogger.Warning("Note : if you payed for this you most likely got scammed."); - Hacks.Misc.ShowMessageBox("Note : if you payed for this you most likely got scammed."); - - crosshairTexture = Helpers.GUIHelper.GetCircularTexture(5, 5); - - // Start all coroutines using new coroutine management mechanism - Helpers.Entities.StartAllCoroutines(); - } - - public void OnDestroy() - { - // Stop all coroutines when component is destroyed - Helpers.Entities.StopAllCoroutines(); - - // Clean up other resources - if (crosshairTexture != null) - { - UnityEngine.Object.Destroy(crosshairTexture); - crosshairTexture = null; - } - } - - public void OnApplicationQuit() - { - // Stop all coroutines when application quits - Helpers.Entities.StopAllCoroutines(); - } - - public void Update() - { - if (Input.GetKeyDown(KeyCode.Insert)) - { - try - { - Il2Cpp.GameUI gameUI = UnityEngine.Object.FindObjectOfType(); - if (Settings.Settings.menu_enable) - { - gameUI.HideMouseCursor(); - } - else - { - gameUI.ShowMouseCursor(); - } - } - catch { } - - Settings.Settings.menu_enable = !Settings.Settings.menu_enable; - } - - if (Player.IsInGame()) - { - if (flashlight_toggle && !fullbright) - { - Hacks.Misc.BigFlashlight(false); - } - else if (!flashlight_toggle && !fullbright) - { - Hacks.Misc.BigFlashlight(true); - } - - if (fullbright && !flashlight_toggle) - { - Hacks.Misc.Fullbright(false); - } - else if (!fullbright && !flashlight_toggle) - { - Hacks.Misc.Fullbright(true); - } - - if (_IsAutoRespawn && Helpers.Player.IsPlayerCrawling()) - { - Hacks.Misc.AutoRespawn(); - } - - if (crosshair && !in_game_cache) - { - in_game_cache = true; - } - } - else - { - if (crosshair && in_game_cache) - { - in_game_cache = false; - } - } - - if (spam_message) - { - spamMessageTimer += Time.deltaTime; - if (spamMessageTimer >= spamMessageInterval) - { - Hacks.Misc.MessageSpam(spamMessageText); - spamMessageTimer = 0f; // Reset timer - } - } - else - { - spamMessageTimer = 0f; // Reset timer when disabled - } - - if (spoofLevel) - { - Hacks.Misc.SetRank((int)spoofLevelValue); - } - - if (Input.GetKeyDown(Settings.Settings.flyKey)) - { - fly = !fly; - } - - if (Player.IsInGameOrLobby()) - { - if (fly && !need_fly_reset) - { - Il2Cpp.NolanBehaviour nb = Player.GetPlayer(); - if (nb) - { - Collider coll = nb.GetComponentInChildren(); - if (coll) - { - coll.enabled = false; - need_fly_reset = true; - } - } - } - - else if (!fly && need_fly_reset) - { - Il2Cpp.NolanBehaviour nb = Player.GetPlayer(); - if (nb) - { - Collider coll = nb.GetComponentInChildren(); - if (coll) - { - coll.enabled = true; - need_fly_reset = false; - } - } - } - - if (fly) - { - Hacks.Misc.Fly(fly_speed); - } - - } - - if (Helpers.Map.GetActiveScene() == "Menu") - { - Hacks.Misc.WalkInLobby(_walkInLobby); - } - - if (fastMove) - { - try - { - Helpers.Entities.LocalPlayer_.p_GameObject.GetComponent().TimeScale = _PlayerSpeedMultiplier; - } - catch { return; } - } - } - - public void OnGUI() - { - if (should_show_start_message) - { - if (DevourClient.Hacks.Misc.ShowMessageBox("Welcome to DevourClient.\n\nPress the INS key to open the menu.") == 0) - should_show_start_message = false; - } - - // Update error message display time - if (Settings.Settings.showErrorMessage) - { - Settings.Settings.errorMessageDisplayTime += Time.deltaTime; - if (Settings.Settings.errorMessageDisplayTime >= Settings.Settings.errorMessageMaxDisplayTime) - { - Settings.Settings.showErrorMessage = false; - } - } - - // Render error message box - if (Settings.Settings.showErrorMessage) - { - // Set message box style - GUIStyle errorBoxStyle = new GUIStyle(GUI.skin.box); - errorBoxStyle.normal.background = GUIHelper.MakeTex(2, 2, new Color(0.8f, 0.2f, 0.2f, 0.9f)); - errorBoxStyle.normal.textColor = Color.white; - errorBoxStyle.fontSize = 14; - errorBoxStyle.padding = new RectOffset(10, 10, 10, 10); - errorBoxStyle.wordWrap = true; - errorBoxStyle.clipping = TextClipping.Overflow; - - // Calculate message box position (bottom center) - float boxWidth = 400f; - float boxHeight = 60f; - float boxX = (Screen.width - boxWidth) / 2f; - float boxY = Screen.height - boxHeight - 20f; - - // Draw message box - GUI.Box(new Rect(boxX, boxY, boxWidth, boxHeight), Settings.Settings.errorMessage, errorBoxStyle); - } - - GUI.backgroundColor = Color.grey; - - // Set button style - var buttonStyle = new GUIStyle(GUI.skin.button); - buttonStyle.normal.background = GUIHelper.MakeTex(2, 2, Color.black); - buttonStyle.normal.textColor = Color.white; - buttonStyle.border = new RectOffset(2, 2, 2, 2); - GUI.skin.button = buttonStyle; - - // Set label style - var labelStyle = new GUIStyle(GUI.skin.label); - labelStyle.normal.textColor = Color.white; - labelStyle.border = new RectOffset(2, 2, 2, 2); - GUI.skin.label = labelStyle; - - // Set text field style - var textFieldStyle = new GUIStyle(GUI.skin.textField); - textFieldStyle.normal.textColor = Color.white; - textFieldStyle.border = new RectOffset(2, 2, 2, 2); - GUI.skin.textField = textFieldStyle; - - // Set slider style - var sliderStyle = new GUIStyle(GUI.skin.horizontalSlider); - sliderStyle.border = new RectOffset(2, 2, 2, 2); - GUI.skin.horizontalSlider = sliderStyle; - - // Set toggle style - var toggleStyle = new GUIStyle(GUI.skin.toggle); - toggleStyle.normal.textColor = Color.white; - toggleStyle.border = new RectOffset(2, 2, 2, 2); - toggleStyle.onNormal.textColor = Color.yellow; - GUI.skin.toggle = toggleStyle; - - //from https://www.unknowncheats.me/forum/unity/437277-mono-internal-optimisation-tips.html - if (UnityEngine.Event.current.type == EventType.Repaint) - { - if (player_esp || player_snapline || player_skel_esp) - { - foreach (Helpers.BasePlayer p in Helpers.Entities.Players) - { - if (p == null) - { - continue; - } - - GameObject player = p.p_GameObject; - if (player != null) - { - Il2Cpp.NolanBehaviour nb = player.GetComponent(); - if (nb.entity.IsOwner) - { - continue; - } - - if (player_skel_esp) - { - Render.Render.DrawAllBones(Hacks.Misc.GetAllBones(nb.animator), Settings.Settings.player_esp_color); - } - - Render.Render.DrawBoxESP(player, -0.25f, 1.75f, p.Name, Settings.Settings.player_esp_color, player_snapline, player_esp); - } - } - } - - if (goat_rat_esp) - { - foreach (Il2Cpp.GoatBehaviour goat in Helpers.Entities.GoatsAndRats) - { - if (goat != null) - { - Render.Render.DrawNameESP(goat.transform.position, goat.name.Replace("Survival", "").Replace("(Clone)", ""), new Color(0.94f, 0.61f, 0.18f, 1.0f)); - } - } - } - - if (item_esp) - { - foreach (Il2Cpp.SurvivalInteractable obj in Helpers.Entities.SurvivalInteractables) - { - if (obj != null) - { - Render.Render.DrawNameESP(obj.transform.position, obj.prefabName.Replace("Survival", ""), new Color(1.0f, 1.0f, 1.0f)); - } - } - - foreach (Il2Cpp.KeyBehaviour key in Helpers.Entities.Keys) - { - if (key != null) - { - Render.Render.DrawNameESP(key.transform.position, "Key", new Color(1.0f, 1.0f, 1.0f)); - } - } - } - - if (demon_esp) - { - foreach (Il2Cpp.SurvivalDemonBehaviour demon in Helpers.Entities.Demons) - { - if (demon != null) - { - Render.Render.DrawNameESP(demon.transform.position, demon.name.Replace("Survival", "").Replace("(Clone)", ""), new Color(1.0f, 0.0f, 0.0f, 1.0f)); - } - } - - foreach (Il2Cpp.SpiderBehaviour spider in Helpers.Entities.Spiders) - { - if (spider != null) - { - Render.Render.DrawNameESP(spider.transform.position, "Spider", new Color(1.0f, 0.0f, 0.0f, 1.0f)); - } - } - - foreach (Il2Cpp.GhostBehaviour ghost in Helpers.Entities.Ghosts) - { - if (ghost != null) - { - Render.Render.DrawNameESP(ghost.transform.position, "Ghost", new Color(1.0f, 0.0f, 0.0f, 1.0f)); - } - } - - foreach (Il2Cpp.BoarBehaviour boar in Helpers.Entities.Boars) - { - if (boar != null) - { - Render.Render.DrawNameESP(boar.transform.position, "Boar", new Color(1.0f, 0.0f, 0.0f, 1.0f)); - } - } - - foreach (Il2Cpp.CorpseBehaviour corpse in Helpers.Entities.Corpses) - { - if (corpse != null) - { - Render.Render.DrawNameESP(corpse.transform.position, "Corpse", new Color(1.0f, 0.0f, 0.0f, 1.0f)); - } - } - - foreach (Il2Cpp.CrowBehaviour crow in Helpers.Entities.Crows) - { - if (crow != null) - { - Render.Render.DrawNameESP(crow.transform.position, "Crow", new Color(1.0f, 0.0f, 0.0f, 1.0f)); - } - } - - foreach (Il2Cpp.ManorLumpController lump in Helpers.Entities.Lumps) - { - if (lump != null) - { - Render.Render.DrawNameESP(lump.transform.position, "Lump", new Color(1.0f, 0.0f, 0.0f, 1.0f)); - } - } - } - - if (azazel_esp || azazel_snapline || azazel_skel_esp) - { - foreach (Il2Cpp.SurvivalAzazelBehaviour survivalAzazel in Helpers.Entities.Azazels) - { - if (survivalAzazel != null) - { - if (azazel_skel_esp) - { - Render.Render.DrawAllBones(Hacks.Misc.GetAllBones(survivalAzazel.animator), Settings.Settings.azazel_esp_color); - } - - Render.Render.DrawBoxESP(survivalAzazel.gameObject, -0.25f, 2.0f, "Azazel", Settings.Settings.azazel_esp_color, azazel_snapline, azazel_esp); - } - } - } - - if (crosshair && in_game_cache) //&& !Player.IsPlayerCrawling()) - { - const float crosshairSize = 4; - - float xMin = (Settings.Settings.width) - (crosshairSize / 2); - float yMin = (Settings.Settings.height) - (crosshairSize / 2); - - if (crosshairTexture == null) - { - crosshairTexture = Helpers.GUIHelper.GetCircularTexture(5, 5); - } - - GUI.DrawTexture(new Rect(xMin, yMin, crosshairSize, crosshairSize), crosshairTexture); - } - } - - if (Settings.Settings.menu_enable) //Si on appuie sur INSERT - { - windowRect = GUI.Window(0, windowRect, (GUI.WindowFunction)Tabs, "DevourClient"); - } - - } - - public static void Tabs(int windowID) - { - GUILayout.BeginHorizontal(); - - if (GUILayout.Button("Visual", GUILayout.Height(40)) || Input.GetKeyDown(KeyCode.F1)) - { - current_tab = CurrentTab.Visuals; - } - - if (GUILayout.Button("Entites", GUILayout.Height(40)) || Input.GetKeyDown(KeyCode.F2)) - { - current_tab = CurrentTab.Entities; - } - - if (GUILayout.Button("Map Specific", GUILayout.Height(40)) || Input.GetKeyDown(KeyCode.F3)) - { - current_tab = CurrentTab.Map; - } - - if (GUILayout.Button("ESP", GUILayout.Height(40)) || Input.GetKeyDown(KeyCode.F4)) - { - current_tab = CurrentTab.ESP; - } - - if (GUILayout.Button("Items", GUILayout.Height(40)) || Input.GetKeyDown(KeyCode.F5)) - { - current_tab = CurrentTab.Items; - } - - if (GUILayout.Button("Misc", GUILayout.Height(40)) || Input.GetKeyDown(KeyCode.F6)) - { - current_tab = CurrentTab.Misc; - } - - if (GUILayout.Button("Player", GUILayout.Height(40)) || Input.GetKeyDown(KeyCode.F7)) - { - current_tab = CurrentTab.Players; - } - - GUILayout.EndHorizontal(); - - switch (current_tab) - { - case CurrentTab.Visuals: - VisualsTab(); - break; - case CurrentTab.Entities: - EntitiesTab(); - break; - case CurrentTab.Map: - MapSpecificTab(); - break; - case CurrentTab.ESP: - EspTab(); - break; - case CurrentTab.Items: - ItemsTab(); - break; - case CurrentTab.Misc: - MiscTab(); - break; - case CurrentTab.Players: - PlayersTab(); - break; - - } - - GUI.DragWindow(); - } - - private static void VisualsTab() - { - // draw visuals - - flashlight_toggle = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 70, 120, 30), flashlight_toggle, "Big Flashlight"); - fullbright = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 100, 120, 30), fullbright, "Fullbright"); - unlimitedUV = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 130, 130, 30), unlimitedUV, "Unlimited UV Light"); - crosshair = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 160, 130, 30), crosshair, "Crosshair"); - - - if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 190, 130, 30), "Flashlight Color")) - { - flashlight_colorpick = !flashlight_colorpick; - MelonLogger.Msg("Flashlight color picker : " + flashlight_colorpick.ToString()); - Hacks.Misc.ShowMessageBox("Flashlight color picker : " + flashlight_colorpick.ToString()); - } - - if (flashlight_colorpick) - { - Color flashlight_color_input = DevourClient.Helpers.GUIHelper.ColorPick("Flashlight Color", Settings.Settings.flashlight_color); - Settings.Settings.flashlight_color = flashlight_color_input; - - if (Player.IsInGame()) - { - Hacks.Misc.FlashlightColor(flashlight_color_input); - } - } - } - - private static void EntitiesTab() - { - //draw entities - - if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 70, 130, 30), "TP items to you")) - { - Hacks.Misc.TPItems(); - MelonLogger.Msg("TP Items!"); - Hacks.Misc.ShowMessageBox("TP Items!"); - } - - if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 110, 130, 30), "Freeze azazel")) - { - Hacks.Misc.FreezeAzazel(); - } - - GUI.Label(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 150, 120, 30), "Azazel & Demons"); - - // azazel - - if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 180, 60, 25), "Sam") && Player.IsInGameOrLobby() && BoltNetwork.IsServer) - { - Hacks.Misc.SpawnAzazel((PrefabId)BoltPrefabs.AzazelSam); - } - - if (GUI.Button(new Rect(Settings.Settings.x + 80, Settings.Settings.y + 180, 60, 25), "Molly") && Player.IsInGameOrLobby() && BoltNetwork.IsServer) - { - Hacks.Misc.SpawnAzazel((PrefabId)BoltPrefabs.SurvivalAzazelMolly); - } - - if (GUI.Button(new Rect(Settings.Settings.x + 150, Settings.Settings.y + 180, 60, 25), "Anna") && Player.IsInGameOrLobby() && BoltNetwork.IsServer) - { - BoltNetwork.Instantiate(BoltPrefabs.SurvivalAnnaNew, Player.GetPlayer().transform.position, Quaternion.identity); - } - - if (GUI.Button(new Rect(Settings.Settings.x + 220, Settings.Settings.y + 180, 60, 25), "Zara") && Player.IsInGameOrLobby() && BoltNetwork.IsServer) - { - BoltNetwork.Instantiate(BoltPrefabs.AzazelZara, Player.GetPlayer().transform.position, Quaternion.identity); - } - - if (GUI.Button(new Rect(Settings.Settings.x + 290, Settings.Settings.y + 180, 60, 25), "Nathan") && Player.IsInGameOrLobby() && BoltNetwork.IsServer) - { - BoltNetwork.Instantiate(BoltPrefabs.AzazelNathan, Player.GetPlayer().transform.position, Quaternion.identity); - } - - if (GUI.Button(new Rect(Settings.Settings.x + 360, Settings.Settings.y + 180, 60, 25), "April") && Player.IsInGameOrLobby() && BoltNetwork.IsServer) - { - BoltNetwork.Instantiate(BoltPrefabs.AzazelApril, Player.GetPlayer().transform.position, Quaternion.identity); - } - - // demon - - if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 220, 60, 25), "Ghost") && Player.IsInGameOrLobby() && BoltNetwork.IsServer) - { - BoltNetwork.Instantiate(BoltPrefabs.Ghost, Player.GetPlayer().transform.position, Quaternion.identity); - } - - if (GUI.Button(new Rect(Settings.Settings.x + 80, Settings.Settings.y + 220, 60, 25), "Inmate") && Player.IsInGameOrLobby() && BoltNetwork.IsServer) - { - BoltNetwork.Instantiate(BoltPrefabs.SurvivalInmate, Player.GetPlayer().transform.position, Quaternion.identity); - } - - if (GUI.Button(new Rect(Settings.Settings.x + 150, Settings.Settings.y + 220, 60, 25), "Demon") && Player.IsInGameOrLobby() && BoltNetwork.IsServer) - { - BoltNetwork.Instantiate(BoltPrefabs.SurvivalDemon, Player.GetPlayer().transform.position, Quaternion.identity); - } - - if (GUI.Button(new Rect(Settings.Settings.x + 220, Settings.Settings.y + 220, 60, 25), "Boar") && Player.IsInGameOrLobby() && BoltNetwork.IsServer) - { - BoltNetwork.Instantiate(BoltPrefabs.Boar, Player.GetPlayer().transform.position, Quaternion.identity); - } - - if (GUI.Button(new Rect(Settings.Settings.x + 290, Settings.Settings.y + 220, 60, 25), "Corpse") && BoltNetwork.IsServer && Player.IsInGameOrLobby()) - { - BoltNetwork.Instantiate(BoltPrefabs.Corpse, Player.GetPlayer().transform.position, Quaternion.identity); - } - - if (GUI.Button(new Rect(Settings.Settings.x + 360, Settings.Settings.y + 220, 60, 25), "Crow") && BoltNetwork.IsServer && Player.IsInGameOrLobby()) - { - BoltNetwork.Instantiate(BoltPrefabs.Crow, Player.GetPlayer().transform.position, Quaternion.identity); - } - - if (GUI.Button(new Rect(Settings.Settings.x + 430, Settings.Settings.y + 220, 60, 25), "Lump") && BoltNetwork.IsServer && Player.IsInGameOrLobby()) - { - BoltNetwork.Instantiate(BoltPrefabs.ManorLump, Player.GetPlayer().transform.position, Quaternion.identity); - } - - // Animal - - if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 260, 60, 25), "Rat")) - { - if (BoltNetwork.IsServer && !Player.IsInGame()) - { - BoltNetwork.Instantiate(BoltPrefabs.SurvivalRat, Player.GetPlayer().transform.position, Quaternion.identity); - } - - if (Player.IsInGame() && !Player.IsPlayerCrawling()) - { - Hacks.Misc.CarryObject("SurvivalRat"); - } - } - - if (GUI.Button(new Rect(Settings.Settings.x + 80, Settings.Settings.y + 260, 60, 25), "Goat")) - { - if (BoltNetwork.IsServer && !Player.IsInGame()) - { - BoltNetwork.Instantiate(BoltPrefabs.SurvivalGoat, Player.GetPlayer().transform.position, Quaternion.identity); - } - - if (Player.IsInGame() && !Player.IsPlayerCrawling()) - { - Hacks.Misc.CarryObject("SurvivalGoat"); - } - } - - if (GUI.Button(new Rect(Settings.Settings.x + 150, Settings.Settings.y + 260, 60, 25), "Spider") && BoltNetwork.IsServer && Player.IsInGameOrLobby()) - { - BoltNetwork.Instantiate(BoltPrefabs.Spider, Player.GetPlayer().transform.position, Quaternion.identity); - } - - if (GUI.Button(new Rect(Settings.Settings.x + 220, Settings.Settings.y + 260, 60, 25), "Pig")) - { - if (BoltNetwork.IsServer && !Player.IsInGame()) - { - BoltNetwork.Instantiate(BoltPrefabs.SurvivalPig, Player.GetPlayer().transform.position, Quaternion.identity); - } - - if (Player.IsInGame() && !Player.IsPlayerCrawling()) - { - Hacks.Misc.CarryObject("SurvivalPig"); - } - } - } - - private static void MapSpecificTab() - { - if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 70, 150, 30), "Instant Win") && Player.IsInGame() && BoltNetwork.IsSinglePlayer) - { - Hacks.Misc.InstantWin(); - MelonLogger.Msg("EZ Win"); - Hacks.Misc.ShowMessageBox("EZ Win"); - } - - if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 110, 150, 30), "Burn a ritual object")) - { - Hacks.Misc.BurnRitualObj(Helpers.Map.GetActiveScene(), false); - } - - if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 150, 150, 30), "Burn all ritual objects")) - { - Hacks.Misc.BurnRitualObj(Helpers.Map.GetActiveScene(), true); - } - - switch (Helpers.Map.GetActiveScene()) - { - case "Menu": - if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 70, 150, 30), "Force Start Game") && BoltNetwork.IsServer && !Player.IsInGame()) - { - Il2CppHorror.Menu menu = UnityEngine.Object.FindObjectOfType(); - menu.OnLobbyStartButtonClick(); - } - break; - - case "Devour": - if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 70, 150, 30), "TP to Azazel")) - { - try - { - Il2Cpp.NolanBehaviour nb = Player.GetPlayer(); - - nb.TeleportTo(Helpers.Map.GetAzazel().transform.position, Quaternion.identity); - } - catch - { - MelonLogger.Msg("Azazel not found !"); - Hacks.Misc.ShowMessageBox("Azazel not found !"); - } - } - - if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 110, 150, 30), "Despawn Demons")) - { - Hacks.Misc.DespawnDemons(); - } - break; - case "Molly": - if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 70, 150, 30), "TP to Azazel")) - { - try - { - Il2Cpp.NolanBehaviour nb = Player.GetPlayer(); - - nb.TeleportTo(Helpers.Map.GetAzazel().transform.position, Quaternion.identity); - } - catch - { - MelonLogger.Msg("Azazel not found !"); - Hacks.Misc.ShowMessageBox("Azazel not found !"); - } - } - - if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 110, 150, 30), "Despawn Inmates")) - { - Hacks.Misc.DespawnDemons(); - } - break; - case "Inn": - if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 70, 150, 30), "TP to Azazel")) - { - try - { - Il2Cpp.NolanBehaviour nb = Player.GetPlayer(); - - nb.TeleportTo(Helpers.Map.GetAzazel().transform.position, Quaternion.identity); - } - catch - { - MelonLogger.Msg("Azazel not found !"); - Hacks.Misc.ShowMessageBox("Azazel not found !"); - } - } - - if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 110, 150, 30), "Clean The Fountains")) - { - Hacks.Misc.CleanFountain(); - } - - if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 150, 150, 30), "Despawn Spiders")) - { - Hacks.Misc.DespawnSpiders(); - } - break; - - case "Town": - if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 70, 150, 30), "TP to Azazel")) - { - try - { - Il2Cpp.NolanBehaviour nb = Player.GetPlayer(); - - nb.TeleportTo(Helpers.Map.GetAzazel().transform.position, Quaternion.identity); - } - catch - { - MelonLogger.Msg("Azazel not found !"); - Hacks.Misc.ShowMessageBox("Azazel not found !"); - } - } - - if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 110, 150, 30), "Despawn Ghosts")) - { - Hacks.Misc.DespawnGhosts(); - } - break; - - case "Slaughterhouse": - if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 70, 150, 30), "TP to Azazel")) - { - try - { - Il2Cpp.NolanBehaviour nb = Player.GetPlayer(); - - nb.TeleportTo(Helpers.Map.GetAzazel().transform.position, Quaternion.identity); - } - catch - { - MelonLogger.Msg("Azazel not found !"); - Hacks.Misc.ShowMessageBox("Azazel not found !"); - } - } - - if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 110, 150, 30), "Despawn Boars")) - { - Hacks.Misc.DespawnBoars(); - } - - if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 150, 150, 30), "Despawn Corpses")) - { - Hacks.Misc.DespawnCorpses(); - } - break; - - case "Manor": - if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 70, 150, 30), "TP to Azazel")) - { - try - { - Il2Cpp.NolanBehaviour nb = Player.GetPlayer(); - - nb.TeleportTo(Helpers.Map.GetAzazel().transform.position, Quaternion.identity); - } - catch - { - MelonLogger.Msg("Azazel not found !"); - Hacks.Misc.ShowMessageBox("Azazel not found !"); - } - } - - if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 110, 150, 30), "Despawn Crows")) - { - Hacks.Misc.DespawnCrows(); - } - - if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 150, 150, 30), "Despawn Lumps")) - { - Hacks.Misc.DespawnLumps(); - } - - if (GUI.Button(new Rect(Settings.Settings.x + 370, Settings.Settings.y + 70, 150, 30), "Switch realm")) - { - Il2Cpp.NolanBehaviour nb = Player.GetPlayer(); - Vector3 pos = nb.transform.position; - - ManorDeadRealmTrigger realm = Il2Cpp.ManorDeadRealmTrigger.FindObjectOfType(); - if (realm == null) - { - MelonLogger.Warning("realm was null."); - Hacks.Misc.ShowMessageBox("realm was null."); - return; - } - - if (realm.IsInDeadRealm) - { - // normal dimension - pos.x += 150f;// -10.216758f; - //pos.y = 0.009999979f; - //pos.z = -7.632657f; - - } - else - { - // other dimension - pos.x -= 150f;//-160.03688f; - //pos.y = 0.010014875f; - //pos.z = -7.5686994f; - } - - nb.locomotion.SetPosition(pos, false); - } - - if (GUI.Button(new Rect(Settings.Settings.x + 370, Settings.Settings.y + 110, 150, 30), "Switch realm (house)")) - { - Il2Cpp.NolanBehaviour nb = Player.GetPlayer(); - Vector3 pos = nb.transform.position; - - ManorDeadRealmTrigger realm = Il2Cpp.ManorDeadRealmTrigger.FindObjectOfType(); - if (realm == null) - { - MelonLogger.Warning("realm was null."); - Hacks.Misc.ShowMessageBox("realm was null."); - return; - } - - if (realm.IsInDeadRealm) - { - // normal dimension - pos.x = -10.216758f; - pos.y = 0.009999979f; - pos.z = -7.632657f; - - } - else - { - // other dimension - pos.x = -160.03688f; - pos.y = 0.010014875f; - pos.z = -7.5686994f; - } - - nb.locomotion.SetPosition(pos, false); - } - - infinite_mirrors = GUI.Toggle(new Rect(Settings.Settings.x + 370, Settings.Settings.y + 150, 150, 20), infinite_mirrors, "Infinite mirrors"); - break; - } - - // load map - GUI.Label(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 210, 100, 30), "Load Map: "); - - if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 240, 100, 30), "Farmhouse") && BoltNetwork.IsServer) - { - Helpers.Map.LoadMap("Devour"); - } - - if (GUI.Button(new Rect(Settings.Settings.x + 120, Settings.Settings.y + 240, 100, 30), "Asylum") && BoltNetwork.IsServer) - { - Helpers.Map.LoadMap("Molly"); - } - - if (GUI.Button(new Rect(Settings.Settings.x + 230, Settings.Settings.y + 240, 100, 30), "Inn") && BoltNetwork.IsServer) - { - Helpers.Map.LoadMap("Inn"); - } - - if (GUI.Button(new Rect(Settings.Settings.x + 340, Settings.Settings.y + 240, 100, 30), "Town") && BoltNetwork.IsServer) - { - Helpers.Map.LoadMap("Town"); - } - - if (GUI.Button(new Rect(Settings.Settings.x + 450, Settings.Settings.y + 240, 100, 30), "Slaughterhouse") && BoltNetwork.IsServer) - { - Helpers.Map.LoadMap("Slaughterhouse"); - } - - if (GUI.Button(new Rect(Settings.Settings.x + 560, Settings.Settings.y + 240, 100, 30), "Manor") && BoltNetwork.IsServer) - { - Helpers.Map.LoadMap("Manor"); - } - - } - - private static void EspTab() - { - player_esp = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 70, 150, 20), player_esp, "Player ESP"); - player_skel_esp = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 100, 150, 20), player_skel_esp, "Skeleton ESP"); - player_snapline = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 130, 150, 20), player_snapline, "Player Snapline"); - if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 160, 130, 30), "Player ESP Color")) - { - player_esp_colorpick = !player_esp_colorpick; - } - - if (player_esp_colorpick) - { - Color player_esp_color_input = GUIHelper.ColorPick("Player ESP Color", Settings.Settings.player_esp_color); - Settings.Settings.player_esp_color = player_esp_color_input; - } - - azazel_esp = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 200, 150, 20), azazel_esp, "Azazel ESP"); - azazel_skel_esp = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 230, 150, 20), azazel_skel_esp, "Skeleton ESP"); - azazel_snapline = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 260, 150, 20), azazel_snapline, "Azazel Snapline"); - if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 290, 130, 30), "Azazel ESP Color")) - { - azazel_esp_colorpick = !azazel_esp_colorpick; - } - - if (azazel_esp_colorpick) - { - Color azazel_esp_color_input = GUIHelper.ColorPick("Azazel ESP Color", Settings.Settings.azazel_esp_color); - Settings.Settings.azazel_esp_color = azazel_esp_color_input; - } - - item_esp = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 330, 150, 20), item_esp, "Item ESP"); - goat_rat_esp = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 360, 150, 20), goat_rat_esp, "Goat/Rat ESP"); - demon_esp = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 390, 150, 20), demon_esp, "Demon ESP"); - } - - private static void ItemsTab() - { - GUILayout.BeginHorizontal(); - - GUILayout.BeginVertical(); - - GUILayout.Label("Items"); - - Settings.Settings.itemsScrollPosition = GUILayout.BeginScrollView(Settings.Settings.itemsScrollPosition, GUILayout.Width(220), GUILayout.Height(190)); - - if (GUILayout.Button("Hay")) - { - if (BoltNetwork.IsServer && !Player.IsInGame()) - { - BoltNetwork.Instantiate(BoltPrefabs.SurvivalHay, Player.GetPlayer().transform.position, Quaternion.identity); - } - else - { - Hacks.Misc.CarryObject("SurvivalHay"); - } - } - - if (GUILayout.Button("First aid")) - { - if (BoltNetwork.IsServer && !Player.IsInGame()) - { - BoltNetwork.Instantiate(BoltPrefabs.SurvivalFirstAid, Player.GetPlayer().transform.position, Quaternion.identity); - } - else - { - Hacks.Misc.CarryObject("SurvivalFirstAid"); - } - } - - if (GUILayout.Button("Battery")) - { - if (BoltNetwork.IsServer && !Player.IsInGame()) - { - BoltNetwork.Instantiate(BoltPrefabs.SurvivalBattery, Player.GetPlayer().transform.position, Quaternion.identity); - } - else - { - Hacks.Misc.CarryObject("SurvivalBattery"); - } - } - - if (GUILayout.Button("Gasoline")) - { - if (BoltNetwork.IsServer && !Player.IsInGame()) - { - BoltNetwork.Instantiate(BoltPrefabs.SurvivalGasoline, Player.GetPlayer().transform.position, Quaternion.identity); - } - else - { - Hacks.Misc.CarryObject("SurvivalGasoline"); - } - } - - if (GUILayout.Button("Fuse")) - { - if (BoltNetwork.IsServer && !Player.IsInGame()) - { - BoltNetwork.Instantiate(BoltPrefabs.SurvivalFuse, Player.GetPlayer().transform.position, Quaternion.identity); - } - else - { - Hacks.Misc.CarryObject("SurvivalFuse"); - } - } - - if (GUILayout.Button("Food")) - { - if (BoltNetwork.IsServer && !Player.IsInGame()) - { - BoltNetwork.Instantiate(BoltPrefabs.SurvivalRottenFood, Player.GetPlayer().transform.position, Quaternion.identity); - } - else - { - Hacks.Misc.CarryObject("SurvivalRottenFood"); - } - } - - if (GUILayout.Button("Bone")) - { - - if (BoltNetwork.IsServer && !Player.IsInGame()) - { - BoltNetwork.Instantiate(BoltPrefabs.SurvivalBone, Player.GetPlayer().transform.position, Quaternion.identity); - } - else - { - Hacks.Misc.CarryObject("SurvivalBone"); - } - } - - if (GUILayout.Button("Bleach")) - { - if (BoltNetwork.IsServer && !Player.IsInGame()) - { - BoltNetwork.Instantiate(BoltPrefabs.SurvivalBleach, Player.GetPlayer().transform.position, Quaternion.identity); - } - else - { - Hacks.Misc.CarryObject("SurvivalBleach"); - } - } - - if (GUILayout.Button("Matchbox")) - { - if (BoltNetwork.IsServer && !Player.IsInGame()) - { - BoltNetwork.Instantiate(BoltPrefabs.SurvivalMatchbox, Player.GetPlayer().transform.position, Quaternion.identity); - } - else - { - Hacks.Misc.CarryObject("Matchbox-3"); - } - } - - if (GUILayout.Button("Shovel")) - { - if (BoltNetwork.IsServer && !Player.IsInGame()) - { - BoltNetwork.Instantiate(BoltPrefabs.SurvivalSpade, Player.GetPlayer().transform.position, Quaternion.identity); - } - else - { - Hacks.Misc.CarryObject("SurvivalSpade"); - } - } - - if (GUILayout.Button("Cake")) - { - if (BoltNetwork.IsServer && !Player.IsInGame()) - { - BoltNetwork.Instantiate(BoltPrefabs.SurvivalCake, Player.GetPlayer().transform.position, Quaternion.identity); - } - else - { - Hacks.Misc.CarryObject("SurvivalCake"); - } - } - - GUILayout.EndScrollView(); - GUILayout.EndVertical(); - - GUILayout.BeginVertical(); - - GUILayout.Label("Ritual Objects"); - - Settings.Settings.rituelObjectsScrollPosition = GUILayout.BeginScrollView(Settings.Settings.rituelObjectsScrollPosition, GUILayout.Width(220), GUILayout.Height(190)); - - if (GUILayout.Button("Egg-1")) - { - Hacks.Misc.CarryObject("Egg-Clean-1"); - } - - if (GUILayout.Button("Egg-2")) - { - Hacks.Misc.CarryObject("Egg-Clean-2"); - } - - if (GUILayout.Button("Egg-3")) - { - Hacks.Misc.CarryObject("Egg-Clean-3"); - } - - if (GUILayout.Button("Egg-4")) - { - Hacks.Misc.CarryObject("Egg-Clean-4"); - } - - if (GUILayout.Button("Egg-5")) - { - Hacks.Misc.CarryObject("Egg-Clean-5"); - } - - if (GUILayout.Button("Egg-6")) - { - Hacks.Misc.CarryObject("Egg-Clean-6"); - } - - if (GUILayout.Button("Egg-7")) - { - Hacks.Misc.CarryObject("Egg-Clean-7"); - } - - if (GUILayout.Button("Egg-8")) - { - Hacks.Misc.CarryObject("Egg-Clean-8"); - } - - if (GUILayout.Button("Egg-9")) - { - Hacks.Misc.CarryObject("Egg-Clean-9"); - } - - if (GUILayout.Button("Egg-10")) - { - Hacks.Misc.CarryObject("Egg-Clean-10"); - } - - if (GUILayout.Button("Ritual Book")) - { - if (BoltNetwork.IsServer && !Player.IsInGame()) - { - BoltNetwork.Instantiate(BoltPrefabs.SurvivalRitualBook, Player.GetPlayer().transform.position, Quaternion.identity); - } - else - { - Hacks.Misc.CarryObject("RitualBook-Active-1"); - } - } - - if (GUILayout.Button("Dirty head")) - { - if (BoltNetwork.IsServer && !Player.IsInGame()) - { - BoltNetwork.Instantiate(BoltPrefabs.SurvivalHead, Player.GetPlayer().transform.position, Quaternion.identity); - } - else - { - Hacks.Misc.CarryObject("SurvivalHead"); - } - } - - if (GUILayout.Button("Clean head")) - { - if (BoltNetwork.IsServer && !Player.IsInGame()) - { - BoltNetwork.Instantiate(BoltPrefabs.SurvivalCleanHead, Player.GetPlayer().transform.position, Quaternion.identity); - } - else - { - Hacks.Misc.CarryObject("SurvivalCleanHead"); - } - } - - GUILayout.EndScrollView(); - GUILayout.EndVertical(); - - GUILayout.BeginVertical(); - - GUILayout.Label("Spawnable Prefabs"); - - Settings.Settings.stuffsScrollPosition = GUILayout.BeginScrollView(Settings.Settings.stuffsScrollPosition, GUILayout.Width(220), GUILayout.Height(190)); - - if (GUILayout.Button("Animal_Gate")) - { - if (BoltNetwork.IsServer) - { - BoltNetwork.Instantiate(BoltPrefabs.Animal_Gate, Player.GetPlayer().transform.position, Quaternion.identity); - } - } - - if (GUILayout.Button("AsylumDoor")) - { - if (BoltNetwork.IsServer) - { - BoltNetwork.Instantiate(BoltPrefabs.AsylumDoor, Player.GetPlayer().transform.position, Quaternion.identity); - } - } - - if (GUILayout.Button("AsylumDoubleDoor")) - { - if (BoltNetwork.IsServer) - { - BoltNetwork.Instantiate(BoltPrefabs.AsylumDoubleDoor, Player.GetPlayer().transform.position, Quaternion.identity); - } - } - - if (GUILayout.Button("AsylumWhiteDoor")) - { - if (BoltNetwork.IsServer) - { - BoltNetwork.Instantiate(BoltPrefabs.AsylumWhiteDoor, Player.GetPlayer().transform.position, Quaternion.identity); - } - } - - - if (GUILayout.Button("DevourDoorBack")) - { - if (BoltNetwork.IsServer) - { - BoltNetwork.Instantiate(BoltPrefabs.DevourDoorBack, Player.GetPlayer().transform.position, Quaternion.identity); - } - } - - if (GUILayout.Button("DevourDoorMain")) - { - if (BoltNetwork.IsServer) - { - BoltNetwork.Instantiate(BoltPrefabs.DevourDoorMain, Player.GetPlayer().transform.position, Quaternion.identity); - } - } - - if (GUILayout.Button("DevourDoorRoom")) - { - if (BoltNetwork.IsServer) - { - BoltNetwork.Instantiate(BoltPrefabs.DevourDoorRoom, Player.GetPlayer().transform.position, Quaternion.identity); - } - } - - if (GUILayout.Button("Elevator_Door")) - { - if (BoltNetwork.IsServer) - { - BoltNetwork.Instantiate(BoltPrefabs.Elevator_Door, Player.GetPlayer().transform.position, Quaternion.identity); - } - } - - if (GUILayout.Button("InnDoor")) - { - if (BoltNetwork.IsServer) - { - BoltNetwork.Instantiate(BoltPrefabs.InnDoor, Player.GetPlayer().transform.position, Quaternion.identity); - } - } - - if (GUILayout.Button("InnDoubleDoor")) - { - if (BoltNetwork.IsServer) - { - BoltNetwork.Instantiate(BoltPrefabs.InnDoubleDoor, Player.GetPlayer().transform.position, Quaternion.identity); - } - } - - if (GUILayout.Button("InnShojiDoor")) - { - if (BoltNetwork.IsServer) - { - BoltNetwork.Instantiate(BoltPrefabs.InnShojiDoor, Player.GetPlayer().transform.position, Quaternion.identity); - } - } - - if (GUILayout.Button("InnShrine")) - { - if (BoltNetwork.IsServer) - { - BoltNetwork.Instantiate(BoltPrefabs.InnShrine, Player.GetPlayer().transform.position, Quaternion.identity); - } - } - - if (GUILayout.Button("InnWardrobe")) - { - if (BoltNetwork.IsServer) - { - BoltNetwork.Instantiate(BoltPrefabs.InnWardrobe, Player.GetPlayer().transform.position, Quaternion.identity); - } - } - - if (GUILayout.Button("InnWoodenDoor")) - { - if (BoltNetwork.IsServer) - { - BoltNetwork.Instantiate(BoltPrefabs.InnWoodenDoor, Player.GetPlayer().transform.position, Quaternion.identity); - } - } - - if (GUILayout.Button("PigExcrement")) - { - if (BoltNetwork.IsServer) - { - BoltNetwork.Instantiate(BoltPrefabs.PigExcrement, Player.GetPlayer().transform.position, Quaternion.identity); - } - } - - if (GUILayout.Button("SlaughterhouseFireEscapeDoor")) - { - if (BoltNetwork.IsServer) - { - BoltNetwork.Instantiate(BoltPrefabs.SlaughterhouseFireEscapeDoor, Player.GetPlayer().transform.position, Quaternion.identity); - } - } - - if (GUILayout.Button("SurvivalAltarMolly")) - { - if (BoltNetwork.IsServer) - { - BoltNetwork.Instantiate(BoltPrefabs.SurvivalAltarMolly, Player.GetPlayer().transform.position, Quaternion.identity); - } - } - - if (GUILayout.Button("SurvivalAltarSlaughterhouse")) - { - if (BoltNetwork.IsServer) - { - BoltNetwork.Instantiate(BoltPrefabs.SurvivalAltarSlaughterhouse, Player.GetPlayer().transform.position, Quaternion.identity); - } - } - - if (GUILayout.Button("SurvivalAltarTown")) - { - if (BoltNetwork.IsServer) - { - BoltNetwork.Instantiate(BoltPrefabs.SurvivalAltarTown, Player.GetPlayer().transform.position, Quaternion.identity); - } - } - - - if (GUILayout.Button("SurvivalCultist")) - { - if (BoltNetwork.IsServer) - { - BoltNetwork.Instantiate(BoltPrefabs.SurvivalCultist, Player.GetPlayer().transform.position, Quaternion.identity); - } - } - - if (GUILayout.Button("SurvivalKai")) - { - if (BoltNetwork.IsServer) - { - BoltNetwork.Instantiate(BoltPrefabs.SurvivalKai, Player.GetPlayer().transform.position, Quaternion.identity); - } - } - - if (GUILayout.Button("SurvivalNathan")) - { - if (BoltNetwork.IsServer) - { - BoltNetwork.Instantiate(BoltPrefabs.SurvivalNathan, Player.GetPlayer().transform.position, Quaternion.identity); - } - } - - if (GUILayout.Button("SurvivalMolly")) - { - if (BoltNetwork.IsServer) - { - BoltNetwork.Instantiate(BoltPrefabs.SurvivalMolly, Player.GetPlayer().transform.position, Quaternion.identity); - } - } - - if (GUILayout.Button("SurvivalApril")) - { - if (BoltNetwork.IsServer) - { - BoltNetwork.Instantiate(BoltPrefabs.SurvivalApril, Player.GetPlayer().transform.position, Quaternion.identity); - } - } - - if (GUILayout.Button("SurvivalFrank")) - { - if (BoltNetwork.IsServer) - { - BoltNetwork.Instantiate(BoltPrefabs.SurvivalFrank, Player.GetPlayer().transform.position, Quaternion.identity); - } - } - - if (GUILayout.Button("SurvivalRose")) - { - if (BoltNetwork.IsServer) - { - BoltNetwork.Instantiate(BoltPrefabs.SurvivalRose, Player.GetPlayer().transform.position, Quaternion.identity); - } - } - - if (GUILayout.Button("SurvivalSmashableWindow")) - { - if (BoltNetwork.IsServer) - { - BoltNetwork.Instantiate(BoltPrefabs.SurvivalSmashableWindow, Player.GetPlayer().transform.position, Quaternion.identity); - } - } - - if (GUILayout.Button("TownDoor")) - { - if (BoltNetwork.IsServer) - { - BoltNetwork.Instantiate(BoltPrefabs.TownDoor, Player.GetPlayer().transform.position, Quaternion.identity); - } - } - - if (GUILayout.Button("TownDoor2")) - { - if (BoltNetwork.IsServer) - { - BoltNetwork.Instantiate(BoltPrefabs.TownDoor2, Player.GetPlayer().transform.position, Quaternion.identity); - } - } - - if (GUILayout.Button("TownPentagram")) - { - if (BoltNetwork.IsServer) - { - BoltNetwork.Instantiate(BoltPrefabs.TownPentagram, Player.GetPlayer().transform.position, Quaternion.identity); - } - } - - if (GUILayout.Button("TrashCan")) - { - if (BoltNetwork.IsServer) - { - BoltNetwork.Instantiate(BoltPrefabs.TrashCan, Player.GetPlayer().transform.position, Quaternion.identity); - } - } - - if (GUILayout.Button("Truck_Shutter")) - { - if (BoltNetwork.IsServer) - { - BoltNetwork.Instantiate(BoltPrefabs.Truck_Shutter, Player.GetPlayer().transform.position, Quaternion.identity); - } - } - - if (GUILayout.Button("TV")) - { - if (BoltNetwork.IsServer) - { - BoltNetwork.Instantiate(BoltPrefabs.TV, Player.GetPlayer().transform.position, Quaternion.identity); - } - } - - if (GUILayout.Button("Mirror")) - { - if (BoltNetwork.IsServer) - { - BoltNetwork.Instantiate(BoltPrefabs.ManorMirror, Player.GetPlayer().transform.position, Quaternion.identity); - } - } - - GUILayout.EndScrollView(); - GUILayout.EndVertical(); - GUILayout.EndHorizontal(); - } - - private static void MiscTab() - { - if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 70, 150, 30), "Unlock Achievements")) - { - Thread AchievementsThread = new Thread(new ThreadStart(Hacks.Unlock.Achievements)); - AchievementsThread.Start(); - - MelonLogger.Msg("Achievements Unlocked!"); - Hacks.Misc.ShowMessageBox("Achievements Unlocked!"); - } - - if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 110, 150, 30), "Unlock Doors")) - { - Hacks.Unlock.Doors(); - - MelonLogger.Msg("Doors Unlocked!"); - Hacks.Misc.ShowMessageBox("Doors Unlocked!"); - } - - if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 150, 150, 30), "TP Keys") && Player.IsInGame()) - { - Hacks.Misc.TPKeys(); - MelonLogger.Msg("Here are your keys!"); - Hacks.Misc.ShowMessageBox("Here are your keys!"); - } - - if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 190, 150, 30), "Make Random Noise")) - { - Hacks.Misc.PlaySound(); - MelonLogger.Msg("Playing a random sound!"); - Hacks.Misc.ShowMessageBox("Playing a random sound!"); - } - - spam_message = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 240, 140, 30), spam_message, "Chat spam"); - if (spam_message) - { - spamMessageText = GUI.TextField(new Rect(Settings.Settings.x + 160, Settings.Settings.y + 240, 200, 30), spamMessageText); - GUI.Label(new Rect(Settings.Settings.x + 370, Settings.Settings.y + 240, 60, 30), "Send Interval(s):"); - spamMessageInterval = GUI.HorizontalSlider(new Rect(Settings.Settings.x + 440, Settings.Settings.y + 240, 100, 30), spamMessageInterval, 1f, 30f); - GUI.Label(new Rect(Settings.Settings.x + 550, Settings.Settings.y + 240, 60, 30), ((int)spamMessageInterval).ToString()); - } - - change_steam_name = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 270, 140, 30), change_steam_name, "Change Steam Name"); - if (change_steam_name) - { - steamNameText = GUI.TextField(new Rect(Settings.Settings.x + 160, Settings.Settings.y + 270, 200, 30), steamNameText); - if (GUI.Button(new Rect(Settings.Settings.x + 370, Settings.Settings.y + 270, 60, 30), "Apply")) - { - Hacks.Misc.SetSteamName(steamNameText); - } - } - - change_server_name = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 300, 140, 30), change_server_name, "Change Server Name"); - if (change_server_name) - { - serverNameText = GUI.TextField(new Rect(Settings.Settings.x + 160, Settings.Settings.y + 300, 200, 30), serverNameText); - if (GUI.Button(new Rect(Settings.Settings.x + 370, Settings.Settings.y + 300, 60, 30), "Apply")) - { - Hacks.Misc.SetServerName(serverNameText); - } - } - - _walkInLobby = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 330, 140, 30), _walkInLobby, "Walk In Lobby"); - _IsAutoRespawn = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 360, 140, 30), _IsAutoRespawn, "Auto Respawn"); - - fly = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 400, 40, 20), fly, "Fly"); - if (GUI.Button(new Rect(Settings.Settings.x + 60, Settings.Settings.y + 400, 40, 20), Settings.Settings.flyKey.ToString())) - { - Settings.Settings.flyKey = Settings.Settings.GetKey(); - } - - fly_speed = GUI.HorizontalSlider(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 430, 100, 10), fly_speed, 5f, 20f); - GUI.Label(new Rect(Settings.Settings.x + 120, Settings.Settings.y + 425, 100, 30), ((int)fly_speed).ToString()); - - - spoofLevel = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 470, 150, 20), spoofLevel, "Spoof Level"); - spoofLevelValue = GUI.HorizontalSlider(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 500, 100, 10), spoofLevelValue, 0f, 666f); - GUI.Label(new Rect(Settings.Settings.x + 120, Settings.Settings.y + 495, 100, 30), ((int)spoofLevelValue).ToString()); - - - exp_modifier = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 540, 150, 20), exp_modifier, "EXP Modifier"); - exp = GUI.HorizontalSlider(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 570, 100, 10), exp, 1000f, 6000f); - GUI.Label(new Rect(Settings.Settings.x + 120, Settings.Settings.y + 565, 100, 30), ((int)exp).ToString()); - - - fastMove = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 610, 150, 20), fastMove, "Player Speed"); - _PlayerSpeedMultiplier = GUI.HorizontalSlider(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 640, 100, 10), _PlayerSpeedMultiplier, (int)1f, (int)10f); - GUI.Label(new Rect(Settings.Settings.x + 120, Settings.Settings.y + 635, 100, 30), ((int)_PlayerSpeedMultiplier).ToString()); - - GUI.Label(new Rect(Settings.Settings.x + 295, Settings.Settings.y + 70, 150, 30), "Max players"); - lobbySize = GUI.HorizontalSlider(new Rect(Settings.Settings.x + 295, Settings.Settings.y + 90, 100, 10), lobbySize, (int)0f, (int)30f); - GUI.Label(new Rect(Settings.Settings.x + 405, Settings.Settings.y + 85, 100, 30), ((int)lobbySize).ToString()); - - if (GUI.Button(new Rect(Settings.Settings.x + 285, Settings.Settings.y + 110, 150, 30), "Create server")) - { - MelonLogger.Msg("Creating the server..."); - Hacks.Misc.ShowMessageBox("Creating the server..."); - Hacks.Misc.CreateCustomizedLobby((int)lobbySize); - MelonLogger.Msg("Done !"); - Hacks.Misc.ShowMessageBox("Done !"); - } - } - - private static void PlayersTab() - { - if (Helpers.Map.GetActiveScene() != "Menu") - { - GUI.Label(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 70, 150, 30), "Player list:"); - int i = 0; - foreach (BasePlayer bp in Entities.Players) - { - if (bp == null || bp.Name == "") - { - MelonLogger.Warning("players is null"); - Hacks.Misc.ShowMessageBox("players is null"); - continue; - } - - GUI.Label(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 110 + i, 150, 30), bp.Name); - - if (GUI.Button(new Rect(Settings.Settings.x + 70, Settings.Settings.y + 105 + i, 60, 30), "Kill")) - { - bp.Kill(); - } - - if (GUI.Button(new Rect(Settings.Settings.x + 140, Settings.Settings.y + 105 + i, 60, 30), "Revive")) - { - bp.Revive(); - } - - if (GUI.Button(new Rect(Settings.Settings.x + 210, Settings.Settings.y + 105 + i, 90, 30), "Jumpscare")) - { - bp.Jumpscare(); - } - - if (GUI.Button(new Rect(Settings.Settings.x + 310, Settings.Settings.y + 105 + i, 60, 30), "TP to")) - { - bp.TP(); - } - - if (GUI.Button(new Rect(Settings.Settings.x + 380, Settings.Settings.y + 105 + i, 100, 30), "Lock in cage")) - { - bp.LockInCage(); - } - - if (GUI.Button(new Rect(Settings.Settings.x + 490, Settings.Settings.y + 105 + i, 90, 30), "TP Azazel")) - { - bp.TPAzazel(); - } - - if (Helpers.Map.GetActiveScene() == "Town") - { - if (GUI.Button(new Rect(Settings.Settings.x + 590, Settings.Settings.y + 105 + i, 90, 30), "Shoot Player")) - { - bp.ShootPlayer(); - } - } - - i += 30; - } - } - else - { - GUI.Label(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 70, 150, 30), "Waiting for the game to start."); - } - } - - } -} From aa0eb090ba91adaf42726f9854363655f23d845d Mon Sep 17 00:00:00 2001 From: manafeng <123635537+mana-feng@users.noreply.github.com> Date: Sun, 8 Jun 2025 03:02:55 +1000 Subject: [PATCH 04/17] Add files via upload --- DevourClient/ClientMain.cs | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/DevourClient/ClientMain.cs b/DevourClient/ClientMain.cs index 2676dbf..01c320e 100644 --- a/DevourClient/ClientMain.cs +++ b/DevourClient/ClientMain.cs @@ -1,4 +1,4 @@ -using DevourClient.Helpers; +using DevourClient.Helpers; using MelonLoader; using System.Threading.Tasks; using Il2CppPhoton.Bolt; @@ -83,13 +83,16 @@ namespace DevourClient crosshairTexture = Helpers.GUIHelper.GetCircularTexture(5, 5); + // Start all coroutines using new coroutine management mechanism Helpers.Entities.StartAllCoroutines(); } public void OnDestroy() { + // Stop all coroutines when component is destroyed Helpers.Entities.StopAllCoroutines(); + // Clean up other resources if (crosshairTexture != null) { UnityEngine.Object.Destroy(crosshairTexture); @@ -99,6 +102,7 @@ namespace DevourClient public void OnApplicationQuit() { + // Stop all coroutines when application quits Helpers.Entities.StopAllCoroutines(); } @@ -255,9 +259,10 @@ namespace DevourClient } } - + // Render error message box if (Settings.Settings.showErrorMessage) { + // Set message box style GUIStyle errorBoxStyle = new GUIStyle(GUI.skin.box); errorBoxStyle.normal.background = GUIHelper.MakeTex(2, 2, new Color(0.8f, 0.2f, 0.2f, 0.9f)); errorBoxStyle.normal.textColor = Color.white; @@ -266,39 +271,43 @@ namespace DevourClient errorBoxStyle.wordWrap = true; errorBoxStyle.clipping = TextClipping.Overflow; - + // Calculate message box position (bottom center) float boxWidth = 400f; float boxHeight = 60f; float boxX = (Screen.width - boxWidth) / 2f; float boxY = Screen.height - boxHeight - 20f; + // Draw message box GUI.Box(new Rect(boxX, boxY, boxWidth, boxHeight), Settings.Settings.errorMessage, errorBoxStyle); } GUI.backgroundColor = Color.grey; - + // Set button style var buttonStyle = new GUIStyle(GUI.skin.button); buttonStyle.normal.background = GUIHelper.MakeTex(2, 2, Color.black); buttonStyle.normal.textColor = Color.white; buttonStyle.border = new RectOffset(2, 2, 2, 2); GUI.skin.button = buttonStyle; + // Set label style var labelStyle = new GUIStyle(GUI.skin.label); labelStyle.normal.textColor = Color.white; labelStyle.border = new RectOffset(2, 2, 2, 2); GUI.skin.label = labelStyle; - + // Set text field style var textFieldStyle = new GUIStyle(GUI.skin.textField); textFieldStyle.normal.textColor = Color.white; textFieldStyle.border = new RectOffset(2, 2, 2, 2); GUI.skin.textField = textFieldStyle; + // Set slider style var sliderStyle = new GUIStyle(GUI.skin.horizontalSlider); sliderStyle.border = new RectOffset(2, 2, 2, 2); GUI.skin.horizontalSlider = sliderStyle; + // Set toggle style var toggleStyle = new GUIStyle(GUI.skin.toggle); toggleStyle.normal.textColor = Color.white; toggleStyle.border = new RectOffset(2, 2, 2, 2); @@ -1703,4 +1712,3 @@ namespace DevourClient } } - From 360aa1061c1e98b6bb0ebe1ffcff27e72f523509 Mon Sep 17 00:00:00 2001 From: manafeng <123635537+mana-feng@users.noreply.github.com> Date: Sun, 8 Jun 2025 03:04:48 +1000 Subject: [PATCH 05/17] Add files via upload --- DevourClient/Hacks/Misc.cs | 1151 +++++++++++++++++----------------- DevourClient/Hacks/Unlock.cs | 4 +- 2 files changed, 577 insertions(+), 578 deletions(-) diff --git a/DevourClient/Hacks/Misc.cs b/DevourClient/Hacks/Misc.cs index 4e8eff1..ae8e681 100644 --- a/DevourClient/Hacks/Misc.cs +++ b/DevourClient/Hacks/Misc.cs @@ -1,575 +1,576 @@ -using UnityEngine; -using MelonLoader; -using UnityEngine.UI; -using System.Reflection; -using System.Runtime.InteropServices; -using DevourClient.Helpers; -using System.Linq; -using System.Collections.Generic; -using Il2CppOpsive.UltimateCharacterController.Character; -using Il2CppPhoton.Bolt; - -namespace DevourClient.Hacks -{ - public class Misc - { - public static void Fly(float speed) //normal speed 5f - { - Il2Cpp.NolanBehaviour nb = Player.GetPlayer(); - Vector3 pos = nb.transform.position; - Il2Cpp.RewiredHelpers helpers = UnityEngine.Object.FindObjectOfType(); - if (Input.GetKey((KeyCode)System.Enum.Parse(typeof(KeyCode), helpers.GetCurrentBinding("Move Up").ToString().Replace(" ", "")))) - { - pos += nb.transform.forward * speed * Time.deltaTime; - } - if (Input.GetKey((KeyCode)System.Enum.Parse(typeof(KeyCode), helpers.GetCurrentBinding("Move Down").ToString().Replace(" ", "")))) - { - pos += -nb.transform.forward * speed * Time.deltaTime; - } - if (Input.GetKey((KeyCode)System.Enum.Parse(typeof(KeyCode), helpers.GetCurrentBinding("Move Right").ToString().Replace(" ", "")))) - { - pos += nb.transform.right * speed * Time.deltaTime; - } - if (Input.GetKey((KeyCode)System.Enum.Parse(typeof(KeyCode), helpers.GetCurrentBinding("Move Left").ToString().Replace(" ", "")))) - { - pos += -nb.transform.right * speed * Time.deltaTime; - } - if (Input.GetKey(KeyCode.Space)) - { - pos += nb.transform.up * speed * Time.deltaTime; - } - if (Input.GetKey(KeyCode.LeftControl)) - { - pos += -nb.transform.up * speed * Time.deltaTime; - } - nb.locomotion.SetPosition(pos, false); - } - - public static void WalkInLobby(bool walk) - { - GameObject LocalPlayer = Helpers.Entities.LocalPlayer_.p_GameObject; - if (LocalPlayer == null) - { - return; - } - - //GetComponent called only once as AddComponent returns a component - UltimateCharacterLocomotionHandler cmp = Helpers.Entities.LocalPlayer_.p_GameObject.GetComponent(); - - if (cmp == null) - { - cmp = LocalPlayer.AddComponent(); - cmp.enabled = false; - } - - cmp.enabled = walk; - } - - public static void BurnRitualObj(string map, bool burnAll) - { - switch (map) - { - case "Inn": - Il2Cpp.InnMapController _innMapController = UnityEngine.Object.FindObjectOfType(); - if (!_innMapController) { - return; - } - - if (burnAll){ - _innMapController.SetProgressTo(10); - } - else{ - _innMapController.IncreaseProgress(); - } - break; - - case "Slaughterhouse": - Il2Cpp.SlaughterhouseAltarController _slaughterhouseAltarController = UnityEngine.Object.FindObjectOfType(); - if (!_slaughterhouseAltarController) { - return; - } - - if (burnAll) - { - _slaughterhouseAltarController.BurnGoat(); - } - else - { - _slaughterhouseAltarController.SkipToGoat(10); - } - break; - - case "Manor": - Il2Cpp.MapController mapc = UnityEngine.Object.FindObjectOfType(); - if (!mapc) - { - return; - } - - if (burnAll) - { - mapc.SetProgressTo(10); - } - else - { - mapc.SetProgressTo(mapc.GetMapProgress() + 1); - } - break; - - default: - Il2Cpp.SurvivalObjectBurnController _altar = UnityEngine.Object.FindObjectOfType(); - if (!_altar) { - return; - } - - if (burnAll) - { - _altar.SkipToGoat(10); - } - else - { - _altar.BurnGoat(); - } - break; - } - } - - public static void SpawnAzazel(PrefabId _azazelPrefabId) - { - if (!Il2CppPhoton.Bolt.BoltNetwork.IsServer) - { - Hacks.Misc.ShowMessageBox("You need to be host to spawn stuff !"); - return; - } - - GameObject _localPlayer = Helpers.Entities.LocalPlayer_.p_GameObject; - - if (_localPlayer != null) - { - Vector3 pos = _localPlayer.transform.position; - - GameObject _azazel; - - _azazel = BoltNetwork.Instantiate(_azazelPrefabId, new Vector3(pos.x, pos.y, pos.z + 1f), Quaternion.identity); - Il2Cpp.SurvivalAzazelBehaviour? azazelBehaviour = _azazel?.GetComponent(); - - if (_azazel != null) - { - if (azazelBehaviour != null) - { - _azazel.gameObject.GetComponent().Spawn(); - } - else - { - MelonLogger.Error("azazelBehaviour is null!"); - } - } - else - { - MelonLogger.Error("azazel is null!"); - } - } - } - - public static void CarryObject(string name) - { - Il2Cpp.NolanBehaviour nb = Helpers.Entities.LocalPlayer_.p_GameObject.GetComponent(); - - nb.StartCarry(name); - } - - public static void CleanFountain() - { - GameObject[] fountains = GameObject.FindGameObjectsWithTag("InnFountain"); - - foreach (GameObject fountain in fountains) - { - fountain.GetComponent().Clean(); - } - } - - public static void AutoRespawn() - { - Il2Cpp.NolanBehaviour nb = Player.GetPlayer(); - - Il2Cpp.SurvivalReviveInteractable _reviveInteractable = UnityEngine.Object.FindObjectOfType(); //probably can't be null - - _reviveInteractable.Interact(nb.gameObject); - } - public static void TPItems() - { - Il2Cpp.NolanBehaviour Nolan = Player.GetPlayer(); - - foreach (Il2Cpp.SurvivalInteractable item in Helpers.Entities.SurvivalInteractables) - { - item.transform.position = Nolan.transform.position + Nolan.transform.forward * UnityEngine.Random.RandomRange(1f, 3f); - } - } - - public static void CreateCustomizedLobby(int lobbySize = 4, bool isPrivate = false, Il2CppUdpKit.Platform.Photon.PhotonRegion.Regions __region = Il2CppUdpKit.Platform.Photon.PhotonRegion.Regions.BEST_REGION) - { - //TODO : make it so we can specify a password for a private lobby - - Il2CppHorror.Menu _menu = UnityEngine.Object.FindObjectOfType(); - - Il2CppUdpKit.Platform.PhotonPlatformConfig __photonPlatformConfig = new Il2CppUdpKit.Platform.PhotonPlatformConfig(); - __photonPlatformConfig.Region = Il2CppUdpKit.Platform.Photon.PhotonRegion.regions[__region]; - - BoltLauncher.SetUdpPlatform(new Il2CppUdpKit.Platform.PhotonPlatform(__photonPlatformConfig)); - - BoltConfig __config = UnityEngine.Object.FindObjectOfType().boltConfig; - Toggle __toggle = _menu.hostPrivateServer; - - __toggle.isOn = isPrivate; - __config.serverConnectionLimit = lobbySize; - - BoltLauncher.StartServer(__config, null); - - _menu.ShowCanvasGroup(_menu.loadingCanvasGroup, true); - _menu.ShowCanvasGroup(_menu.hostCanvasGroup, false); - _menu.ShowCanvasGroup(_menu.mainMenuCanvasGroup, false); - } - - public static void SetSteamName(string name) - { - Il2CppHorror.Menu Menu_ = UnityEngine.Object.FindObjectOfType(); - if (Menu_ == null) - { - return; - } - - Menu_.steamName = name; - } - public static void SetServerName(string name) - { - Il2CppHorror.Menu Menu_ = UnityEngine.Object.FindObjectOfType(); - if (Menu_ == null) - { - return; - } - - Menu_.serverNameText.text = name; - } - - public static void BigFlashlight(bool reset) - { - Il2Cpp.NolanBehaviour Nolan = Player.GetPlayer(); - if (Nolan == null) - { - return; - } - - Light flashlightSpot = Nolan.flashlightSpot; - if (flashlightSpot == null) - { - return; - } - - if (reset) - { - flashlightSpot.intensity = 1.4f; - flashlightSpot.range = 9f; - flashlightSpot.spotAngle = 70f; - } - else - { - flashlightSpot.intensity = 1.1f; - flashlightSpot.range = 200f; - flashlightSpot.spotAngle = 90f; - } - - } - - public static List GetAllBones(Animator a) - { - List Bones = new List - { - a.GetBoneTransform(HumanBodyBones.Head), // 0 - a.GetBoneTransform(HumanBodyBones.Neck), // 1 - a.GetBoneTransform(HumanBodyBones.Spine), // 2 - a.GetBoneTransform(HumanBodyBones.Hips), // 3 - - a.GetBoneTransform(HumanBodyBones.LeftShoulder), // 4 - a.GetBoneTransform(HumanBodyBones.LeftUpperArm), // 5 - a.GetBoneTransform(HumanBodyBones.LeftLowerArm), // 6 - a.GetBoneTransform(HumanBodyBones.LeftHand), // 7 - - a.GetBoneTransform(HumanBodyBones.RightShoulder), // 8 - a.GetBoneTransform(HumanBodyBones.RightUpperArm), // 9 - a.GetBoneTransform(HumanBodyBones.RightLowerArm), // 10 - a.GetBoneTransform(HumanBodyBones.RightHand), // 11 - - a.GetBoneTransform(HumanBodyBones.LeftUpperLeg), // 12 - a.GetBoneTransform(HumanBodyBones.LeftLowerLeg), // 13 - a.GetBoneTransform(HumanBodyBones.LeftFoot), // 14 - - a.GetBoneTransform(HumanBodyBones.RightUpperLeg), // 15 - a.GetBoneTransform(HumanBodyBones.RightLowerLeg), // 16 - a.GetBoneTransform(HumanBodyBones.RightFoot) // 17 - }; - - return Bones; - } - - public static void Fullbright(bool reset) - { - Il2Cpp.NolanBehaviour Nolan = Player.GetPlayer(); - if (Nolan == null) - { - return; - } - - Light flashlightSpot = Nolan.flashlightSpot; - if (flashlightSpot == null) - { - return; - } - - if (reset) - { - flashlightSpot.intensity = 1.4f; - flashlightSpot.range = 9f; - flashlightSpot.spotAngle = 70f; - flashlightSpot.type = LightType.Spot; - flashlightSpot.shadows = LightShadows.Soft; - } - else - { - flashlightSpot.intensity = 1.1f; - flashlightSpot.range = 200f; - flashlightSpot.spotAngle = 179f; - flashlightSpot.type = LightType.Point; - flashlightSpot.shadows = LightShadows.None; - } - - } - public static void FlashlightColor(Color color) - { - Il2Cpp.NolanBehaviour Nolan = Player.GetPlayer(); - Light flashlightSpot = Nolan.flashlightSpot; - - flashlightSpot.color = color; - } - - public static void TPKeys() - { - //TOFIX: spawn manually the missing key in slaughterhouse - Il2Cpp.NolanBehaviour Nolan = Player.GetPlayer(); - - foreach (Il2Cpp.KeyBehaviour keyBehaviour in Helpers.Entities.Keys) - { - if (keyBehaviour == null) - { - return; - } - keyBehaviour.transform.position = Nolan.transform.position + Nolan.transform.forward * 1.5f; - } - } - - public static void SetRank(int rank) - { - Il2Cpp.NolanRankController NolanRank = UnityEngine.Object.FindObjectOfType(); - if (NolanRank == null) - { - return; - } - NolanRank.SetRank(rank); - } - - public static void MessageSpam(string message) - { - //TOFIX : not spamming anymore :/ - if (Helpers.Player.IsInGame()) - { - Il2Cpp.GameUI game_ui_class = UnityEngine.Object.FindObjectOfType(); - - game_ui_class.textChatInput.text = message; - game_ui_class.OnChatMessageSubmit(); - } - else - { - Il2CppHorror.Menu menu_class = UnityEngine.Object.FindObjectOfType(); - menu_class.textChatInput.text = message; - menu_class.OnChatMessageSubmit(); - } - } - - public static void DespawnDemons() - { - foreach (Il2Cpp.SurvivalDemonBehaviour demon in Helpers.Entities.Demons) - { - if (demon != null) - { - demon.Despawn(); - } - } - } - - public static void DespawnSpiders() - { - foreach (Il2Cpp.SpiderBehaviour spider in Helpers.Entities.Spiders) - { - if (spider != null) - { - spider.Despawn(); - } - } - } - - public static void DespawnGhosts() - { - foreach (Il2Cpp.GhostBehaviour ghost in Helpers.Entities.Ghosts) - { - if (ghost != null) - { - ghost.Despawn(); - } - } - } - - public static void DespawnBoars() - { - foreach (Il2Cpp.BoarBehaviour boar in Helpers.Entities.Boars) - { - if (boar != null) - { - boar.Despawn(); - } - } - } - - public static void DespawnCorpses() - { - foreach (Il2Cpp.CorpseBehaviour corpse in Helpers.Entities.Corpses) - { - if (corpse != null) - { - corpse.Despawn(); - } - } - } - - public static void DespawnCrows() - { - foreach (Il2Cpp.CrowBehaviour crow in Helpers.Entities.Crows) - { - if (crow != null) - { - crow.Despawn(); - } - } - } - - public static void DespawnLumps() - { - foreach (Il2Cpp.ManorLumpController lump in Helpers.Entities.Lumps) - { - if (lump != null) - { - lump.Dissolve(); - } - } - } - - public static int ShowMessageBox(string message) - { - //not used, might be useful, some day - Il2CppHorror.Menu menu = UnityEngine.Object.FindObjectOfType(); - if (menu == null) - return 1; - menu.ShowMessageModal(message); - return 0; - } - - public static void PlaySound() - { - Il2Cpp.PlayRandomAudioClip playRandomAudioClip = UnityEngine.Object.FindObjectOfType(); - Il2Cpp.NolanVoiceOvers nolanVoiceOvers = UnityEngine.Object.FindObjectOfType(); - playRandomAudioClip.delay = 0f; - - int num = UnityEngine.Random.RandomRangeInt(0, 10); - switch (num) - { - case 0: - nolanVoiceOvers.yesClips.Play(); - return; - case 1: - nolanVoiceOvers.noClips.Play(); - return; - case 2: - nolanVoiceOvers.beckonClips.Play(); - return; - case 3: - nolanVoiceOvers.showOffClips.Play(); - return; - case 4: - nolanVoiceOvers.screamClips.Play(); - return; - case 5: - nolanVoiceOvers.pickupClips.Play(); - return; - case 6: - nolanVoiceOvers.burnGoatClips.Play(); - return; - case 7: - nolanVoiceOvers.laughClips.Play(); - return; - case 8: - nolanVoiceOvers.PlayMoan(); - return; - case 9: - nolanVoiceOvers.Scream(); - return; - default: - return; - } - } - - public static void FreezeAzazel() - { - if (Helpers.Map.GetActiveScene() == "Menu") - { - return; - } - - if (Helpers.Map.GetAzazel() == null) { - return; - } - - UltimateCharacterLocomotion _azazelLocomotion = Helpers.Map.GetAzazel().GetComponent(); - - if (_azazelLocomotion == null) - { - return; - } - - if (_azazelLocomotion.TimeScale > 0.0f) - { - _azazelLocomotion.TimeScale = 0f; //host only (?) - } - else - { - _azazelLocomotion.TimeScale = 1.0f; - } - } - - public static void InstantWin() - { - Il2Cpp.Survival survival_class = UnityEngine.Object.FindObjectOfType(); - string map_name = Map.GetMapName(Map.GetActiveScene()); - - if (map_name == "Menu") - { - return; - } - - if (map_name == "Farmhouse") - { - survival_class.PlayEnding("Win"); - return; - } - - survival_class.PlayEnding(map_name+"Win"); - } - } -} +using UnityEngine; +using MelonLoader; +using UnityEngine.UI; +using System.Reflection; +using System.Runtime.InteropServices; +using DevourClient.Helpers; +using System.Linq; +using System.Collections.Generic; +using Il2CppOpsive.UltimateCharacterController.Character; +using Il2CppPhoton.Bolt; + +namespace DevourClient.Hacks +{ + public class Misc + { + public static void Fly(float speed) //normal speed 5f + { + Il2Cpp.NolanBehaviour nb = Player.GetPlayer(); + Vector3 pos = nb.transform.position; + Il2Cpp.RewiredHelpers helpers = UnityEngine.Object.FindObjectOfType(); + if (Input.GetKey((KeyCode)System.Enum.Parse(typeof(KeyCode), helpers.GetCurrentBinding("Move Up").ToString().Replace(" ", "")))) + { + pos += nb.transform.forward * speed * Time.deltaTime; + } + if (Input.GetKey((KeyCode)System.Enum.Parse(typeof(KeyCode), helpers.GetCurrentBinding("Move Down").ToString().Replace(" ", "")))) + { + pos += -nb.transform.forward * speed * Time.deltaTime; + } + if (Input.GetKey((KeyCode)System.Enum.Parse(typeof(KeyCode), helpers.GetCurrentBinding("Move Right").ToString().Replace(" ", "")))) + { + pos += nb.transform.right * speed * Time.deltaTime; + } + if (Input.GetKey((KeyCode)System.Enum.Parse(typeof(KeyCode), helpers.GetCurrentBinding("Move Left").ToString().Replace(" ", "")))) + { + pos += -nb.transform.right * speed * Time.deltaTime; + } + if (Input.GetKey(KeyCode.Space)) + { + pos += nb.transform.up * speed * Time.deltaTime; + } + if (Input.GetKey(KeyCode.LeftControl)) + { + pos += -nb.transform.up * speed * Time.deltaTime; + } + nb.locomotion.SetPosition(pos, false); + } + + public static void WalkInLobby(bool walk) + { + GameObject LocalPlayer = Helpers.Entities.LocalPlayer_.p_GameObject; + if (LocalPlayer == null) + { + return; + } + + //GetComponent called only once as AddComponent returns a component + UltimateCharacterLocomotionHandler cmp = Helpers.Entities.LocalPlayer_.p_GameObject.GetComponent(); + + if (cmp == null) + { + cmp = LocalPlayer.AddComponent(); + cmp.enabled = false; + } + + cmp.enabled = walk; + } + + public static void BurnRitualObj(string map, bool burnAll) + { + switch (map) + { + case "Inn": + Il2Cpp.InnMapController _innMapController = UnityEngine.Object.FindObjectOfType(); + if (!_innMapController) { + return; + } + + if (burnAll){ + _innMapController.SetProgressTo(10); + } + else{ + _innMapController.IncreaseProgress(); + } + break; + + case "Slaughterhouse": + Il2Cpp.SlaughterhouseAltarController _slaughterhouseAltarController = UnityEngine.Object.FindObjectOfType(); + if (!_slaughterhouseAltarController) { + return; + } + + if (burnAll) + { + _slaughterhouseAltarController.SkipToGoat(10); + } + else + { + _slaughterhouseAltarController.BurnGoat(); + + } + break; + + case "Manor": + Il2Cpp.MapController mapc = UnityEngine.Object.FindObjectOfType(); + if (!mapc) + { + return; + } + + if (burnAll) + { + mapc.SetProgressTo(10); + } + else + { + mapc.SetProgressTo(mapc.GetMapProgress() + 1); + } + break; + + default: + Il2Cpp.SurvivalObjectBurnController _altar = UnityEngine.Object.FindObjectOfType(); + if (!_altar) { + return; + } + + if (burnAll) + { + _altar.SkipToGoat(10); + } + else + { + _altar.BurnGoat(); + } + break; + } + } + + public static void SpawnAzazel(PrefabId _azazelPrefabId) + { + if (!Il2CppPhoton.Bolt.BoltNetwork.IsServer) + { + Hacks.Misc.ShowMessageBox("You need to be host to spawn stuff !"); + return; + } + + GameObject _localPlayer = Helpers.Entities.LocalPlayer_.p_GameObject; + + if (_localPlayer != null) + { + Vector3 pos = _localPlayer.transform.position; + + GameObject _azazel; + + _azazel = BoltNetwork.Instantiate(_azazelPrefabId, new Vector3(pos.x, pos.y, pos.z + 1f), Quaternion.identity); + Il2Cpp.SurvivalAzazelBehaviour? azazelBehaviour = _azazel?.GetComponent(); + + if (_azazel != null) + { + if (azazelBehaviour != null) + { + _azazel.gameObject.GetComponent().Spawn(); + } + else + { + MelonLogger.Error("azazelBehaviour is null!"); + Hacks.Misc.ShowMessageBox("azazelBehaviour is null!"); + } + } + else + { + MelonLogger.Error("azazel is null!"); + Hacks.Misc.ShowMessageBox("azazel is null!"); + } + } + } + + public static void CarryObject(string name) + { + Il2Cpp.NolanBehaviour nb = Helpers.Entities.LocalPlayer_.p_GameObject.GetComponent(); + + nb.StartCarry(name); + } + + public static void CleanFountain() + { + GameObject[] fountains = GameObject.FindGameObjectsWithTag("InnFountain"); + + foreach (GameObject fountain in fountains) + { + fountain.GetComponent().Clean(); + } + } + + public static void AutoRespawn() + { + Il2Cpp.NolanBehaviour nb = Player.GetPlayer(); + + Il2Cpp.SurvivalReviveInteractable _reviveInteractable = UnityEngine.Object.FindObjectOfType(); //probably can't be null + + _reviveInteractable.Interact(nb.gameObject); + } + public static void TPItems() + { + Il2Cpp.NolanBehaviour Nolan = Player.GetPlayer(); + + foreach (Il2Cpp.SurvivalInteractable item in Helpers.Entities.SurvivalInteractables) + { + item.transform.position = Nolan.transform.position + Nolan.transform.forward * UnityEngine.Random.RandomRange(1f, 3f); + } + } + + public static void CreateCustomizedLobby(int lobbySize = 4, bool isPrivate = false, Il2CppUdpKit.Platform.Photon.PhotonRegion.Regions __region = Il2CppUdpKit.Platform.Photon.PhotonRegion.Regions.BEST_REGION) + { + //TODO : make it so we can specify a password for a private lobby + + Il2CppHorror.Menu _menu = UnityEngine.Object.FindObjectOfType(); + + Il2CppUdpKit.Platform.PhotonPlatformConfig __photonPlatformConfig = new Il2CppUdpKit.Platform.PhotonPlatformConfig(); + __photonPlatformConfig.Region = Il2CppUdpKit.Platform.Photon.PhotonRegion.regions[__region]; + + BoltLauncher.SetUdpPlatform(new Il2CppUdpKit.Platform.PhotonPlatform(__photonPlatformConfig)); + + BoltConfig __config = UnityEngine.Object.FindObjectOfType().boltConfig; + Toggle __toggle = _menu.hostPrivateServer; + + __toggle.isOn = isPrivate; + __config.serverConnectionLimit = lobbySize; + + BoltLauncher.StartServer(__config, null); + + _menu.ShowCanvasGroup(_menu.loadingCanvasGroup, true); + _menu.ShowCanvasGroup(_menu.hostCanvasGroup, false); + _menu.ShowCanvasGroup(_menu.mainMenuCanvasGroup, false); + } + + public static void SetSteamName(string name) + { + Il2CppHorror.Menu Menu_ = UnityEngine.Object.FindObjectOfType(); + if (Menu_ == null) + { + return; + } + + Menu_.steamName = name; + } + public static void SetServerName(string name) + { + Il2CppHorror.Menu Menu_ = UnityEngine.Object.FindObjectOfType(); + if (Menu_ == null) + { + return; + } + + Menu_.serverNameText.text = name; + } + + public static void BigFlashlight(bool reset) + { + Il2Cpp.NolanBehaviour Nolan = Player.GetPlayer(); + if (Nolan == null) + { + return; + } + + Light flashlightSpot = Nolan.flashlightSpot; + if (flashlightSpot == null) + { + return; + } + + if (reset) + { + flashlightSpot.intensity = 1.4f; + flashlightSpot.range = 9f; + flashlightSpot.spotAngle = 70f; + } + else + { + flashlightSpot.intensity = 1.1f; + flashlightSpot.range = 200f; + flashlightSpot.spotAngle = 90f; + } + + } + + public static List GetAllBones(Animator a) + { + List Bones = new List + { + a.GetBoneTransform(HumanBodyBones.Head), // 0 + a.GetBoneTransform(HumanBodyBones.Neck), // 1 + a.GetBoneTransform(HumanBodyBones.Spine), // 2 + a.GetBoneTransform(HumanBodyBones.Hips), // 3 + + a.GetBoneTransform(HumanBodyBones.LeftShoulder), // 4 + a.GetBoneTransform(HumanBodyBones.LeftUpperArm), // 5 + a.GetBoneTransform(HumanBodyBones.LeftLowerArm), // 6 + a.GetBoneTransform(HumanBodyBones.LeftHand), // 7 + + a.GetBoneTransform(HumanBodyBones.RightShoulder), // 8 + a.GetBoneTransform(HumanBodyBones.RightUpperArm), // 9 + a.GetBoneTransform(HumanBodyBones.RightLowerArm), // 10 + a.GetBoneTransform(HumanBodyBones.RightHand), // 11 + + a.GetBoneTransform(HumanBodyBones.LeftUpperLeg), // 12 + a.GetBoneTransform(HumanBodyBones.LeftLowerLeg), // 13 + a.GetBoneTransform(HumanBodyBones.LeftFoot), // 14 + + a.GetBoneTransform(HumanBodyBones.RightUpperLeg), // 15 + a.GetBoneTransform(HumanBodyBones.RightLowerLeg), // 16 + a.GetBoneTransform(HumanBodyBones.RightFoot) // 17 + }; + + return Bones; + } + + public static void Fullbright(bool reset) + { + Il2Cpp.NolanBehaviour Nolan = Player.GetPlayer(); + if (Nolan == null) + { + return; + } + + Light flashlightSpot = Nolan.flashlightSpot; + if (flashlightSpot == null) + { + return; + } + + if (reset) + { + flashlightSpot.intensity = 1.4f; + flashlightSpot.range = 9f; + flashlightSpot.spotAngle = 70f; + flashlightSpot.type = LightType.Spot; + flashlightSpot.shadows = LightShadows.Soft; + } + else + { + flashlightSpot.intensity = 1.1f; + flashlightSpot.range = 200f; + flashlightSpot.spotAngle = 179f; + flashlightSpot.type = LightType.Point; + flashlightSpot.shadows = LightShadows.None; + } + + } + public static void FlashlightColor(Color color) + { + Il2Cpp.NolanBehaviour Nolan = Player.GetPlayer(); + Light flashlightSpot = Nolan.flashlightSpot; + + flashlightSpot.color = color; + } + + public static void TPKeys() + { + //TOFIX: spawn manually the missing key in slaughterhouse + Il2Cpp.NolanBehaviour Nolan = Player.GetPlayer(); + + foreach (Il2Cpp.KeyBehaviour keyBehaviour in Helpers.Entities.Keys) + { + if (keyBehaviour == null) + { + return; + } + keyBehaviour.transform.position = Nolan.transform.position + Nolan.transform.forward * 1.5f; + } + } + + public static void SetRank(int rank) + { + Il2Cpp.NolanRankController NolanRank = UnityEngine.Object.FindObjectOfType(); + if (NolanRank == null) + { + return; + } + NolanRank.SetRank(rank); + } + + public static void MessageSpam(string message) + { + //TOFIX : not spamming anymore :/ + if (Helpers.Player.IsInGame()) + { + Il2Cpp.GameUI game_ui_class = UnityEngine.Object.FindObjectOfType(); + + game_ui_class.textChatInput.text = message; + game_ui_class.OnChatMessageSubmit(); + } + else + { + Il2CppHorror.Menu menu_class = UnityEngine.Object.FindObjectOfType(); + menu_class.textChatInput.text = message; + menu_class.OnChatMessageSubmit(); + } + } + + public static void DespawnDemons() + { + foreach (Il2Cpp.SurvivalDemonBehaviour demon in Helpers.Entities.Demons) + { + if (demon != null) + { + demon.Despawn(); + } + } + } + + public static void DespawnSpiders() + { + foreach (Il2Cpp.SpiderBehaviour spider in Helpers.Entities.Spiders) + { + if (spider != null) + { + spider.Despawn(); + } + } + } + + public static void DespawnGhosts() + { + foreach (Il2Cpp.GhostBehaviour ghost in Helpers.Entities.Ghosts) + { + if (ghost != null) + { + ghost.Despawn(); + } + } + } + + public static void DespawnBoars() + { + foreach (Il2Cpp.BoarBehaviour boar in Helpers.Entities.Boars) + { + if (boar != null) + { + boar.Despawn(); + } + } + } + + public static void DespawnCorpses() + { + foreach (Il2Cpp.CorpseBehaviour corpse in Helpers.Entities.Corpses) + { + if (corpse != null) + { + corpse.Despawn(); + } + } + } + + public static void DespawnCrows() + { + foreach (Il2Cpp.CrowBehaviour crow in Helpers.Entities.Crows) + { + if (crow != null) + { + crow.Despawn(); + } + } + } + + public static void DespawnLumps() + { + foreach (Il2Cpp.ManorLumpController lump in Helpers.Entities.Lumps) + { + if (lump != null) + { + lump.Dissolve(); + } + } + } + + public static int ShowMessageBox(string message) + { + Settings.Settings.errorMessage = message; + Settings.Settings.errorMessageDisplayTime = 0f; + Settings.Settings.showErrorMessage = true; + return 0; + } + + public static void PlaySound() + { + Il2Cpp.PlayRandomAudioClip playRandomAudioClip = UnityEngine.Object.FindObjectOfType(); + Il2Cpp.NolanVoiceOvers nolanVoiceOvers = UnityEngine.Object.FindObjectOfType(); + playRandomAudioClip.delay = 0f; + + int num = UnityEngine.Random.RandomRangeInt(0, 10); + switch (num) + { + case 0: + nolanVoiceOvers.yesClips.Play(); + return; + case 1: + nolanVoiceOvers.noClips.Play(); + return; + case 2: + nolanVoiceOvers.beckonClips.Play(); + return; + case 3: + nolanVoiceOvers.showOffClips.Play(); + return; + case 4: + nolanVoiceOvers.screamClips.Play(); + return; + case 5: + nolanVoiceOvers.pickupClips.Play(); + return; + case 6: + nolanVoiceOvers.burnGoatClips.Play(); + return; + case 7: + nolanVoiceOvers.laughClips.Play(); + return; + case 8: + nolanVoiceOvers.PlayMoan(); + return; + case 9: + nolanVoiceOvers.Scream(); + return; + default: + return; + } + } + + public static void FreezeAzazel() + { + if (Helpers.Map.GetActiveScene() == "Menu") + { + return; + } + + if (Helpers.Map.GetAzazel() == null) { + return; + } + + UltimateCharacterLocomotion _azazelLocomotion = Helpers.Map.GetAzazel().GetComponent(); + + if (_azazelLocomotion == null) + { + return; + } + + if (_azazelLocomotion.TimeScale > 0.0f) + { + _azazelLocomotion.TimeScale = 0f; //host only (?) + } + else + { + _azazelLocomotion.TimeScale = 1.0f; + } + } + + public static void InstantWin() + { + Il2Cpp.Survival survival_class = UnityEngine.Object.FindObjectOfType(); + string map_name = Map.GetMapName(Map.GetActiveScene()); + + if (map_name == "Menu") + { + return; + } + + if (map_name == "Farmhouse") + { + survival_class.PlayEnding("Win"); + return; + } + + survival_class.PlayEnding(map_name+"Win"); + } + } +} diff --git a/DevourClient/Hacks/Unlock.cs b/DevourClient/Hacks/Unlock.cs index 49da7f4..daec655 100644 --- a/DevourClient/Hacks/Unlock.cs +++ b/DevourClient/Hacks/Unlock.cs @@ -22,9 +22,7 @@ namespace DevourClient.Hacks } MelonLoader.MelonLogger.Warning("You need to restart your game for the achievements to be unlocked !!!"); - MelonLoader.MelonLogger.Warning("You need to restart your game for the achievements to be unlocked !!!"); - MelonLoader.MelonLogger.Warning("You need to restart your game for the achievements to be unlocked !!!"); - MelonLoader.MelonLogger.Warning("You need to restart your game for the achievements to be unlocked !!!"); + Hacks.Misc.ShowMessageBox("You need to restart your game for the achievements to be unlocked !!!"); } public static void Doors() From d7597b055fd747627489ffe79367e67e55f04e2e Mon Sep 17 00:00:00 2001 From: manafeng <123635537+mana-feng@users.noreply.github.com> Date: Sun, 8 Jun 2025 03:05:16 +1000 Subject: [PATCH 06/17] Add files via upload --- DevourClient/Helpers/GUIHelper.cs | 129 +++- DevourClient/Helpers/Map.cs | 2 + DevourClient/Helpers/StateHelper.cs | 951 +++++++++++++++++----------- 3 files changed, 687 insertions(+), 395 deletions(-) diff --git a/DevourClient/Helpers/GUIHelper.cs b/DevourClient/Helpers/GUIHelper.cs index 8d4e1aa..c57aefe 100644 --- a/DevourClient/Helpers/GUIHelper.cs +++ b/DevourClient/Helpers/GUIHelper.cs @@ -1,57 +1,143 @@ using UnityEngine; +using MelonLoader; +using System.Collections.Generic; namespace DevourClient.Helpers { - class GUIHelper + public static class GUIHelper // 改为静态类 { + private static Texture2D previewTexture; + private static GUIStyle boxStyle; + + private static Dictionary colorTextureCache = new Dictionary(); + private static Dictionary circularTextureCache = new Dictionary(); + + // 初始化方法 + public static void Initialize() + { + if (previewTexture == null) + { + previewTexture = new Texture2D(1, 1); + boxStyle = new GUIStyle(GUI.skin.box); + } + } + + // 清理方法 + public static void Cleanup() + { + if (previewTexture != null) + { + UnityEngine.Object.Destroy(previewTexture); + previewTexture = null; + } + + foreach (var texture in colorTextureCache.Values) + { + if (texture != null) + { + UnityEngine.Object.Destroy(texture); + } + } + colorTextureCache.Clear(); + + foreach (var texture in circularTextureCache.Values) + { + if (texture != null) + { + UnityEngine.Object.Destroy(texture); + } + } + circularTextureCache.Clear(); + } + private static float R; private static float G; private static float B; public static Color ColorPick(string title, Color color) { - GUI.Label(new Rect(Settings.Settings.x + 195, Settings.Settings.y + 70, 250, 30), title); + Initialize(); // 确保已初始化 - R = GUI.VerticalSlider(new Rect(Settings.Settings.x + 240, Settings.Settings.y + 100, 30, 90), color.r, 0f, 1f); - G = GUI.VerticalSlider(new Rect(Settings.Settings.x + 270, Settings.Settings.y + 100, 30, 90), color.g, 0f, 1f); - B = GUI.VerticalSlider(new Rect(Settings.Settings.x + 300, Settings.Settings.y + 100, 30, 90), color.b, 0f, 1f); - - GUI.Label(new Rect(Settings.Settings.x + 240, Settings.Settings.y + 190, 30, 30), "R"); - GUI.Label(new Rect(Settings.Settings.x + 270, Settings.Settings.y + 190, 30, 30), "G"); - GUI.Label(new Rect(Settings.Settings.x + 300, Settings.Settings.y + 190, 30, 30), "B"); + // 使用 GUILayout 来创建更可靠的滑动条 + GUILayout.BeginArea(new Rect(Settings.Settings.x + 195, Settings.Settings.y + 70, 250, 250)); - color = new Color(R, G, B, 1); + GUILayout.Label(title); + GUILayout.Space(10); - void DrawPreview(Rect position, Color color_to_draw) + // R 通道 + GUILayout.BeginHorizontal(); + GUILayout.Label("R", GUILayout.Width(20)); + R = GUILayout.HorizontalSlider(color.r, 0f, 1f, GUILayout.Width(150)); + GUILayout.Label(((int)(R * 255)).ToString(), GUILayout.Width(30)); + GUILayout.EndHorizontal(); + + // G 通道 + GUILayout.BeginHorizontal(); + GUILayout.Label("G", GUILayout.Width(20)); + G = GUILayout.HorizontalSlider(color.g, 0f, 1f, GUILayout.Width(150)); + GUILayout.Label(((int)(G * 255)).ToString(), GUILayout.Width(30)); + GUILayout.EndHorizontal(); + + // B 通道 + GUILayout.BeginHorizontal(); + GUILayout.Label("B", GUILayout.Width(20)); + B = GUILayout.HorizontalSlider(color.b, 0f, 1f, GUILayout.Width(150)); + GUILayout.Label(((int)(B * 255)).ToString(), GUILayout.Width(30)); + GUILayout.EndHorizontal(); + + GUILayout.Space(10); + + // 颜色预览 + void DrawPreview(Color color_to_draw) { - Texture2D texture = new Texture2D(1, 1); - texture.SetPixel(0, 0, color_to_draw); - texture.Apply(); - GUIStyle boxStyle = new GUIStyle(GUI.skin.box); - boxStyle.normal.background = texture; - GUI.Box(position, GUIContent.none, boxStyle); + if (previewTexture == null) + { + previewTexture = new Texture2D(1, 1); + } + + previewTexture.SetPixel(0, 0, color_to_draw); + previewTexture.Apply(); + boxStyle.normal.background = previewTexture; + GUILayout.Box(GUIContent.none, boxStyle, GUILayout.Height(30)); } - DrawPreview(new Rect(Settings.Settings.x + 195, Settings.Settings.y + 100, 20, 90), color); + DrawPreview(new Color(R, G, B, 1)); + + GUILayout.EndArea(); - return color; + return new Color(R, G, B, 1); } public static Texture2D MakeTex(int width, int height, Color col) { + string cacheKey = $"{width}x{height}_{col.r}_{col.g}_{col.b}"; + + if (colorTextureCache.TryGetValue(col, out Texture2D cachedTexture)) + { + return cachedTexture; + } + + Texture2D result = new Texture2D(width, height); Color[] pix = new Color[width * height]; for (int i = 0; i < pix.Length; ++i) { pix[i] = col; } - Texture2D result = new Texture2D(width, height); result.SetPixels(pix); result.Apply(); + + colorTextureCache[col] = result; return result; } public static Texture2D GetCircularTexture(int width, int height) { + int size = Mathf.Max(width, height); + if (circularTextureCache.TryGetValue(size, out Texture2D cachedTexture)) + { + return cachedTexture; + } + Texture2D texture = new Texture2D(width, height); for (int x = 0; x < texture.width; x++) { @@ -69,7 +155,8 @@ namespace DevourClient.Helpers } texture.Apply(); - + + circularTextureCache[size] = texture; return texture; } } diff --git a/DevourClient/Helpers/Map.cs b/DevourClient/Helpers/Map.cs index 8e5582a..6540006 100644 --- a/DevourClient/Helpers/Map.cs +++ b/DevourClient/Helpers/Map.cs @@ -40,10 +40,12 @@ Il2CppPhoton.Bolt.BoltNetwork.LoadScene(mapName); MelonLoader.MelonLogger.Warning("Please press the button only once, it may take some time for the map to load."); + Hacks.Misc.ShowMessageBox("Please press the button only once, it may take some time for the map to load."); } else { MelonLoader.MelonLogger.Warning("You must be the host to use this command!"); + Hacks.Misc.ShowMessageBox("You must be the host to use this command!"); } } } diff --git a/DevourClient/Helpers/StateHelper.cs b/DevourClient/Helpers/StateHelper.cs index af82bb4..6590536 100644 --- a/DevourClient/Helpers/StateHelper.cs +++ b/DevourClient/Helpers/StateHelper.cs @@ -1,374 +1,577 @@ -using UnityEngine; -using Il2CppOpsive.UltimateCharacterController.Character; -using System.Collections.Generic; -using System.Collections; -using MelonLoader; -using Il2CppPhoton.Bolt; - -namespace DevourClient.Helpers -{ - public class BasePlayer - { - public GameObject p_GameObject { get; set; } = default!; - public string Name { get; set; } = default!; - public string Id { get; set; } = default!; - - public void Kill() - { - if (p_GameObject == null) - { - return; - } - - Il2Cpp.SurvivalAzazelBehaviour sab = Il2Cpp.SurvivalAzazelBehaviour.FindObjectOfType(); - - if (sab == null) - { - return; - } - - sab.OnKnockout(sab.gameObject, p_GameObject); - } - - public void Revive() - { - if (p_GameObject == null) - { - return; - } - - Il2Cpp.NolanBehaviour nb = p_GameObject.GetComponent(); - Il2Cpp.SurvivalReviveInteractable _reviveInteractable = UnityEngine.Object.FindObjectOfType(); - - _reviveInteractable.Interact(nb.gameObject); - } - - public void Jumpscare() - { - if (!BoltNetwork.IsServer) - { - MelonLogger.Msg("You need to be server !"); - return; - } - - if (p_GameObject == null) - { - return; - } - - Il2Cpp.SurvivalAzazelBehaviour sab = Il2Cpp.SurvivalAzazelBehaviour.FindObjectOfType(); - - if (sab == null) - { - return; - } - - sab.OnPickedUpPlayer(sab.gameObject, p_GameObject, false); - - /* - MelonLogger.Msg(Name); - Il2Cpp.JumpScare _jumpscare = UnityEngine.Object.FindObjectOfType(); - _jumpscare.player = p_GameObject; - _jumpscare.Activate(p_GameObject.GetComponent()); - */ - } - - public void LockInCage() - { - if (p_GameObject == null) - { - return; - } - - BoltNetwork.Instantiate(BoltPrefabs.Cage, p_GameObject.transform.position, Quaternion.identity); - } - - public void TP() - { - if (p_GameObject == null) - { - return; - } - - Il2Cpp.NolanBehaviour nb = Player.GetPlayer(); - nb.TeleportTo(p_GameObject.transform.position, Quaternion.identity); - } - - public void TPAzazel() - { - if (p_GameObject == null) - { - return; - } - - UltimateCharacterLocomotion ucl = Helpers.Map.GetAzazel().GetComponent(); - - if (ucl) - { - ucl.SetPosition(p_GameObject.transform.position); - } - else - { - MelonLogger.Error("Azazel not found!"); - return; - } - } - - public void ShootPlayer() - { - if (!BoltNetwork.IsServer) - { - MelonLogger.Msg("You need to be server !"); - return; - } - - if (p_GameObject == null) - { - return; - } - - Il2Cpp.AzazelSamBehaviour _azazelSam = UnityEngine.Object.FindObjectOfType(); - - if (_azazelSam) - { - _azazelSam.OnShootPlayer(p_GameObject, true); - } - } - } - public class Player - { - public static bool IsInGame() - { - Il2Cpp.OptionsHelpers optionsHelpers = UnityEngine.Object.FindObjectOfType(); - return optionsHelpers.inGame; - } - - public static bool IsInGameOrLobby() - { - return GetPlayer() != null; - } - - public static Il2Cpp.NolanBehaviour GetPlayer() - { - if (Entities.LocalPlayer_.p_GameObject == null) - { - return null!; - } - - return Entities.LocalPlayer_.p_GameObject.GetComponent(); - } - - public static bool IsPlayerCrawling() - { - Il2Cpp.NolanBehaviour nb = Player.GetPlayer(); - - if (nb == null) - { - return false; - } - - return nb.IsCrawling(); - } - - } - - public class Entities - { - public static int MAX_PLAYERS = 4; //will change by calling CreateCustomizedLobby - - public static BasePlayer LocalPlayer_ = new BasePlayer(); - public static BasePlayer[] Players = default!; - public static Il2Cpp.GoatBehaviour[] GoatsAndRats = default!; - public static Il2Cpp.SurvivalInteractable[] SurvivalInteractables = default!; - public static Il2Cpp.KeyBehaviour[] Keys = default!; - public static Il2Cpp.SurvivalDemonBehaviour[] Demons = default!; - public static Il2Cpp.SpiderBehaviour[] Spiders = default!; - public static Il2Cpp.GhostBehaviour[] Ghosts = default!; - public static Il2Cpp.SurvivalAzazelBehaviour[] Azazels = default!; - public static Il2Cpp.BoarBehaviour[] Boars = default!; - public static Il2Cpp.CorpseBehaviour[] Corpses = default!; - public static Il2Cpp.CrowBehaviour[] Crows = default!; - public static Il2Cpp.ManorLumpController[] Lumps = default!; - - public static IEnumerator GetLocalPlayer() - { - while (true) - { - GameObject[] currentPlayers = GameObject.FindGameObjectsWithTag("Player"); - - for (int i = 0; i < currentPlayers.Length; i++) - { - if (currentPlayers[i].GetComponent().entity.IsOwner) - { - LocalPlayer_.p_GameObject = currentPlayers[i]; - break; - } - } - - // Wait 5 seconds before caching objects again. - yield return new WaitForSeconds(5f); - } - } - - public static IEnumerator GetAllPlayers() - { - while (true) - { - GameObject[] players = GameObject.FindGameObjectsWithTag("Player"); - Players = new BasePlayer[players.Length]; - - int i = 0; - foreach (GameObject p in players) - { - string player_name = ""; - string player_id = "-1"; - - Il2Cpp.DissonancePlayerTracking dpt = p.gameObject.GetComponent(); - if (dpt != null) - { - player_name = dpt.state.PlayerName; - player_id = dpt.state.PlayerId; - } - - if (Players[i] == null) - { - Players[i] = new BasePlayer(); - } - - Players[i].Id = player_id; - Players[i].Name = player_name; - Players[i].p_GameObject = p; - - i++; - } - - - // Wait 5 seconds before caching objects again. - yield return new WaitForSeconds(5f); - } - } - public static IEnumerator GetGoatsAndRats() - { - while (true) - { - GoatsAndRats = Il2Cpp.GoatBehaviour.FindObjectsOfType(); - - // Wait 5 seconds before caching objects again. - yield return new WaitForSeconds(5f); - } - } - - public static IEnumerator GetSurvivalInteractables() - { - while (true) - { - SurvivalInteractables = Il2Cpp.SurvivalInteractable.FindObjectsOfType(); - - // Wait 5 seconds before caching objects again. - yield return new WaitForSeconds(5f); - } - } - - public static IEnumerator GetKeys() - { - while (true) - { - Keys = Il2Cpp.KeyBehaviour.FindObjectsOfType(); - - // Wait 5 seconds before caching objects again. - yield return new WaitForSeconds(5f); - } - } - - public static IEnumerator GetDemons() - { - while (true) - { - Demons = Il2Cpp.SurvivalDemonBehaviour.FindObjectsOfType(); - - // Wait 5 seconds before caching objects again. - yield return new WaitForSeconds(5f); - } - } - - public static IEnumerator GetSpiders() - { - while (true) - { - Spiders = Il2Cpp.SpiderBehaviour.FindObjectsOfType(); - - // Wait 5 seconds before caching objects again. - yield return new WaitForSeconds(5f); - } - } - - public static IEnumerator GetGhosts() - { - while (true) - { - Ghosts = Il2Cpp.GhostBehaviour.FindObjectsOfType(); - - // Wait 5 seconds before caching objects again. - yield return new WaitForSeconds(5f); - } - } - - public static IEnumerator GetBoars() - { - while (true) - { - Boars = Il2Cpp.BoarBehaviour.FindObjectsOfType(); - - // Wait 5 seconds before caching objects again. - yield return new WaitForSeconds(5f); - } - } - - public static IEnumerator GetCorpses() - { - while (true) - { - Corpses = Il2Cpp.CorpseBehaviour.FindObjectsOfType(); - - // Wait 5 seconds before caching objects again. - yield return new WaitForSeconds(5f); - } - } - - public static IEnumerator GetCrows() - { - while (true) - { - Crows = Il2Cpp.CrowBehaviour.FindObjectsOfType(); - - // Wait 5 seconds before caching objects again. - yield return new WaitForSeconds(5f); - } - } - - public static IEnumerator GetLumps() - { - while (true) - { - Lumps = Il2Cpp.ManorLumpController.FindObjectsOfType(); - - // Wait 5 seconds before caching objects again. - yield return new WaitForSeconds(5f); - } - } - - public static IEnumerator GetAzazels() - { - /* - * ikr AzazelS, because in case we spawn multiple we want the esp to render all of them - */ - while (true) - { - Azazels = Il2Cpp.SurvivalAzazelBehaviour.FindObjectsOfType(); - - // Wait 5 seconds before caching objects again. - yield return new WaitForSeconds(5f); - } - } - } -} +using UnityEngine; +using Il2CppOpsive.UltimateCharacterController.Character; +using System.Collections.Generic; +using System.Collections; +using MelonLoader; +using Il2CppPhoton.Bolt; + +namespace DevourClient.Helpers +{ + public class BasePlayer + { + public GameObject p_GameObject { get; set; } = default!; + public string Name { get; set; } = default!; + public string Id { get; set; } = default!; + + public void Kill() + { + if (p_GameObject == null) + { + return; + } + + Il2Cpp.SurvivalAzazelBehaviour sab = Il2Cpp.SurvivalAzazelBehaviour.FindObjectOfType(); + + if (sab == null) + { + return; + } + + sab.OnKnockout(sab.gameObject, p_GameObject); + } + + public void Revive() + { + if (p_GameObject == null) + { + return; + } + + Il2Cpp.NolanBehaviour nb = p_GameObject.GetComponent(); + Il2Cpp.SurvivalReviveInteractable _reviveInteractable = UnityEngine.Object.FindObjectOfType(); + + _reviveInteractable.Interact(nb.gameObject); + } + + public void Jumpscare() + { + if (!BoltNetwork.IsServer) + { + MelonLogger.Msg("You need to be server !"); + Hacks.Misc.ShowMessageBox("You need to be server !"); + return; + } + + if (p_GameObject == null) + { + return; + } + + Il2Cpp.SurvivalAzazelBehaviour sab = Il2Cpp.SurvivalAzazelBehaviour.FindObjectOfType(); + + if (sab == null) + { + return; + } + + sab.OnPickedUpPlayer(sab.gameObject, p_GameObject, false); + + MelonLogger.Msg(Name); + Hacks.Misc.ShowMessageBox(Name); + + /* + MelonLogger.Msg(Name); + Il2Cpp.JumpScare _jumpscare = UnityEngine.Object.FindObjectOfType(); + _jumpscare.player = p_GameObject; + _jumpscare.Activate(p_GameObject.GetComponent()); + */ + } + + public void LockInCage() + { + if (p_GameObject == null) + { + return; + } + + BoltNetwork.Instantiate(BoltPrefabs.Cage, p_GameObject.transform.position, Quaternion.identity); + } + + public void TP() + { + if (p_GameObject == null) + { + return; + } + + Il2Cpp.NolanBehaviour nb = Player.GetPlayer(); + nb.TeleportTo(p_GameObject.transform.position, Quaternion.identity); + } + + public void TPAzazel() + { + if (p_GameObject == null) + { + return; + } + + UltimateCharacterLocomotion ucl = Helpers.Map.GetAzazel().GetComponent(); + + if (ucl) + { + ucl.SetPosition(p_GameObject.transform.position); + } + else + { + MelonLogger.Error("Azazel not found!"); + Hacks.Misc.ShowMessageBox("Azazel not found!"); + return; + } + } + + public void ShootPlayer() + { + if (!BoltNetwork.IsServer) + { + MelonLogger.Msg("You need to be server !"); + Hacks.Misc.ShowMessageBox("You need to be server !"); + return; + } + + if (p_GameObject == null) + { + return; + } + + Il2Cpp.AzazelSamBehaviour _azazelSam = UnityEngine.Object.FindObjectOfType(); + + if (_azazelSam) + { + _azazelSam.OnShootPlayer(p_GameObject, true); + } + } + } + public class Player + { + public static bool IsInGame() + { + Il2Cpp.OptionsHelpers optionsHelpers = UnityEngine.Object.FindObjectOfType(); + return optionsHelpers.inGame; + } + + public static bool IsInGameOrLobby() + { + return GetPlayer() != null; + } + + public static Il2Cpp.NolanBehaviour GetPlayer() + { + if (Entities.LocalPlayer_.p_GameObject == null) + { + return null!; + } + + return Entities.LocalPlayer_.p_GameObject.GetComponent(); + } + + public static bool IsPlayerCrawling() + { + Il2Cpp.NolanBehaviour nb = Player.GetPlayer(); + + if (nb == null) + { + return false; + } + + return nb.IsCrawling(); + } + + } + + public class Entities + { + private static bool isRunning = true; // Control coroutine running state + private static List activeCoroutines = new List(); // Track active coroutines + + public static int MAX_PLAYERS = 4; //will change by calling CreateCustomizedLobby + + public static BasePlayer LocalPlayer_ = new BasePlayer(); + public static BasePlayer[] Players = default!; + public static Il2Cpp.GoatBehaviour[] GoatsAndRats = default!; + public static Il2Cpp.SurvivalInteractable[] SurvivalInteractables = default!; + public static Il2Cpp.KeyBehaviour[] Keys = default!; + public static Il2Cpp.SurvivalDemonBehaviour[] Demons = default!; + public static Il2Cpp.SpiderBehaviour[] Spiders = default!; + public static Il2Cpp.GhostBehaviour[] Ghosts = default!; + public static Il2Cpp.SurvivalAzazelBehaviour[] Azazels = default!; + public static Il2Cpp.BoarBehaviour[] Boars = default!; + public static Il2Cpp.CorpseBehaviour[] Corpses = default!; + public static Il2Cpp.CrowBehaviour[] Crows = default!; + public static Il2Cpp.ManorLumpController[] Lumps = default!; + + // Method to stop all coroutines + public static void StopAllCoroutines() + { + isRunning = false; + foreach (var coroutine in activeCoroutines) + { + if (coroutine != null) + { + MelonCoroutines.Stop(coroutine); + } + } + activeCoroutines.Clear(); + + // Clean up all cached objects + CleanupCachedObjects(); + } + + // Clean up cached objects + private static void CleanupCachedObjects() + { + if (Players != null) + { + foreach (var player in Players) + { + if (player != null) + { + player.p_GameObject = null; + } + } + Players = null; + } + + LocalPlayer_.p_GameObject = null; + GoatsAndRats = null; + SurvivalInteractables = null; + Keys = null; + Demons = null; + Spiders = null; + Ghosts = null; + Azazels = null; + Boars = null; + Corpses = null; + Crows = null; + Lumps = null; + } + + // Method to start all coroutines + public static void StartAllCoroutines() + { + isRunning = true; + activeCoroutines.Clear(); + + // Start all coroutines and save references + activeCoroutines.Add(MelonCoroutines.Start(GetLocalPlayer())); + activeCoroutines.Add(MelonCoroutines.Start(GetAllPlayers())); + activeCoroutines.Add(MelonCoroutines.Start(GetGoatsAndRats())); + activeCoroutines.Add(MelonCoroutines.Start(GetSurvivalInteractables())); + activeCoroutines.Add(MelonCoroutines.Start(GetKeys())); + activeCoroutines.Add(MelonCoroutines.Start(GetDemons())); + activeCoroutines.Add(MelonCoroutines.Start(GetSpiders())); + activeCoroutines.Add(MelonCoroutines.Start(GetGhosts())); + activeCoroutines.Add(MelonCoroutines.Start(GetBoars())); + activeCoroutines.Add(MelonCoroutines.Start(GetCorpses())); + activeCoroutines.Add(MelonCoroutines.Start(GetCrows())); + activeCoroutines.Add(MelonCoroutines.Start(GetLumps())); + activeCoroutines.Add(MelonCoroutines.Start(GetAzazels())); + } + + public static IEnumerator GetLocalPlayer() + { + while (isRunning) + { + try + { + GameObject[] currentPlayers = GameObject.FindGameObjectsWithTag("Player"); + if (currentPlayers != null) + { + for (int i = 0; i < currentPlayers.Length; i++) + { + if (currentPlayers[i].GetComponent().entity.IsOwner) + { + // Clean up old references before updating + if (LocalPlayer_.p_GameObject != currentPlayers[i]) + { + LocalPlayer_.p_GameObject = currentPlayers[i]; + } + break; + } + } + } + } + catch (System.Exception e) + { + string err = $"GetLocalPlayer coroutine encountered an error: {e.Message}"; + MelonLogger.Error(err); + DevourClient.Settings.Settings.errorMessage = err; + DevourClient.Settings.Settings.showErrorMessage = true; + } + + yield return new WaitForSeconds(5f); + } + } + + public static IEnumerator GetAllPlayers() + { + while (isRunning) + { + try + { + GameObject[] players = GameObject.FindGameObjectsWithTag("Player"); + + // Clean up old array before creating new one + if (Players != null) + { + foreach (var player in Players) + { + if (player != null) + { + player.p_GameObject = null; + } + } + } + + // Create new array + Players = new BasePlayer[players.Length]; + + for (int i = 0; i < players.Length; i++) + { + if (Players[i] == null) + { + Players[i] = new BasePlayer(); + } + + Players[i].p_GameObject = players[i]; + + Il2Cpp.DissonancePlayerTracking dpt = players[i].GetComponent(); + if (dpt != null) + { + Players[i].Name = dpt.state.PlayerName; + Players[i].Id = dpt.state.PlayerId; + } + } + } + catch (System.Exception e) + { + string err = $"GetAllPlayers coroutine encountered an error: {e.Message}"; + MelonLogger.Error(err); + DevourClient.Settings.Settings.errorMessage = err; + DevourClient.Settings.Settings.showErrorMessage = true; + } + + yield return new WaitForSeconds(5f); + } + } + + public static IEnumerator GetGoatsAndRats() + { + while (isRunning) + { + try + { + GoatsAndRats = Il2Cpp.GoatBehaviour.FindObjectsOfType(); + } + catch (System.Exception e) + { + string err = $"GetGoatsAndRats coroutine encountered an error: {e.Message}"; + MelonLogger.Error(err); + DevourClient.Settings.Settings.errorMessage = err; + DevourClient.Settings.Settings.showErrorMessage = true; + } + + yield return new WaitForSeconds(5f); + } + } + + public static IEnumerator GetSurvivalInteractables() + { + while (isRunning) + { + try + { + SurvivalInteractables = Il2Cpp.SurvivalInteractable.FindObjectsOfType(); + } + catch (System.Exception e) + { + string err = $"GetSurvivalInteractables coroutine encountered an error: {e.Message}"; + MelonLogger.Error(err); + DevourClient.Settings.Settings.errorMessage = err; + DevourClient.Settings.Settings.showErrorMessage = true; + } + + yield return new WaitForSeconds(5f); + } + } + + public static IEnumerator GetKeys() + { + while (isRunning) + { + try + { + Keys = Il2Cpp.KeyBehaviour.FindObjectsOfType(); + } + catch (System.Exception e) + { + string err = $"GetKeys coroutine encountered an error: {e.Message}"; + MelonLogger.Error(err); + DevourClient.Settings.Settings.errorMessage = err; + DevourClient.Settings.Settings.showErrorMessage = true; + } + + yield return new WaitForSeconds(5f); + } + } + + public static IEnumerator GetDemons() + { + while (isRunning) + { + try + { + Demons = Il2Cpp.SurvivalDemonBehaviour.FindObjectsOfType(); + } + catch (System.Exception e) + { + string err = $"GetDemons coroutine encountered an error: {e.Message}"; + MelonLogger.Error(err); + DevourClient.Settings.Settings.errorMessage = err; + DevourClient.Settings.Settings.showErrorMessage = true; + } + + yield return new WaitForSeconds(5f); + } + } + + public static IEnumerator GetSpiders() + { + while (isRunning) + { + try + { + Spiders = Il2Cpp.SpiderBehaviour.FindObjectsOfType(); + } + catch (System.Exception e) + { + string err = $"GetSpiders coroutine encountered an error: {e.Message}"; + MelonLogger.Error(err); + DevourClient.Settings.Settings.errorMessage = err; + DevourClient.Settings.Settings.showErrorMessage = true; + } + + yield return new WaitForSeconds(5f); + } + } + + public static IEnumerator GetGhosts() + { + while (isRunning) + { + try + { + Ghosts = Il2Cpp.GhostBehaviour.FindObjectsOfType(); + } + catch (System.Exception e) + { + string err = $"GetGhosts coroutine encountered an error: {e.Message}"; + MelonLogger.Error(err); + DevourClient.Settings.Settings.errorMessage = err; + DevourClient.Settings.Settings.showErrorMessage = true; + } + + yield return new WaitForSeconds(5f); + } + } + + public static IEnumerator GetBoars() + { + while (isRunning) + { + try + { + Boars = Il2Cpp.BoarBehaviour.FindObjectsOfType(); + } + catch (System.Exception e) + { + string err = $"GetBoars coroutine encountered an error: {e.Message}"; + MelonLogger.Error(err); + DevourClient.Settings.Settings.errorMessage = err; + DevourClient.Settings.Settings.showErrorMessage = true; + } + + yield return new WaitForSeconds(5f); + } + } + + public static IEnumerator GetCorpses() + { + while (isRunning) + { + try + { + Corpses = Il2Cpp.CorpseBehaviour.FindObjectsOfType(); + } + catch (System.Exception e) + { + string err = $"GetCorpses coroutine encountered an error: {e.Message}"; + MelonLogger.Error(err); + DevourClient.Settings.Settings.errorMessage = err; + DevourClient.Settings.Settings.showErrorMessage = true; + } + + yield return new WaitForSeconds(5f); + } + } + + public static IEnumerator GetCrows() + { + while (isRunning) + { + try + { + Crows = Il2Cpp.CrowBehaviour.FindObjectsOfType(); + } + catch (System.Exception e) + { + string err = $"GetCrows coroutine encountered an error: {e.Message}"; + MelonLogger.Error(err); + DevourClient.Settings.Settings.errorMessage = err; + DevourClient.Settings.Settings.showErrorMessage = true; + } + + yield return new WaitForSeconds(5f); + } + } + + public static IEnumerator GetLumps() + { + while (isRunning) + { + try + { + Lumps = Il2Cpp.ManorLumpController.FindObjectsOfType(); + } + catch (System.Exception e) + { + string err = $"GetLumps coroutine encountered an error: {e.Message}"; + MelonLogger.Error(err); + DevourClient.Settings.Settings.errorMessage = err; + DevourClient.Settings.Settings.showErrorMessage = true; + } + + yield return new WaitForSeconds(5f); + } + } + + public static IEnumerator GetAzazels() + { + while (isRunning) + { + try + { + Azazels = Il2Cpp.SurvivalAzazelBehaviour.FindObjectsOfType(); + } + catch (System.Exception e) + { + string err = $"Error in GetAzazels coroutine: {e.Message}"; + MelonLogger.Error(err); + DevourClient.Settings.Settings.errorMessage = err; + DevourClient.Settings.Settings.showErrorMessage = true; + } + + yield return new WaitForSeconds(5f); + } + } + } +} From 83ffed3c86fca906564bd3f42d9c74b39839f1f0 Mon Sep 17 00:00:00 2001 From: manafeng <123635537+mana-feng@users.noreply.github.com> Date: Sun, 8 Jun 2025 03:05:49 +1000 Subject: [PATCH 07/17] Add files via upload --- DevourClient/Settings/Settings.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/DevourClient/Settings/Settings.cs b/DevourClient/Settings/Settings.cs index a8dd9b4..f06322a 100644 --- a/DevourClient/Settings/Settings.cs +++ b/DevourClient/Settings/Settings.cs @@ -13,12 +13,18 @@ namespace DevourClient.Settings public static Color player_esp_color = new Color(0.00f, 1.00f, 0.00f, 1); public static Color azazel_esp_color = new Color(1.00f, 0.00f, 0.00f, 1); public static float speed = 1f; - public const string message_to_spam = "Deez Nutz"; + // public const string message_to_spam = " "; public static KeyCode flyKey = KeyCode.None; public static Vector2 itemsScrollPosition = Vector2.zero; public static Vector2 rituelObjectsScrollPosition = Vector2.zero; public static Vector2 stuffsScrollPosition = Vector2.zero; + // Error message box settings + public static bool showErrorMessage = false; + public static string errorMessage = ""; + public static float errorMessageDisplayTime = 0f; + public static float errorMessageMaxDisplayTime = 4f; // Maximum display time for error messages (in seconds) + public static KeyCode GetKey() { Thread.Sleep(50); //TOFIX tried using anyKeydown, no success From 2ce4fea6848868126977b8d69ff38e7377abb568 Mon Sep 17 00:00:00 2001 From: manafeng <123635537+mana-feng@users.noreply.github.com> Date: Sun, 8 Jun 2025 03:06:42 +1000 Subject: [PATCH 08/17] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 8892167..4eb0308 100644 --- a/README.md +++ b/README.md @@ -107,6 +107,7 @@ In order to get all of this working you need to generate the DevourClient.dll fi * `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\UnityEngine.AnimationModule.dll` * `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\UnityEngine.PhysicsModule.dll` * `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\Il2Cppcom.rlabrecque.steamworks.net.dll` +* `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\unity.TextMeshPro. dll` 8. Build the solutions in Release | Any CPU ## Contact From e52f29f702e56219aa7024aacf10740196c4e5fe Mon Sep 17 00:00:00 2001 From: manafeng <123635537+mana-feng@users.noreply.github.com> Date: Sun, 8 Jun 2025 03:19:31 +1000 Subject: [PATCH 09/17] Update README.md --- README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4eb0308..cd8cf8e 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,17 @@ In order to get all of this working you need to generate the DevourClient.dll fi 2. Put the DevourClient.dll file located in `DevourClient\bin\Release\net6.0` inside `C:\Program Files (x86)\Steam\steamapps\common\Devour\Mods` folder. 3. Start the game, now you have successfully installed DevourClient. Use INSERT to open the menu +## Chinese Installation Tutorial +如果你只是想要安装这个插件,直接在游戏里使用的话 +1、安装 .net 6 的运行环境 → (https://dotnet.microsoft.com/en-us/download/dotnet/6.0) +2、安装melonloader → (https://github.com/LavaGang/MelonLoader/releases) + 版本无限制,尽量选择新版即可。打开melonloader页面后,点击devour进入安装界面,全部默认即可,无需勾选或修改其他选项,点击install进行安装(安装过程中可能需要vpn支持) +3、安装dll文件 → 从本项目的release中下载最新的dll文件,然后将此文件添加到你的devour的安装目录中的mods文件夹里(不知道目录的情况下,可以在steam中右键devour,选择“管理”-“浏览本地文件”即可) +4、运行devour → 如果安装成功,你会看到一个windows窗口进行各类安装提示后,自动进入游戏。点击insert键即可打开和关闭devourclient窗口 + +如果你想要对代码进行修改和开发,请按照下面的”building from source“的步骤,逐步进行 + + ## Uninstallation 0. Delete the folders `MelonLoader`, `Mods`, `Plugins`, `UserData`, and the file `version.dll` from `C:\Program Files (x86)\Steam\steamapps\common\Devour` @@ -107,7 +118,7 @@ In order to get all of this working you need to generate the DevourClient.dll fi * `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\UnityEngine.AnimationModule.dll` * `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\UnityEngine.PhysicsModule.dll` * `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\Il2Cppcom.rlabrecque.steamworks.net.dll` -* `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\unity.TextMeshPro. dll` +* `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\unity.TextMeshPro.dll` 8. Build the solutions in Release | Any CPU ## Contact From 9f93c16dc3151d92e61fdb4a594b5b89bf1aeafd Mon Sep 17 00:00:00 2001 From: manafeng <123635537+mana-feng@users.noreply.github.com> Date: Sun, 8 Jun 2025 03:20:24 +1000 Subject: [PATCH 10/17] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index cd8cf8e..feaa50f 100644 --- a/README.md +++ b/README.md @@ -72,10 +72,14 @@ In order to get all of this working you need to generate the DevourClient.dll fi ## Chinese Installation Tutorial 如果你只是想要安装这个插件,直接在游戏里使用的话 + 1、安装 .net 6 的运行环境 → (https://dotnet.microsoft.com/en-us/download/dotnet/6.0) + 2、安装melonloader → (https://github.com/LavaGang/MelonLoader/releases) 版本无限制,尽量选择新版即可。打开melonloader页面后,点击devour进入安装界面,全部默认即可,无需勾选或修改其他选项,点击install进行安装(安装过程中可能需要vpn支持) + 3、安装dll文件 → 从本项目的release中下载最新的dll文件,然后将此文件添加到你的devour的安装目录中的mods文件夹里(不知道目录的情况下,可以在steam中右键devour,选择“管理”-“浏览本地文件”即可) + 4、运行devour → 如果安装成功,你会看到一个windows窗口进行各类安装提示后,自动进入游戏。点击insert键即可打开和关闭devourclient窗口 如果你想要对代码进行修改和开发,请按照下面的”building from source“的步骤,逐步进行 From 7a2815681c1564a63f2a96296d4f5e29f5b9ef16 Mon Sep 17 00:00:00 2001 From: manafeng <123635537+mana-feng@users.noreply.github.com> Date: Sun, 8 Jun 2025 03:20:48 +1000 Subject: [PATCH 11/17] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index feaa50f..dd69a95 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ In order to get all of this working you need to generate the DevourClient.dll fi 1、安装 .net 6 的运行环境 → (https://dotnet.microsoft.com/en-us/download/dotnet/6.0) 2、安装melonloader → (https://github.com/LavaGang/MelonLoader/releases) - 版本无限制,尽量选择新版即可。打开melonloader页面后,点击devour进入安装界面,全部默认即可,无需勾选或修改其他选项,点击install进行安装(安装过程中可能需要vpn支持) + 版本无限制,尽量选择新版即可。打开melonloader页面后,点击devour进入安装界面,全部默认即可,无需勾选或修改其他选项,点击install进行安装(安装过程中可能需要vpn支持) 3、安装dll文件 → 从本项目的release中下载最新的dll文件,然后将此文件添加到你的devour的安装目录中的mods文件夹里(不知道目录的情况下,可以在steam中右键devour,选择“管理”-“浏览本地文件”即可) From b450fa1cbf34d89032c3925595db8b06eb46dfb3 Mon Sep 17 00:00:00 2001 From: manafeng <123635537+mana-feng@users.noreply.github.com> Date: Sun, 8 Jun 2025 03:50:02 +1000 Subject: [PATCH 12/17] Update GUIHelper.cs --- DevourClient/Helpers/GUIHelper.cs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/DevourClient/Helpers/GUIHelper.cs b/DevourClient/Helpers/GUIHelper.cs index c57aefe..51f6e2e 100644 --- a/DevourClient/Helpers/GUIHelper.cs +++ b/DevourClient/Helpers/GUIHelper.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; namespace DevourClient.Helpers { - public static class GUIHelper // 改为静态类 + public static class GUIHelper { private static Texture2D previewTexture; private static GUIStyle boxStyle; @@ -12,7 +12,7 @@ namespace DevourClient.Helpers private static Dictionary colorTextureCache = new Dictionary(); private static Dictionary circularTextureCache = new Dictionary(); - // 初始化方法 + public static void Initialize() { if (previewTexture == null) @@ -22,7 +22,7 @@ namespace DevourClient.Helpers } } - // 清理方法 + public static void Cleanup() { if (previewTexture != null) @@ -56,29 +56,28 @@ namespace DevourClient.Helpers public static Color ColorPick(string title, Color color) { - Initialize(); // 确保已初始化 + Initialize(); - // 使用 GUILayout 来创建更可靠的滑动条 GUILayout.BeginArea(new Rect(Settings.Settings.x + 195, Settings.Settings.y + 70, 250, 250)); GUILayout.Label(title); GUILayout.Space(10); - // R 通道 + GUILayout.BeginHorizontal(); GUILayout.Label("R", GUILayout.Width(20)); R = GUILayout.HorizontalSlider(color.r, 0f, 1f, GUILayout.Width(150)); GUILayout.Label(((int)(R * 255)).ToString(), GUILayout.Width(30)); GUILayout.EndHorizontal(); - // G 通道 + GUILayout.BeginHorizontal(); GUILayout.Label("G", GUILayout.Width(20)); G = GUILayout.HorizontalSlider(color.g, 0f, 1f, GUILayout.Width(150)); GUILayout.Label(((int)(G * 255)).ToString(), GUILayout.Width(30)); GUILayout.EndHorizontal(); - // B 通道 + GUILayout.BeginHorizontal(); GUILayout.Label("B", GUILayout.Width(20)); B = GUILayout.HorizontalSlider(color.b, 0f, 1f, GUILayout.Width(150)); @@ -87,7 +86,7 @@ namespace DevourClient.Helpers GUILayout.Space(10); - // 颜色预览 + void DrawPreview(Color color_to_draw) { if (previewTexture == null) From a5aed348fd6e0df625480218d90a2812a8a7b45c Mon Sep 17 00:00:00 2001 From: manafeng <123635537+mana-feng@users.noreply.github.com> Date: Sun, 8 Jun 2025 03:50:58 +1000 Subject: [PATCH 13/17] Update Settings.cs --- DevourClient/Settings/Settings.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/DevourClient/Settings/Settings.cs b/DevourClient/Settings/Settings.cs index f06322a..c66fe11 100644 --- a/DevourClient/Settings/Settings.cs +++ b/DevourClient/Settings/Settings.cs @@ -13,7 +13,6 @@ namespace DevourClient.Settings public static Color player_esp_color = new Color(0.00f, 1.00f, 0.00f, 1); public static Color azazel_esp_color = new Color(1.00f, 0.00f, 0.00f, 1); public static float speed = 1f; - // public const string message_to_spam = " "; public static KeyCode flyKey = KeyCode.None; public static Vector2 itemsScrollPosition = Vector2.zero; public static Vector2 rituelObjectsScrollPosition = Vector2.zero; From 3c0d57e308b93a8e55c55a3b1571b09bf75c26a0 Mon Sep 17 00:00:00 2001 From: manafeng <123635537+mana-feng@users.noreply.github.com> Date: Sun, 27 Jul 2025 19:24:22 +1000 Subject: [PATCH 14/17] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dd69a95..3930830 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ In order to get all of this working you need to generate the DevourClient.dll fi 2. Put the DevourClient.dll file located in `DevourClient\bin\Release\net6.0` inside `C:\Program Files (x86)\Steam\steamapps\common\Devour\Mods` folder. 3. Start the game, now you have successfully installed DevourClient. Use INSERT to open the menu -## Chinese Installation Tutorial +## 中文安装指南 如果你只是想要安装这个插件,直接在游戏里使用的话 1、安装 .net 6 的运行环境 → (https://dotnet.microsoft.com/en-us/download/dotnet/6.0) From ccffaf352f6d291590da8dacb8e1322a2b6fbdff Mon Sep 17 00:00:00 2001 From: manafeng <123635537+mana-feng@users.noreply.github.com> Date: Sun, 12 Oct 2025 20:34:00 +1100 Subject: [PATCH 15/17] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 3930830..14bf9a4 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,8 @@ In order to get all of this working you need to generate the DevourClient.dll fi 4、运行devour → 如果安装成功,你会看到一个windows窗口进行各类安装提示后,自动进入游戏。点击insert键即可打开和关闭devourclient窗口 +ps:有些电脑在安装melonloader之后,会出现fatal error的提示,这个我目前并没有碰到过。但是出现这个提示的主要原因,基本是melonloader安装过程中,提取到devour根目录的melonloader文件夹里的文件出现了问题,比较简单的解决办法就是(1)在别人的同系统同位宽(x86,x32)的电脑里拷贝出来他的melonloader文件夹,然后直接粘贴到自己的电脑里。(2)将melonloader文件夹完全删除,然后重装。 + 如果你想要对代码进行修改和开发,请按照下面的”building from source“的步骤,逐步进行 @@ -157,3 +159,4 @@ Open an [issue](https://github.com/ALittlePatate/DevourClient/issues/new) or mak ## License [GPL 3.0](https://www.gnu.org/licenses/gpl-3.0.md) + From e01dd26d6f857ccc1293c2f4344117d7f1483a17 Mon Sep 17 00:00:00 2001 From: Hao Feng Date: Mon, 13 Oct 2025 16:05:56 +1100 Subject: [PATCH 16/17] update for "carnival" --- DevourClient/ClientMain.cs | 514 ++++++++++++++++------------ DevourClient/DevourClient.csproj | 74 ++++ DevourClient/Hacks/Misc.cs | 67 ++-- DevourClient/Hacks/Unlock.cs | 4 +- DevourClient/Helpers/GUIHelper.cs | 228 ++++++------ DevourClient/Helpers/Map.cs | 6 +- DevourClient/Helpers/Render.cs | 26 +- DevourClient/Helpers/StateHelper.cs | 426 +++++++++-------------- DevourClient/Settings/Settings.cs | 7 +- 9 files changed, 686 insertions(+), 666 deletions(-) diff --git a/DevourClient/ClientMain.cs b/DevourClient/ClientMain.cs index 01c320e..9bccfcd 100644 --- a/DevourClient/ClientMain.cs +++ b/DevourClient/ClientMain.cs @@ -4,10 +4,13 @@ using System.Threading.Tasks; using Il2CppPhoton.Bolt; using UnityEngine; using Il2Cpp; +using System; +using System.Collections; +using System.Collections.Generic; namespace DevourClient { - public class ClientMain : MonoBehaviour + public class ClientMain : MonoBehaviour, IDisposable { public ClientMain(IntPtr ptr) : base(ptr) @@ -25,7 +28,7 @@ namespace DevourClient Players = 6 } - static Rect windowRect = new Rect(Settings.Settings.x + 10, Settings.Settings.y + 10, 700, 700); + static Rect windowRect = new Rect(Settings.Settings.x + 10, Settings.Settings.y + 10, 800, 750); static CurrentTab current_tab = CurrentTab.Visuals; static bool flashlight_toggle = false; @@ -34,13 +37,12 @@ namespace DevourClient static bool azazel_esp_colorpick = false; static bool spoofLevel = false; static float spoofLevelValue = 0; - static bool change_server_name = false; - static bool change_steam_name = false; + + // UI variables static bool fly = false; static float fly_speed = 5; static bool fastMove = false; static float _PlayerSpeedMultiplier = 1; - public static float lobbySize = 4; public static bool _IsAutoRespawn = false; public static bool unlimitedUV = false; public static bool exp_modifier = false; @@ -53,7 +55,6 @@ namespace DevourClient static bool azazel_esp = false; static bool azazel_skel_esp = false; static bool azazel_snapline = false; - static bool spam_message = false; static bool item_esp = false; static bool goat_rat_esp = false; static bool demon_esp = false; @@ -64,46 +65,40 @@ namespace DevourClient static bool should_show_start_message = true; static Texture2D crosshairTexture = default!; - private static string spamMessageText = "Deez Nutz"; - private static string steamNameText = "patate"; - private static string serverNameText = "patate on top !"; - private static float spamMessageInterval = 5f; // Default send interval in seconds - private static float spamMessageTimer = 0f; // Timer + private static int frameCount = 0; + private static int lastMemoryLog = 0; + private const int GC_GEN0_INTERVAL = 300; + private const int GC_FULL_INTERVAL = 3600; + private const int MEMORY_LOG_INTERVAL = 1800; public void Start() { MelonLogger.Msg("For the Queen !"); - Hacks.Misc.ShowMessageBox("For the Queen !"); MelonLogger.Warning("Made with <3 by patate and Jadis."); - Hacks.Misc.ShowMessageBox("Made with <3 by patate and Jadis."); MelonLogger.Warning("Github : https://github.com/ALittlePatate/DevourClient"); - Hacks.Misc.ShowMessageBox("Github : https://github.com/ALittlePatate/DevourClient"); MelonLogger.Warning("Note : if you payed for this you most likely got scammed."); - Hacks.Misc.ShowMessageBox("Note : if you payed for this you most likely got scammed."); + + long startMemory = GC.GetTotalMemory(false); + MelonLogger.Msg($"[Memory Monitor] Startup managed memory: {startMemory / 1024 / 1024} MB"); crosshairTexture = Helpers.GUIHelper.GetCircularTexture(5, 5); - // Start all coroutines using new coroutine management mechanism Helpers.Entities.StartAllCoroutines(); - } - public void OnDestroy() - { - // Stop all coroutines when component is destroyed - Helpers.Entities.StopAllCoroutines(); - - // Clean up other resources - if (crosshairTexture != null) - { - UnityEngine.Object.Destroy(crosshairTexture); - crosshairTexture = null; - } - } - - public void OnApplicationQuit() - { - // Stop all coroutines when application quits - Helpers.Entities.StopAllCoroutines(); + Helpers.Entities.RegisterCoroutine(MelonCoroutines.Start(Helpers.Entities.GetLocalPlayer())); + Helpers.Entities.RegisterCoroutine(MelonCoroutines.Start(Helpers.Entities.GetGoatsAndRats())); + Helpers.Entities.RegisterCoroutine(MelonCoroutines.Start(Helpers.Entities.GetSurvivalInteractables())); + Helpers.Entities.RegisterCoroutine(MelonCoroutines.Start(Helpers.Entities.GetKeys())); + Helpers.Entities.RegisterCoroutine(MelonCoroutines.Start(Helpers.Entities.GetDemons())); + Helpers.Entities.RegisterCoroutine(MelonCoroutines.Start(Helpers.Entities.GetSpiders())); + Helpers.Entities.RegisterCoroutine(MelonCoroutines.Start(Helpers.Entities.GetGhosts())); + Helpers.Entities.RegisterCoroutine(MelonCoroutines.Start(Helpers.Entities.GetBoars())); + Helpers.Entities.RegisterCoroutine(MelonCoroutines.Start(Helpers.Entities.GetCorpses())); + Helpers.Entities.RegisterCoroutine(MelonCoroutines.Start(Helpers.Entities.GetCrows())); + Helpers.Entities.RegisterCoroutine(MelonCoroutines.Start(Helpers.Entities.GetLumps())); + Helpers.Entities.RegisterCoroutine(MelonCoroutines.Start(Helpers.Entities.GetAzazels())); + Helpers.Entities.RegisterCoroutine(MelonCoroutines.Start(Helpers.Entities.GetAllPlayers())); + Helpers.Entities.RegisterCoroutine(MelonCoroutines.Start(Helpers.Entities.GetMonkeys())); } public void Update() @@ -159,31 +154,13 @@ namespace DevourClient } else { + if (crosshair && in_game_cache) { in_game_cache = false; } } - if (spam_message) - { - spamMessageTimer += Time.deltaTime; - if (spamMessageTimer >= spamMessageInterval) - { - Hacks.Misc.MessageSpam(spamMessageText); - spamMessageTimer = 0f; // Reset timer - } - } - else - { - spamMessageTimer = 0f; // Reset timer when disabled - } - - if (spoofLevel) - { - Hacks.Misc.SetRank((int)spoofLevelValue); - } - if (Input.GetKeyDown(Settings.Settings.flyKey)) { fly = !fly; @@ -237,7 +214,30 @@ namespace DevourClient { Helpers.Entities.LocalPlayer_.p_GameObject.GetComponent().TimeScale = _PlayerSpeedMultiplier; } - catch { return; } + catch { return; } + } + + + frameCount++; + + if (frameCount % GC_GEN0_INTERVAL == 0) + { + GC.Collect(0, GCCollectionMode.Optimized); + } + + if (frameCount % GC_FULL_INTERVAL == 0) + { + GC.Collect(); + GC.WaitForPendingFinalizers(); + GC.Collect(); + frameCount = 0; + } + + if (frameCount - lastMemoryLog >= MEMORY_LOG_INTERVAL) + { + long memoryUsed = GC.GetTotalMemory(false); + MelonLogger.Msg($"[Memory Monitor] Current managed memory: {memoryUsed / 1024 / 1024} MB | Frame: {frameCount}"); + lastMemoryLog = frameCount; } } @@ -249,72 +249,37 @@ namespace DevourClient should_show_start_message = false; } - // Update error message display time - if (Settings.Settings.showErrorMessage) + // 保存原始GUI状态 + Color originalBackgroundColor = GUI.backgroundColor; + GUISkin originalSkin = GUI.skin; + + try { - Settings.Settings.errorMessageDisplayTime += Time.deltaTime; - if (Settings.Settings.errorMessageDisplayTime >= Settings.Settings.errorMessageMaxDisplayTime) - { - Settings.Settings.showErrorMessage = false; - } - } + GUI.backgroundColor = Color.grey; - // Render error message box - if (Settings.Settings.showErrorMessage) - { - // Set message box style - GUIStyle errorBoxStyle = new GUIStyle(GUI.skin.box); - errorBoxStyle.normal.background = GUIHelper.MakeTex(2, 2, new Color(0.8f, 0.2f, 0.2f, 0.9f)); - errorBoxStyle.normal.textColor = Color.white; - errorBoxStyle.fontSize = 14; - errorBoxStyle.padding = new RectOffset(10, 10, 10, 10); - errorBoxStyle.wordWrap = true; - errorBoxStyle.clipping = TextClipping.Overflow; + // 设置按钮样式 + GUI.skin.button.normal.background = GUIHelper.MakeTex(2, 2, Color.black); + GUI.skin.button.normal.textColor = Color.white; + GUI.skin.button.hover.background = GUIHelper.MakeTex(2, 2, Color.green); + GUI.skin.button.hover.textColor = Color.black; - // Calculate message box position (bottom center) - float boxWidth = 400f; - float boxHeight = 60f; - float boxX = (Screen.width - boxWidth) / 2f; - float boxY = Screen.height - boxHeight - 20f; + // 设置切换按钮样式 + GUI.skin.toggle.onNormal.textColor = Color.yellow; - // Draw message box - GUI.Box(new Rect(boxX, boxY, boxWidth, boxHeight), Settings.Settings.errorMessage, errorBoxStyle); - } + // 设置文本框样式 - 这是关键修复 + GUI.skin.textField.normal.background = GUIHelper.MakeTex(2, 2, new Color(0.2f, 0.2f, 0.2f, 0.8f)); + GUI.skin.textField.normal.textColor = Color.white; + GUI.skin.textField.focused.background = GUIHelper.MakeTex(2, 2, new Color(0.3f, 0.3f, 0.3f, 0.9f)); + GUI.skin.textField.focused.textColor = Color.yellow; + GUI.skin.textField.border = new RectOffset(2, 2, 2, 2); - GUI.backgroundColor = Color.grey; + // 设置标签样式 + GUI.skin.label.normal.textColor = Color.white; - // Set button style - var buttonStyle = new GUIStyle(GUI.skin.button); - buttonStyle.normal.background = GUIHelper.MakeTex(2, 2, Color.black); - buttonStyle.normal.textColor = Color.white; - buttonStyle.border = new RectOffset(2, 2, 2, 2); - GUI.skin.button = buttonStyle; + // 设置滑块样式 + GUI.skin.horizontalSlider.normal.background = GUIHelper.MakeTex(2, 2, new Color(0.3f, 0.3f, 0.3f, 0.8f)); + GUI.skin.horizontalSliderThumb.normal.background = GUIHelper.MakeTex(2, 2, Color.white); - // Set label style - var labelStyle = new GUIStyle(GUI.skin.label); - labelStyle.normal.textColor = Color.white; - labelStyle.border = new RectOffset(2, 2, 2, 2); - GUI.skin.label = labelStyle; - - // Set text field style - var textFieldStyle = new GUIStyle(GUI.skin.textField); - textFieldStyle.normal.textColor = Color.white; - textFieldStyle.border = new RectOffset(2, 2, 2, 2); - GUI.skin.textField = textFieldStyle; - - // Set slider style - var sliderStyle = new GUIStyle(GUI.skin.horizontalSlider); - sliderStyle.border = new RectOffset(2, 2, 2, 2); - GUI.skin.horizontalSlider = sliderStyle; - - // Set toggle style - var toggleStyle = new GUIStyle(GUI.skin.toggle); - toggleStyle.normal.textColor = Color.white; - toggleStyle.border = new RectOffset(2, 2, 2, 2); - toggleStyle.onNormal.textColor = Color.yellow; - GUI.skin.toggle = toggleStyle; - - //from https://www.unknowncheats.me/forum/unity/437277-mono-internal-optimisation-tips.html if (UnityEngine.Event.current.type == EventType.Repaint) { if (player_esp || player_snapline || player_skel_esp) @@ -432,6 +397,13 @@ namespace DevourClient Render.Render.DrawNameESP(lump.transform.position, "Lump", new Color(1.0f, 0.0f, 0.0f, 1.0f)); } } + foreach (Il2Cpp.MonkeyBehaviour monkey in Helpers.Entities.Monkeys) + { + if (monkey != null) + { + Render.Render.DrawNameESP(monkey.transform.position, "Monkey", new Color(1.0f, 0.0f, 0.0f, 1.0f)); + } + } } if (azazel_esp || azazel_snapline || azazel_skel_esp) @@ -450,7 +422,7 @@ namespace DevourClient } } - if (crosshair && in_game_cache) //&& !Player.IsPlayerCrawling()) + if (crosshair && in_game_cache) { const float crosshairSize = 4; @@ -466,11 +438,21 @@ namespace DevourClient } } - if (Settings.Settings.menu_enable) //Si on appuie sur INSERT + if (Settings.Settings.menu_enable) { windowRect = GUI.Window(0, windowRect, (GUI.WindowFunction)Tabs, "DevourClient"); } - + } + catch (System.Exception ex) + { + MelonLogger.Msg($"OnGUI Error: {ex.Message}"); + } + finally + { + // 恢复原始GUI状态 + GUI.backgroundColor = originalBackgroundColor; + GUI.skin = originalSkin; + } } public static void Tabs(int windowID) @@ -557,7 +539,7 @@ namespace DevourClient { flashlight_colorpick = !flashlight_colorpick; MelonLogger.Msg("Flashlight color picker : " + flashlight_colorpick.ToString()); - Hacks.Misc.ShowMessageBox("Flashlight color picker : " + flashlight_colorpick.ToString()); + } if (flashlight_colorpick) @@ -580,7 +562,6 @@ namespace DevourClient { Hacks.Misc.TPItems(); MelonLogger.Msg("TP Items!"); - Hacks.Misc.ShowMessageBox("TP Items!"); } if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 110, 130, 30), "Freeze azazel")) @@ -590,8 +571,6 @@ namespace DevourClient GUI.Label(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 150, 120, 30), "Azazel & Demons"); - // azazel - if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 180, 60, 25), "Sam") && Player.IsInGameOrLobby() && BoltNetwork.IsServer) { Hacks.Misc.SpawnAzazel((PrefabId)BoltPrefabs.AzazelSam); @@ -622,7 +601,10 @@ namespace DevourClient BoltNetwork.Instantiate(BoltPrefabs.AzazelApril, Player.GetPlayer().transform.position, Quaternion.identity); } - // demon + if (GUI.Button(new Rect(Settings.Settings.x + 430, Settings.Settings.y + 180, 60, 25), "Kai") && Player.IsInGameOrLobby() && BoltNetwork.IsServer) + { + BoltNetwork.Instantiate(BoltPrefabs.AzazelKai, Player.GetPlayer().transform.position, Quaternion.identity); + } if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 220, 60, 25), "Ghost") && Player.IsInGameOrLobby() && BoltNetwork.IsServer) { @@ -659,7 +641,10 @@ namespace DevourClient BoltNetwork.Instantiate(BoltPrefabs.ManorLump, Player.GetPlayer().transform.position, Quaternion.identity); } - // Animal + if (GUI.Button(new Rect(Settings.Settings.x + 500, Settings.Settings.y + 220, 60, 25), "Monkey") && BoltNetwork.IsServer && Player.IsInGameOrLobby()) + { + BoltNetwork.Instantiate(BoltPrefabs.Monkey, Player.GetPlayer().transform.position, Quaternion.identity); + } if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 260, 60, 25), "Rat")) { @@ -712,7 +697,6 @@ namespace DevourClient { Hacks.Misc.InstantWin(); MelonLogger.Msg("EZ Win"); - Hacks.Misc.ShowMessageBox("EZ Win"); } if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 110, 150, 30), "Burn a ritual object")) @@ -747,7 +731,6 @@ namespace DevourClient catch { MelonLogger.Msg("Azazel not found !"); - Hacks.Misc.ShowMessageBox("Azazel not found !"); } } @@ -768,7 +751,6 @@ namespace DevourClient catch { MelonLogger.Msg("Azazel not found !"); - Hacks.Misc.ShowMessageBox("Azazel not found !"); } } @@ -789,7 +771,6 @@ namespace DevourClient catch { MelonLogger.Msg("Azazel not found !"); - Hacks.Misc.ShowMessageBox("Azazel not found !"); } } @@ -816,7 +797,6 @@ namespace DevourClient catch { MelonLogger.Msg("Azazel not found !"); - Hacks.Misc.ShowMessageBox("Azazel not found !"); } } @@ -838,7 +818,6 @@ namespace DevourClient catch { MelonLogger.Msg("Azazel not found !"); - Hacks.Misc.ShowMessageBox("Azazel not found !"); } } @@ -865,7 +844,6 @@ namespace DevourClient catch { MelonLogger.Msg("Azazel not found !"); - Hacks.Misc.ShowMessageBox("Azazel not found !"); } } @@ -888,7 +866,6 @@ namespace DevourClient if (realm == null) { MelonLogger.Warning("realm was null."); - Hacks.Misc.ShowMessageBox("realm was null."); return; } @@ -920,7 +897,6 @@ namespace DevourClient if (realm == null) { MelonLogger.Warning("realm was null."); - Hacks.Misc.ShowMessageBox("realm was null."); return; } @@ -945,41 +921,66 @@ namespace DevourClient infinite_mirrors = GUI.Toggle(new Rect(Settings.Settings.x + 370, Settings.Settings.y + 150, 150, 20), infinite_mirrors, "Infinite mirrors"); break; + + case "Carnival": + if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 70, 150, 30), "TP to Azazel")) + { + try + { + Il2Cpp.NolanBehaviour nb = Player.GetPlayer(); + + nb.TeleportTo(Helpers.Map.GetAzazel().transform.position, Quaternion.identity); + } + catch + { + MelonLogger.Msg("Azazel not found !"); + } + } + + if (GUI.Button(new Rect(Settings.Settings.x + 190, Settings.Settings.y + 110, 150, 30), "Despawn Monkeys")) + { + Hacks.Misc.DespawnMonkeys(); + } + break; } - // load map GUI.Label(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 210, 100, 30), "Load Map: "); - if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 240, 100, 30), "Farmhouse") && BoltNetwork.IsServer) + if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 240, 90, 30), "Farmhouse") && BoltNetwork.IsServer) { Helpers.Map.LoadMap("Devour"); } - if (GUI.Button(new Rect(Settings.Settings.x + 120, Settings.Settings.y + 240, 100, 30), "Asylum") && BoltNetwork.IsServer) + if (GUI.Button(new Rect(Settings.Settings.x + 110, Settings.Settings.y + 240, 90, 30), "Asylum") && BoltNetwork.IsServer) { Helpers.Map.LoadMap("Molly"); } - if (GUI.Button(new Rect(Settings.Settings.x + 230, Settings.Settings.y + 240, 100, 30), "Inn") && BoltNetwork.IsServer) + if (GUI.Button(new Rect(Settings.Settings.x + 210, Settings.Settings.y + 240, 90, 30), "Inn") && BoltNetwork.IsServer) { Helpers.Map.LoadMap("Inn"); } - if (GUI.Button(new Rect(Settings.Settings.x + 340, Settings.Settings.y + 240, 100, 30), "Town") && BoltNetwork.IsServer) + if (GUI.Button(new Rect(Settings.Settings.x + 310, Settings.Settings.y + 240, 90, 30), "Town") && BoltNetwork.IsServer) { Helpers.Map.LoadMap("Town"); } - if (GUI.Button(new Rect(Settings.Settings.x + 450, Settings.Settings.y + 240, 100, 30), "Slaughterhouse") && BoltNetwork.IsServer) + if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 280, 90, 30), "Slaughterhouse") && BoltNetwork.IsServer) { Helpers.Map.LoadMap("Slaughterhouse"); } - if (GUI.Button(new Rect(Settings.Settings.x + 560, Settings.Settings.y + 240, 100, 30), "Manor") && BoltNetwork.IsServer) + if (GUI.Button(new Rect(Settings.Settings.x + 110, Settings.Settings.y + 280, 90, 30), "Manor") && BoltNetwork.IsServer) { Helpers.Map.LoadMap("Manor"); } + if (GUI.Button(new Rect(Settings.Settings.x + 210, Settings.Settings.y + 280, 90, 30), "Carnival") && BoltNetwork.IsServer) + { + Helpers.Map.LoadMap("Carnival"); + } + } private static void EspTab() @@ -1136,7 +1137,7 @@ namespace DevourClient } } - if (GUILayout.Button("Shovel")) + if (GUILayout.Button("Spade")) { if (BoltNetwork.IsServer && !Player.IsInGame()) { @@ -1159,6 +1160,29 @@ namespace DevourClient Hacks.Misc.CarryObject("SurvivalCake"); } } + if (GUILayout.Button("MusicBox")) + { + if (BoltNetwork.IsServer && !Player.IsInGame()) + { + BoltNetwork.Instantiate(BoltPrefabs.SurvivalMusicBox, Player.GetPlayer().transform.position, Quaternion.identity); + } + else + { + Hacks.Misc.CarryObject("MusicBox-Idle"); + } + } + if (GUILayout.Button("Coin")) + { + if (BoltNetwork.IsServer && !Player.IsInGame()) + { + BoltNetwork.Instantiate(BoltPrefabs.SurvivalCoin, Player.GetPlayer().transform.position, Quaternion.identity); + } + else + { + Hacks.Misc.CarryObject("SurvivalCoin"); + } + } + GUILayout.EndScrollView(); GUILayout.EndVertical(); @@ -1231,29 +1255,40 @@ namespace DevourClient } } - if (GUILayout.Button("Dirty head")) - { - if (BoltNetwork.IsServer && !Player.IsInGame()) - { - BoltNetwork.Instantiate(BoltPrefabs.SurvivalHead, Player.GetPlayer().transform.position, Quaternion.identity); - } - else - { - Hacks.Misc.CarryObject("SurvivalHead"); - } - } + // if (GUILayout.Button("Dirty head")) + // { + // if (BoltNetwork.IsServer && !Player.IsInGame()) + // { + // BoltNetwork.Instantiate(BoltPrefabs.SurvivalHead, Player.GetPlayer().transform.position, Quaternion.identity); + // } + // else + // { + // Hacks.Misc.CarryObject("SurvivalHead"); + // } + // } - if (GUILayout.Button("Clean head")) + // if (GUILayout.Button("Clean head")) + // { + // if (BoltNetwork.IsServer && !Player.IsInGame()) + // { + // BoltNetwork.Instantiate(BoltPrefabs.SurvivalCleanHead, Player.GetPlayer().transform.position, Quaternion.identity); + // } + // else + // { + // Hacks.Misc.CarryObject("SurvivalCleanHead"); + // } + // } + if (GUILayout.Button("Doll Head")) { if (BoltNetwork.IsServer && !Player.IsInGame()) { - BoltNetwork.Instantiate(BoltPrefabs.SurvivalCleanHead, Player.GetPlayer().transform.position, Quaternion.identity); + BoltNetwork.Instantiate(BoltPrefabs.SurvivalDollHead, Player.GetPlayer().transform.position, Quaternion.identity); } else { - Hacks.Misc.CarryObject("SurvivalCleanHead"); + Hacks.Misc.CarryObject("SurvivalDollHead"); } - } + } GUILayout.EndScrollView(); GUILayout.EndVertical(); @@ -1545,105 +1580,67 @@ namespace DevourClient private static void MiscTab() { - if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 70, 150, 30), "Unlock Achievements")) + // === 游戏功能按钮区域 (左上) === + if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 70, 140, 25), "Unlock Achievements")) { Thread AchievementsThread = new Thread(new ThreadStart(Hacks.Unlock.Achievements)); AchievementsThread.Start(); - MelonLogger.Msg("Achievements Unlocked!"); - Hacks.Misc.ShowMessageBox("Achievements Unlocked!"); + MelonLogger.Msg("Achievements unlocked!"); + Hacks.Misc.ShowMessageBox("Achievements unlocked!"); } - if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 110, 150, 30), "Unlock Doors")) + if (GUI.Button(new Rect(Settings.Settings.x + 160, Settings.Settings.y + 70, 140, 25), "Unlock Doors")) { Hacks.Unlock.Doors(); - MelonLogger.Msg("Doors Unlocked!"); - Hacks.Misc.ShowMessageBox("Doors Unlocked!"); + MelonLogger.Msg("Doors unlocked!"); + Hacks.Misc.ShowMessageBox("Doors unlocked!"); } - if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 150, 150, 30), "TP Keys") && Player.IsInGame()) + if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 105, 140, 25), "Teleport Keys") && Player.IsInGame()) { Hacks.Misc.TPKeys(); - MelonLogger.Msg("Here are your keys!"); - Hacks.Misc.ShowMessageBox("Here are your keys!"); + MelonLogger.Msg("Keys teleported!"); + Hacks.Misc.ShowMessageBox("Keys teleported!"); } - if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 190, 150, 30), "Make Random Noise")) + if (GUI.Button(new Rect(Settings.Settings.x + 160, Settings.Settings.y + 105, 140, 25), "Play Random Sound")) { Hacks.Misc.PlaySound(); - MelonLogger.Msg("Playing a random sound!"); - Hacks.Misc.ShowMessageBox("Playing a random sound!"); + MelonLogger.Msg("Playing random sound!"); + Hacks.Misc.ShowMessageBox("Playing random sound!"); } - spam_message = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 240, 140, 30), spam_message, "Chat spam"); - if (spam_message) - { - spamMessageText = GUI.TextField(new Rect(Settings.Settings.x + 160, Settings.Settings.y + 240, 200, 30), spamMessageText); - GUI.Label(new Rect(Settings.Settings.x + 370, Settings.Settings.y + 240, 60, 30), "Send Interval(s):"); - spamMessageInterval = GUI.HorizontalSlider(new Rect(Settings.Settings.x + 440, Settings.Settings.y + 240, 100, 30), spamMessageInterval, 1f, 30f); - GUI.Label(new Rect(Settings.Settings.x + 550, Settings.Settings.y + 240, 60, 30), ((int)spamMessageInterval).ToString()); - } + // === 基础开关区域 (左中) === + _walkInLobby = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 150, 140, 20), _walkInLobby, "Walk In Lobby"); + _IsAutoRespawn = GUI.Toggle(new Rect(Settings.Settings.x + 160, Settings.Settings.y + 150, 140, 20), _IsAutoRespawn, "Auto Respawn"); - change_steam_name = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 270, 140, 30), change_steam_name, "Change Steam Name"); - if (change_steam_name) - { - steamNameText = GUI.TextField(new Rect(Settings.Settings.x + 160, Settings.Settings.y + 270, 200, 30), steamNameText); - if (GUI.Button(new Rect(Settings.Settings.x + 370, Settings.Settings.y + 270, 60, 30), "Apply")) - { - Hacks.Misc.SetSteamName(steamNameText); - } - } - - change_server_name = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 300, 140, 30), change_server_name, "Change Server Name"); - if (change_server_name) - { - serverNameText = GUI.TextField(new Rect(Settings.Settings.x + 160, Settings.Settings.y + 300, 200, 30), serverNameText); - if (GUI.Button(new Rect(Settings.Settings.x + 370, Settings.Settings.y + 300, 60, 30), "Apply")) - { - Hacks.Misc.SetServerName(serverNameText); - } - } - - _walkInLobby = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 330, 140, 30), _walkInLobby, "Walk In Lobby"); - _IsAutoRespawn = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 360, 140, 30), _IsAutoRespawn, "Auto Respawn"); - - fly = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 400, 40, 20), fly, "Fly"); - if (GUI.Button(new Rect(Settings.Settings.x + 60, Settings.Settings.y + 400, 40, 20), Settings.Settings.flyKey.ToString())) + // === 飞行控制区域 (左中下) === + fly = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 180, 40, 20), fly, "Fly"); + if (GUI.Button(new Rect(Settings.Settings.x + 60, Settings.Settings.y + 180, 50, 20), Settings.Settings.flyKey.ToString())) { Settings.Settings.flyKey = Settings.Settings.GetKey(); } + GUI.Label(new Rect(Settings.Settings.x + 120, Settings.Settings.y + 180, 80, 20), "Speed:"); + fly_speed = GUI.HorizontalSlider(new Rect(Settings.Settings.x + 170, Settings.Settings.y + 185, 80, 10), fly_speed, 5f, 20f); + GUI.Label(new Rect(Settings.Settings.x + 260, Settings.Settings.y + 180, 40, 20), ((int)fly_speed).ToString()); - fly_speed = GUI.HorizontalSlider(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 430, 100, 10), fly_speed, 5f, 20f); - GUI.Label(new Rect(Settings.Settings.x + 120, Settings.Settings.y + 425, 100, 30), ((int)fly_speed).ToString()); + // === 等级欺骗区域 (左下) === + spoofLevel = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 210, 100, 20), spoofLevel, "Spoof Level"); + spoofLevelValue = GUI.HorizontalSlider(new Rect(Settings.Settings.x + 120, Settings.Settings.y + 215, 80, 10), spoofLevelValue, 0f, 666f); + GUI.Label(new Rect(Settings.Settings.x + 210, Settings.Settings.y + 210, 50, 20), ((int)spoofLevelValue).ToString()); + // === 经验修改区域 (左下) === + exp_modifier = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 240, 100, 20), exp_modifier, "Exp Modifier"); + exp = GUI.HorizontalSlider(new Rect(Settings.Settings.x + 120, Settings.Settings.y + 245, 80, 10), exp, 1000f, 6000f); + GUI.Label(new Rect(Settings.Settings.x + 210, Settings.Settings.y + 240, 50, 20), ((int)exp).ToString()); - spoofLevel = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 470, 150, 20), spoofLevel, "Spoof Level"); - spoofLevelValue = GUI.HorizontalSlider(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 500, 100, 10), spoofLevelValue, 0f, 666f); - GUI.Label(new Rect(Settings.Settings.x + 120, Settings.Settings.y + 495, 100, 30), ((int)spoofLevelValue).ToString()); + // === 速度修改区域 (左下) === + fastMove = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 270, 100, 20), fastMove, "Player Speed"); + _PlayerSpeedMultiplier = GUI.HorizontalSlider(new Rect(Settings.Settings.x + 120, Settings.Settings.y + 275, 80, 10), _PlayerSpeedMultiplier, (int)1f, (int)10f); + GUI.Label(new Rect(Settings.Settings.x + 210, Settings.Settings.y + 270, 50, 20), ((int)_PlayerSpeedMultiplier).ToString()); - - exp_modifier = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 540, 150, 20), exp_modifier, "EXP Modifier"); - exp = GUI.HorizontalSlider(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 570, 100, 10), exp, 1000f, 6000f); - GUI.Label(new Rect(Settings.Settings.x + 120, Settings.Settings.y + 565, 100, 30), ((int)exp).ToString()); - - - fastMove = GUI.Toggle(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 610, 150, 20), fastMove, "Player Speed"); - _PlayerSpeedMultiplier = GUI.HorizontalSlider(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 640, 100, 10), _PlayerSpeedMultiplier, (int)1f, (int)10f); - GUI.Label(new Rect(Settings.Settings.x + 120, Settings.Settings.y + 635, 100, 30), ((int)_PlayerSpeedMultiplier).ToString()); - - GUI.Label(new Rect(Settings.Settings.x + 295, Settings.Settings.y + 70, 150, 30), "Max players"); - lobbySize = GUI.HorizontalSlider(new Rect(Settings.Settings.x + 295, Settings.Settings.y + 90, 100, 10), lobbySize, (int)0f, (int)30f); - GUI.Label(new Rect(Settings.Settings.x + 405, Settings.Settings.y + 85, 100, 30), ((int)lobbySize).ToString()); - - if (GUI.Button(new Rect(Settings.Settings.x + 285, Settings.Settings.y + 110, 150, 30), "Create server")) - { - MelonLogger.Msg("Creating the server..."); - Hacks.Misc.ShowMessageBox("Creating the server..."); - Hacks.Misc.CreateCustomizedLobby((int)lobbySize); - MelonLogger.Msg("Done !"); - Hacks.Misc.ShowMessageBox("Done !"); - } } private static void PlayersTab() @@ -1657,7 +1654,6 @@ namespace DevourClient if (bp == null || bp.Name == "") { MelonLogger.Warning("players is null"); - Hacks.Misc.ShowMessageBox("players is null"); continue; } @@ -1710,5 +1706,69 @@ namespace DevourClient } } + private void OnDestroy() + { + try + { + base.StopAllCoroutines(); + + Dispose(); + } + catch (Exception ex) + { + MelonLogger.Error($"Error in OnDestroy: {ex.Message}"); + } + } + + private void OnApplicationQuit() + { + try + { + Dispose(); + } + catch (Exception ex) + { + MelonLogger.Error($"Error in OnApplicationQuit: {ex.Message}"); + } + } + + public void Dispose() + { + try + { + MelonLogger.Msg("Starting ClientMain cleanup..."); + + long memoryBeforeCleanup = GC.GetTotalMemory(false); + MelonLogger.Msg($"[Memory Monitor] Pre-cleanup managed memory: {memoryBeforeCleanup / 1024 / 1024} MB"); + + Helpers.Entities.StopAllCoroutines(); + + if (crosshairTexture != null) + { + UnityEngine.Object.DestroyImmediate(crosshairTexture); + crosshairTexture = null; + } + + Helpers.GUIHelper.Cleanup(); + + Helpers.Entities.CleanupCachedObjects(); + + GC.Collect(); + GC.WaitForPendingFinalizers(); + GC.Collect(); + + long memoryAfterCleanup = GC.GetTotalMemory(true); + long memoryFreed = memoryBeforeCleanup - memoryAfterCleanup; + MelonLogger.Msg($"[Memory Monitor] Post-cleanup managed memory: {memoryAfterCleanup / 1024 / 1024} MB"); + MelonLogger.Msg($"[Memory Monitor] Memory freed: {memoryFreed / 1024 / 1024} MB"); + + MelonLogger.Msg("ClientMain disposed successfully."); + } + catch (Exception ex) + { + MelonLogger.Error($"Error disposing ClientMain: {ex.Message}"); + } + } } } + diff --git a/DevourClient/DevourClient.csproj b/DevourClient/DevourClient.csproj index 91b5fbf..a9a350e 100644 --- a/DevourClient/DevourClient.csproj +++ b/DevourClient/DevourClient.csproj @@ -12,4 +12,78 @@ 0 + + + E:\SteamLibrary\steamapps\common\Devour\MelonLoader\net6\0Harmony.dll + + + E:\SteamLibrary\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\Assembly-CSharp.dll + + + E:\SteamLibrary\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\Il2CppBehaviorDesigner.Runtime.dll + + + E:\SteamLibrary\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\Il2Cppbolt.dll + + + E:\SteamLibrary\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\Il2Cppbolt.user.dll + + + E:\SteamLibrary\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\Il2Cppcom.rlabrecque.steamworks.net.dll + + + E:\SteamLibrary\steamapps\common\Devour\MelonLoader\net6\Il2CppInterop.Runtime.dll + + + E:\SteamLibrary\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\Il2Cppmscorlib.dll + + + E:\SteamLibrary\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\Il2CppOpsive.UltimateCharacterController.dll + + + E:\SteamLibrary\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\Il2Cppudpkit.dll + + + E:\SteamLibrary\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\Il2Cppudpkit.common.dll + + + E:\SteamLibrary\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\Il2Cppudpkit.platform.photon.dll + + + E:\SteamLibrary\steamapps\common\Devour\MelonLoader\net6\MelonLoader.dll + + + E:\SteamLibrary\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\UnityEngine.dll + + + E:\SteamLibrary\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\UnityEngine.AnimationModule.dll + + + E:\SteamLibrary\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\UnityEngine.CoreModule.dll + + + E:\SteamLibrary\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\UnityEngine.HotReloadModule.dll + + + E:\SteamLibrary\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\UnityEngine.IMGUIModule.dll + + + E:\SteamLibrary\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\UnityEngine.InputLegacyModule.dll + + + E:\SteamLibrary\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\UnityEngine.InputModule.dll + + + E:\SteamLibrary\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\UnityEngine.PhysicsModule.dll + + + E:\SteamLibrary\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\UnityEngine.UI.dll + + + E:\SteamLibrary\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\UnityEngine.UIModule.dll + + + E:\SteamLibrary\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\Unity.TextMeshPro.dll + + \ No newline at end of file diff --git a/DevourClient/Hacks/Misc.cs b/DevourClient/Hacks/Misc.cs index ae8e681..29c7285 100644 --- a/DevourClient/Hacks/Misc.cs +++ b/DevourClient/Hacks/Misc.cs @@ -91,12 +91,11 @@ namespace DevourClient.Hacks if (burnAll) { - _slaughterhouseAltarController.SkipToGoat(10); + _slaughterhouseAltarController.BurnGoat(); } else { - _slaughterhouseAltarController.BurnGoat(); - + _slaughterhouseAltarController.SkipToGoat(10); } break; @@ -163,13 +162,11 @@ namespace DevourClient.Hacks else { MelonLogger.Error("azazelBehaviour is null!"); - Hacks.Misc.ShowMessageBox("azazelBehaviour is null!"); } } else { MelonLogger.Error("azazel is null!"); - Hacks.Misc.ShowMessageBox("azazel is null!"); } } } @@ -233,26 +230,6 @@ namespace DevourClient.Hacks _menu.ShowCanvasGroup(_menu.mainMenuCanvasGroup, false); } - public static void SetSteamName(string name) - { - Il2CppHorror.Menu Menu_ = UnityEngine.Object.FindObjectOfType(); - if (Menu_ == null) - { - return; - } - - Menu_.steamName = name; - } - public static void SetServerName(string name) - { - Il2CppHorror.Menu Menu_ = UnityEngine.Object.FindObjectOfType(); - if (Menu_ == null) - { - return; - } - - Menu_.serverNameText.text = name; - } public static void BigFlashlight(bool reset) { @@ -379,23 +356,6 @@ namespace DevourClient.Hacks NolanRank.SetRank(rank); } - public static void MessageSpam(string message) - { - //TOFIX : not spamming anymore :/ - if (Helpers.Player.IsInGame()) - { - Il2Cpp.GameUI game_ui_class = UnityEngine.Object.FindObjectOfType(); - - game_ui_class.textChatInput.text = message; - game_ui_class.OnChatMessageSubmit(); - } - else - { - Il2CppHorror.Menu menu_class = UnityEngine.Object.FindObjectOfType(); - menu_class.textChatInput.text = message; - menu_class.OnChatMessageSubmit(); - } - } public static void DespawnDemons() { @@ -474,13 +434,26 @@ namespace DevourClient.Hacks } } + public static void DespawnMonkeys() + { + foreach (Il2Cpp.MonkeyBehaviour monkey in Helpers.Entities.Monkeys) + { + if (monkey != null) + { + monkey.Despawn(); + } + } + } + public static int ShowMessageBox(string message) { - Settings.Settings.errorMessage = message; - Settings.Settings.errorMessageDisplayTime = 0f; - Settings.Settings.showErrorMessage = true; - return 0; - } + //not used, might be useful, some day + Il2CppHorror.Menu menu = UnityEngine.Object.FindObjectOfType(); + if (menu == null) + return 1; + menu.ShowMessageModal(message); + return 0; + } public static void PlaySound() { diff --git a/DevourClient/Hacks/Unlock.cs b/DevourClient/Hacks/Unlock.cs index daec655..49da7f4 100644 --- a/DevourClient/Hacks/Unlock.cs +++ b/DevourClient/Hacks/Unlock.cs @@ -22,7 +22,9 @@ namespace DevourClient.Hacks } MelonLoader.MelonLogger.Warning("You need to restart your game for the achievements to be unlocked !!!"); - Hacks.Misc.ShowMessageBox("You need to restart your game for the achievements to be unlocked !!!"); + MelonLoader.MelonLogger.Warning("You need to restart your game for the achievements to be unlocked !!!"); + MelonLoader.MelonLogger.Warning("You need to restart your game for the achievements to be unlocked !!!"); + MelonLoader.MelonLogger.Warning("You need to restart your game for the achievements to be unlocked !!!"); } public static void Doors() diff --git a/DevourClient/Helpers/GUIHelper.cs b/DevourClient/Helpers/GUIHelper.cs index 51f6e2e..fd78081 100644 --- a/DevourClient/Helpers/GUIHelper.cs +++ b/DevourClient/Helpers/GUIHelper.cs @@ -1,27 +1,120 @@ using UnityEngine; -using MelonLoader; using System.Collections.Generic; namespace DevourClient.Helpers { - public static class GUIHelper + class GUIHelper { - private static Texture2D previewTexture; - private static GUIStyle boxStyle; - + private static float R; + private static float G; + private static float B; + + private static Texture2D previewTexture = null; private static Dictionary colorTextureCache = new Dictionary(); private static Dictionary circularTextureCache = new Dictionary(); - - public static void Initialize() + private static Color lastPreviewColor = Color.clear; + private static GUIStyle cachedBoxStyle = null; + + public static Color ColorPick(string title, Color color) { - if (previewTexture == null) - { - previewTexture = new Texture2D(1, 1); - boxStyle = new GUIStyle(GUI.skin.box); - } - } + GUI.Label(new Rect(Settings.Settings.x + 195, Settings.Settings.y + 70, 250, 30), title); + R = GUI.VerticalSlider(new Rect(Settings.Settings.x + 240, Settings.Settings.y + 100, 30, 90), color.r, 0f, 1f); + G = GUI.VerticalSlider(new Rect(Settings.Settings.x + 270, Settings.Settings.y + 100, 30, 90), color.g, 0f, 1f); + B = GUI.VerticalSlider(new Rect(Settings.Settings.x + 300, Settings.Settings.y + 100, 30, 90), color.b, 0f, 1f); + + GUI.Label(new Rect(Settings.Settings.x + 240, Settings.Settings.y + 190, 30, 30), "R"); + GUI.Label(new Rect(Settings.Settings.x + 270, Settings.Settings.y + 190, 30, 30), "G"); + GUI.Label(new Rect(Settings.Settings.x + 300, Settings.Settings.y + 190, 30, 30), "B"); + + color = new Color(R, G, B, 1); + + void DrawPreview(Rect position, Color color_to_draw) + { + if (previewTexture == null || lastPreviewColor != color_to_draw) + { + if (previewTexture == null) + { + previewTexture = new Texture2D(1, 1); + } + + previewTexture.SetPixel(0, 0, color_to_draw); + previewTexture.Apply(); + lastPreviewColor = color_to_draw; + } + + if (cachedBoxStyle == null) + { + cachedBoxStyle = new GUIStyle(GUI.skin.box); + } + cachedBoxStyle.normal.background = previewTexture; + GUI.Box(position, GUIContent.none, cachedBoxStyle); + } + + DrawPreview(new Rect(Settings.Settings.x + 195, Settings.Settings.y + 100, 20, 90), color); + + return color; + } + + public static Texture2D MakeTex(int width, int height, Color col) + { + if (colorTextureCache.TryGetValue(col, out Texture2D cachedTexture)) + { + if (cachedTexture != null) + { + return cachedTexture; + } + } + + Color[] pix = new Color[width * height]; + for (int i = 0; i < pix.Length; ++i) + { + pix[i] = col; + } + Texture2D result = new Texture2D(width, height); + result.SetPixels(pix); + result.Apply(); + + colorTextureCache[col] = result; + + return result; + } + + public static Texture2D GetCircularTexture(int width, int height) + { + int cacheKey = width; + + if (circularTextureCache.TryGetValue(cacheKey, out Texture2D cachedTexture)) + { + if (cachedTexture != null) + { + return cachedTexture; + } + } + + Texture2D texture = new Texture2D(width, height); + for (int x = 0; x < texture.width; x++) + { + for (int y = 0; y < texture.height; y++) + { + if (Vector2.Distance(new Vector2(x, y), new Vector2(texture.width / 2, texture.height / 2)) <= texture.width / 2) + { + texture.SetPixel(x, y, Color.white); + } + else + { + texture.SetPixel(x, y, Color.clear); + } + } + } + + texture.Apply(); + + circularTextureCache[cacheKey] = texture; + + return texture; + } public static void Cleanup() { @@ -49,114 +142,5 @@ namespace DevourClient.Helpers } circularTextureCache.Clear(); } - - private static float R; - private static float G; - private static float B; - - public static Color ColorPick(string title, Color color) - { - Initialize(); - - GUILayout.BeginArea(new Rect(Settings.Settings.x + 195, Settings.Settings.y + 70, 250, 250)); - - GUILayout.Label(title); - GUILayout.Space(10); - - - GUILayout.BeginHorizontal(); - GUILayout.Label("R", GUILayout.Width(20)); - R = GUILayout.HorizontalSlider(color.r, 0f, 1f, GUILayout.Width(150)); - GUILayout.Label(((int)(R * 255)).ToString(), GUILayout.Width(30)); - GUILayout.EndHorizontal(); - - - GUILayout.BeginHorizontal(); - GUILayout.Label("G", GUILayout.Width(20)); - G = GUILayout.HorizontalSlider(color.g, 0f, 1f, GUILayout.Width(150)); - GUILayout.Label(((int)(G * 255)).ToString(), GUILayout.Width(30)); - GUILayout.EndHorizontal(); - - - GUILayout.BeginHorizontal(); - GUILayout.Label("B", GUILayout.Width(20)); - B = GUILayout.HorizontalSlider(color.b, 0f, 1f, GUILayout.Width(150)); - GUILayout.Label(((int)(B * 255)).ToString(), GUILayout.Width(30)); - GUILayout.EndHorizontal(); - - GUILayout.Space(10); - - - void DrawPreview(Color color_to_draw) - { - if (previewTexture == null) - { - previewTexture = new Texture2D(1, 1); - } - - previewTexture.SetPixel(0, 0, color_to_draw); - previewTexture.Apply(); - boxStyle.normal.background = previewTexture; - GUILayout.Box(GUIContent.none, boxStyle, GUILayout.Height(30)); - } - - DrawPreview(new Color(R, G, B, 1)); - - GUILayout.EndArea(); - - return new Color(R, G, B, 1); - } - - public static Texture2D MakeTex(int width, int height, Color col) - { - string cacheKey = $"{width}x{height}_{col.r}_{col.g}_{col.b}"; - - if (colorTextureCache.TryGetValue(col, out Texture2D cachedTexture)) - { - return cachedTexture; - } - - Texture2D result = new Texture2D(width, height); - Color[] pix = new Color[width * height]; - for (int i = 0; i < pix.Length; ++i) - { - pix[i] = col; - } - result.SetPixels(pix); - result.Apply(); - - colorTextureCache[col] = result; - return result; - } - - public static Texture2D GetCircularTexture(int width, int height) - { - int size = Mathf.Max(width, height); - if (circularTextureCache.TryGetValue(size, out Texture2D cachedTexture)) - { - return cachedTexture; - } - - Texture2D texture = new Texture2D(width, height); - for (int x = 0; x < texture.width; x++) - { - for (int y = 0; y < texture.height; y++) - { - if (Vector2.Distance(new Vector2(x, y), new Vector2(texture.width / 2, texture.height / 2)) <= texture.width / 2) - { - texture.SetPixel(x, y, Color.white); - } - else - { - texture.SetPixel(x, y, Color.clear); - } - } - } - - texture.Apply(); - - circularTextureCache[size] = texture; - return texture; - } } } diff --git a/DevourClient/Helpers/Map.cs b/DevourClient/Helpers/Map.cs index 6540006..76bc7db 100644 --- a/DevourClient/Helpers/Map.cs +++ b/DevourClient/Helpers/Map.cs @@ -11,7 +11,7 @@ { switch (sceneName) { - case "Devour": + case "Anna": return "Farmhouse"; case "Molly": return "Asylum"; @@ -23,6 +23,8 @@ return "Slaughterhouse"; case "Manor": return "Manor"; + case "Carnival": + return "Carnival"; default: return "Menu"; } @@ -40,12 +42,10 @@ Il2CppPhoton.Bolt.BoltNetwork.LoadScene(mapName); MelonLoader.MelonLogger.Warning("Please press the button only once, it may take some time for the map to load."); - Hacks.Misc.ShowMessageBox("Please press the button only once, it may take some time for the map to load."); } else { MelonLoader.MelonLogger.Warning("You must be the host to use this command!"); - Hacks.Misc.ShowMessageBox("You must be the host to use this command!"); } } } diff --git a/DevourClient/Helpers/Render.cs b/DevourClient/Helpers/Render.cs index d309334..2756910 100644 --- a/DevourClient/Helpers/Render.cs +++ b/DevourClient/Helpers/Render.cs @@ -12,14 +12,32 @@ namespace DevourClient.Render { public static GUIStyle StringStyle { get; set; } = new GUIStyle(GUI.skin.label); + private static GUIContent cachedContent = new GUIContent(); + private static Dictionary sizeCache = new Dictionary(); + private static int frameCacheClearCounter = 0; + private const int CACHE_CLEAR_INTERVAL = 1800; + public static void DrawString(Vector2 position, Color color, string label, bool centered = true) { - var content = new GUIContent(label); - var size = StringStyle.CalcSize(content); + cachedContent.text = label; + + if (!sizeCache.TryGetValue(label, out Vector2 size)) + { + size = StringStyle.CalcSize(cachedContent); + sizeCache[label] = size; + + frameCacheClearCounter++; + if (frameCacheClearCounter >= CACHE_CLEAR_INTERVAL) + { + sizeCache.Clear(); + frameCacheClearCounter = 0; + } + } + var upperLeft = centered ? position - size / 2f : position; Color color2 = GUI.color; GUI.color = color; - GUI.Label(new Rect(upperLeft, size), content); + GUI.Label(new Rect(upperLeft, size), cachedContent); GUI.color = color2; } @@ -63,7 +81,7 @@ namespace DevourClient.Render } public static void DrawBones(Transform bone1, Transform bone2, Color c) { - if (!Camera.main) //fix the crash maybe + if (!Camera.main) { return; } diff --git a/DevourClient/Helpers/StateHelper.cs b/DevourClient/Helpers/StateHelper.cs index 6590536..39d406e 100644 --- a/DevourClient/Helpers/StateHelper.cs +++ b/DevourClient/Helpers/StateHelper.cs @@ -40,7 +40,8 @@ namespace DevourClient.Helpers Il2Cpp.NolanBehaviour nb = p_GameObject.GetComponent(); Il2Cpp.SurvivalReviveInteractable _reviveInteractable = UnityEngine.Object.FindObjectOfType(); - _reviveInteractable.Interact(nb.gameObject); + if (_reviveInteractable.CanInteract(nb.gameObject) == true) { _reviveInteractable.Interact(nb.gameObject); } + } public void Jumpscare() @@ -48,7 +49,6 @@ namespace DevourClient.Helpers if (!BoltNetwork.IsServer) { MelonLogger.Msg("You need to be server !"); - Hacks.Misc.ShowMessageBox("You need to be server !"); return; } @@ -66,9 +66,6 @@ namespace DevourClient.Helpers sab.OnPickedUpPlayer(sab.gameObject, p_GameObject, false); - MelonLogger.Msg(Name); - Hacks.Misc.ShowMessageBox(Name); - /* MelonLogger.Msg(Name); Il2Cpp.JumpScare _jumpscare = UnityEngine.Object.FindObjectOfType(); @@ -114,7 +111,6 @@ namespace DevourClient.Helpers else { MelonLogger.Error("Azazel not found!"); - Hacks.Misc.ShowMessageBox("Azazel not found!"); return; } } @@ -124,7 +120,6 @@ namespace DevourClient.Helpers if (!BoltNetwork.IsServer) { MelonLogger.Msg("You need to be server !"); - Hacks.Misc.ShowMessageBox("You need to be server !"); return; } @@ -180,9 +175,6 @@ namespace DevourClient.Helpers public class Entities { - private static bool isRunning = true; // Control coroutine running state - private static List activeCoroutines = new List(); // Track active coroutines - public static int MAX_PLAYERS = 4; //will change by calling CreateCustomizedLobby public static BasePlayer LocalPlayer_ = new BasePlayer(); @@ -198,106 +190,28 @@ namespace DevourClient.Helpers public static Il2Cpp.CorpseBehaviour[] Corpses = default!; public static Il2Cpp.CrowBehaviour[] Crows = default!; public static Il2Cpp.ManorLumpController[] Lumps = default!; + public static Il2Cpp.MonkeyBehaviour[] Monkeys = default!; - // Method to stop all coroutines - public static void StopAllCoroutines() - { - isRunning = false; - foreach (var coroutine in activeCoroutines) - { - if (coroutine != null) - { - MelonCoroutines.Stop(coroutine); - } - } - activeCoroutines.Clear(); - - // Clean up all cached objects - CleanupCachedObjects(); - } - - // Clean up cached objects - private static void CleanupCachedObjects() - { - if (Players != null) - { - foreach (var player in Players) - { - if (player != null) - { - player.p_GameObject = null; - } - } - Players = null; - } - - LocalPlayer_.p_GameObject = null; - GoatsAndRats = null; - SurvivalInteractables = null; - Keys = null; - Demons = null; - Spiders = null; - Ghosts = null; - Azazels = null; - Boars = null; - Corpses = null; - Crows = null; - Lumps = null; - } - - // Method to start all coroutines - public static void StartAllCoroutines() - { - isRunning = true; - activeCoroutines.Clear(); - - // Start all coroutines and save references - activeCoroutines.Add(MelonCoroutines.Start(GetLocalPlayer())); - activeCoroutines.Add(MelonCoroutines.Start(GetAllPlayers())); - activeCoroutines.Add(MelonCoroutines.Start(GetGoatsAndRats())); - activeCoroutines.Add(MelonCoroutines.Start(GetSurvivalInteractables())); - activeCoroutines.Add(MelonCoroutines.Start(GetKeys())); - activeCoroutines.Add(MelonCoroutines.Start(GetDemons())); - activeCoroutines.Add(MelonCoroutines.Start(GetSpiders())); - activeCoroutines.Add(MelonCoroutines.Start(GetGhosts())); - activeCoroutines.Add(MelonCoroutines.Start(GetBoars())); - activeCoroutines.Add(MelonCoroutines.Start(GetCorpses())); - activeCoroutines.Add(MelonCoroutines.Start(GetCrows())); - activeCoroutines.Add(MelonCoroutines.Start(GetLumps())); - activeCoroutines.Add(MelonCoroutines.Start(GetAzazels())); - } + // 协程生命周期管理 + private static List activeCoroutines = new List(); + private static bool isRunning = false; public static IEnumerator GetLocalPlayer() { while (isRunning) { - try + GameObject[] currentPlayers = GameObject.FindGameObjectsWithTag("Player"); + + for (int i = 0; i < currentPlayers.Length; i++) { - GameObject[] currentPlayers = GameObject.FindGameObjectsWithTag("Player"); - if (currentPlayers != null) + if (currentPlayers[i].GetComponent().entity.IsOwner) { - for (int i = 0; i < currentPlayers.Length; i++) - { - if (currentPlayers[i].GetComponent().entity.IsOwner) - { - // Clean up old references before updating - if (LocalPlayer_.p_GameObject != currentPlayers[i]) - { - LocalPlayer_.p_GameObject = currentPlayers[i]; - } - break; - } - } + LocalPlayer_.p_GameObject = currentPlayers[i]; + break; } } - catch (System.Exception e) - { - string err = $"GetLocalPlayer coroutine encountered an error: {e.Message}"; - MelonLogger.Error(err); - DevourClient.Settings.Settings.errorMessage = err; - DevourClient.Settings.Settings.showErrorMessage = true; - } + // Wait 5 seconds before caching objects again. yield return new WaitForSeconds(5f); } } @@ -306,70 +220,46 @@ namespace DevourClient.Helpers { while (isRunning) { - try + GameObject[] players = GameObject.FindGameObjectsWithTag("Player"); + Players = new BasePlayer[players.Length]; + + int i = 0; + foreach (GameObject p in players) { - GameObject[] players = GameObject.FindGameObjectsWithTag("Player"); - - // Clean up old array before creating new one - if (Players != null) + string player_name = ""; + string player_id = "-1"; + + Il2Cpp.DissonancePlayerTracking dpt = p.gameObject.GetComponent(); + if (dpt != null) { - foreach (var player in Players) - { - if (player != null) - { - player.p_GameObject = null; - } - } + player_name = dpt.state.PlayerName; + player_id = dpt.state.PlayerId; } - // Create new array - Players = new BasePlayer[players.Length]; - - for (int i = 0; i < players.Length; i++) + if (Players[i] == null) { - if (Players[i] == null) - { - Players[i] = new BasePlayer(); - } - - Players[i].p_GameObject = players[i]; - - Il2Cpp.DissonancePlayerTracking dpt = players[i].GetComponent(); - if (dpt != null) - { - Players[i].Name = dpt.state.PlayerName; - Players[i].Id = dpt.state.PlayerId; - } + Players[i] = new BasePlayer(); } - } - catch (System.Exception e) - { - string err = $"GetAllPlayers coroutine encountered an error: {e.Message}"; - MelonLogger.Error(err); - DevourClient.Settings.Settings.errorMessage = err; - DevourClient.Settings.Settings.showErrorMessage = true; + + Players[i].Id = player_id; + Players[i].Name = player_name; + Players[i].p_GameObject = p; + + i++; } + + // Wait 5 seconds before caching objects again. yield return new WaitForSeconds(5f); } } - public static IEnumerator GetGoatsAndRats() { while (isRunning) { - try - { - GoatsAndRats = Il2Cpp.GoatBehaviour.FindObjectsOfType(); - } - catch (System.Exception e) - { - string err = $"GetGoatsAndRats coroutine encountered an error: {e.Message}"; - MelonLogger.Error(err); - DevourClient.Settings.Settings.errorMessage = err; - DevourClient.Settings.Settings.showErrorMessage = true; - } + GoatsAndRats = Il2Cpp.GoatBehaviour.FindObjectsOfType(); + // Wait 5 seconds before caching objects again. yield return new WaitForSeconds(5f); } } @@ -378,18 +268,9 @@ namespace DevourClient.Helpers { while (isRunning) { - try - { - SurvivalInteractables = Il2Cpp.SurvivalInteractable.FindObjectsOfType(); - } - catch (System.Exception e) - { - string err = $"GetSurvivalInteractables coroutine encountered an error: {e.Message}"; - MelonLogger.Error(err); - DevourClient.Settings.Settings.errorMessage = err; - DevourClient.Settings.Settings.showErrorMessage = true; - } + SurvivalInteractables = Il2Cpp.SurvivalInteractable.FindObjectsOfType(); + // Wait 5 seconds before caching objects again. yield return new WaitForSeconds(5f); } } @@ -398,18 +279,9 @@ namespace DevourClient.Helpers { while (isRunning) { - try - { - Keys = Il2Cpp.KeyBehaviour.FindObjectsOfType(); - } - catch (System.Exception e) - { - string err = $"GetKeys coroutine encountered an error: {e.Message}"; - MelonLogger.Error(err); - DevourClient.Settings.Settings.errorMessage = err; - DevourClient.Settings.Settings.showErrorMessage = true; - } + Keys = Il2Cpp.KeyBehaviour.FindObjectsOfType(); + // Wait 5 seconds before caching objects again. yield return new WaitForSeconds(5f); } } @@ -418,18 +290,9 @@ namespace DevourClient.Helpers { while (isRunning) { - try - { - Demons = Il2Cpp.SurvivalDemonBehaviour.FindObjectsOfType(); - } - catch (System.Exception e) - { - string err = $"GetDemons coroutine encountered an error: {e.Message}"; - MelonLogger.Error(err); - DevourClient.Settings.Settings.errorMessage = err; - DevourClient.Settings.Settings.showErrorMessage = true; - } + Demons = Il2Cpp.SurvivalDemonBehaviour.FindObjectsOfType(); + // Wait 5 seconds before caching objects again. yield return new WaitForSeconds(5f); } } @@ -438,18 +301,9 @@ namespace DevourClient.Helpers { while (isRunning) { - try - { - Spiders = Il2Cpp.SpiderBehaviour.FindObjectsOfType(); - } - catch (System.Exception e) - { - string err = $"GetSpiders coroutine encountered an error: {e.Message}"; - MelonLogger.Error(err); - DevourClient.Settings.Settings.errorMessage = err; - DevourClient.Settings.Settings.showErrorMessage = true; - } + Spiders = Il2Cpp.SpiderBehaviour.FindObjectsOfType(); + // Wait 5 seconds before caching objects again. yield return new WaitForSeconds(5f); } } @@ -458,18 +312,9 @@ namespace DevourClient.Helpers { while (isRunning) { - try - { - Ghosts = Il2Cpp.GhostBehaviour.FindObjectsOfType(); - } - catch (System.Exception e) - { - string err = $"GetGhosts coroutine encountered an error: {e.Message}"; - MelonLogger.Error(err); - DevourClient.Settings.Settings.errorMessage = err; - DevourClient.Settings.Settings.showErrorMessage = true; - } + Ghosts = Il2Cpp.GhostBehaviour.FindObjectsOfType(); + // Wait 5 seconds before caching objects again. yield return new WaitForSeconds(5f); } } @@ -478,18 +323,9 @@ namespace DevourClient.Helpers { while (isRunning) { - try - { - Boars = Il2Cpp.BoarBehaviour.FindObjectsOfType(); - } - catch (System.Exception e) - { - string err = $"GetBoars coroutine encountered an error: {e.Message}"; - MelonLogger.Error(err); - DevourClient.Settings.Settings.errorMessage = err; - DevourClient.Settings.Settings.showErrorMessage = true; - } + Boars = Il2Cpp.BoarBehaviour.FindObjectsOfType(); + // Wait 5 seconds before caching objects again. yield return new WaitForSeconds(5f); } } @@ -498,18 +334,9 @@ namespace DevourClient.Helpers { while (isRunning) { - try - { - Corpses = Il2Cpp.CorpseBehaviour.FindObjectsOfType(); - } - catch (System.Exception e) - { - string err = $"GetCorpses coroutine encountered an error: {e.Message}"; - MelonLogger.Error(err); - DevourClient.Settings.Settings.errorMessage = err; - DevourClient.Settings.Settings.showErrorMessage = true; - } + Corpses = Il2Cpp.CorpseBehaviour.FindObjectsOfType(); + // Wait 5 seconds before caching objects again. yield return new WaitForSeconds(5f); } } @@ -518,18 +345,9 @@ namespace DevourClient.Helpers { while (isRunning) { - try - { - Crows = Il2Cpp.CrowBehaviour.FindObjectsOfType(); - } - catch (System.Exception e) - { - string err = $"GetCrows coroutine encountered an error: {e.Message}"; - MelonLogger.Error(err); - DevourClient.Settings.Settings.errorMessage = err; - DevourClient.Settings.Settings.showErrorMessage = true; - } + Crows = Il2Cpp.CrowBehaviour.FindObjectsOfType(); + // Wait 5 seconds before caching objects again. yield return new WaitForSeconds(5f); } } @@ -538,39 +356,135 @@ namespace DevourClient.Helpers { while (isRunning) { - try - { - Lumps = Il2Cpp.ManorLumpController.FindObjectsOfType(); - } - catch (System.Exception e) - { - string err = $"GetLumps coroutine encountered an error: {e.Message}"; - MelonLogger.Error(err); - DevourClient.Settings.Settings.errorMessage = err; - DevourClient.Settings.Settings.showErrorMessage = true; - } + Lumps = Il2Cpp.ManorLumpController.FindObjectsOfType(); + // Wait 5 seconds before caching objects again. + yield return new WaitForSeconds(5f); + } + } + + public static IEnumerator GetMonkeys() + { + while (isRunning) + { + Monkeys = Il2Cpp.MonkeyBehaviour.FindObjectsOfType(); + + // Wait 5 seconds before caching objects again. yield return new WaitForSeconds(5f); } } public static IEnumerator GetAzazels() { + /* + * ikr AzazelS, because in case we spawn multiple we want the esp to render all of them + */ while (isRunning) { - try + Azazels = Il2Cpp.SurvivalAzazelBehaviour.FindObjectsOfType(); + + // Wait 5 seconds before caching objects again. + yield return new WaitForSeconds(5f); + } + } + + /// + /// 启动所有协程 + /// + public static void StartAllCoroutines() + { + isRunning = true; + } + + /// + /// 停止所有协程并清理协程引用 + /// + public static void StopAllCoroutines() + { + try + { + // 设置标志,让所有协程循环自然退出 + isRunning = false; + + // 停止所有记录的协程 + foreach (var coroutine in activeCoroutines) { - Azazels = Il2Cpp.SurvivalAzazelBehaviour.FindObjectsOfType(); - } - catch (System.Exception e) - { - string err = $"Error in GetAzazels coroutine: {e.Message}"; - MelonLogger.Error(err); - DevourClient.Settings.Settings.errorMessage = err; - DevourClient.Settings.Settings.showErrorMessage = true; + if (coroutine != null) + { + MelonCoroutines.Stop(coroutine); + } } - yield return new WaitForSeconds(5f); + // 清空协程引用列表 + activeCoroutines.Clear(); + + // 清理缓存对象 + CleanupCachedObjects(); + + MelonLogger.Msg("All coroutines stopped and cleaned up successfully."); + } + catch (System.Exception ex) + { + MelonLogger.Error($"Error stopping coroutines: {ex.Message}"); + } + } + + /// + /// 清理所有缓存的游戏对象引用 + /// + public static void CleanupCachedObjects() + { + try + { + // 清理玩家对象引用 + if (Players != null) + { + foreach (var player in Players) + { + if (player != null) + { + player.p_GameObject = null; + } + } + } + + // 将所有实体数组设为null,释放对游戏对象的引用 + Players = null; + GoatsAndRats = null; + SurvivalInteractables = null; + Keys = null; + Demons = null; + Spiders = null; + Ghosts = null; + Azazels = null; + Boars = null; + Corpses = null; + Crows = null; + Lumps = null; + Monkeys = null; + + // 清理本地玩家引用 + if (LocalPlayer_ != null) + { + LocalPlayer_.p_GameObject = null; + } + + MelonLogger.Msg("Cached objects cleaned up successfully."); + } + catch (System.Exception ex) + { + MelonLogger.Error($"Error cleaning up cached objects: {ex.Message}"); + } + } + + /// + /// 注册协程引用用于后续管理 + /// + public static void RegisterCoroutine(object coroutine) + { + if (coroutine != null && !activeCoroutines.Contains(coroutine)) + { + activeCoroutines.Add(coroutine); } } } diff --git a/DevourClient/Settings/Settings.cs b/DevourClient/Settings/Settings.cs index c66fe11..a8dd9b4 100644 --- a/DevourClient/Settings/Settings.cs +++ b/DevourClient/Settings/Settings.cs @@ -13,17 +13,12 @@ namespace DevourClient.Settings public static Color player_esp_color = new Color(0.00f, 1.00f, 0.00f, 1); public static Color azazel_esp_color = new Color(1.00f, 0.00f, 0.00f, 1); public static float speed = 1f; + public const string message_to_spam = "Deez Nutz"; public static KeyCode flyKey = KeyCode.None; public static Vector2 itemsScrollPosition = Vector2.zero; public static Vector2 rituelObjectsScrollPosition = Vector2.zero; public static Vector2 stuffsScrollPosition = Vector2.zero; - // Error message box settings - public static bool showErrorMessage = false; - public static string errorMessage = ""; - public static float errorMessageDisplayTime = 0f; - public static float errorMessageMaxDisplayTime = 4f; // Maximum display time for error messages (in seconds) - public static KeyCode GetKey() { Thread.Sleep(50); //TOFIX tried using anyKeydown, no success From e720da278bdb264f83a38557a6f94127a92c6395 Mon Sep 17 00:00:00 2001 From: Hao Feng Date: Mon, 13 Oct 2025 16:45:48 +1100 Subject: [PATCH 17/17] Update README.md --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 14bf9a4..b236913 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,6 @@ Everything about spoofing ehre (steam name, server name, level...) will persist * Doors unlocker (should work fine, though it doesn't seem to work sometimes) * Keys teleporter * LV spoofer -* Steam name spoofer (sets it to "patate", again no input text :/) -* Server name spoofer (sets it to "patate on top !", again no input text :/) * Fly * Unlock all, including flashlights, perks, outfits. Active by default, can't be turned off, no persistance. * Instant Win (allows you to win instantaniously on any map, works in singleplayer, but not as a client. May be working as host) @@ -47,9 +45,9 @@ Everything about spoofing ehre (steam name, server name, level...) will persist * Walk in the lobby * Change the player's speed * Fullbright -* Create a lobby with no player limit * Infinite mirrors (Manor update) * Switch between realms (Manor update) +* 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) ## English Installation Tutorial