Some mods may be broken due to the recent Alloyed Collective update.
Decompiled source of FruityBossDrop v1.2.2
BossDropRework.dll
Decompiled 7 months agousing System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using On.RoR2; using R2API; using R2API.Utils; using RoR2; using UnityEngine; using UnityEngine.AddressableAssets; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")] [assembly: AssemblyCompany("BossDropRework")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("BossDropRework")] [assembly: AssemblyTitle("BossDropRework")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: UnverifiableCode] namespace BossDropRework; [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.RiskOfBrainrot.FruityBossDrops", "FruityBossDrops", "1.2.2")] [R2APISubmoduleDependency(new string[] { "LanguageAPI", "ContentAddition", "DirectorAPI" })] public class BossDropReworkPlugin : BaseUnityPlugin { public delegate void BossDropChanceHandler(CharacterBody victim, CharacterBody attacker, ref float dropChance); public delegate void TricornFireHandler(CharacterBody attacker, CharacterBody victim, ref bool shouldFire); public const string guid = "com.RiskOfBrainrot.FruityBossDrops"; public const string teamName = "RiskOfBrainrot"; public const string modName = "FruityBossDrops"; public const string version = "1.2.2"; public static BuffDef bossHunterDebuff; private int tricornDebuffDuration = 999; private bool reworkTricorn = true; public static ExplicitPickupDropTable hordeDropTable; public static PluginInfo PInfo { get; private set; } internal static ConfigFile CustomConfigFile { get; private set; } public static ConfigEntry<float> LesserDropChance { get; set; } public static ConfigEntry<float> EliteDropChance { get; set; } public static ConfigEntry<float> ChampionDropChance { get; set; } public static ConfigEntry<float> ChampionEliteDropChance { get; set; } public static ConfigEntry<float> SpecialBossDropChance { get; set; } public static ConfigEntry<bool> ForceDropsFromAurelionite { get; set; } public static ConfigEntry<bool> ReworkTricorn { get; set; } public static ConfigEntry<bool> ReworkVultures { get; set; } public static ConfigEntry<bool> ReworkPrinters { get; set; } public static ConfigEntry<float> TricornDamageCoefficient { get; set; } public static ConfigEntry<float> TricornProcCoefficient { get; set; } public static GameObject overgrownPrinterPrefab => LegacyResourcesAPI.Load<GameObject>("prefabs/networkedobjects/chest/DuplicatorWild"); public static event BossDropChanceHandler ModifyBossItemDropChance; public static event TricornFireHandler ShouldTricornFireAndBreak; public void Awake() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: 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_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) CustomConfigFile = new ConfigFile(Paths.ConfigPath + "\\FruityBossDrops.cfg", true); LesserDropChance = CustomConfigFile.Bind<float>("Trophy Drops", "Droprate for Non-Elite Lessers", 0.5f, "Includes Horde of Many"); EliteDropChance = CustomConfigFile.Bind<float>("Trophy Drops", "Droprate for Elite Lessers", 2f, "Includes Horde of Many"); ChampionDropChance = CustomConfigFile.Bind<float>("Trophy Drops", "Droprate for Non-Elite Champions", 6f, ""); ChampionEliteDropChance = CustomConfigFile.Bind<float>("Trophy Drops", "Droprate for Elite Champions", 10f, ""); SpecialBossDropChance = CustomConfigFile.Bind<float>("Trophy Drops", "Droprate for Special Bosses", 14f, "Affects AWU"); ForceDropsFromAurelionite = CustomConfigFile.Bind<bool>("Trophy Drops", "Force Drops From Aurelionite", true, "Force Aurelionite to drop a Halcyon Seed on death, replacing the portal loot with 1 green for each player. Recommended to set to false for use with GildedCoastPlus"); ReworkTricorn = CustomConfigFile.Bind<bool>("Reworks", "Rework Tricorn", true, ""); ReworkVultures = CustomConfigFile.Bind<bool>("Reworks", "Rework Wake of Vultures", true, "Turns it into a Horde of Many trophy"); ReworkPrinters = CustomConfigFile.Bind<bool>("Reworks", "Rework Overgrown Printers", true, "Removes Overgrown Printers from the game"); TricornDamageCoefficient = CustomConfigFile.Bind<float>("Tricorn", "Tricorn Damage Coefficient", 70f, "Multiply by 100 for % ie 70 is 7000%"); TricornProcCoefficient = CustomConfigFile.Bind<float>("Tricorn", "Tricorn Proc Coefficient", 5f, "Most attacks default to 1. Recommended to install ProcPatcher"); bossHunterDebuff = ScriptableObject.CreateInstance<BuffDef>(); bossHunterDebuff.buffColor = new Color(0.2f, 0.9f, 0.8f, 1f); bossHunterDebuff.canStack = false; bossHunterDebuff.isDebuff = true; BuffDef obj = bossHunterDebuff; obj.flags = (Flags)(obj.flags | 1); ((Object)bossHunterDebuff).name = "TrophyHunterDebuff"; bossHunterDebuff.iconSprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/LunarSkillReplacements/texBuffLunarDetonatorIcon.tif").WaitForCompletion(); ContentAddition.AddBuffDef(bossHunterDebuff); BossesDropBossItems(); if (ReworkTricorn.Value) { TricornRework(); } if (ReworkVultures.Value) { WakeOfVulturesRework(); } if (ReworkPrinters.Value) { DirectorAPI.InteractableActions += DeleteYellowPrinters; } } private void BossesDropBossItems() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown BossGroup.Awake += new hook_Awake(RemoveBossItemDropsFromTeleporter); GlobalEventManager.OnCharacterDeath += new hook_OnCharacterDeath(BossesDropTrophies); } private void DeleteYellowPrinters(DccsPool pool, StageInfo currentStage) { Helpers.RemoveExistingInteractable(InteractableNames.PrinterOvergrown3D); } private void RemoveBossItemDropsFromTeleporter(orig_Awake orig, BossGroup self) { orig.Invoke(self); self.bossDropChance = 0f; } public static float InvokeModifyBossItemDropChance(CharacterBody victim, CharacterBody attacker, ref float dropChance) { BossDropReworkPlugin.ModifyBossItemDropChance?.Invoke(victim, attacker, ref dropChance); return dropChance; } public void BossesDropTrophies(orig_OnCharacterDeath orig, GlobalEventManager self, DamageReport damageReport) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Invalid comparison between Unknown and I4 //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: 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_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0127: 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_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0150: 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_0159: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, damageReport); if ((int)damageReport.victimTeamIndex == 1) { return; } CharacterBody attackerBody = damageReport.attackerBody; CharacterBody victimBody = damageReport.victimBody; if ((Object)(object)attackerBody == (Object)null || (Object)(object)victimBody == (Object)null) { return; } BodyIndex bodyIndex = victimBody.bodyIndex; if ((bodyIndex == BodyCatalog.FindBodyIndex("TitanGoldBody") && !ForceDropsFromAurelionite.Value) || victimBody.healthComponent.alive) { return; } CharacterMaster attackerMaster = damageReport.attackerMaster; ItemDef val = null; int participatingPlayerCount = Run.instance.participatingPlayerCount; PickupDropTable dropTable; float dropChance = GetBaseBossItemDropChanceFromBody(victimBody, out dropTable); if (dropChance > 0f && (Object)(object)dropTable != (Object)null && InvokeModifyBossItemDropChance(victimBody, attackerBody, ref dropChance) > 0f) { PickupIndex val2 = dropTable.GenerateDrop(Run.instance.bossRewardRng); if (Util.CheckRoll(dropChance, attackerMaster) && val2 != PickupCatalog.FindPickupIndex("VoidCoin")) { Vector3 val3 = (Object.op_Implicit((Object)(object)victimBody) ? victimBody.corePosition : Vector3.zero); Vector3 val4 = val3 - attackerBody.corePosition; Vector3 normalized = ((Vector3)(ref val4)).normalized; PickupDropletController.CreatePickupDroplet(val2, val3, normalized * 15f); } } } public static float GetBaseBossItemDropChanceFromBody(CharacterBody body, out PickupDropTable dropTable) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) DeathRewards deathRewardsFromTarget = GetDeathRewardsFromTarget(body); if ((Object)(object)deathRewardsFromTarget == (Object)null || (Object)(object)deathRewardsFromTarget.bossDropTable == (Object)null) { dropTable = null; return 0f; } dropTable = deathRewardsFromTarget.bossDropTable; BodyIndex bodyIndex = body.bodyIndex; if (bodyIndex == BodyCatalog.FindBodyIndex("TitanGoldBody")) { return ForceDropsFromAurelionite.Value ? 100 : 0; } if (deathRewardsFromTarget.goldReward == 0) { return 0f; } if (bodyIndex == BodyCatalog.FindBodyIndex("SuperRoboBallBossBody")) { return SpecialBossDropChance.Value; } bool isChampion = body.isChampion; bool isElite = body.isElite; if (isChampion) { if (isElite) { return ChampionEliteDropChance.Value; } return ChampionDropChance.Value; } if (isElite) { return EliteDropChance.Value; } return LesserDropChance.Value; } public static DeathRewards GetDeathRewardsFromTarget(HurtBox hurtBox) { if ((Object)(object)hurtBox == (Object)null) { return null; } HealthComponent healthComponent = hurtBox.healthComponent; if ((Object)(object)healthComponent == (Object)null) { return null; } return GetDeathRewardsFromTarget(healthComponent.body); } public static DeathRewards GetDeathRewardsFromTarget(CharacterBody enemyBody) { if ((Object)(object)enemyBody == (Object)null) { return null; } return ((Component)enemyBody).GetComponent<DeathRewards>(); } private void TricornRework() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown EquipmentSlot.FireBossHunter += new hook_FireBossHunter(FireTricornFix); ModifyBossItemDropChance += TricornDropChance; LanguageAPI.Add("EQUIPMENT_BOSSHUNTER_PICKUP", "Cripple a large monster and claim its <style=cIsDamage>trophy</style> after it dies. Consumed on use."); LanguageAPI.Add("EQUIPMENT_BOSSHUNTER_DESC", "Targets any enemy capable of dropping a <style=cIsDamage>unique reward</style>, " + $"dealing <style=cIsDamage>{TricornDamageCoefficient.Value * 100f}% damage</style>, " + "then <style=cIsUtility>Crippling and Hemorrhaging</style> it " + $"for <style=cIsUtility>{tricornDebuffDuration}</style> seconds. " + "When the enemy dies, it has a 100% chance to drop it's <style=cIsDamage>trophy</style>. Equipment is <style=cIsUtility>consumed</style> on use."); } private void TricornDropChance(CharacterBody victim, CharacterBody attacker, ref float dropChance) { if (victim.HasBuff(bossHunterDebuff) && dropChance != 0f) { dropChance = 100f; } } public static bool GetTricornFireAndBreak(CharacterBody attacker, CharacterBody victim, ref bool shouldFire) { BossDropReworkPlugin.ShouldTricornFireAndBreak?.Invoke(attacker, victim, ref shouldFire); return shouldFire; } private bool FireTricornFix(orig_FireBossHunter orig, EquipmentSlot self) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Expected O, but got Unknown //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_0323: Unknown result type (might be due to invalid IL or missing references) //IL_032b: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Unknown result type (might be due to invalid IL or missing references) //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Expected O, but got Unknown //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Expected O, but got Unknown //IL_0131: 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_017c: Unknown result type (might be due to invalid IL or missing references) //IL_039a: Unknown result type (might be due to invalid IL or missing references) //IL_0432: Unknown result type (might be due to invalid IL or missing references) //IL_0437: Unknown result type (might be due to invalid IL or missing references) //IL_043f: Unknown result type (might be due to invalid IL or missing references) //IL_044a: Unknown result type (might be due to invalid IL or missing references) //IL_044b: Unknown result type (might be due to invalid IL or missing references) //IL_0454: Unknown result type (might be due to invalid IL or missing references) //IL_0459: Unknown result type (might be due to invalid IL or missing references) //IL_045e: Unknown result type (might be due to invalid IL or missing references) //IL_0463: Unknown result type (might be due to invalid IL or missing references) //IL_0468: Unknown result type (might be due to invalid IL or missing references) //IL_046d: Unknown result type (might be due to invalid IL or missing references) //IL_0475: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Expected O, but got Unknown //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03e9: Unknown result type (might be due to invalid IL or missing references) //IL_03f4: Unknown result type (might be due to invalid IL or missing references) //IL_03fc: Unknown result type (might be due to invalid IL or missing references) //IL_0401: Unknown result type (might be due to invalid IL or missing references) //IL_0406: Unknown result type (might be due to invalid IL or missing references) //IL_040e: Unknown result type (might be due to invalid IL or missing references) //IL_0423: Expected O, but got Unknown //IL_04e8: Unknown result type (might be due to invalid IL or missing references) //IL_04f2: Unknown result type (might be due to invalid IL or missing references) //IL_050e: Unknown result type (might be due to invalid IL or missing references) self.UpdateTargets(Equipment.BossHunter.equipmentIndex, true); HurtBox hurtBox = self.currentTarget.hurtBox; DeathRewards deathRewardsFromTarget = GetDeathRewardsFromTarget(hurtBox); if (Object.op_Implicit((Object)(object)hurtBox) && Object.op_Implicit((Object)(object)deathRewardsFromTarget)) { HealthComponent healthComponent = hurtBox.healthComponent; if ((Object)(object)healthComponent != (Object)null) { CharacterBody characterBody = self.characterBody; CharacterBody body = healthComponent.body; if ((Object)(object)body != (Object)null && (Object)(object)characterBody != (Object)null) { bool flag = false; Vector3 val = (Object.op_Implicit((Object)(object)body) ? body.corePosition : Vector3.zero); Vector3 val2 = val - characterBody.corePosition; Vector3 normalized = ((Vector3)(ref val2)).normalized; Object val3 = (val3 = (Object)(object)(((Object)(object)body != (Object)null) ? body.master : null)); if (Object.op_Implicit(val3)) { bool shouldFire = true; if (GetTricornFireAndBreak(characterBody, body, ref shouldFire)) { body.AddBuff(bossHunterDebuff); flag = true; } if (reworkTricorn) { DamageInfo val4 = new DamageInfo(); val4.attacker = ((Component)self).gameObject; val4.force = normalized * 1500f; val4.damage = characterBody.damage * TricornDamageCoefficient.Value; val4.procCoefficient = TricornProcCoefficient.Value; healthComponent.TakeDamage(val4); body.AddTimedBuffAuthority(Buffs.Cripple.buffIndex, (float)tricornDebuffDuration); DotController.InflictDot(((Component)healthComponent).gameObject, val4.attacker, (DotIndex)6, (float)tricornDebuffDuration, 1f, (uint?)null); } else { body.master.TrueKill(((Component)this).gameObject, (GameObject)null, default(DamageTypeCombo)); } } CharacterModel component = ((Component)hurtBox.hurtBoxGroup).GetComponent<CharacterModel>(); if (Object.op_Implicit((Object)(object)component)) { TemporaryOverlayInstance val5 = TemporaryOverlayManager.AddOverlay(((Component)component).gameObject); val5.duration = 0.1f; val5.animateShaderAlpha = true; val5.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); val5.destroyComponentOnEnd = true; val5.originalMaterial = LegacyResourcesAPI.Load<Material>("Materials/matHuntressFlashBright"); val5.AddToCharacterModel(component); TemporaryOverlayInstance val6 = TemporaryOverlayManager.AddOverlay(((Component)component).gameObject); val6.duration = 1.2f; val6.animateShaderAlpha = true; val6.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); val6.destroyComponentOnEnd = true; val6.originalMaterial = LegacyResourcesAPI.Load<Material>("Materials/matGhostEffect"); val6.AddToCharacterModel(component); } DamageInfo val7 = new DamageInfo(); val7.attacker = ((Component)self).gameObject; val7.force = -normalized * 2500f; self.healthComponent.TakeDamageForce(val7, true, false); GameObject val8 = LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/BossHunterKillEffect"); Quaternion rotation = Util.QuaternionSafeLookRotation(normalized, Vector3.up); EffectManager.SpawnEffect(val8, new EffectData { origin = val, rotation = rotation }, true); ModelLocator component2 = ((Component)this).gameObject.GetComponent<ModelLocator>(); CharacterModel val9; if ((Object)(object)component2 == (Object)null) { val9 = null; } else { Transform modelTransform = component2.modelTransform; val9 = (((Object)(object)modelTransform != (Object)null) ? ((Component)modelTransform).GetComponent<CharacterModel>() : null); } CharacterModel val10 = val9; if (Object.op_Implicit((Object)(object)val10)) { foreach (GameObject equipmentDisplayObject in val10.GetEquipmentDisplayObjects(Equipment.BossHunter.equipmentIndex)) { if (((Object)equipmentDisplayObject).name.Contains("DisplayTricorn")) { EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/BossHunterHatEffect"), new EffectData { origin = equipmentDisplayObject.transform.position, rotation = equipmentDisplayObject.transform.rotation, scale = equipmentDisplayObject.transform.localScale.x }, true); } else { EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/BossHunterGunEffect"), new EffectData { origin = equipmentDisplayObject.transform.position, rotation = Util.QuaternionSafeLookRotation(val - equipmentDisplayObject.transform.position, Vector3.up), scale = equipmentDisplayObject.transform.localScale.x }, true); } } } if (Object.op_Implicit((Object)(object)(((Object)(object)characterBody != (Object)null) ? characterBody.inventory : null)) && flag) { CharacterMasterNotificationQueue.PushEquipmentTransformNotification(self.characterBody.master, self.characterBody.inventory.currentEquipmentIndex, Equipment.BossHunterConsumed.equipmentIndex, (TransformationType)0); self.characterBody.inventory.SetEquipmentIndex(Equipment.BossHunterConsumed.equipmentIndex); } self.InvalidateCurrentTarget(); return true; } } } return false; } private void WakeOfVulturesRework() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown ItemDef val = Addressables.LoadAssetAsync<ItemDef>((object)"RoR2/Base/HeadHunter/HeadHunter.asset").WaitForCompletion(); val.tier = (ItemTier)4; val.deprecatedTier = (ItemTier)4; PickupDefEntry val2 = default(PickupDefEntry); val2.pickupDef = (Object)(object)val; hordeDropTable = ScriptableObject.CreateInstance<ExplicitPickupDropTable>(); ((PickupDropTable)hordeDropTable).canDropBeReplaced = true; hordeDropTable.pickupEntries = (PickupDefEntry[])(object)new PickupDefEntry[1] { val2 }; BossGroup.OnMemberDiscovered += new hook_OnMemberDiscovered(SetHordeDropTable); } private void SetHordeDropTable(orig_OnMemberDiscovered orig, BossGroup self, CharacterMaster memberMaster) { orig.Invoke(self, memberMaster); CharacterBody body = memberMaster.GetBody(); if (Object.op_Implicit((Object)(object)body) && !body.isChampion) { DeathRewards component = ((Component)body).GetComponent<DeathRewards>(); if (Object.op_Implicit((Object)(object)component)) { component.bossDropTable = (PickupDropTable)(object)hordeDropTable; } } } private void SetDropTableForHordesOfMany(orig_Awake orig, DeathRewards self) { orig.Invoke(self); CharacterBody characterBody = self.characterBody; if (Object.op_Implicit((Object)(object)characterBody) && characterBody.isBoss) { Debug.Log((object)((Object)characterBody).name); if ((Object)(object)self.bossDropTable == (Object)null) { self.bossDropTable = (PickupDropTable)(object)hordeDropTable; } } } }