The BepInEx console will not appear when launching like it does for other games on Thunderstore. This is normal (and helps prevent crashes during startup). You can turn it back on in your BepInEx.cfg file.
Decompiled source of PEAK Item Randomizer v1.1.0
PEAKItemRandomizer.dll
Decompiled 3 hours agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using HarmonyLib; using Photon.Pun; using UnityEngine; using Zorro.Core; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("PEAKItemRandomizer")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("PEAKItemRandomizer")] [assembly: AssemblyCopyright("Copyright © 2025")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("c8b0ed46-e722-431e-9568-849c463bbf32")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace PEAKItemRandomizer; [BepInPlugin("com.peakmod.itemrandomizer", "PEAK Item Randomizer", "1.0.0")] public class PEAKItemRandomizerPlugin : BaseUnityPlugin { private static ManualLogSource Logger; private static Harmony harmony; private void Awake() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown Logger = Logger.CreateLogSource("PEAK Item Randomizer"); Logger.LogInfo((object)"Plugin com.peakmod.itemrandomizer is loading..."); harmony = new Harmony("com.peakmod.itemrandomizer"); harmony.PatchAll(); Logger.LogInfo((object)"Plugin com.peakmod.itemrandomizer is loaded!"); } private void OnDestroy() { Harmony obj = harmony; if (obj != null) { obj.UnpatchSelf(); } ManualLogSource logger = Logger; if (logger != null) { logger.LogInfo((object)"Plugin com.peakmod.itemrandomizer is unloaded!"); } } } [HarmonyPatch(typeof(LootData), "GetRandomItem")] public static class LootData_GetRandomItem_Patch { private static bool Prefix(SpawnPool spawnPool, ref GameObject __result) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) Logger.CreateLogSource("PEAKItemRandomizer").LogInfo((object)"LootData.GetRandomItem PATCH PREFIX called!"); if (Ascents.canReviveDead && Character.PlayerIsDeadOrDown()) { return true; } Logger.CreateLogSource("PEAKItemRandomizer").LogInfo((object)$"LootData.GetRandomItem PATCHED! Pool: {spawnPool}"); Dictionary<ushort, Item> itemLookup = SingletonAsset<ItemDatabase>.Instance.itemLookup; if (itemLookup == null || itemLookup.Count == 0) { return true; } List<Item> list = new List<Item>(itemLookup.Values); Item val = list[Random.Range(0, list.Count)]; __result = ((Component)val).gameObject; return false; } } [HarmonyPatch(typeof(LootData), "GetRandomItems")] public static class LootData_GetRandomItems_Patch { private static bool Prefix(SpawnPool spawnPool, int count, bool canRepeat, ref List<GameObject> __result) { Logger.CreateLogSource("PEAKItemRandomizer").LogInfo((object)"LootData.GetRandomItems PATCH PREFIX called!"); if (Ascents.canReviveDead && Character.PlayerIsDeadOrDown()) { return true; } Dictionary<ushort, Item> itemLookup = SingletonAsset<ItemDatabase>.Instance.itemLookup; if (itemLookup == null || itemLookup.Count == 0) { return true; } List<Item> list = new List<Item>(itemLookup.Values); List<GameObject> list2 = new List<GameObject>(); HashSet<int> hashSet = new HashSet<int>(); for (int i = 0; i < count; i++) { int num; if (canRepeat) { num = Random.Range(0, list.Count); } else { int num2 = 0; do { num = Random.Range(0, list.Count); num2++; } while (hashSet.Contains(num) && hashSet.Count < list.Count && num2 < 100); hashSet.Add(num); } list2.Add(((Component)list[num]).gameObject); } __result = list2; Logger.CreateLogSource("PEAKItemRandomizer").LogInfo((object)$"LootData.GetRandomItems PATCHED! Returned {list2.Count} random items."); return false; } } [HarmonyPatch(typeof(BerryBush), "SpawnItems")] public static class BerryBush_SpawnItems_Patch { private static bool Prefix(BerryBush __instance, List<Transform> spawnSpots, ref List<PhotonView> __result) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) Logger.CreateLogSource("PEAKItemRandomizer").LogInfo((object)"BerryBush.SpawnItems PATCH PREFIX called!"); List<PhotonView> list = new List<PhotonView>(); if (!PhotonNetwork.IsMasterClient) { __result = list; return false; } List<Item> list2 = new List<Item>(); foreach (Transform spawnSpot in spawnSpots) { Collider[] array = Physics.OverlapSphere(spawnSpot.position, 1f); for (int i = 0; i < array.Length; i++) { Item component = ((Component)array[i]).GetComponent<Item>(); if ((Object)(object)component != (Object)null && !list2.Contains(component)) { list2.Add(component); } } } if (list2.Count > 0) { Logger.CreateLogSource("PEAKItemRandomizer").LogInfo((object)$"BerryBush.SpawnItems: Already has {list2.Count} items, skipping spawn."); __result = list; return false; } Dictionary<ushort, Item> itemLookup = SingletonAsset<ItemDatabase>.Instance.itemLookup; if (itemLookup == null || itemLookup.Count == 0) { __result = list; return false; } List<Item> list3 = new List<Item>(itemLookup.Values); List<Transform> list4 = new List<Transform>(spawnSpots); float value = Random.value; value = Mathf.Pow(value, __instance.randomPow); int num = Mathf.RoundToInt(Mathf.Lerp(__instance.possibleBerries.x, __instance.possibleBerries.y, value)); for (int j = 0; j < spawnSpots.Count && j < num; j++) { int index = Random.Range(0, list4.Count); Item val = list3[Random.Range(0, list3.Count)]; if ((Object)(object)val != (Object)null) { Item component2 = PhotonNetwork.InstantiateItemRoom(((Object)((Component)val).gameObject).name, list4[index].position, Quaternion.identity).GetComponent<Item>(); list.Add(((Component)component2).GetComponent<PhotonView>()); if (Object.op_Implicit((Object)(object)((Spawner)__instance).spawnUpTowardsTarget)) { Transform transform = ((Component)component2).transform; Vector3 val2 = ((Spawner)__instance).spawnUpTowardsTarget.position - ((Component)component2).transform.position; transform.up = ((Vector3)(ref val2)).normalized; ((Component)component2).transform.Rotate(Vector3.up, Random.Range(0f, 360f), (Space)1); } if ((Object)(object)component2 != (Object)null) { ((Component)component2).GetComponent<PhotonView>().RPC("SetKinematicRPC", (RpcTarget)3, new object[3] { true, ((Component)component2).transform.position, ((Component)component2).transform.rotation }); } list4.RemoveAt(index); } } __result = list; Logger.CreateLogSource("PEAKItemRandomizer").LogInfo((object)$"BerryBush.SpawnItems PATCHED! Spawned {list.Count} random items."); return false; } } [HarmonyPatch(typeof(Spawner), "SpawnItems")] public static class Spawner_SpawnItems_Patch { private static bool Prefix(Spawner __instance, List<Transform> spawnSpots, ref List<PhotonView> __result) { //IL_0065: Unknown result type (might be due to invalid IL or missing references) Logger.CreateLogSource("PEAKItemRandomizer").LogInfo((object)("Spawner.SpawnItems PATCH PREFIX called! Instance type: " + ((object)__instance).GetType().FullName)); if (((object)__instance).GetType() == typeof(RespawnChest)) { return true; } List<PhotonView> list = new List<PhotonView>(); if (!PhotonNetwork.IsMasterClient) { __result = list; return false; } List<Item> list2 = new List<Item>(); foreach (Transform spawnSpot in spawnSpots) { Collider[] array = Physics.OverlapSphere(spawnSpot.position, 1f); for (int i = 0; i < array.Length; i++) { Item component = ((Component)array[i]).GetComponent<Item>(); if ((Object)(object)component != (Object)null && !list2.Contains(component)) { list2.Add(component); } } } if (list2.Count > 0) { Logger.CreateLogSource("PEAKItemRandomizer").LogInfo((object)$"Spawner.SpawnItems: Already has {list2.Count} items, skipping spawn."); __result = list; return false; } return true; } } [HarmonyPatch(typeof(Luggage), "<OpenLuggageRPC>g__SpawnItemRoutine|14_0")] public static class Luggage_SpawnItemRoutine_Patch { private static bool Prefix(Luggage __instance) { //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) Logger.CreateLogSource("PEAKItemRandomizer").LogInfo((object)"Luggage.<OpenLuggageRPC>g__SpawnItemRoutine|14_0 PATCH PREFIX called!"); if (!PhotonNetwork.IsMasterClient) { return true; } Dictionary<ushort, Item> itemLookup = SingletonAsset<ItemDatabase>.Instance.itemLookup; if (itemLookup == null || itemLookup.Count == 0) { return true; } List<Transform> list = (List<Transform>)typeof(Spawner).GetMethod("GetSpawnSpots", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).Invoke(__instance, null); List<Item> list2 = new List<Item>(itemLookup.Values); foreach (Transform item in list) { Item val = list2[Random.Range(0, list2.Count)]; if ((Object)(object)val != (Object)null) { Item component = PhotonNetwork.InstantiateItemRoom(((Object)((Component)val).gameObject).name, item.position, item.rotation).GetComponent<Item>(); if ((Object)(object)component != (Object)null) { ((Component)component).GetComponent<PhotonView>().RPC("SetKinematicRPC", (RpcTarget)3, new object[3] { true, ((Component)component).transform.position, ((Component)component).transform.rotation }); } } } Logger.CreateLogSource("PEAKItemRandomizer").LogInfo((object)$"Luggage.<OpenLuggageRPC>g__SpawnItemRoutine|14_0 PATCHED! Spawned {list.Count} random items."); return false; } } [HarmonyPatch(typeof(Luggage), "Interact_CastFinished", new Type[] { typeof(Character) })] public static class Luggage_Interact_CastFinished_Patch { private static void Postfix(Luggage __instance, Character interactor) { //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) Logger.CreateLogSource("PEAKItemRandomizer").LogInfo((object)("Luggage.Interact_CastFinished PATCH POSTFIX called! Instance type: " + ((object)__instance).GetType().FullName)); if (((object)__instance).GetType() != typeof(RespawnChest) || !PhotonNetwork.IsMasterClient) { return; } Dictionary<ushort, Item> itemLookup = SingletonAsset<ItemDatabase>.Instance.itemLookup; if (itemLookup == null) { return; } Item val = null; foreach (Item value in itemLookup.Values) { if (((Object)value).name.ToLower().Contains("scouteffigy") || ((Object)((Component)value).gameObject).name.ToLower().Contains("scouteffigy")) { val = value; break; } } if ((Object)(object)val == (Object)null) { Logger.CreateLogSource("PEAKItemRandomizer").LogWarning((object)"Scout Effigy item not found!"); return; } Vector3 val2 = ((Component)__instance).transform.position + ((Component)__instance).transform.up * 2f; for (int i = 0; i < 3; i++) { Vector3 val3 = Quaternion.Euler(0f, (float)i * 120f, 0f) * ((Component)__instance).transform.right * 1.5f; Item component = PhotonNetwork.InstantiateItemRoom(((Object)((Component)val).gameObject).name, val2 + val3, Quaternion.identity).GetComponent<Item>(); if ((Object)(object)component != (Object)null) { ((Component)component).GetComponent<PhotonView>().RPC("SetKinematicRPC", (RpcTarget)3, new object[3] { true, ((Component)component).transform.position, ((Component)component).transform.rotation }); } } Logger.CreateLogSource("PEAKItemRandomizer").LogInfo((object)"Spawned 3 Scout Effigy items at Ancient Statue!"); } } [HarmonyPatch(typeof(Campfire), "Light_Rpc")] public static class Campfire_LightRpc_Patch { private static void Postfix(Campfire __instance) { //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) if (!PhotonNetwork.IsMasterClient) { return; } Dictionary<ushort, Item> itemLookup = SingletonAsset<ItemDatabase>.Instance.itemLookup; if (itemLookup == null) { return; } Item val = null; foreach (Item value in itemLookup.Values) { if (((Object)value).name.ToLower().Contains("scouteffigy") || ((Object)((Component)value).gameObject).name.ToLower().Contains("scouteffigy")) { val = value; break; } } if ((Object)(object)val == (Object)null) { Logger.CreateLogSource("PEAKItemRandomizer").LogWarning((object)"Scout Effigy item not found!"); return; } int num = 3; float num2 = 1f; for (int i = 0; i < num; i++) { float num3 = 360f / (float)num * (float)i; Vector3 val2 = Quaternion.Euler(0f, num3, 0f) * ((Component)__instance).transform.right * num2; Vector3 val3 = ((Component)__instance).transform.position + val2; Item component = PhotonNetwork.InstantiateItemRoom(((Object)((Component)val).gameObject).name, val3, Quaternion.identity).GetComponent<Item>(); if ((Object)(object)component != (Object)null) { ((Component)component).GetComponent<PhotonView>().RPC("SetKinematicRPC", (RpcTarget)3, new object[3] { true, ((Component)component).transform.position, ((Component)component).transform.rotation }); } } Logger.CreateLogSource("PEAKItemRandomizer").LogInfo((object)$"Spawned {num} Scout Effigy at Campfire!"); } } public static class PluginInfo { public const string PLUGIN_GUID = "com.peakmod.itemrandomizer"; public const string PLUGIN_NAME = "PEAK Item Randomizer"; public const string PLUGIN_VERSION = "1.0.0"; }