Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of UltraRareBuff v1.0.2
plugins/ClassLibrary1.dll
Decompiled a month agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Photon.Pun; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("ClassLibrary1")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ClassLibrary1")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("b02b47e0-868d-46fc-840e-b5b3046b62f4")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] [BepInPlugin("com.jair.ultrararebuff", "Ultra Rare Buff", "1.0.1")] public class UltraRareBuff : BaseUnityPlugin { public static ManualLogSource Log; public static ConfigEntry<int> UltraRareAmount; private void Awake() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; UltraRareAmount = ((BaseUnityPlugin)this).Config.Bind<int>("General", "UltraRareAmount", 3, new ConfigDescription("Cantidad de cajas UltraRare por partida", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 10), Array.Empty<object>())); Harmony val = new Harmony("com.jair.ultrararebuff"); val.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Ultra Rare Buff cargado!"); } } [HarmonyPatch(typeof(ValuableDirector), "SetupHost")] public class ValuableDirectorPatch { private static void Postfix(ValuableDirector __instance) { //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) if ((PhotonNetwork.InRoom && !PhotonNetwork.IsMasterClient) || (PhotonNetwork.InRoom && !PhotonNetwork.IsMasterClient)) { return; } UltraRareBuff.Log.LogInfo((object)"Forzando spawn de UltraRare..."); try { CosmeticWorldObjectSetup ultraRareSetup = __instance.cosmeticWorldObjectSetups[3]; List<ValuableVolume> list = (from v in Object.FindObjectsOfType<ValuableVolume>(false) where v.VolumeType == ultraRareSetup.volume orderby Random.value select v).ToList(); if (list.Count == 0) { UltraRareBuff.Log.LogWarning((object)"No se encontraron volumes válidos"); return; } PrefabRef prefab = ultraRareSetup.prefab; int num = Mathf.Clamp(UltraRareBuff.UltraRareAmount.Value, 1, 10); int num2 = Mathf.Min(num, list.Count); for (int i = 0; i < num2; i++) { ValuableVolume val = list[0]; list.RemoveAt(0); if (GameManager.instance.gameMode == 0) { Object.Instantiate<GameObject>(prefab.Prefab, ((Component)val).transform.position, ((Component)val).transform.rotation); } else { PhotonNetwork.InstantiateRoomObject(prefab.ResourcePath, ((Component)val).transform.position, ((Component)val).transform.rotation, (byte)0, (object[])null); } UltraRareBuff.Log.LogInfo((object)$"UltraRare #{i + 1} spawn en {((Object)val).name}"); } UltraRareBuff.Log.LogInfo((object)$"Spawn completado: {num2} UltraRare"); } catch (Exception ex) { UltraRareBuff.Log.LogError((object)ex); } } }