using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using CartelEnforcer; using HarmonyLib; using Il2Cpp; using Il2CppFishNet; using Il2CppFishNet.Connection; using Il2CppFishNet.Managing; using Il2CppFishNet.Managing.Object; using Il2CppFishNet.Object; using Il2CppInterop.Runtime.Injection; using Il2CppInterop.Runtime.InteropTypes; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppScheduleOne; using Il2CppScheduleOne.Audio; using Il2CppScheduleOne.AvatarFramework; using Il2CppScheduleOne.AvatarFramework.Animation; using Il2CppScheduleOne.AvatarFramework.Equipping; using Il2CppScheduleOne.Cartel; using Il2CppScheduleOne.Combat; using Il2CppScheduleOne.Core.Items.Framework; using Il2CppScheduleOne.DevUtilities; using Il2CppScheduleOne.Dialogue; using Il2CppScheduleOne.Doors; using Il2CppScheduleOne.Dragging; using Il2CppScheduleOne.Economy; using Il2CppScheduleOne.EntityFramework; using Il2CppScheduleOne.GameTime; using Il2CppScheduleOne.Graffiti; using Il2CppScheduleOne.Interaction; using Il2CppScheduleOne.ItemFramework; using Il2CppScheduleOne.Law; using Il2CppScheduleOne.Levelling; using Il2CppScheduleOne.Lighting; using Il2CppScheduleOne.Map; using Il2CppScheduleOne.Messaging; using Il2CppScheduleOne.Misc; using Il2CppScheduleOne.Money; using Il2CppScheduleOne.NPCs; using Il2CppScheduleOne.NPCs.Behaviour; using Il2CppScheduleOne.NPCs.CharacterClasses; using Il2CppScheduleOne.NPCs.Other; using Il2CppScheduleOne.NPCs.Relation; using Il2CppScheduleOne.NPCs.Schedules; using Il2CppScheduleOne.ObjectScripts; using Il2CppScheduleOne.Packaging; using Il2CppScheduleOne.Persistence; using Il2CppScheduleOne.PlayerScripts; using Il2CppScheduleOne.Police; using Il2CppScheduleOne.Product; using Il2CppScheduleOne.Product.Packaging; using Il2CppScheduleOne.Property; using Il2CppScheduleOne.Quests; using Il2CppScheduleOne.Storage; using Il2CppScheduleOne.UI; using Il2CppScheduleOne.UI.Handover; using Il2CppScheduleOne.UI.MainMenu; using Il2CppScheduleOne.UI.Phone.ContactsApp; using Il2CppScheduleOne.Vehicles; using Il2CppScheduleOne.Vehicles.AI; using Il2CppScheduleOne.VoiceOver; using Il2CppSystem; using Il2CppSystem.Collections.Generic; using Il2CppSystem.Reflection; using Il2CppTMPro; using MelonLoader; using MelonLoader.Preferences; using MelonLoader.Utils; using Microsoft.CodeAnalysis; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using UnityEngine; using UnityEngine.Events; using UnityEngine.Rendering; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: MelonInfo(typeof(global::CartelEnforcer.CartelEnforcer), "Cartel Enforcer", "1.8.6", "XOWithSauce", null)] [assembly: MelonColor] [assembly: MelonOptionalDependencies(new string[] { "FishNet.Runtime" })] [assembly: MelonGame("TVGS", "Schedule I")] [assembly: MelonPlatformDomain(/*Could not decode attribute arguments.*/)] [assembly: VerifyLoaderVersion("0.7.0", true)] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: AssemblyCompany("XOWithSauce")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyCopyright("Copyright XOWithSauce 2026 Source MIT")] [assembly: AssemblyDescription("Schedule I Cartel Enforcer Mod")] [assembly: AssemblyFileVersion("1.8.5.0")] [assembly: AssemblyInformationalVersion("1.8.5")] [assembly: AssemblyProduct("Cartel Enforcer")] [assembly: AssemblyTitle("CartelEnforcer-IL2Cpp")] [assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/XOWithSauce/schedule-cartelenforcer")] [assembly: NeutralResourcesLanguage("en-US")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace CartelEnforcer { public static class DealerActivity { [HarmonyPatch(typeof(Dealer), "DealerUnconscious")] public static class Dealer_DealerUnconscious_Patch { [HarmonyPrefix] public static bool Prefix(Dealer __instance) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) if ((int)__instance.DealerType == 1) { List val = new List(); for (int i = 0; i < __instance.ActiveContracts.Count; i++) { if ((Object)(object)__instance.ActiveContracts[i] != (Object)null && !val.Contains(__instance.ActiveContracts[i])) { val.Add(__instance.ActiveContracts[i]); } } Enumerator enumerator = val.GetEnumerator(); while (enumerator.MoveNext()) { Contract current = enumerator.Current; lock (playerDealerStolenLock) { Dictionary> playerDealerStolen = DealerActivity.playerDealerStolen; Guid gUID = ((Quest)current).GUID; if (!playerDealerStolen.ContainsKey(((object)(Guid)(ref gUID)).ToString())) { ((Quest)current).Fail(true); } } } return false; } return true; } } [HarmonyPatch(typeof(Customer), "ProcessHandover")] public static class Customer_ProcessHandover_Patch { private static readonly string name = "ProcessHandover"; [HarmonyPrefix] public static bool Prefix(Customer __instance, EHandoverOutcome outcome, Contract contract, List items, bool handoverByPlayer, bool giveBonuses = true) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) if (handoverByPlayer) { return true; } if ((Object)(object)contract.Dealer == (Object)null) { CheckIntercept(__instance, contract, outcome, handoverByPlayer); return true; } CheckPlayerDealerStolen(__instance, contract, outcome); return true; } public static void CheckPlayerDealerStolen(Customer __instance, Contract contract, EHandoverOutcome outcome) { //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_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_005c: 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_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: 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_01ed: Unknown result type (might be due to invalid IL or missing references) Dictionary> playerDealerStolen = DealerActivity.playerDealerStolen; Guid gUID = ((Quest)contract).GUID; if (!playerDealerStolen.ContainsKey(((object)(Guid)(ref gUID)).ToString())) { return; } Dictionary> playerDealerStolen2 = DealerActivity.playerDealerStolen; gUID = ((Quest)contract).GUID; playerDealerStolen2.TryGetValue(((object)(Guid)(ref gUID)).ToString(), out var value); if (value == null) { return; } Dealer item = value.Item1; int item2 = value.Item2; float num = Vector3.Distance(__instance.NPC.CenterPoint, ((NPC)contract.Dealer).CenterPoint); float num2 = Vector3.Distance(__instance.NPC.CenterPoint, ((NPC)item).CenterPoint); if (num2 < num && num2 < 2f) { if (contract.Dealer.ActiveContracts.Count != 0 && (Object)(object)contract.Dealer.ActiveContracts[0] == (Object)(object)contract) { ((Quest)contract.Dealer.ActiveContracts[0]).Fail(true); } contract.Dealer = item; ((Quest)contract).CompletionXP = item2; contract.completedContractsIncremented = true; } else if (num < num2 && num2 < 2f) { if (item.ActiveContracts.Count != 0 && (Object)(object)item.ActiveContracts[0] == (Object)(object)contract) { ((Quest)item.ActiveContracts[0]).Fail(true); } if (CartelEnforcer.currentConfig.stealBackCustomers && __instance.NPC.RelationData.RelationDelta > 1f) { float relationDelta = Mathf.Clamp(Mathf.Max(__instance.NPC.RelationData.RelationDelta * 0.85f, 0.2f), 0f, 5f); __instance.NPC.RelationData.RelationDelta = relationDelta; } } lock (playerDealerStolenLock) { Dictionary> playerDealerStolen3 = DealerActivity.playerDealerStolen; gUID = ((Quest)contract).GUID; playerDealerStolen3.Remove(((object)(Guid)(ref gUID)).ToString()); } List consumedGUIDs = DealerActivity.consumedGUIDs; gUID = ((Quest)contract).GUID; consumedGUIDs.Add(((object)(Guid)(ref gUID)).ToString()); } public static void CheckIntercept(Customer __instance, Contract contract, EHandoverOutcome outcome, bool handoverByPlayer) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) if (!CartelEnforcer.currentConfig.interceptDeals) { return; } Guid gUID = ((Quest)contract).GUID; string key = ((object)(Guid)(ref gUID)).ToString(); if (InterceptEvent.contractGuids.ContainsKey(key)) { if (handoverByPlayer) { InterceptEvent.contractGuids[key].CompletedByPlayer = true; } else { InterceptEvent.contractGuids[key].CompletedByCartel = true; } } } } [HarmonyPatch(typeof(CartelDealer), "RandomizeInventory")] public static class CartelDealer_RandomizeInventory_Patch { [HarmonyPrefix] public static bool Prefix(CartelDealer __instance) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Invalid comparison between Unknown and I4 if (CartelEnforcer.currentConfig.alliedExtensions && (int)NetworkSingleton.Instance.Status == 1 && ((Dealer)__instance).IsRecruited) { return false; } if (stolenInDealerInv.TryGetValue(__instance, out var value) && value != null && value.Count != 0) { List list = new List(); for (int i = 0; i < value.Count; i++) { for (int j = 0; j < ((NPC)__instance).Inventory.ItemSlots.Count; j++) { if (((NPC)__instance).Inventory.ItemSlots[j].ItemInstance == value[i]) { list.Add(value[i]); } } } if (list.Count > 0) { CartelInventory.CartelStealsItems(list); stolenInDealerInv[__instance].Clear(); } } return true; } } [CompilerGenerated] private sealed class <>c__DisplayClass27_0 { public ProductDefinition tempDef; internal bool b__1(ProductTypeAffinity x) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) return x.DrugType == tempDef.DrugType; } } [CompilerGenerated] private sealed class d__20 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public List goons; private int 5__2; private int 5__3; private int 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__20(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { Enumerator enumerator; switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__2 = 2; 5__3 = 0; 5__4 = 0; goto IL_00eb; case 1: <>1__state = -1; enumerator = goons.GetEnumerator(); while (enumerator.MoveNext()) { CartelGoon current = enumerator.Current; if ((((NPC)current).Health.IsDead || ((NPC)current).Health.IsKnockedOut) && current.IsGoonSpawned) { 5__3++; ((NPC)current).Health.Revive(); current.Despawn(); ((Behaviour)((NPC)current).Behaviour.CombatBehaviour).Disable_Networked((NetworkConnection)null); } } if (5__3 != goons.Count) { 5__4++; goto IL_00eb; } goto IL_00fc; case 2: { <>1__state = -1; return false; } IL_00eb: if (5__4 < 5__2) { <>2__current = CartelEnforcer.Wait60; <>1__state = 1; return true; } goto IL_00fc; IL_00fc: enumerator = goons.GetEnumerator(); while (enumerator.MoveNext()) { CartelGoon current2 = enumerator.Current; if (current2.IsGoonSpawned) { if (((NPC)current2).Health.IsDead || ((NPC)current2).Health.IsKnockedOut) { ((NPC)current2).Health.Revive(); } current2.Despawn(); ((Behaviour)((NPC)current2).Behaviour.CombatBehaviour).Disable_Networked((NetworkConnection)null); } } <>2__current = null; <>1__state = 2; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__17 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private bool 5__2; private bool 5__3; private CartelDealer[] <>7__wrap3; private int <>7__wrap4; private CartelDealer 5__6; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__17(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>7__wrap3 = null; 5__6 = null; <>1__state = -2; } private bool MoveNext() { //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Invalid comparison between Unknown and I4 switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = CartelEnforcer.Wait5; <>1__state = 1; return true; case 1: { <>1__state = -1; if (allCartelDealers == null) { allCartelDealers = Il2CppArrayBase.op_Implicit(Object.FindObjectsOfType(true)); } Dealer[] array = Il2CppArrayBase.op_Implicit(Object.FindObjectsOfType(true)); foreach (Dealer val in array) { if ((int)val.DealerType == 0) { allDealers.Add(val); } } currentStayInsideStart = defaultStayInsideStart; currentStayInsideEnd = defaultStayInsideEnd; currentStayInsideDur = defaultStayInsideDur; SetupDealers(); TimeManager instance = NetworkSingleton.Instance; instance.onDayPass += Action.op_Implicit((Action)OnDayPassChange); goto IL_0553; } case 2: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } if (CartelEnforcer.currentConfig.enhancedDealers && (NetworkSingleton.Instance.CurrentTime >= 1620 || NetworkSingleton.Instance.CurrentTime <= 359)) { 5__2 = true; if ((int)NetworkSingleton.Instance.Status != 2) { 5__2 = false; } if (currentDealerActivity != previousDealerActivity) { int num = 0; int num2 = 0; int num3 = 0; if (currentDealerActivity > 0f) { int minSumFrom24HourTime = TimeManager.GetMinSumFrom24HourTime(currentStayInsideStart); int minSumFrom24HourTime2 = TimeManager.GetMinSumFrom24HourTime(359); int num4 = Mathf.RoundToInt(Mathf.Lerp((float)minSumFrom24HourTime, (float)minSumFrom24HourTime2, currentDealerActivity)); num = TimeManager.Get24HourTimeFromMinSum(num4); if (num == 400) { num = 359; } int minSumFrom24HourTime3 = TimeManager.GetMinSumFrom24HourTime(currentStayInsideEnd); int minSumFrom24HourTime4 = TimeManager.GetMinSumFrom24HourTime(1620); int num5 = Mathf.RoundToInt(Mathf.Lerp((float)minSumFrom24HourTime3, (float)minSumFrom24HourTime4, currentDealerActivity)); num2 = TimeManager.Get24HourTimeFromMinSum(num5); num3 = num5 - num4; } else if (currentDealerActivity < 0f) { float num6 = 0f - currentDealerActivity; int minSumFrom24HourTime5 = TimeManager.GetMinSumFrom24HourTime(currentStayInsideStart); int minSumFrom24HourTime6 = TimeManager.GetMinSumFrom24HourTime(2); int num7 = Mathf.RoundToInt(Mathf.Lerp((float)minSumFrom24HourTime5, (float)minSumFrom24HourTime6, num6)); num = TimeManager.Get24HourTimeFromMinSum(num7); int minSumFrom24HourTime7 = TimeManager.GetMinSumFrom24HourTime(currentStayInsideEnd); int minSumFrom24HourTime8 = TimeManager.GetMinSumFrom24HourTime(2359); int num8 = Mathf.RoundToInt(Mathf.Lerp((float)minSumFrom24HourTime7, (float)minSumFrom24HourTime8, num6)); num2 = TimeManager.Get24HourTimeFromMinSum(num8); num3 = num8 - num7; } else { num = defaultStayInsideStart; num2 = defaultStayInsideEnd; num3 = defaultStayInsideDur; } currentStayInsideStart = num; currentStayInsideEnd = num2; currentStayInsideDur = num3; <>7__wrap3 = allCartelDealers; <>7__wrap4 = 0; goto IL_0326; } goto IL_033d; } goto IL_0553; case 3: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } ApplyNewEventState(5__6, currentStayInsideStart, currentStayInsideEnd, currentStayInsideDur); 5__6 = null; <>7__wrap4++; goto IL_0326; case 4: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } ApplyNewEventState(5__6, 600, 559, 1439); 5__6.SetIsAcceptingDeals(false); 5__6 = null; <>7__wrap4++; goto IL_03fe; case 5: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } if (!((NPC)5__6).isInBuilding && !((NPC)5__6).Movement.HasDestination && !((NPC)5__6).Health.IsDead && !((NPC)5__6).Health.IsKnockedOut) { WalkToInterestPoint(5__6); } 5__6 = null; <>7__wrap4++; goto IL_04df; case 6: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } goto IL_0553; case 7: { <>1__state = -1; return false; } IL_0418: if (!5__3) { if (!5__2) { <>7__wrap3 = allCartelDealers; <>7__wrap4 = 0; goto IL_04df; } if (NetworkSingleton.Instance.CurrentTime >= currentStayInsideEnd || NetworkSingleton.Instance.CurrentTime <= currentStayInsideStart) { CartelEnforcer.coros.Add(MelonCoroutines.Start(StartActiveSignal())); } } goto IL_0553; IL_033d: previousDealerActivity = currentDealerActivity; 5__3 = false; if (dealerConfig.SafetyEnabled && currentDealerActivity <= dealerConfig.SafetyThreshold) { 5__3 = true; <>7__wrap3 = allCartelDealers; <>7__wrap4 = 0; goto IL_03fe; } goto IL_0418; IL_04df: if (<>7__wrap4 < <>7__wrap3.Length) { 5__6 = <>7__wrap3[<>7__wrap4]; <>2__current = CartelEnforcer.Wait2; <>1__state = 5; return true; } <>7__wrap3 = null; <>2__current = CartelEnforcer.Wait60; <>1__state = 6; return true; IL_0553: if (CartelEnforcer.registered) { <>2__current = CartelEnforcer.Wait60; <>1__state = 2; return true; } <>2__current = null; <>1__state = 7; return true; IL_03fe: if (<>7__wrap4 < <>7__wrap3.Length) { 5__6 = <>7__wrap3[<>7__wrap4]; <>2__current = CartelEnforcer.Wait05; <>1__state = 4; return true; } <>7__wrap3 = null; goto IL_0418; IL_0326: if (<>7__wrap4 < <>7__wrap3.Length) { 5__6 = <>7__wrap3[<>7__wrap4]; <>2__current = CartelEnforcer.Wait05; <>1__state = 3; return true; } <>7__wrap3 = null; goto IL_033d; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__27 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public bool started; public CartelCustomerDeal dealEvent; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__27(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_039b: Unknown result type (might be due to invalid IL or missing references) //IL_03b7: Unknown result type (might be due to invalid IL or missing references) //IL_03bc: Unknown result type (might be due to invalid IL or missing references) //IL_03bf: Unknown result type (might be due to invalid IL or missing references) //IL_0238: 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) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = CartelEnforcer.Wait2; <>1__state = 1; return true; case 1: <>1__state = -1; if (started) { List val = new List(); Enumerator enumerator = Customer.LockedCustomers.GetEnumerator(); while (enumerator.MoveNext()) { Customer current = enumerator.Current; if (current.NPC.Region == ((CartelActivity)dealEvent).Region) { val.Add(current); } } if (val.Count == 0) { ((CartelActivity)dealEvent).Deactivate(); return false; } int num = Random.Range(0, val.Count); Customer val2 = null; for (int i = 0; i < val.Count; i++) { val2 = val[num]; bool flag = true; if ((Object)(object)val2.CurrentContract != (Object)null) { flag = false; } if (!val2.NPC.IsConscious) { flag = false; } int orderTime = val2.customerData.OrderTime; int num2 = TimeManager.AddMinutesTo24HourTime(orderTime, 240); if (!NetworkSingleton.Instance.IsCurrentTimeWithinRange(orderTime, num2)) { flag = false; } if (!flag) { if (i == val.Count - 1) { ((CartelActivity)dealEvent).Deactivate(); val2 = null; return false; } num = (num + 1) % val.Count; } } if ((Object)(object)val2 == (Object)null) { ((CartelActivity)dealEvent).Deactivate(); return false; } EQuality correspondingQuality = StandardsMethod.GetCorrespondingQuality(val2.customerData.Standards); List list = new List(); Enumerator enumerator2 = val2.CustomerData.DefaultAffinityData.ProductAffinities.GetEnumerator(); while (enumerator2.MoveNext()) { ProductTypeAffinity current2 = enumerator2.Current; list.Add(current2); } list = list.OrderByDescending((ProductTypeAffinity x) => x.Affinity).ToList(); bool flag2 = false; ProductItemInstance val3 = null; QualityItemInstance val4 = null; Enumerator enumerator3 = ((Dealer)dealEvent.dealer).GetAllSlots().GetEnumerator(); while (enumerator3.MoveNext()) { ItemSlot current3 = enumerator3.Current; if (current3.ItemInstance == null) { continue; } val3 = ((Il2CppObjectBase)current3.ItemInstance).TryCast(); if (val3 != null) { if (((QualityItemInstance)val3).Quality < correspondingQuality) { flag2 = true; ((QualityItemInstance)val3).Quality = correspondingQuality; } else { flag2 = true; } break; } val3 = null; } if (!flag2) { List list2 = ((IEnumerable)dealEvent.dealer.RandomProducts).ToList(); ProductDefinition val5 = null; float num3 = 0f; using (List.Enumerator enumerator4 = list2.GetEnumerator()) { while (enumerator4.MoveNext()) { <>c__DisplayClass27_0 CS$<>8__locals0 = new <>c__DisplayClass27_0 { tempDef = enumerator4.Current }; ProductTypeAffinity val6 = list.First((ProductTypeAffinity x) => x.DrugType == CS$<>8__locals0.tempDef.DrugType); if (val6 != null && val6.Affinity > num3) { val5 = CS$<>8__locals0.tempDef; num3 = val6.Affinity; } } } if ((Object)(object)val5 == (Object)null) { val5 = ((Il2CppArrayBase)(object)dealEvent.dealer.RandomProducts)[0]; } ItemInstance defaultInstance = ((ItemDefinition)val5).GetDefaultInstance(10); val4 = ((Il2CppObjectBase)defaultInstance).TryCast(); if (val4 != null) { val4.Quality = correspondingQuality; } if (((NPC)dealEvent.dealer).Inventory.CanItemFit(defaultInstance)) { ((NPC)dealEvent.dealer).Inventory.InsertItem(defaultInstance, true); } } ContractInfo val7 = val2.TryGenerateContract((Dealer)(object)dealEvent.dealer); if (val7 != null) { int offeredDeals = val2.OfferedDeals; val2.OfferedDeals = offeredDeals + 1; val2.TimeSinceLastDealOffered = 0; val2.OfferedContractInfo = val7; val2.OfferedContractTime = NetworkSingleton.Instance.GetDateTime(); val2.HasChanged = true; EDealWindow dealWindow = ((Dealer)dealEvent.dealer).GetDealWindow(); Contract val8 = val2.ContractAccepted(dealWindow, false, (Dealer)(object)dealEvent.dealer); ((Quest)val8).CompletionXP = 0; val8.completedContractsIncremented = false; ((Dealer)dealEvent.dealer).AddContract(val8); } else { ((CartelActivity)dealEvent).Deactivate(); } } <>2__current = null; <>1__state = 2; return true; case 2: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__21 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private Dictionary 5__2; private Contract 5__3; private List 5__4; private List 5__5; private List.Enumerator <>7__wrap5; private Dealer 5__7; private CartelDealer[] <>7__wrap7; private int <>7__wrap8; private CartelDealer 5__10; private bool 5__11; private Customer 5__12; private ContractInfo 5__13; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__21(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if (num == -3 || num == 1) { try { } finally { <>m__Finally1(); } } 5__2 = null; 5__3 = null; 5__4 = null; 5__5 = null; <>7__wrap5 = default(List.Enumerator); 5__7 = null; <>7__wrap7 = null; 5__10 = null; 5__12 = null; 5__13 = null; <>1__state = -2; } private bool MoveNext() { //IL_0721: Unknown result type (might be due to invalid IL or missing references) //IL_0726: Unknown result type (might be due to invalid IL or missing references) //IL_072f: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_03f0: Unknown result type (might be due to invalid IL or missing references) //IL_0409: Unknown result type (might be due to invalid IL or missing references) //IL_0434: Unknown result type (might be due to invalid IL or missing references) //IL_0439: Unknown result type (might be due to invalid IL or missing references) //IL_045c: Unknown result type (might be due to invalid IL or missing references) //IL_0461: Unknown result type (might be due to invalid IL or missing references) //IL_05d4: Unknown result type (might be due to invalid IL or missing references) //IL_05de: Expected O, but got Unknown //IL_04c9: Unknown result type (might be due to invalid IL or missing references) //IL_04ce: Unknown result type (might be due to invalid IL or missing references) bool result; try { Guid gUID; switch (<>1__state) { default: result = false; goto end_IL_0000; case 0: <>1__state = -1; 5__2 = new Dictionary(); 5__3 = null; <>7__wrap5 = allDealers.GetEnumerator(); <>1__state = -3; goto IL_0191; case 1: <>1__state = -3; if (CartelEnforcer.registered) { if (5__7.ActiveContracts.Count != 0) { 5__3 = 5__7.ActiveContracts[Random.Range(0, 5__7.ActiveContracts.Count)]; gUID = ((Quest)5__3).GUID; string text = ((object)(Guid)(ref gUID)).ToString(); if (!InterceptEvent.contractGuids.Keys.Contains(text) && !5__2.ContainsValue(5__3) && !DealerActivity.consumedGUIDs.Contains(text) && !DealerActivity.playerDealerStolen.ContainsKey(text) && ((Quest)5__3).GetMinsUntilExpiry() > 120) { EMapRegion regionFromPosition = Singleton.Instance.GetRegionFromPosition(5__3.DeliveryLocation.CustomerStandPoint.position); if (!5__2.ContainsKey(regionFromPosition)) { 5__2.Add(regionFromPosition, 5__3); } } 5__7 = null; } goto IL_0191; } result = false; <>m__Finally1(); goto end_IL_0000; case 2: <>1__state = -1; if (CartelEnforcer.registered) { Customer val = 5__4[Random.Range(0, 5__4.Count)]; if ((Object)(object)val.CurrentContract == (Object)null && (Object)(object)val.AssignedDealer == (Object)null && val.offeredContractInfo != null) { 5__5.Add(val); } 5__4.Remove(val); if (5__4.Count > 0) { goto IL_0206; } <>7__wrap7 = allCartelDealers; <>7__wrap8 = 0; goto IL_0854; } result = false; goto end_IL_0000; case 3: <>1__state = -1; if (!CartelEnforcer.registered) { result = false; } else { if (NetworkSingleton.Instance.CurrentTime < currentStayInsideEnd && NetworkSingleton.Instance.CurrentTime > currentStayInsideStart) { break; } if (((Object)(object)InterceptEvent.interceptor != (Object)null && (Object)(object)InterceptEvent.interceptor == (Object)(object)5__10) || ((NPC)5__10).Health.IsDead || ((NPC)5__10).Health.IsKnockedOut || ((Dealer)5__10).ActiveContracts == null) { goto IL_0846; } if (((Dealer)5__10).ActiveContracts.Count != 0) { if (!((Behaviour)((Dealer)5__10)._attendDealBehaviour).Active) { ((Dealer)5__10).CheckAttendStart(); } goto IL_0846; } 5__11 = false; if (5__2.Count > 0 && Random.Range(0.01f, 1f) < dealerConfig.StealDealerContractChance && dealerConfig.StealDealerContractChance != 0f) { if (5__2.ContainsKey(((NPC)5__10).Region)) { 5__3 = 5__2[((NPC)5__10).Region]; } if ((Object)(object)5__3 != (Object)null) { Dictionary> playerDealerStolen = DealerActivity.playerDealerStolen; gUID = ((Quest)5__3).GUID; if (!playerDealerStolen.ContainsKey(((object)(Guid)(ref gUID)).ToString())) { List consumedGUIDs = DealerActivity.consumedGUIDs; gUID = ((Quest)5__3).GUID; if (!consumedGUIDs.Contains(((object)(Guid)(ref gUID)).ToString())) { int completionXP = ((Quest)5__3).CompletionXP; ((Quest)5__3).CompletionXP = 0; 5__3.completedContractsIncremented = false; Dealer dealer = 5__3.Dealer; lock (playerDealerStolenLock) { Dictionary> playerDealerStolen2 = DealerActivity.playerDealerStolen; gUID = ((Quest)5__3).GUID; playerDealerStolen2.Add(((object)(Guid)(ref gUID)).ToString(), new Tuple(dealer, completionXP)); } ((Dealer)5__10).AddContract(5__3); if (!((Behaviour)((Dealer)5__10)._attendDealBehaviour).Active) { ((Dealer)5__10).CheckAttendStart(); } 5__11 = true; } } } goto IL_07bd; } if (5__5.Count <= 0 || !(Random.Range(0.01f, 1f) < dealerConfig.StealPlayerPendingChance) || dealerConfig.StealPlayerPendingChance == 0f) { goto IL_07bd; } 5__12 = 5__5[Random.Range(0, 5__5.Count)]; if (!((Object)(object)5__12.CurrentContract == (Object)null) || !((Object)(object)5__12.AssignedDealer == (Object)null) || 5__12.offeredContractInfo == null) { goto IL_07a4; } 5__13 = new ContractInfo(); 5__13.DeliveryLocation = 5__12.offeredContractInfo.DeliveryLocation; 5__13.DeliveryLocationGUID = 5__12.offeredContractInfo.DeliveryLocationGUID; 5__13.Payment = 5__12.offeredContractInfo.Payment; 5__13.Expires = 5__12.offeredContractInfo.Expires; 5__13.DeliveryWindow = 5__12.offeredContractInfo.DeliveryWindow; 5__13.PickupScheduleIndex = 5__12.offeredContractInfo.PickupScheduleIndex; 5__13.ExpiresAfter = 5__12.offeredContractInfo.ExpiresAfter; 5__13.IsCounterOffer = 5__12.offeredContractInfo.IsCounterOffer; 5__13.Products = 5__12.offeredContractInfo.Products; 5__12.ExpireOffer(); <>2__current = CartelEnforcer.Wait01; <>1__state = 4; result = true; } goto end_IL_0000; case 4: { <>1__state = -1; if (CartelEnforcer.registered) { 5__12.offeredContractInfo = 5__13; EDealWindow dealWindow = ((Dealer)5__10).GetDealWindow(); 5__3 = 5__12.ContractAccepted(dealWindow, false, (Dealer)(object)5__10); if ((Object)(object)5__3 != (Object)null) { ((Quest)5__3).CompletionXP = 0; 5__3.completedContractsIncremented = false; ((Dealer)5__10).AddContract(5__3); if (!((Behaviour)((Dealer)5__10)._attendDealBehaviour).Active) { ((Dealer)5__10).CheckAttendStart(); } 5__11 = true; } 5__13 = null; goto IL_07a4; } result = false; goto end_IL_0000; } IL_0846: <>7__wrap8++; goto IL_0854; IL_07bd: if (!5__11) { if (!((NPC)5__10).isInBuilding && !((NPC)5__10).Movement.HasDestination) { WalkToInterestPoint(5__10); } } else if ((Object)(object)5__3 != (Object)null && (Object)(object)5__10 != (Object)null) { CartelInventory.FulfillContractItems(5__3, 5__10); } 5__10 = null; goto IL_0846; IL_0191: if (!<>7__wrap5.MoveNext()) { <>m__Finally1(); <>7__wrap5 = default(List.Enumerator); 5__4 = new List(); for (int i = 0; i < Customer.UnlockedCustomers.Count; i++) { 5__4.Add(Customer.UnlockedCustomers[i]); } 5__5 = new List(); goto IL_0206; } 5__7 = <>7__wrap5.Current; <>2__current = CartelEnforcer.Wait01; <>1__state = 1; result = true; goto end_IL_0000; IL_07a4: 5__5.Remove(5__12); 5__12 = null; goto IL_07bd; IL_0854: if (<>7__wrap8 >= <>7__wrap7.Length) { break; } 5__10 = <>7__wrap7[<>7__wrap8]; 5__3 = null; <>2__current = CartelEnforcer.Wait2; <>1__state = 3; result = true; goto end_IL_0000; IL_0206: <>2__current = CartelEnforcer.Wait01; <>1__state = 2; result = true; goto end_IL_0000; } <>7__wrap7 = null; 5__4.Clear(); 5__5.Clear(); 5__2.Clear(); result = false; end_IL_0000:; } catch { //try-fault ((IDisposable)this).Dispose(); throw; } return result; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; ((IDisposable)<>7__wrap5).Dispose(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__24 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public WaitForSeconds delay; public CartelDealer d; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__24(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = delay; <>1__state = 1; return true; case 1: <>1__state = -1; WalkToInterestPoint(d); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static List allDealers = new List(); public static CartelDealer[] allCartelDealers; public static CartelDealerConfig dealerConfig; public static float currentDealerActivity = 0f; public static float previousDealerActivity = 0f; private static float maxActivity = 1f; private static float minActivity = -1f; private static int defaultStayInsideStart = 200; private static int defaultStayInsideEnd = 2000; private static int defaultStayInsideDur = 1080; public static int currentStayInsideStart = 0; public static int currentStayInsideEnd = 0; public static int currentStayInsideDur = 0; public static Dictionary> playerDealerStolen = new Dictionary>(); public static readonly object playerDealerStolenLock = new object(); public static List consumedGUIDs = new List(); public static Dictionary> stolenInDealerInv = new Dictionary>(); [IteratorStateMachine(typeof(d__17))] public static IEnumerator EvaluateDealerState() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__17(0); } public static void ApplyNewEventState(CartelDealer dealer, int inStart, int inEnd, int inDur) { if ((Object)(object)InterceptEvent.interceptor != (Object)null && (Object)(object)InterceptEvent.interceptor == (Object)(object)dealer) { return; } NPCEvent_StayInBuilding val = null; if (((NPC)dealer).Behaviour.ScheduleManager.ActionList != null) { Enumerator enumerator = ((NPC)dealer).Behaviour.ScheduleManager.ActionList.GetEnumerator(); while (enumerator.MoveNext()) { NPCEvent_StayInBuilding val2 = ((Il2CppObjectBase)enumerator.Current).TryCast(); if ((Object)(object)val2 != (Object)null) { val = val2; } } } if ((Object)(object)val != (Object)null) { ((NPCAction)val).StartTime = inStart; ((NPCEvent)val).EndTime = inEnd; ((NPCEvent)val).Duration = inDur; } } public static void SetupDealers() { //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) CartelDealer[] array = allCartelDealers; foreach (CartelDealer key in array) { if (!stolenInDealerInv.ContainsKey(key)) { stolenInDealerInv.Add(key, new List()); } } string text = ""; GameObject obj = ((Il2CppObjectBase)Resources.Load(dealerConfig.CartelDealerWeapon.ToLower() switch { "m1911" => "Avatar/Equippables/M1911", "revolver" => "Avatar/Equippables/Revolver", "knife" => "Avatar/Equippables/Knife", "shotgun" => "Avatar/Equippables/PumpShotgun", _ => "Avatar/Equippables/M1911", })).TryCast(); _ = (Object)(object)obj == (Object)null; AvatarEquippable component = Object.Instantiate(obj, new Vector3(0f, -5f, 0f), Quaternion.identity, (Transform)null).GetComponent(); if (!((Component)component).gameObject.activeSelf) { ((Component)component).gameObject.SetActive(true); } AvatarRangedWeapon val = ((Il2CppObjectBase)component).TryCast(); AvatarMeleeWeapon val2 = ((Il2CppObjectBase)component).TryCast(); if ((Object)(object)val != (Object)null && dealerConfig.CartelDealerLethality > 0f) { val.Damage = Mathf.Lerp(val.Damage, val.Damage * 2f, dealerConfig.CartelDealerLethality); val.AimTime_Max = Mathf.Lerp(val.AimTime_Max, val.AimTime_Max * 0.5f, dealerConfig.CartelDealerLethality); val.AimTime_Min = Mathf.Lerp(val.AimTime_Min, val.AimTime_Min * 0.5f, dealerConfig.CartelDealerLethality); val.HitChance_MaxRange = Mathf.Lerp(val.HitChance_MaxRange, val.HitChance_MaxRange * 2f, dealerConfig.CartelDealerLethality); val.HitChance_MinRange = Mathf.Lerp(val.HitChance_MinRange, val.HitChance_MinRange * 2f, dealerConfig.CartelDealerLethality); ((AvatarWeapon)val).MaxUseRange = Mathf.Lerp(((AvatarWeapon)val).MaxUseRange, ((AvatarWeapon)val).MaxUseRange * 2f, dealerConfig.CartelDealerLethality); ((AvatarWeapon)val).MinUseRange = Mathf.Lerp(((AvatarWeapon)val).MinUseRange, ((AvatarWeapon)val).MinUseRange * 0.5f, dealerConfig.CartelDealerLethality); val.MaxFireRate = Mathf.Lerp(val.MaxFireRate, val.MaxFireRate * 0.5f, dealerConfig.CartelDealerLethality); val.ReloadTime = Mathf.Lerp(val.ReloadTime, val.ReloadTime * 0.5f, dealerConfig.CartelDealerLethality); } else if ((Object)(object)val2 != (Object)null && dealerConfig.CartelDealerLethality > 0f) { val2.Damage = Mathf.Lerp(val2.Damage, val2.Damage * 2f, dealerConfig.CartelDealerLethality); ((AvatarWeapon)val2).CooldownDuration = Mathf.Lerp(((AvatarWeapon)val2).CooldownDuration, ((AvatarWeapon)val2).CooldownDuration * 0.5f, dealerConfig.CartelDealerLethality); val2.AttackRange = Mathf.Lerp(val2.AttackRange, val2.AttackRange * 2f, dealerConfig.CartelDealerLethality); val2.AttackRadius = Mathf.Lerp(val2.AttackRadius, val2.AttackRadius * 2f, dealerConfig.CartelDealerLethality); ((AvatarWeapon)val2).MaxUseRange = Mathf.Lerp(((AvatarWeapon)val2).MaxUseRange, ((AvatarWeapon)val2).MaxUseRange * 2f, dealerConfig.CartelDealerLethality); } array = allCartelDealers; foreach (CartelDealer dealer in array) { ((NPC)dealer).Movement.WalkSpeed = dealerConfig.CartelDealerWalkSpeed; ((NPC)dealer).Health.MaxHealth = dealerConfig.CartelDealerHP; ((NPC)dealer).Health.Health = dealerConfig.CartelDealerHP; AvatarWeapon val3 = ((Il2CppObjectBase)component).TryCast(); if ((Object)(object)val3 != (Object)null) { ((NPC)dealer).Behaviour.CombatBehaviour.DefaultWeapon = val3; if ((Object)(object)((NPC)dealer).Avatar != (Object)null) { component.Equip(((NPC)dealer).Avatar); } } ((NPC)dealer).OverrideAggression(1f); NPCEvent_StayInBuilding val4 = null; if (((NPC)dealer).Behaviour.ScheduleManager.ActionList != null) { Enumerator enumerator = ((NPC)dealer).Behaviour.ScheduleManager.ActionList.GetEnumerator(); while (enumerator.MoveNext()) { NPCEvent_StayInBuilding val5 = ((Il2CppObjectBase)enumerator.Current).TryCast(); if ((Object)(object)val5 != (Object)null) { val4 = val5; } } if ((Object)(object)val4 != (Object)null) { ((NPCAction)val4).StartTime = defaultStayInsideStart; ((NPCEvent)val4).EndTime = defaultStayInsideEnd; ((NPCEvent)val4).Duration = defaultStayInsideDur; NPCEvent_StayInBuilding obj2 = val4; ((NPCAction)obj2).onEnded = ((NPCAction)obj2).onEnded + Action.op_Implicit((Action)onStayInsideEnd); } } ((NPC)dealer).Health.onDieOrKnockedOut.AddListener(UnityAction.op_Implicit((Action)OnDealerDied)); ((NPC)dealer).Health.onDieOrKnockedOut.AddListener(UnityAction.op_Implicit((Action)TrySpawnGoonsOnDeath)); void TrySpawnGoonsOnDeath() { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) if ((!(Random.Range(0f, 1f) > 0.5f) || CartelEnforcer.currentConfig.debugMode) && NetworkSingleton.Instance.GoonPool.UnspawnedGoonCount >= 2) { float num = default(float); Player closestPlayer = Player.GetClosestPlayer(((NPC)dealer).CenterPoint, ref num, (List)null); Vector3 val7 = Vector3.zero; int num2 = 4; int num3 = 0; do { if (!CartelEnforcer.registered) { return; } if (num3 == num2) { break; } Vector3 onUnitSphere = Random.onUnitSphere; onUnitSphere.y = 0f; ((Vector3)(ref onUnitSphere)).Normalize(); float num4 = Random.Range(16f, 24f); val7 = ((Component)dealer).transform.position + onUnitSphere * num4; num3++; } while (closestPlayer.IsPointVisibleToPlayer(val7, 30f, 5f)); if (!(val7 == Vector3.zero)) { List val8 = NetworkSingleton.Instance.GoonPool.SpawnMultipleGoons(val7, 2, true); Enumerator enumerator3 = val8.GetEnumerator(); while (enumerator3.MoveNext()) { CartelGoon current = enumerator3.Current; ((NPC)current).Movement.WarpToNavMesh(); if (Random.Range(0f, 1f) > 0.7f && AmbushOverrides.RangedWeapons != null && AmbushOverrides.RangedWeapons.Length != 0) { ((NPC)current).Behaviour.CombatBehaviour.DefaultWeapon = AmbushOverrides.RangedWeapons[Random.Range(0, AmbushOverrides.RangedWeapons.Length)]; } else if (AmbushOverrides.MeleeWeapons != null && AmbushOverrides.MeleeWeapons.Length != 0) { ((NPC)current).Behaviour.CombatBehaviour.DefaultWeapon = AmbushOverrides.MeleeWeapons[Random.Range(0, AmbushOverrides.MeleeWeapons.Length)]; } current.AttackEntity(((Component)closestPlayer).GetComponent(), true); } CartelEnforcer.coros.Add(MelonCoroutines.Start(DespawnDefenderGoonsSoon(val8))); } } } void onStayInsideEnd() { if ((!InterceptEvent.interceptingDeal || !((Object)(object)InterceptEvent.interceptor != (Object)null) || !((Object)(object)dealer == (Object)(object)InterceptEvent.interceptor)) && ((Dealer)dealer).ActiveContracts.Count == 0) { if (!dealer.IsAcceptingDeals) { dealer.SetIsAcceptingDeals(true); } CartelEnforcer.coros.Add(MelonCoroutines.Start(WalkToInterestPoint(dealer, CartelEnforcer.Wait5))); } } } List list = new List(); array = allCartelDealers; foreach (CartelDealer val6 in array) { if ((Object)(object)((NPC)val6).Avatar.CurrentSettings == (Object)null) { list.Add(val6); } } if (list.Count > 0) { foreach (CartelDealer item in list) { item.RandomizeAppearance(); } } list.Clear(); list = null; } [IteratorStateMachine(typeof(d__20))] public static IEnumerator DespawnDefenderGoonsSoon(List goons) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__20(0) { goons = goons }; } [IteratorStateMachine(typeof(d__21))] public static IEnumerator StartActiveSignal() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__21(0); } public static bool IsWalkingEnabled(CartelDealer d) { if (!CartelEnforcer.currentConfig.enhancedDealers) { return false; } if (!dealerConfig.FreeTimeWalking) { return false; } if (InterceptEvent.interceptingDeal && (Object)(object)InterceptEvent.interceptor != (Object)null && (Object)(object)InterceptEvent.interceptor == (Object)(object)d) { return false; } if (((Dealer)d).ActiveContracts.Count > 0) { return false; } if (((NPC)d).Health.IsDead || ((NPC)d).Health.IsKnockedOut) { return false; } if (NetworkSingleton.Instance.CurrentTime < currentStayInsideEnd && NetworkSingleton.Instance.CurrentTime > currentStayInsideStart) { return false; } if ((Object)(object)((NPC)d).Behaviour.GetBehaviour("Smoke Break") != (Object)null && ((NPC)d).Behaviour.GetBehaviour("Smoke Break").Active) { return false; } if ((Object)(object)((NPC)d).Behaviour.activeBehaviour != (Object)null && (Object)(object)((NPC)d).Behaviour.activeBehaviour == (Object)(object)((NPC)d).Behaviour.GenericDialogueBehaviour && (Object)(object)((NPC)d).Behaviour.GenericDialogueBehaviour.targetPlayer != (Object)null) { return false; } return true; } public static void WalkToInterestPoint(CartelDealer d) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected I4, but got Unknown //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0109: 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) if (!IsWalkingEnabled(d)) { return; } if (Random.Range(0f, 1f) > 0.5f) { DeliveryLocation randomUnscheduledDeliveryLocation = ((Il2CppArrayBase)(object)Singleton.instance.Regions)[(int)((NPC)d).Region].GetRandomUnscheduledDeliveryLocation(); ((NPC)d).Movement.SetDestination(randomUnscheduledDeliveryLocation.CustomerStandPoint.position); } else { List list = new List(); for (int i = 0; i < DeadDrop.DeadDrops.Count; i++) { if (DeadDrop.DeadDrops[i].Region == ((NPC)d).Region) { list.Add(DeadDrop.DeadDrops[i]); } } DeadDrop val = list[Random.Range(0, list.Count)]; _ = ((Component)val).transform.position; Vector3 val2 = ((Component)val).transform.position + ((Component)val).transform.forward * 1.6f + Vector3.down * 1.4f; Vector3 val3 = default(Vector3); ((NPC)d).Movement.GetClosestReachablePoint(val2, ref val3); if (val3 != Vector3.zero) { ((NPC)d).Movement.SetDestination(val3); } } if (!d.IsAcceptingDeals) { d.SetIsAcceptingDeals(true); } } [IteratorStateMachine(typeof(d__24))] public static IEnumerator WalkToInterestPoint(CartelDealer d, WaitForSeconds delay) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__24(0) { d = d, delay = delay }; } public static void OnDealerDied() { currentDealerActivity = Mathf.Clamp(currentDealerActivity - dealerConfig.DealerActivityDecreasePerKill, minActivity, maxActivity); } public static void OnDayPassChange() { currentDealerActivity = Mathf.Clamp(currentDealerActivity + dealerConfig.DealerActivityIncreasePerDay, minActivity, maxActivity); } [IteratorStateMachine(typeof(d__27))] public static IEnumerator OnCartelCustomerDeal(CartelCustomerDeal dealEvent, bool started) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__27(0) { dealEvent = dealEvent, started = started }; } } [Serializable] public class CartelDealerConfig { public float CartelDealerWalkSpeed = 2.8f; public float CartelDealerHP = 200f; public float CartelDealerLethality = 0.5f; public string CartelDealerWeapon = "M1911"; public float StealDealerContractChance = 0.06f; public float StealPlayerPendingChance = 0.08f; public float DealerActivityDecreasePerKill = 0.1f; public float DealerActivityIncreasePerDay = 0.25f; public float SafetyThreshold = -0.85f; public bool SafetyEnabled = true; public bool FreeTimeWalking = true; } public static class StealBackCustomer { public class StolenNPC { public NPC npc; public int sampleChancesProcessed = -1; } [CompilerGenerated] private sealed class d__8 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public NPC npc; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__8(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (Random.Range(0f, 1f) > 0.5f) { <>2__current = CartelEnforcer.Wait30; <>1__state = 1; return true; } <>2__current = CartelEnforcer.Wait10; <>1__state = 2; return true; case 1: <>1__state = -1; break; case 2: <>1__state = -1; break; } if (!CartelEnforcer.registered) { return false; } npc.MSGConversation.SendMessage(new Message(playerMessageTemplates[Random.Range(0, playerMessageTemplates.Count)], (ESenderType)1, true, -1), true, true); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__5 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public float cartelInfluence; private List 5__2; private int 5__3; private int 5__4; private int 5__5; private int 5__6; private int 5__7; private int 5__8; private EMapRegion 5__9; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__5(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: { <>1__state = -1; 5__2 = new List(); Enumerator enumerator = Customer.UnlockedCustomers.GetEnumerator(); while (enumerator.MoveNext()) { Customer current = enumerator.Current; if (!5__2.Contains(current)) { 5__2.Add(current); } } if (5__2.Count <= 18) { return false; } 5__3 = Random.Range(3, 6); 5__4 = Mathf.Clamp(5__2.Count - 5__3, 0, 5__2.Count - 1); 5__5 = 5; 5__6 = 2; 5__7 = 0; 5__8 = 0; 5__9 = (EMapRegion)0; goto IL_019a; } case 1: <>1__state = -1; goto IL_019a; case 2: { <>1__state = -1; return false; } IL_019a: if (CartelEnforcer.registered && 5__4 >= 0 && 5__8 < 5__6 && 5__7 < 5__5) { Customer val = 5__2[5__4]; if (CanStealCustomer(val.NPC, cartelInfluence) && 5__9 != val.NPC.Region) { StealCustomer(val.NPC); 5__8++; 5__9 = val.NPC.Region; } 5__4 = Mathf.Clamp(5__4 - 5__3, 0, 5__2.Count - 1); 5__3 = Random.Range(3, 6); 5__7++; <>2__current = CartelEnforcer.Wait05; <>1__state = 1; return true; } <>2__current = null; <>1__state = 2; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__4 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Invalid comparison between Unknown and I4 //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Invalid comparison between Unknown and I4 //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Invalid comparison between Unknown and I4 //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Invalid comparison between Unknown and I4 //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Invalid comparison between Unknown and I4 //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Invalid comparison between Unknown and I4 //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Invalid comparison between Unknown and I4 switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = CartelEnforcer.Wait30; <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = (object)new WaitUntil(Func.op_Implicit((Func)(() => !CartelEnforcer.isSaving && !Singleton.Instance.IsSaving))); <>1__state = 2; return true; case 2: { <>1__state = -1; if (!CartelEnforcer.registered || !CartelEnforcer.currentConfig.stealBackCustomers) { return false; } if (!InstanceFinder.NetworkManager.IsServer) { return false; } if ((int)NetworkSingleton.Instance.Status != 2) { return false; } float num = 0f; Enumerator enumerator = NetworkSingleton.Instance.Influence.regionInfluence.GetEnumerator(); while (enumerator.MoveNext()) { RegionInfluenceData current = enumerator.Current; num += current.Influence; } float num2 = num / (float)NetworkSingleton.Instance.Influence.regionInfluence.Count; if (num2 > 0f && num2 <= 0.66f) { if ((int)NetworkSingleton.Instance.CurrentDay != 1 && (int)NetworkSingleton.Instance.CurrentDay != 4 && (int)NetworkSingleton.Instance.CurrentDay != 6) { return false; } } else if (num2 > 0.66f && num2 < 0.8f) { if ((int)NetworkSingleton.Instance.CurrentDay != 1 && (int)NetworkSingleton.Instance.CurrentDay != 4) { return false; } } else if ((int)NetworkSingleton.Instance.CurrentDay != 4) { return false; } CartelEnforcer.coros.Add(MelonCoroutines.Start(StealCustomerWithDelay(num2))); return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static List stolenNPCs = new List(); public static List playerMessageTemplates = new List { "I won't be hustling with you anymore. Got better quality from another person...", "Sorry, but I've got to change my local. These prices ain't it.", "Just letting you know that I won't be hitting you up anymore...", "These last deals have been a bit pricey. I'll get my stuff elsewhere.", "You've been cutting me short. I'm done buying from you.", "Thought we were cool, but you've been ripping me off. Peace.", "That last one was too light and quality was trash... I'll find someone else." }; public static void OnDayPassTrySteal() { if (CartelEnforcer.currentConfig.stealBackCustomers) { CartelEnforcer.coros.Add(MelonCoroutines.Start(WaitSleepEndTrySteal())); } } [IteratorStateMachine(typeof(d__4))] public static IEnumerator WaitSleepEndTrySteal() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__4(0); } [IteratorStateMachine(typeof(d__5))] public static IEnumerator StealCustomerWithDelay(float cartelInfluence) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__5(0) { cartelInfluence = cartelInfluence }; } public static bool CanStealCustomer(NPC npc, float cartelInfluence) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Invalid comparison between Unknown and I4 if ((int)npc.Region == 0) { return false; } if (!npc.RelationData.Unlocked) { return false; } float num = Random.Range(0f, 1f); if ((int)npc.Region == 1 && num > 0.5f) { return false; } float num2 = Mathf.Lerp(4.5f, 1.5f, cartelInfluence); if (npc.RelationData.RelationDelta > num2 && num > 0.1f) { return false; } Customer component = ((Component)npc).GetComponent(); if (Customer.LockedCustomers.Contains(component)) { return false; } if ((Object)(object)component.CurrentContract != (Object)null) { return false; } if (component.CurrentAddiction > 0.8f && num > 0.2f) { return false; } if (npc.RelationData.Connections.Count < 2) { return false; } for (int i = 0; i < npc.RelationData.Connections.Count; i++) { if (!npc.RelationData.Connections[i].RelationData.Unlocked) { return false; } } List list = new List(stolenNPCs); for (int j = 0; j < list.Count; j++) { if ((Object)(object)list[j].npc == (Object)(object)npc) { return false; } } return true; } public static void StealCustomer(NPC npc) { npc.RelationData.Unlocked = false; Customer component = ((Component)npc).GetComponent(); if (!Customer.LockedCustomers.Contains(component)) { Customer.LockedCustomers.Add(component); } if (Customer.UnlockedCustomers.Contains(component)) { Customer.UnlockedCustomers.Remove(component); } component.minsSinceUnlocked = 0; component.customerData.GuaranteeFirstSampleSuccess = false; component.UpdatePotentialCustomerPoI(); StolenNPC stolenNPC = new StolenNPC(); stolenNPC.npc = npc; stolenNPC.sampleChancesProcessed = 1; stolenNPCs.Add(stolenNPC); if ((Object)(object)component.AssignedDealer != (Object)null) { component.AssignedDealer.RemoveCustomer(component); } Singleton.Instance.PlayPopup(component); ((TMP_Text)Singleton.Instance.Title).text = "Customer has been stolen by Cartel!"; CartelEnforcer.coros.Add(MelonCoroutines.Start(LateSendMessage(npc))); } [IteratorStateMachine(typeof(d__8))] public static IEnumerator LateSendMessage(NPC npc) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__8(0) { npc = npc }; } } [HarmonyPatch(typeof(Customer), "GetSampleSuccess")] public static class Customer_GetSampleSuccess_Patch { [HarmonyPostfix] public static void Postfix(Customer __instance, ref float __result) { if (!CartelEnforcer.currentConfig.stealBackCustomers) { return; } List list = new List(StealBackCustomer.stolenNPCs); StealBackCustomer.StolenNPC stolenNPC = null; for (int i = 0; i < list.Count; i++) { if ((Object)(object)list[i].npc == (Object)(object)__instance.NPC) { stolenNPC = list[i]; break; } } if (stolenNPC != null && stolenNPC.sampleChancesProcessed != -1) { float num = (float)stolenNPC.sampleChancesProcessed / 9f; if (num >= 1f) { __result = 0.95f; } else { __result = Mathf.Lerp(0.05f, 0.75f, Mathf.Clamp01(num * (1f + __instance.CurrentAddiction))); } stolenNPC.sampleChancesProcessed++; } } } public class CartelRegActivityHours { public int cartelActivityClass; public int hoursUntilEnable; } [Serializable] public class EventFrequencyConfig { public List events; public void InitializeDefault() { events = new List(); events.Add(new EventFrequency { Identifier = "Ambush", CooldownHours = 0, InfluenceRequirement = -1f, RandomTimeRangePercentage = 0f }); events.Add(new EventFrequency { Identifier = "RegionActivity", CooldownHours = 0, InfluenceRequirement = -1f, RandomTimeRangePercentage = 0f }); events.Add(new EventFrequency { Identifier = "StealDeadDrop", CooldownHours = 0, InfluenceRequirement = -1f, RandomTimeRangePercentage = 0f }); events.Add(new EventFrequency { Identifier = "CartelCustomerDeal", CooldownHours = 0, InfluenceRequirement = -1f, RandomTimeRangePercentage = 0f }); events.Add(new EventFrequency { Identifier = "RobDealer", CooldownHours = 0, InfluenceRequirement = -1f, RandomTimeRangePercentage = 0f }); events.Add(new EventFrequency { Identifier = "SprayGraffiti", CooldownHours = 0, InfluenceRequirement = -1f, RandomTimeRangePercentage = 0f }); events.Add(new EventFrequency { Identifier = "CartelPlayerDeal", CooldownHours = 0, InfluenceRequirement = -1f, RandomTimeRangePercentage = 0f }); events.Add(new EventFrequency { Identifier = "DriveBy", CooldownHours = 0, InfluenceRequirement = -1f, RandomTimeRangePercentage = 0f }); events.Add(new EventFrequency { Identifier = "InterceptDeals", CooldownHours = 0, InfluenceRequirement = -1f, RandomTimeRangePercentage = 0f }); events.Add(new EventFrequency { Identifier = "Gathering", CooldownHours = 0, InfluenceRequirement = -1f, RandomTimeRangePercentage = 0f }); events.Add(new EventFrequency { Identifier = "Sabotage", CooldownHours = 0, InfluenceRequirement = -1f, RandomTimeRangePercentage = 0f }); } } [Serializable] public class EventFrequency { public string Identifier = ""; public int CooldownHours; public float InfluenceRequirement; public float RandomTimeRangePercentage = 0.15f; } [Serializable] public class CurrentEventCooldowns { public int StealDeadDropCooldown; public int CartelCustomerDealCooldown; public int RobDealerCooldown; public int SprayGraffitiCooldown; public int DriveByCooldown; public int GatheringCooldown; public int InterceptDealsCooldown; public Dictionary SabotageCooldowns; public void InitializeDefault() { StealDeadDropCooldown = FrequencyOverrides.GetActivityHours("StealDeadDrop"); CartelCustomerDealCooldown = FrequencyOverrides.GetActivityHours("CartelCustomerDeal"); RobDealerCooldown = FrequencyOverrides.GetActivityHours("RobDealer"); SprayGraffitiCooldown = FrequencyOverrides.GetActivityHours("SprayGraffiti"); int activityHours = FrequencyOverrides.GetActivityHours("DriveBy"); DriveByCooldown = ((activityHours != 0) ? activityHours : Random.Range(24, 68)); int activityHours2 = FrequencyOverrides.GetActivityHours("Gathering"); GatheringCooldown = ((activityHours2 != 0) ? activityHours2 : Random.Range(6, 15)); int activityHours3 = FrequencyOverrides.GetActivityHours("InterceptDeals"); InterceptDealsCooldown = ((activityHours3 != 0) ? activityHours3 : Random.Range(2, 8)); int activityHours4 = FrequencyOverrides.GetActivityHours("Sabotage"); activityHours4 = ((activityHours4 != 0) ? activityHours4 : Random.Range(16, 64)); SabotageCooldowns = new Dictionary { { "Laundromat", activityHours4 }, { "Post Office", activityHours4 }, { "Taco Ticklers", activityHours4 } }; } } public static class FrequencyOverrides { public static EventFrequencyConfig frequencyConfig; public static List regActivityHours = new List(); public static readonly List SupportedEventIdentifiers = new List { "Ambush", "RegionActivity", "StealDeadDrop", "CartelCustomerDeal", "RobDealer", "SprayGraffiti", "CartelPlayerDeal", "DriveBy", "InterceptDeals", "Gathering", "Sabotage" }; public static void InitFrequencyOverrides() { regActivityHours.Add(new CartelRegActivityHours { cartelActivityClass = 0, hoursUntilEnable = CartelEnforcer.eventCooldowns.StealDeadDropCooldown }); regActivityHours.Add(new CartelRegActivityHours { cartelActivityClass = 1, hoursUntilEnable = CartelEnforcer.eventCooldowns.CartelCustomerDealCooldown }); regActivityHours.Add(new CartelRegActivityHours { cartelActivityClass = 2, hoursUntilEnable = CartelEnforcer.eventCooldowns.RobDealerCooldown }); regActivityHours.Add(new CartelRegActivityHours { cartelActivityClass = 3, hoursUntilEnable = CartelEnforcer.eventCooldowns.SprayGraffitiCooldown }); DriveByEvent.hoursUntilDriveBy = CartelEnforcer.eventCooldowns.DriveByCooldown; CartelGathering.hoursUntilNextGathering = CartelEnforcer.eventCooldowns.GatheringCooldown; InterceptEvent.hoursUntilInterceptEvent = CartelEnforcer.eventCooldowns.InterceptDealsCooldown; if (CartelEnforcer.eventCooldowns.SabotageCooldowns != null && CartelEnforcer.eventCooldowns.SabotageCooldowns.Count > 0) { try { SabotageEvent.locations.ForEach(delegate(SabotageEvent.SabotageEventLocation x) { x.hoursUntilEnabled = CartelEnforcer.eventCooldowns.SabotageCooldowns.First((KeyValuePair y) => y.Key == ((Property)x.business).propertyName).Value; }); } catch (Exception) { } } Enumerator enumerator = NetworkSingleton.Instance.Activities.GlobalActivities.GetEnumerator(); while (enumerator.MoveNext()) { CartelActivity current = enumerator.Current; float influenceRequirement = GetByID("Ambush").InfluenceRequirement; if (influenceRequirement >= 0f) { current.InfluenceRequirement = influenceRequirement; } } CartelRegionActivities[] array = Il2CppArrayBase.op_Implicit((Il2CppArrayBase)(object)NetworkSingleton.Instance.Activities.RegionalActivities); for (int i = 0; i < array.Length; i++) { enumerator = array[i].Activities.GetEnumerator(); while (enumerator.MoveNext()) { CartelActivity current2 = enumerator.Current; float influenceRequirement2 = GetByID(((MemberInfo)((Object)current2).GetIl2CppType()).Name).InfluenceRequirement; if (influenceRequirement2 >= 0f) { current2.InfluenceRequirement = influenceRequirement2; } } } } public static int GetActivityHours(string identifier) { EventFrequency byID = GetByID(identifier); _ = byID.RandomTimeRangePercentage; int num = Mathf.RoundToInt((float)byID.CooldownHours * (1f + byID.RandomTimeRangePercentage)); int num2 = Mathf.Clamp(Mathf.RoundToInt((float)byID.CooldownHours * (1f - byID.RandomTimeRangePercentage)), 1, num - 1); if (byID.CooldownHours != 0) { return Random.Range(num2, num); } return byID.CooldownHours; } public static EventFrequency GetByID(string identifier) { return frequencyConfig.events.First((EventFrequency x) => SupportedEventIdentifiers.Contains(x.Identifier) && x.Identifier == identifier); } public static void OnHourPassReduceCartelRegActHours() { if (regActivityHours == null || regActivityHours.Count == 0 || Singleton.Instance.IsSaving || CartelEnforcer.isSaving) { return; } foreach (CartelRegActivityHours regActivityHour in regActivityHours) { if (regActivityHour.hoursUntilEnable > 0) { regActivityHour.hoursUntilEnable--; } } } } [HarmonyPatch(typeof(CartelDealManager), "CompleteDeal")] public static class CartelDealManager_CompleteDeal_Patch { [HarmonyPostfix] public static void Postfix(CartelDealManager __instance) { int activityHours = FrequencyOverrides.GetActivityHours("CartelPlayerDeal"); __instance.HoursUntilNextDealRequest = ((activityHours != 0) ? activityHours : __instance.HoursUntilNextDealRequest); } } [HarmonyPatch(typeof(CartelActivities), "TryStartActivity")] public static class CartelActivities_TryStartActivityPatch { private static readonly string name = "TryStartGlobalActivity"; [HarmonyPrefix] public static bool Prefix(CartelActivities __instance) { //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: 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_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_0185: 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_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) int activityHours = FrequencyOverrides.GetActivityHours("Ambush"); if (activityHours == 0) { __instance.HoursUntilNextGlobalActivity = CartelActivities.GetNewCooldown(); } else { __instance.HoursUntilNextGlobalActivity = activityHours; } if (!__instance.CanNewActivityBegin()) { return false; } List list = new List(); List list2 = new List(); Enumerator enumerator = __instance.GetActivitiesReadyToStart().GetEnumerator(); while (enumerator.MoveNext()) { CartelActivity current = enumerator.Current; list.Add(current); } Enumerator enumerator2 = __instance.GetValidRegionsForActivity().GetEnumerator(); while (enumerator2.MoveNext()) { EMapRegion current2 = enumerator2.Current; list2.Add(current2); } if (list.Count == 0 || list2.Count == 0) { return false; } list2.Sort((EMapRegion a, EMapRegion b) => NetworkSingleton.Instance.Influence.GetInfluence(b).CompareTo(NetworkSingleton.Instance.Influence.GetInfluence(a))); bool flag = false; EMapRegion currentRegion = Player.Local.CurrentRegion; if (list2.Contains(currentRegion)) { flag = true; list2.Remove(currentRegion); list2.Insert(0, currentRegion); } EMapRegion val = (EMapRegion)0; bool flag2 = false; if (!CartelEnforcer.currentConfig.debugMode) { foreach (EMapRegion item in list2) { float influence = NetworkSingleton.Instance.Influence.GetInfluence(item); float num = 0f; float num2 = 0f; num = AmbushOverrides.ambushSettings.AmbushTriggerProbability; num2 = influence * num; if (Random.Range(0f, 1f) < num2) { val = item; flag2 = true; break; } } if (!flag2) { return false; } } else { flag2 = true; val = Player.Local.CurrentRegion; } int count = list.Count; bool flag3 = false; do { count = list.Count; if (count == 0) { break; } int num3 = 0; if (flag) { num3 = (flag3 ? Random.Range(0, count) : 0); flag3 = true; } else { num3 = Random.Range(0, count); } if (list[num3].IsRegionValidForActivity(val)) { NetworkSingleton.Instance.Activities.StartGlobalActivity((NetworkConnection)null, val, 0); if (activityHours == 0) { __instance.HoursUntilNextGlobalActivity = CartelActivities.GetNewCooldown(); } else { __instance.HoursUntilNextGlobalActivity = activityHours; } break; } list.Remove(list[num3]); } while (count != 0); list.Clear(); list2.Clear(); return false; } } [HarmonyPatch(typeof(CartelRegionActivities), "TryStartActivity")] public static class CartelRegionActivities_TryStartActivityPatch { private static readonly string name = "TryStartRegionActivity"; [HarmonyPrefix] public static bool Prefix(CartelRegionActivities __instance) { //IL_0016: 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) Dictionary> dictionary = new Dictionary>(); int activityHours = FrequencyOverrides.GetActivityHours("RegionActivity"); if (activityHours == 0) { __instance.HoursUntilNextActivity = CartelRegionActivities.GetNewCooldown(__instance.Region); } else { __instance.HoursUntilNextActivity = activityHours; } Enumerator enumerator = __instance.Activities.GetEnumerator(); while (enumerator.MoveNext()) { CartelActivity current = enumerator.Current; int actInt = 0; string text = ""; if ((Object)(object)((Il2CppObjectBase)current).TryCast() != (Object)null) { actInt = 0; text = "StealDeadDrop"; } else if ((Object)(object)((Il2CppObjectBase)current).TryCast() != (Object)null) { actInt = 1; text = "CartelCustomerDeal"; } else if ((Object)(object)((Il2CppObjectBase)current).TryCast() != (Object)null) { actInt = 2; text = "RobDealer"; } else { actInt = 3; text = "SprayGraffiti"; } CartelRegActivityHours cartelRegActivityHours = FrequencyOverrides.regActivityHours.First((CartelRegActivityHours x) => x.cartelActivityClass == actInt); if (cartelRegActivityHours != null && cartelRegActivityHours.hoursUntilEnable <= 0) { dictionary.Add(current, new Tuple(actInt, text)); } } if (dictionary.Count == 0) { dictionary.Clear(); return false; } int count = dictionary.Count; do { count = dictionary.Count; if (count == 0) { break; } KeyValuePair> keyValuePair = dictionary.ElementAt(Random.Range(0, count)); if (keyValuePair.Key.IsRegionValidForActivity(__instance.Region)) { __instance.StartActivity((NetworkConnection)null, __instance.Activities.IndexOf(keyValuePair.Key)); FrequencyOverrides.regActivityHours[keyValuePair.Value.Item1].hoursUntilEnable = FrequencyOverrides.GetActivityHours(keyValuePair.Value.Item2); break; } dictionary.Remove(keyValuePair.Key); } while (count != 0); dictionary.Clear(); dictionary = null; return false; } } public static class InfluenceOverrides { [CompilerGenerated] private sealed class d__1 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private IEnumerator <>7__wrap1; private MapRegionData 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__1(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if (num == -3 || num == 1) { try { } finally { <>m__Finally1(); } } <>7__wrap1 = null; 5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) try { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>7__wrap1 = ((Il2CppArrayBase)(object)Singleton.Instance.Regions).GetEnumerator(); <>1__state = -3; goto IL_00b5; case 1: <>1__state = -3; if (ShouldChangeInfluence(5__3.Region)) { NetworkSingleton.Instance.Influence.ChangeInfluence(5__3.Region, CartelEnforcer.influenceConfig.passiveInfluenceGainPerDay); } 5__3 = null; goto IL_00b5; case 2: { <>1__state = -1; return false; } IL_00b5: if (<>7__wrap1.MoveNext()) { 5__3 = <>7__wrap1.Current; <>2__current = CartelEnforcer.Wait05; <>1__state = 1; return true; } <>m__Finally1(); <>7__wrap1 = null; <>2__current = null; <>1__state = 2; return true; } } catch { //try-fault ((IDisposable)this).Dispose(); throw; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; if (<>7__wrap1 != null) { <>7__wrap1.Dispose(); } } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static bool ShouldChangeInfluence(EMapRegion region) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Invalid comparison between Unknown and I4 //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) bool result = false; if ((int)NetworkSingleton.Instance.Status != 2) { result = false; } Enumerator enumerator = Singleton.Instance.GetUnlockedRegions().GetEnumerator(); while (enumerator.MoveNext()) { if (enumerator.Current == region && InstanceFinder.IsServer) { result = true; break; } } if ((int)region == 0) { result = false; } return result; } [IteratorStateMachine(typeof(d__1))] public static IEnumerator OnDayChangeApplyPassiveGain() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__1(0); } public static void OnDayPassChangePassive() { if (CartelEnforcer.influenceConfig.passiveInfluenceGainPerDay != 0f) { CartelEnforcer.coros.Add(MelonCoroutines.Start(OnDayChangeApplyPassiveGain())); } } } [Serializable] public class InfluenceConfig { public float interceptFail = 0.025f; public float interceptSuccess = -0.05f; public float deadDropFail = 0.025f; public float deadDropSuccess = -0.05f; public float gatheringFail = 0.025f; public float gatheringSuccess = -0.08f; public float robberyPlayerEscape = 0.025f; public float robberyGoonEscapeSuccess = 0.025f; public float robberyGoonDead = -0.08f; public float robberyGoonEscapeDead = -0.05f; public float sabotageBombDefused = -0.15f; public float sabotageGoonKilled = -0.05f; public float sabotageBombExploded = 0.2f; public float cartelDealerPersuaded = -0.1f; public float trucedGreetingChallenge = -0.15f; public float passiveInfluenceGainPerDay = 0.025f; public float cartelDealerDied = -0.1f; public float ambushDefeated = -0.1f; public float graffitiInfluenceReduction = -0.05f; public float customerUnlockInfluenceChange = -0.075f; } [HarmonyPatch(typeof(CartelDealer), "DiedOrKnockedOut")] public static class CartelDealer_Died_Patch { public static bool Prefix(CartelDealer __instance) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Invalid comparison between Unknown and I4 //IL_0023: Unknown result type (might be due to invalid IL or missing references) if (!InstanceFinder.IsServer) { return false; } if ((int)NetworkSingleton.Instance.Status != 2) { return false; } NetworkSingleton.Instance.Influence.ChangeInfluence(((NPC)__instance).Region, CartelEnforcer.influenceConfig.cartelDealerDied); return false; } } [HarmonyPatch(typeof(Ambush), "SpawnAmbush")] public static class Ambush_SpawnAmbush_Patch { [CompilerGenerated] private sealed class d__1 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public List currentlySpawned; public EMapRegion region; private float 5__2; private float 5__3; private List 5__4; private float 5__5; private float 5__6; private List 5__7; private int 5__8; private List.Enumerator <>7__wrap8; private CartelGoon 5__10; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__1(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { switch (<>1__state) { case -3: case 2: try { } finally { <>m__Finally1(); } break; case -4: case 3: try { } finally { <>m__Finally2(); } break; } 5__4 = null; 5__7 = null; <>7__wrap8 = default(List.Enumerator); 5__10 = null; <>1__state = -2; } private bool MoveNext() { //IL_038d: Unknown result type (might be due to invalid IL or missing references) try { switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__2 = 0.3f; 5__3 = 0f; 5__4 = new List(); goto IL_0103; case 1: <>1__state = -1; 5__3 += 0.1f; if (NetworkSingleton.Instance.GoonPool.spawnedGoons.Count != currentlySpawned.Count) { Enumerator enumerator = NetworkSingleton.Instance.GoonPool.spawnedGoons.GetEnumerator(); while (enumerator.MoveNext()) { CartelGoon current = enumerator.Current; if (!currentlySpawned.Contains(current) && !5__4.Contains(current) && !CartelGathering.spawnedGatherGoons.Contains(current)) { 5__4.Add(current); } } } goto IL_0103; case 2: <>1__state = -3; 5__6 += 0.5f; if (!5__7.Contains(5__10)) { if (((NPC)5__10).Health.IsDead || ((NPC)5__10).Health.IsKnockedOut) { 5__7.Add(5__10); } 5__10 = null; } goto IL_023e; case 3: <>1__state = -4; 5__6 += 0.5f; if (5__4.Contains(5__10)) { 5__4.Remove(5__10); } 5__10 = null; goto IL_02eb; case 4: { <>1__state = -1; if ((5__4.Count == 0 || 5__7.Count == 5__8) && InstanceFinder.IsServer) { float num = 0f - Ambush.AMBUSH_DEFEATED_INFLUENCE_CHANGE + CartelEnforcer.influenceConfig.ambushDefeated; if (num != 0f) { NetworkSingleton.Instance.Influence.ChangeInfluence(region, num); } } return false; } IL_030a: if (CartelEnforcer.registered && 5__6 < 5__5 && 5__4.Count != 0 && 5__7.Count != 5__8) { <>7__wrap8 = 5__4.GetEnumerator(); <>1__state = -3; goto IL_023e; } <>2__current = CartelEnforcer.Wait01; <>1__state = 4; return true; IL_023e: if (<>7__wrap8.MoveNext()) { 5__10 = <>7__wrap8.Current; <>2__current = CartelEnforcer.Wait05; <>1__state = 2; return true; } <>m__Finally1(); <>7__wrap8 = default(List.Enumerator); <>7__wrap8 = 5__7.GetEnumerator(); <>1__state = -4; goto IL_02eb; IL_0103: if (CartelEnforcer.registered && 5__3 < 5__2) { <>2__current = CartelEnforcer.Wait01; <>1__state = 1; return true; } if (5__4.Count == 0) { return false; } 5__5 = Ambush.CANCEL_AMBUSH_AFTER_MINS; 5__6 = 0f; 5__7 = new List(); 5__8 = 5__4.Count; goto IL_030a; IL_02eb: if (<>7__wrap8.MoveNext()) { 5__10 = <>7__wrap8.Current; <>2__current = CartelEnforcer.Wait05; <>1__state = 3; return true; } <>m__Finally2(); <>7__wrap8 = default(List.Enumerator); goto IL_030a; } } catch { //try-fault ((IDisposable)this).Dispose(); throw; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; ((IDisposable)<>7__wrap8).Dispose(); } private void <>m__Finally2() { <>1__state = -1; ((IDisposable)<>7__wrap8).Dispose(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static bool Prefix(Ambush __instance, Player target, Vector3[] potentialSpawnPoints) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) List spawnedGoons = NetworkSingleton.Instance.GoonPool.spawnedGoons; List list = new List(spawnedGoons.Count); Enumerator enumerator = spawnedGoons.GetEnumerator(); while (enumerator.MoveNext()) { CartelGoon current = enumerator.Current; list.Add(current); } List currentlySpawned = list; CartelEnforcer.coros.Add(MelonCoroutines.Start(OverMonitorAmbush(potentialSpawnPoints, currentlySpawned, ((CartelActivity)__instance).Region))); return true; } [IteratorStateMachine(typeof(d__1))] public static IEnumerator OverMonitorAmbush(Vector3[] potentialSpawnPoints, List currentlySpawned, EMapRegion region) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__1(0) { currentlySpawned = currentlySpawned, region = region }; } } [HarmonyPatch(typeof(WorldSpraySurface), "Reward")] public static class WorldSpraySurface_Reward_Patch { public static bool Prefix(WorldSpraySurface __instance) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Invalid comparison between Unknown and I4 //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Invalid comparison between Unknown and I4 NetworkSingleton.Instance.AddXP(50); if (!InstanceFinder.IsServer) { return false; } if ((int)NetworkSingleton.Instance.Status != 2 || (CartelEnforcer.currentConfig.alliedExtensions && (int)NetworkSingleton.Instance.Status == 1)) { NetworkSingleton.Instance.Influence.ChangeInfluence(__instance.Region, CartelEnforcer.influenceConfig.graffitiInfluenceReduction); } return false; } } [HarmonyPatch(typeof(Customer), "OnCustomerUnlocked")] public static class Customer_OnCustomerUnlocked_Patch { public static bool Prefix(Customer __instance, EUnlockType unlockType, bool notify) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Invalid comparison between Unknown and I4 //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Invalid comparison between Unknown and I4 //IL_0112: 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_00cb: 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) if (!notify || !NetworkSingleton.InstanceExists) { return true; } bool num = (int)NetworkSingleton.Instance.Status == 2; bool flag = (int)NetworkSingleton.Instance.Status == 1; if (num || flag) { if (flag && !CartelEnforcer.currentConfig.alliedExtensions) { return true; } if ((int)NetworkSingleton.Instance.Status != 2) { return true; } if (CartelEnforcer.currentConfig.stealBackCustomers) { List list = new List(StealBackCustomer.stolenNPCs); StealBackCustomer.StolenNPC stolenNPC = null; for (int i = 0; i < list.Count; i++) { if ((Object)(object)list[i].npc == (Object)(object)__instance.NPC) { stolenNPC = list[i]; break; } } if (stolenNPC != null) { float num2 = 0f - Customer.CUSTOMER_UNLOCKED_CARTEL_INFLUENCE_CHANGE + CartelEnforcer.influenceConfig.customerUnlockInfluenceChange * 0.5f; if (num2 != 0f && (int)__instance.NPC.Region != 0) { NetworkSingleton.Instance.Influence.ChangeInfluence(__instance.NPC.Region, num2); } } } else { float num3 = 0f - Customer.CUSTOMER_UNLOCKED_CARTEL_INFLUENCE_CHANGE + CartelEnforcer.influenceConfig.customerUnlockInfluenceChange; if (num3 != 0f && (int)__instance.NPC.Region != 0) { NetworkSingleton.Instance.Influence.ChangeInfluence(__instance.NPC.Region, num3); } } return true; } return true; } } public static class AlliedExtension { [CompilerGenerated] private sealed class d__4 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public ECartelStatus oldStatus; public ECartelStatus newStatus; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0046: 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_00fe: Invalid comparison between Unknown and I4 //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Invalid comparison between Unknown and I4 //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Invalid comparison between Unknown and I4 //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = CartelEnforcer.Wait5; <>1__state = 1; return true; case 1: <>1__state = -1; if ((int)oldStatus == 0 && (int)newStatus == 1) { CartelDealer[] allCartelDealers = DealerActivity.allCartelDealers; for (int i = 0; i < allCartelDealers.Length; i++) { CartelPersuade.AddPersuadeDialogue(allCartelDealers[i]); } if (!alliedQuests.alliedIntroCompleted && (Object)(object)EndGameQuest.activeTruceIntro == (Object)null) { <>2__current = (object)new WaitUntil(Func.op_Implicit((Func)CanStart)); <>1__state = 2; return true; } } else if ((int)oldStatus == 1 && (int)newStatus == 2) { CartelDealer[] allCartelDealers = DealerActivity.allCartelDealers; foreach (CartelDealer val in allCartelDealers) { if (((Dealer)val).IsRecruited) { ((Dealer)val).IsRecruited = false; ((NPC)val).Inventory.ClearInventoryEachNight = true; if (((Dealer)val).AssignedCustomers.Count == 0) { continue; } for (int num = ((Dealer)val).AssignedCustomers.Count - 1; num >= 0; num--) { if ((Object)(object)((Dealer)val).AssignedCustomers[num] != (Object)null) { ((Dealer)val).RemoveCustomer(((Dealer)val).AssignedCustomers[num]); } } } if (((Dealer)val).HasBeenRecommended) { ((Dealer)val).HasBeenRecommended = false; } if (((NPC)val).RelationData.Unlocked) { ((NPC)val).RelationData.Unlocked = false; } } } goto IL_01c1; case 2: <>1__state = -1; <>2__current = CartelEnforcer.Wait05; <>1__state = 3; return true; case 3: <>1__state = -1; CartelEnforcer.coros.Add(MelonCoroutines.Start(EndGameQuest.SetupTruceIntroQuest())); goto IL_01c1; case 4: { <>1__state = -1; return false; } IL_01c1: <>2__current = null; <>1__state = 4; return true; } static bool CanStart() { if (!Singleton.Instance.isActive && !Singleton.Instance.IsOpen) { return PlayerSingleton.Instance.activeUIElementCount <= 0; } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__6 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__6(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Invalid comparison between Unknown and I4 //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Invalid comparison between Unknown and I4 //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Expected I4, but got Unknown //IL_02ee: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_0318: Invalid comparison between Unknown and I4 //IL_0380: Unknown result type (might be due to invalid IL or missing references) //IL_0386: Invalid comparison between Unknown and I4 //IL_03a9: Unknown result type (might be due to invalid IL or missing references) //IL_03af: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: Unknown result type (might be due to invalid IL or missing references) //IL_03b5: Unknown result type (might be due to invalid IL or missing references) //IL_03ca: Unknown result type (might be due to invalid IL or missing references) //IL_038b: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = CartelEnforcer.Wait10; <>1__state = 1; return true; case 1: { <>1__state = -1; alliedConfig = ConfigLoader.LoadAlliedConfig(); alliedQuests = ConfigLoader.LoadAlliedQuests(); persuadeContainer = CartelPersuade.InitPersuadeContainer(); SuppliesModule.InitSuppliesModule(); NetworkSingleton.Instance.onMinutePass.Add(Action.op_Implicit((Action)CartelPersuade.ReduceCooldown)); TimeManager instance = NetworkSingleton.Instance; instance.onHourPass += Action.op_Implicit((Action)SuppliesModule.OnHourPassEvaluateSupply); if ((int)NetworkSingleton.Instance.Status == 0 || (int)NetworkSingleton.Instance.Status == 1) { Cartel instance2 = NetworkSingleton.Instance; instance2.OnStatusChange += Action.op_Implicit((Action)OnAlliedStateChange); } if (DealerActivity.allCartelDealers == null) { DealerActivity.allCartelDealers = Il2CppArrayBase.op_Implicit(Object.FindObjectsOfType(true)); } if (DealerActivity.allCartelDealers == null || DealerActivity.allCartelDealers.Length == 0) { return false; } NPC val = null; Enumerator enumerator = Dealer.AllPlayerDealers.GetEnumerator(); while (enumerator.MoveNext()) { Dealer current = enumerator.Current; if (((NPC)current).ID == "molly_presley") { val = (NPC)(object)current; } } Dictionary dictionary = new Dictionary(); if ((int)NetworkSingleton.Instance.Status == 1) { bool flag = false; CartelDealer[] allCartelDealers = DealerActivity.allCartelDealers; foreach (CartelDealer val2 in allCartelDealers) { EMapRegion region = ((NPC)val2).Region; switch (region - 1) { case 0: ((Dealer)val2).Cut = alliedConfig.WestvilleCartelDealerCut; ((Dealer)val2).SigningFee = alliedConfig.WestvilleCartelSigningFee; dictionary.Add((EMapRegion)1, val2); break; case 1: ((Dealer)val2).Cut = alliedConfig.DowntownCartelDealerCut; ((Dealer)val2).SigningFee = alliedConfig.DowntownCartelSigningFee; dictionary.Add((EMapRegion)2, val2); break; case 2: ((Dealer)val2).Cut = alliedConfig.DocksCartelDealerCut; ((Dealer)val2).SigningFee = alliedConfig.DocksCartelSigningFee; dictionary.Add((EMapRegion)3, val2); break; case 3: ((Dealer)val2).Cut = alliedConfig.SuburbiaCartelDealerCut; ((Dealer)val2).SigningFee = alliedConfig.SuburbiaCartelSigningFee; dictionary.Add((EMapRegion)4, val2); break; case 4: ((Dealer)val2).Cut = alliedConfig.UptownCartelDealerCut; ((Dealer)val2).SigningFee = alliedConfig.UptownCartelSigningFee; dictionary.Add((EMapRegion)5, val2); break; default: ((Dealer)val2).Cut = 99f; ((Dealer)val2).SigningFee = 9999f; break; } ((NPC)val2).MugshotSprite = InterceptEvent.benziesLogo; ((NPC)val2).FirstName = $"{((NPC)val2).FirstName} ({((NPC)val2).Region})"; if ((int)((NPC)val2).Region == 1 && ((Dealer)val2).IsRecruited) { flag = true; } if (((Dealer)val2).IsRecruited) { ((NPC)val2).Inventory.ClearInventoryEachNight = false; } else if (!((Dealer)val2).IsRecruited && !((Dealer)val2).HasBeenRecommended) { CartelPersuade.AddPersuadeDialogue(val2); } } foreach (KeyValuePair item in dictionary) { if ((int)item.Key == 1) { ((NPC)dictionary[item.Key]).RelationData.Connections.Add(val); } else { EMapRegion key = (EMapRegion)(item.Key - 1); ((NPC)dictionary[item.Key]).RelationData.Connections.Add((NPC)(object)dictionary[key]); } if (!((Dealer)item.Value).IsRecruited && ((Dealer)item.Value).HasBeenRecommended) { ((Dealer)item.Value).SetUpDialogue(); } } if (!alliedQuests.alliedIntroCompleted && (Object)(object)EndGameQuest.activeTruceIntro == (Object)null && !flag) { CartelEnforcer.coros.Add(MelonCoroutines.Start(EndGameQuest.SetupTruceIntroQuest())); } } <>2__current = null; <>1__state = 2; return true; } case 2: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static ConfigLoader.CartelAlliedConfig alliedConfig; public static ConfigLoader.CartelAlliedQuests alliedQuests; public static DialogueContainer persuadeContainer; public static DialogueNodeData entryNode; [IteratorStateMachine(typeof(d__4))] public static IEnumerator DelayedStateChange(ECartelStatus oldStatus, ECartelStatus newStatus) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__4(0) { oldStatus = oldStatus, newStatus = newStatus }; } public static void OnAlliedStateChange(ECartelStatus oldStatus, ECartelStatus newStatus) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) if (CartelEnforcer.currentConfig.alliedExtensions) { CartelEnforcer.coros.Add(MelonCoroutines.Start(DelayedStateChange(oldStatus, newStatus))); } } [IteratorStateMachine(typeof(d__6))] public static IEnumerator SetupAlliedExtension() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__6(0); } public static bool IsTrucedDialogueEnabled() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Invalid comparison between Unknown and I4 if ((int)NetworkSingleton.Instance.Status != 1) { return CartelEnforcer.currentConfig.debugMode; } return true; } } [HarmonyPatch(typeof(CartelDealManager), "ExpireDeal")] public static class CartelDealManager_ExpireDeal_Patch { [HarmonyPrefix] public static bool Prefix(CartelDealManager __instance) { if (!CartelEnforcer.currentConfig.alliedExtensions) { return true; } ((Quest)__instance.DealQuest).Expire(true); __instance.SendExpiryMessage(); __instance.ActiveDeal = null; return false; } } [HarmonyPatch(typeof(CartelInfluenceChangePopup), "Show")] public static class CartelInfluenceChangePopup_Show_Patch { [CompilerGenerated] private sealed class d__3 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public CartelInfluenceChangePopup __instance; public float oldInfluence; public EMapRegion region; public float newInfluence; private float 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__3(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Expected O, but got Unknown //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitUntil(Func.op_Implicit((Func)CanShowInfluenceChange)); <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 2; return true; case 2: <>1__state = -1; __instance.SetDisplayedInfluence(oldInfluence); ((TMP_Text)__instance.TitleLabel).text = $"Benzies' Influence in {region}"; __instance.Anim.Play(); <>2__current = (object)new WaitForSeconds(0.8f); <>1__state = 3; return true; case 3: <>1__state = -1; 5__2 = 0f; goto IL_0169; case 4: <>1__state = -1; goto IL_0169; case 5: { <>1__state = -1; return false; } IL_0169: if (5__2 <= 1.5f) { 5__2 += Time.deltaTime; float displayedInfluence = Mathf.Lerp(oldInfluence, newInfluence, 5__2 / 1.5f); __instance.SetDisplayedInfluence(displayedInfluence); <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 4; return true; } __instance.SetDisplayedInfluence(newInfluence); showEnqueued = false; <>2__current = null; <>1__state = 5; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static bool showEnqueued; [HarmonyPrefix] public static bool Prefix(CartelInfluenceChangePopup __instance, EMapRegion region, float oldInfluence, float newInfluence) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Invalid comparison between Unknown and I4 //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (!CartelEnforcer.currentConfig.alliedExtensions) { return true; } if ((int)NetworkSingleton.Instance.Status != 1) { return true; } if (Singleton.Instance.IsLoading) { return false; } if (newInfluence >= oldInfluence) { return false; } if (!showEnqueued) { showEnqueued = true; CartelEnforcer.coros.Add(MelonCoroutines.Start(InfluenceChangeAnimation(__instance, region, oldInfluence, newInfluence))); } return false; } public static bool CanShowInfluenceChange() { if (!Singleton.Instance.isActive && !Singleton.Instance.IsPlaying) { return !Singleton.Instance.IsPlaying; } return false; } [IteratorStateMachine(typeof(d__3))] public static IEnumerator InfluenceChangeAnimation(CartelInfluenceChangePopup __instance, EMapRegion region, float oldInfluence, float newInfluence) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__3(0) { __instance = __instance, region = region, oldInfluence = oldInfluence, newInfluence = newInfluence }; } } [HarmonyPatch(typeof(ContactsApp), "SetSelectedRegion")] public static class ContactsApp_SetSelectedRegion_Patch { [HarmonyPostfix] public static void Postfix(ContactsApp __instance, EMapRegion region, bool selectNPC) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Invalid comparison between Unknown and I4 //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0029: 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_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Invalid comparison between Unknown and I4 //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0367: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: 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_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_030b: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_031b: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Unknown result type (might be due to invalid IL or missing references) if (!CartelEnforcer.currentConfig.alliedExtensions || (int)NetworkSingleton.Instance.Status != 1 || (int)region == 0) { return; } float influence = NetworkSingleton.Instance.Influence.GetInfluence(region); ((Component)__instance.LowerContainer).gameObject.SetActive(true); __instance.HorizontalScrollbarRectTransform.anchoredPosition = new Vector2(0f, 77f); ((Component)__instance.UnlockRegionSliderNotch).gameObject.SetActive(true); __instance.InfluenceSlider.value = influence; __instance.InfluenceCountLabel.text = Mathf.RoundToInt(influence * 1000f) + " / 1000"; __instance.InfluenceText.text = "Cartel influence in " + ((object)(EMapRegion)(ref region)).ToString(); if (Singleton.Instance.GetRegionData(region).IsUnlocked) { return; } if ((int)region >= 3 && ((Component)__instance.RegionLocked_Unavailable).gameObject.activeSelf) { ((Component)__instance.RegionLocked_Unavailable).gameObject.SetActive(false); } ((Component)__instance.RegionLockedContainer).gameObject.SetActive(true); ((Component)__instance.RegionLocked_CartelInfluence).gameObject.SetActive(true); EMapRegion value = (EMapRegion)(region - 1); __instance.RegionLocked_CartelInfluence_Text.text = $"Reduce cartel influence in {value}\n\n\nto unlock this region."; Transform val = ((Component)__instance.RegionLocked_CartelInfluence_Text).transform.Find("CARTEL_ENFORCER_TEXT"); if ((Object)(object)val == (Object)null) { GameObject val2 = new GameObject("CARTEL_ENFORCER_TEXT"); val2.transform.parent = ((Component)__instance.RegionLocked_CartelInfluence_Text).transform; Text val3 = val2.AddComponent(); val3.text = $"Or recruit the {value} Cartel Dealer"; RectTransform component = val2.GetComponent(); component.anchoredPosition = Vector2.zero; component.anchoredPosition3D = Vector3.zero; component.anchorMax = new Vector2(0.5f, 0.5f); component.anchorMin = new Vector2(0.5f, 0.5f); component.offsetMax = new Vector2(150.5f, 214.25f); component.offsetMin = new Vector2(-150.5f, -214.25f); component.pivot = new Vector2(0.5f, 0.5f); component.sizeDelta = new Vector2(301f, 428.5f); val3.alignment = (TextAnchor)4; val3.fontSize = 28; val3.resizeTextMinSize = 0; ((Graphic)val3).color = new Color(1f, 0.23f, 0.23f, 0.7f); Transform val4 = ((Component)__instance.RegionLocked_CartelInfluence_Text).transform.Find("Rank"); if ((Object)(object)val4 != (Object)null) { Text component2 = ((Component)val4).GetComponent(); if ((Object)(object)component2 != (Object)null) { val3.font = component2.font; } } val2.transform.localEulerAngles = Vector3.zero; val2.transform.localRotation = Quaternion.identity; val2.transform.localScale = Vector3.one; val2.transform.localPosition = new Vector3(0f, -105f, 0f); } else { ((Component)val).gameObject.GetComponent().text = $"Or recruit the {value} Cartel Dealer"; } } } [HarmonyPatch(typeof(Quest_DefeatCartel), "OnSleepEnd")] public static class Quest_DefeatCartel_OnSleepEnd_Patch { [HarmonyPrefix] public static bool Prefix(Quest_DefeatCartel __instance) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Invalid comparison between Unknown and I4 //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Invalid comparison between Unknown and I4 if (!CartelEnforcer.currentConfig.alliedExtensions) { return true; } if ((int)((Quest)__instance).State == 0 && Singleton.Instance.GetRegionData((EMapRegion)5).IsUnlocked && ((int)NetworkSingleton.Instance.Status == 1 || (int)NetworkSingleton.Instance.Status == 2)) { ((Quest)__instance).Begin(true); } return true; } } public static class AlliedCartelDialogue { public static readonly List dealerEntryNodeTexts = new List { "You've got a lot of nerve showing up like this.", "What's your problem?", "What do you want?!", "Start talking or start walking young punk." }; public static readonly List alliedDialogueKeys = new List { "CLOTHING_SIMILARITY", "CARTEL_INFLUENCE", "THREATEN_CARTEL", "SPREAD_RUMOURS", "EXIT" }; public static readonly Dictionary> alliedDialogue = new Dictionary> { { alliedDialogueKeys[0], new List { "Check out my new drip.", "Same style, same goals, yeah?", "You're rocking the same vest?" } }, { alliedDialogueKeys[1], new List { "The Benzies are small time!", "Are the Benzies having it rough lately?", "The Benzies are a bunch of young punks." } }, { alliedDialogueKeys[2], new List { "Check the piece. You want a taste of lead?", "I'm packing some serious heat.", "You're about to get yo' ass whooped." } }, { alliedDialogueKeys[3], new List { "You know that Thomas has been talking to the cops right?", "I heard that Thomas is going to cut you out.", "Better watch out, that Thomas is a snake." } }, { alliedDialogueKeys[4], new List { "Nevermind.", "I got to go." } } }; public static Dictionary persuasionChances = new Dictionary { { alliedDialogueKeys[0], 0f }, { alliedDialogueKeys[1], 0f }, { alliedDialogueKeys[2], 0f }, { alliedDialogueKeys[3], 0f } }; public static readonly Dictionary persuasionBaseChances = new Dictionary { { alliedDialogueKeys[0], CartelPersuade.CLOTHING_SIMILARITY_BASE_CHANCE }, { alliedDialogueKeys[1], CartelPersuade.CARTEL_INFLUENCE_BASE_CHANCE }, { alliedDialogueKeys[2], CartelPersuade.THREATEN_CARTEL_BASE_CHANCE }, { alliedDialogueKeys[3], CartelPersuade.SPREAD_RUMOURS_BASE_CHANCE } }; } public static class CartelPersuade { [CompilerGenerated] private sealed class d__13 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__13(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; goto IL_012a; case 1: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } goto IL_012a; case 2: { <>1__state = -1; return false; } IL_012a: if ((Object)(object)DialogueHandler.activeDialogue != (Object)null && DialogueHandler.activeDialogueNode != null && ((Object)DialogueHandler.activeDialogue).name == "CARTEL_ENFORCER_PERSUADE" && DialogueHandler.activeDialogueNode.Guid == AlliedExtension.entryNode.Guid && Singleton.Instance.dialogueChoices.Count != 0) { DialogueChoiceEntry val = Singleton.Instance.dialogueChoices[0]; if (persuadeCooldown == 0 && val.notPossibleGameObject.activeSelf) { val.notPossibleGameObject.SetActive(false); ((Selectable)val.button).interactable = true; ColorBlock colors = ((Selectable)val.button).colors; ((ColorBlock)(ref colors)).disabledColor = ((ColorBlock)(ref colors)).pressedColor; ((Selectable)val.button).colors = colors; ((Component)val.text).GetComponent().offsetMax = new Vector2(0f, 0f); } else { string text = $"Wait {persuadeCooldown} minutes before trying again."; ((TMP_Text)val.notPossibleText).text = text.ToUpper(); } <>2__current = CartelEnforcer.Wait1; <>1__state = 1; return true; } <>2__current = null; <>1__state = 2; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static readonly float CLOTHING_SIMILARITY_BASE_CHANCE = 0.01f; public static readonly float CLOTHING_SIMILARITY_MAX_CHANCE = 0.85f; public static readonly float CARTEL_INFLUENCE_BASE_CHANCE = 0.02f; public static readonly float CARTEL_INFLUENCE_MAX_CHANCE = 0.35f; public static readonly float THREATEN_CARTEL_BASE_CHANCE = 0.01f; public static readonly float THREATEN_CARTEL_MAX_CHANCE = 0.6f; public static readonly float SPREAD_RUMOURS_BASE_CHANCE = 0.03f; public static readonly float SPREAD_RUMOURS_MAX_CHANCE = 0.45f; public static int persuadeCooldown = 60; public static readonly float colorSimilarityThreshold = 0.2f; public static void ReduceCooldown() { if (CartelEnforcer.currentConfig.alliedExtensions && persuadeCooldown > 0) { persuadeCooldown--; } } public static DialogueContainer InitPersuadeContainer() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Expected O, but got Unknown //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Expected O, but got Unknown //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Expected O, but got Unknown //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Expected O, but got Unknown DialogueContainer val = ScriptableObject.CreateInstance(); ((Object)val).name = "CARTEL_ENFORCER_PERSUADE"; val.allowExit = true; val.BranchNodeData = new List(); val.DialogueNodeData = new List(); val.NodeLinks = new List(); AlliedExtension.entryNode = new DialogueNodeData(); AlliedExtension.entryNode.DialogueNodeLabel = "ENTRY"; AlliedExtension.entryNode.DialogueText = AlliedCartelDialogue.dealerEntryNodeTexts[Random.Range(0, AlliedCartelDialogue.dealerEntryNodeTexts.Count)]; AlliedExtension.entryNode.Guid = GetGuid(); AlliedExtension.entryNode.Position = new Vector2(-284f, 572f); AlliedExtension.entryNode.VoiceLine = (EVOLineType)1; AlliedExtension.entryNode.choices = Il2CppReferenceArray.op_Implicit((DialogueChoiceData[])(object)new DialogueChoiceData[2]); DialogueChoiceData val2 = new DialogueChoiceData(); val2.ChoiceLabel = "START_PERSUADE"; val2.ChoiceText = "[Persuade] Just hear me out. You could work with me instead."; val2.Guid = GetGuid(); val2.ShowWorldspaceDialogue = true; DialogueChoiceData val3 = new DialogueChoiceData(); val3.ChoiceLabel = "EXIT"; val3.ChoiceText = "Nevermind."; val3.Guid = GetGuid(); val3.ShowWorldspaceDialogue = true; ((Il2CppArrayBase)(object)AlliedExtension.entryNode.choices)[0] = val2; ((Il2CppArrayBase)(object)AlliedExtension.entryNode.choices)[1] = val3; DialogueNodeData val4 = new DialogueNodeData(); val4.DialogueNodeLabel = "ENTRY"; val4.DialogueText = "I'm not so sure about that..."; val4.Guid = GetGuid(); val4.Position = new Vector2(-284f, 572f); val4.VoiceLine = (EVOLineType)11; val4.choices = Il2CppReferenceArray.op_Implicit((DialogueChoiceData[])(object)new DialogueChoiceData[5]); for (int i = 0; i < 5; i++) { DialogueChoiceData val5 = new DialogueChoiceData(); val5.ChoiceLabel = AlliedCartelDialogue.alliedDialogueKeys[i]; val5.ChoiceText = AlliedCartelDialogue.alliedDialogue[AlliedCartelDialogue.alliedDialogueKeys[i]][0]; val5.Guid = GetGuid(); val5.ShowWorldspaceDialogue = true; ((Il2CppArrayBase)(object)val4.choices)[i] = val5; } NodeLinkData val6 = new NodeLinkData(); val6.BaseDialogueOrBranchNodeGuid = AlliedExtension.entryNode.Guid; val6.BaseChoiceOrOptionGUID = val2.Guid; val6.TargetNodeGuid = val4.Guid; val.DialogueNodeData.Add(AlliedExtension.entryNode); val.DialogueNodeData.Add(val4); val.NodeLinks.Add(val6); return val; static string GetGuid() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) Guid val7 = Guid.NewGuid(); return ((object)(Guid)(ref val7)).ToString(); } } public static void AddPersuadeDialogue(CartelDealer d) { if (!((Object)(object)d == (Object)null)) { DialogueController component = ((Component)((NPC)d).DialogueHandler).GetComponent(); if (!((Object)(object)component == (Object)null)) { component.OverrideContainer = AlliedExtension.persuadeContainer; ((NPC)d).DialogueHandler.onConversationStart.AddListener(UnityAction.op_Implicit((Action)OnConversationStarted)); } } static void OnConversationStarted() { DialogueHandler.activeDialogueNode = AlliedExtension.entryNode; } } [IteratorStateMachine(typeof(d__13))] public static IEnumerator UpdatePersuadeCooldownText() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__13(0); } public static float ExpCurve(float baseVal, float maxVal, float t) { return baseVal * Mathf.Pow(maxVal / baseVal, t); } public static float CalculateClothingSimilarity(Dealer d) { //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: 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_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) int num = 0; int num2 = 0; AvatarSettings avatarSettings = Player.Local.CurrentAvatarSettings.GetAvatarSettings(); for (int i = 0; i < ((NPC)d).Avatar.CurrentSettings.BodyLayerSettings.Count; i++) { LayerSetting val = ((NPC)d).Avatar.CurrentSettings.BodyLayerSettings[i]; if (val.layerPath == null || val.layerPath == string.Empty) { continue; } num++; for (int j = 0; j < avatarSettings.BodyLayerSettings.Count; j++) { bool flag = false; bool flag2 = false; LayerSetting val2 = avatarSettings.BodyLayerSettings[j]; if (val2.layerPath != null && !(val.layerPath == string.Empty)) { if (CalculateColorSimilarity(val.layerTint, val2.layerTint) > colorSimilarityThreshold) { flag = true; } if (ClothingPathMatches(val.layerPath, val2.layerPath)) { flag2 = true; } if (flag2 && flag) { num2++; break; } } } } for (int k = 0; k < ((Il2CppArrayBase)(object)((NPC)d).Avatar.appliedAccessories).Length; k++) { if ((Object)(object)((Il2CppArrayBase)(object)((NPC)d).Avatar.appliedAccessories)[k] == (Object)null) { continue; } num++; Accessory val3 = ((Il2CppArrayBase)(object)((NPC)d).Avatar.appliedAccessories)[k]; for (int l = 0; l < Player.Local.Avatar.CurrentSettings.AccessorySettings.Count; l++) { if (Player.Local.Avatar.CurrentSettings.AccessorySettings[l] != null) { bool flag3 = false; bool flag4 = false; AccessorySetting val4 = Player.Local.Avatar.CurrentSettings.AccessorySettings[l]; Color a = Color.black; if (((IEnumerable)val3.meshesToColor).Count() > 0) { a = ((Renderer)((Il2CppArrayBase)(object)val3.meshesToColor)[0]).material.color; } else if (((Il2CppArrayBase)(object)val3.skinnedMeshesToColor).Length > 0) { a = ((Renderer)((Il2CppArrayBase)(object)val3.skinnedMeshesToBind)[0]).material.color; } if (CalculateColorSimilarity(a, val4.color) < colorSimilarityThreshold) { flag3 = true; } if (ClothingPathMatches(val3.AssetPath, val4.path)) { flag4 = true; } if (flag4 && flag3) { num2++; break; } } } } if (num == 0) { return 0f; } float t = Mathf.Clamp01((float)num2 / (float)num * 1.2f); return ExpCurve(CLOTHING_SIMILARITY_BASE_CHANCE, CLOTHING_SIMILARITY_MAX_CHANCE, t); } public static float CalculateColorSimilarity(Color a, Color b) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) return Vector3.Distance(new Vector3(a.r, a.g, a.b), new Vector3(b.r, b.g, b.b)) / Mathf.Sqrt(3f); } public static bool ClothingPathMatches(string a, string b) { if (a == "Avatar/Layers/Top/Tucked T-Shirt") { a = "Avatar/Layers/Top/T-Shirt"; } return a == b; } public static float CalculateInfluenceProbability() { float num = 0f; Enumerator enumerator = NetworkSingleton.Instance.Influence.regionInfluence.GetEnumerator(); while (enumerator.MoveNext()) { RegionInfluenceData current = enumerator.Current; num += current.Influence; } float t = num / (float)NetworkSingleton.Instance.Influence.regionInfluence.Count; return ExpCurve(CARTEL_INFLUENCE_BASE_CHANCE, CARTEL_INFLUENCE_MAX_CHANCE, t); } public static float CalculateThreathenProbability() { int num = PlayerSingleton.Instance.PriorEquippedSlotIndex - 1; string text = ""; if (num != -1 && num < 8) { ItemInstance itemInstance = ((Il2CppArrayBase)(object)Player.Local.Inventory)[num].ItemInstance; if (itemInstance != null) { text = ((BaseItemInstance)itemInstance).ID; } float num2 = 0f; return ExpCurve(THREATEN_CARTEL_BASE_CHANCE, THREATEN_CARTEL_MAX_CHANCE, text switch { "baseballbat" => 0.2f, "fryingpan" => 0.3f, "machete" => 0.5f, "revolver" => 0.65f, "m1911" => 0.8f, "pumpshotgun" => 0.95f, _ => 0.1f, }); } return 0f; } public static float CalculateRumourProbability() { float result = ExpCurve(SPREAD_RUMOURS_BASE_CHANCE, SPREAD_RUMOURS_MAX_CHANCE, (float)AlliedExtension.alliedQuests.timesPersuaded / 10f); if (CartelEnforcer.currentConfig.debugMode) { result = 0.99f; } return result; } } [HarmonyPatch(typeof(DialogueController_Dealer), "CheckChoice")] public static class DialogueController_Dealer_CheckChoice_Patch { [HarmonyPostfix] public static void Postfix(DialogueController_Dealer __instance, ref string choiceLabel, ref bool __result, ref string invalidReason) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) if ((int)__instance.Dealer.DealerType == 0 || !CartelEnforcer.currentConfig.alliedExtensions || (Object)(object)DialogueHandler.activeDialogue == (Object)null || !(((Object)DialogueHandler.activeDialogue).name == "CARTEL_ENFORCER_PERSUADE")) { return; } ((DialogueController)__instance).OverrideContainer.DialogueNodeData[0].DialogueText = AlliedCartelDialogue.dealerEntryNodeTexts[Random.Range(0, AlliedCartelDialogue.dealerEntryNodeTexts.Count)]; if (choiceLabel == "EXIT") { __result = true; return; } if (__instance.Dealer.IsRecruited || __instance.Dealer.HasBeenRecommended) { invalidReason = "Can't persuade this dealer."; __result = false; } if (choiceLabel == "START_PERSUADE") { if (CartelPersuade.persuadeCooldown != 0) { invalidReason = $"Wait {CartelPersuade.persuadeCooldown} minutes before trying again."; CartelEnforcer.coros.Add(MelonCoroutines.Start(CartelPersuade.UpdatePersuadeCooldownText())); __result = false; } else { __result = true; } } else { __result = true; } } } [HarmonyPatch(typeof(DialogueController_Dealer), "ChoiceCallback")] public static class DialogueController_Dealer_ChoiceCallback_Patch { [CompilerGenerated] private sealed class <>c__DisplayClass2_0 { public DialogueController_Dealer __instance; } [CompilerGenerated] private sealed class d__3 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Dealer d; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__3(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = CartelEnforcer.Wait2; <>1__state = 1; return true; case 1: <>1__state = -1; if (d.IsRecruited) { ((NPC)d).Inventory.ClearInventoryEachNight = false; } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__2 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DialogueController_Dealer __instance; private <>c__DisplayClass2_0 <>8__1; public string choiceLabel; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__2(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass2_0(); <>8__1.__instance = __instance; AlliedExtension.alliedQuests.timesPersuaded = 0; <>8__1.__instance.Dealer.HasBeenRecommended = true; ((DialogueController)<>8__1.__instance).handler.EndDialogue(); <>2__current = CartelEnforcer.Wait01; <>1__state = 1; return true; case 1: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } ((DialogueController)<>8__1.__instance).ClearOverrideContainer(); <>8__1.__instance.Dealer.SetUpDialogue(); <>8__1.__instance.Dealer.recruitChoice.onChoosen.AddListener(UnityAction.op_Implicit((Action)DisableInventoryClear)); if (choiceLabel == "THREATEN_CARTEL") { ((NPC)<>8__1.__instance.Dealer).SetPanicked_Server(); ((DialogueController)<>8__1.__instance).npc.PlayVO((EVOLineType)12, false); } else { ((DialogueController)<>8__1.__instance).npc.PlayVO((EVOLineType)19, false); } <>2__current = CartelEnforcer.Wait05; <>1__state = 2; return true; case 2: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } switch (Random.Range(0, 4)) { case 0: ((DialogueController)<>8__1.__instance).handler.WorldspaceRend.ShowText($"Pay me ${<>8__1.__instance.Dealer.SigningFee} and I'll work for you.", 10f); break; case 1: ((DialogueController)<>8__1.__instance).handler.WorldspaceRend.ShowText($"Come back with ${<>8__1.__instance.Dealer.SigningFee}. Then we can talk.", 10f); break; case 2: ((DialogueController)<>8__1.__instance).handler.WorldspaceRend.ShowText($"My price is ${<>8__1.__instance.Dealer.SigningFee}. Take it or leave it!", 10f); break; case 3: ((DialogueController)<>8__1.__instance).handler.WorldspaceRend.ShowText($"Fine! For ${<>8__1.__instance.Dealer.SigningFee} cash I'm in.", 10f); break; } <>2__current = null; <>1__state = 3; return true; case 3: <>1__state = -1; return false; } void DisableInventoryClear() { CartelEnforcer.coros.Add(MelonCoroutines.Start(DisableInventoryClearDelayed(((<>c__DisplayClass2_0)this).__instance.Dealer))); } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static readonly float redColorThreshold = 0.12f; public static readonly float yellowColorThreshold = 0.25f; [IteratorStateMachine(typeof(d__2))] public static IEnumerator EnableDelayed(DialogueController_Dealer __instance, string choiceLabel) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__2(0) { __instance = __instance, choiceLabel = choiceLabel }; } [IteratorStateMachine(typeof(d__3))] public static IEnumerator DisableInventoryClearDelayed(Dealer d) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__3(0) { d = d }; } [HarmonyPrefix] public static bool Prefix(DialogueController_Dealer __instance, string choiceLabel) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) if ((int)__instance.Dealer.DealerType == 0) { return true; } if (!CartelEnforcer.currentConfig.alliedExtensions) { return true; } DialogueContainer activeDialogue = DialogueHandler.activeDialogue; if (((activeDialogue != null) ? ((Object)activeDialogue).name : null) != "CARTEL_ENFORCER_PERSUADE") { return true; } if (choiceLabel == "START_PERSUADE") { if (((DialogueController)__instance).OverrideContainer.DialogueNodeData.Count != 2) { return true; } AlliedCartelDialogue.persuasionChances["CLOTHING_SIMILARITY"] = CartelPersuade.CalculateClothingSimilarity(__instance.Dealer); AlliedCartelDialogue.persuasionChances["CARTEL_INFLUENCE"] = CartelPersuade.CalculateInfluenceProbability(); AlliedCartelDialogue.persuasionChances["THREATEN_CARTEL"] = CartelPersuade.CalculateThreathenProbability(); AlliedCartelDialogue.persuasionChances["SPREAD_RUMOURS"] = CartelPersuade.CalculateRumourProbability(); CartelPersuade.persuadeCooldown = AlliedExtension.alliedConfig.PersuadeCooldownMins; for (int i = 0; i < ((Il2CppArrayBase)(object)((DialogueController)__instance).OverrideContainer.DialogueNodeData[1].choices).Length; i++) { DialogueChoiceData val = ((Il2CppArrayBase)(object)((DialogueController)__instance).OverrideContainer.DialogueNodeData[1].choices)[i]; float value = 0f; string text = "#000000"; if (AlliedCartelDialogue.alliedDialogue.TryGetValue(val.ChoiceLabel, out var value2) && AlliedCartelDialogue.persuasionChances.TryGetValue(val.ChoiceLabel, out value)) { text = ((value <= redColorThreshold) ? "#F08473" : ((!(value > redColorThreshold) || !(value <= yellowColorThreshold)) ? "#65E07C" : "#E2E872")); string choiceText = $"{value2[Random.Range(0, value2.Count)]} ({Mathf.RoundToInt(value * 100f)}% Chance)"; val.ChoiceText = choiceText; } } } else if (choiceLabel == "EXIT") { ((DialogueController)__instance).handler.EndDialogue(); ((DialogueController)__instance).handler.WorldspaceRend.ShowText("Just a waste of my time...", 5f); ((DialogueController)__instance).npc.PlayVO((EVOLineType)9, false); } else { NetworkSingleton.Instance.Influence.ChangeInfluence(((NPC)__instance.Dealer).Region, CartelEnforcer.influenceConfig.cartelDealerPersuaded); if (CartelEnforcer.registered && !Singleton.Instance.IsSaving && !CartelEnforcer.isSaving && AlliedExtension.alliedQuests != null) { AlliedExtension.alliedQuests.timesPersuaded++; } float value3 = 0f; if (AlliedCartelDialogue.persuasionChances.TryGetValue(choiceLabel, out value3)) { if (value3 != 0f && Random.Range(0f, 1f) < value3) { CartelEnforcer.coros.Add(MelonCoroutines.Start(EnableDelayed(__instance, choiceLabel))); } else { switch (Random.Range(0, 5)) { case 0: ((DialogueController)__instance).handler.WorldspaceRend.ShowText("Piss off mate!", 10f); ((DialogueController)__instance).npc.PlayVO((EVOLineType)9, false); break; case 1: ((DialogueController)__instance).handler.WorldspaceRend.ShowText("I'm busy...", 10f); ((DialogueController)__instance).npc.PlayVO((EVOLineType)17, false); break; case 2: ((DialogueController)__instance).handler.WorldspaceRend.ShowText("Get out of here!", 10f); ((DialogueController)__instance).npc.PlayVO((EVOLineType)10, false); break; case 3: ((DialogueController)__instance).handler.WorldspaceRend.ShowText("Keep walking bloke!", 10f); ((DialogueController)__instance).npc.PlayVO((EVOLineType)9, false); break; } if (choiceLabel == "THREATEN_CARTEL") { ((NPC)__instance.Dealer).Behaviour.CombatBehaviour.SetTarget(((Component)Player.Local).GetComponent().NetworkObject); ((Behaviour)((NPC)__instance.Dealer).Behaviour.CombatBehaviour).Enable_Networked(); } } } } return true; } } [RegisterTypeInIl2Cpp] public class Quest_TrucedRecruits : Quest { private CartelDealer westvilleDealer; public QuestEntry QuestEntry_FindCartel; public QuestEntry QuestEntry_GreetGoons; public QuestEntry QuestEntry_PersuadeCartelDealer; public QuestEntry QuestEntry_HireCartelDealer; public Quest_TrucedRecruits(IntPtr ptr) : base(ptr) { } public Quest_TrucedRecruits() : base(ClassInjector.DerivedConstructorPointer()) { ClassInjector.DerivedConstructorBody((Il2CppObjectBase)(object)this); } public override void Complete(bool network = true) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 try { if ((int)((Quest)this).State != 2) { if (InstanceFinder.IsServer && !Singleton.Instance.IsLoading) { NetworkSingleton.Instance.AddXP(((Quest)this).CompletionXP); } ((Quest)this).SetQuestState((EQuestState)2, false); NetworkSingleton.Instance.PlayCompleteQuestSound(); ((Quest)this).End(); } } catch (Exception) { throw; } } public override void Fail(bool network = true) { try { ((Quest)this).SetQuestState((EQuestState)3, false); ((Quest)this).End(); } catch (Exception) { throw; } } public override void End() { try { if ((Object)(object)((Quest)this).hudUI != (Object)null) { ((Quest)this).hudUI.Complete(); } TimeManager instance = NetworkSingleton.Instance; Action action = ((Quest)this).OnMinPass; if ((Object)(object)instance == (Object)null) { return; } instance.onMinutePass.Remove(Action.op_Implicit(action)); } catch (Exception) { throw; } ((Component)this).gameObject.SetActive(false); } public void SetupSelf() { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected O, but got Unknown //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Expected O, but got Unknown //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Expected O, but got Unknown //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Expected O, but got Unknown //IL_0105: 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_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Expected O, but got Unknown //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Expected O, but got Unknown //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Invalid comparison between Unknown and I4 //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_0398: Unknown result type (might be due to invalid IL or missing references) //IL_03d2: Unknown result type (might be due to invalid IL or missing references) //IL_045c: Unknown result type (might be due to invalid IL or missing references) //IL_0496: Unknown result type (might be due to invalid IL or missing references) ((Object)this).name = "Quest_TrucedRecruits"; ((Quest)this).Expires = false; ((Quest)this).title = "Truced Recruits"; ((Quest)this).CompletionXP = 200; ((Quest)this).Description = "Persuade Cartel Dealers to work for you"; ((Quest)this).TrackOnBegin = true; ((Quest)this).autoInitialize = false; ((Quest)this).AutoCompleteOnAllEntriesComplete = false; ((Quest)this).onActiveState = new UnityEvent(); ((Quest)this).onComplete = new UnityEvent(); ((Quest)this).onInitialComplete = new UnityEvent(); ((Quest)this).onQuestBegin = new UnityEvent(); ((Quest)this).onQuestEnd = new UnityEvent(); ((Quest)this).onTrackChange = new UnityEvent(); ((Quest)this).SetGUID(Guid.NewGuid()); Transform questContainer = NetworkSingleton.Instance.QuestContainer; Transform val = ((questContainer != null) ? questContainer.GetChild(0) : null); if ((Object)(object)val != (Object)null) { ((Component)this).transform.SetParent(val); } ((Quest)this).IconPrefab = EndGameQuest.MakeIcon(((Component)this).transform); ((Quest)this).PoIPrefab = EndGameQuest.MakePOI(); GameObject val2 = new GameObject("QuestEntry_FindCartel"); val2.transform.SetParent(((Component)this).transform); GameObject val3 = new GameObject("QuestEntry_GreetGoons"); val3.transform.SetParent(((Component)this).transform); GameObject val4 = new GameObject("QuestEntry_PersuadeCartelDealer"); val4.transform.SetParent(((Component)this).transform); GameObject val5 = new GameObject("QuestEntry_HireCartelDealer"); val5.transform.SetParent(((Component)this).transform); QuestEntry findCartel = val2.AddComponent(); QuestEntry val6 = val3.AddComponent(); QuestEntry persuadeCartel = val4.AddComponent(); QuestEntry hireCartel = val5.AddComponent(); QuestEntry_FindCartel = findCartel; QuestEntry_GreetGoons = val6; QuestEntry_PersuadeCartelDealer = persuadeCartel; QuestEntry_HireCartelDealer = hireCartel; ((Quest)this).Entries = new List(); ((Quest)this).Entries.Add(findCartel); ((Quest)this).Entries.Add(val6); ((Quest)this).Entries.Add(persuadeCartel); ((Quest)this).Entries.Add(hireCartel); foreach (CartelDealer item in Object.FindObjectsOfType(true)) { if ((int)((NPC)item).Region == 1) { westvilleDealer = item; break; } } findCartel.SetEntryTitle("Find the Westville Cartel Dealer"); findCartel.ParentQuest = (Quest)(object)this; findCartel.CompleteParentQuest = false; findCartel.PoILocation = new GameObject("FindCartelEntry_POI").transform; ((Component)findCartel.PoILocation).transform.SetParent(((Component)findCartel).transform); ((Component)findCartel.PoILocation).transform.position = ((NPC)westvilleDealer).CenterPoint; findCartel.AutoUpdatePoILocation = true; findCartel.SetState((EQuestState)1, false); UnityAction findCartelAction = null; findCartelAction = UnityAction.op_Implicit((Action)OnFindCartelComplete); findCartel.onComplete.AddListener(findCartelAction); val6.SetEntryTitle("(Optional) Say greetings to all 3 gathering goons"); val6.ParentQuest = (Quest)(object)this; val6.CompleteParentQuest = false; val6.PoILocation = new GameObject("GreetGoonsEntry_POI").transform; ((Component)val6.PoILocation).transform.SetParent(((Component)val6).transform); val6.AutoUpdatePoILocation = true; val6.SetState((EQuestState)0, false); persuadeCartel.SetEntryTitle("Try persuading the Westville Cartel Dealer"); persuadeCartel.ParentQuest = (Quest)(object)this; persuadeCartel.CompleteParentQuest = false; persuadeCartel.PoILocation = new GameObject("PersuadeCartelEntry_POI").transform; persuadeCartel.PoILocation.SetParent(((Component)westvilleDealer).transform); ((Component)persuadeCartel.PoILocation).transform.localPosition = Vector3.zero; persuadeCartel.AutoUpdatePoILocation = true; persuadeCartel.SetState((EQuestState)0, false); UnityAction persuadeCartelAction = null; persuadeCartelAction = UnityAction.op_Implicit((Action)OnPersuadeCartelComplete); persuadeCartel.onComplete.AddListener(persuadeCartelAction); hireCartel.SetEntryTitle("Hire the Westville Cartel Dealer"); hireCartel.ParentQuest = (Quest)(object)this; hireCartel.CompleteParentQuest = false; hireCartel.PoILocation = new GameObject("HireCartelEntry_POI").transform; hireCartel.PoILocation.SetParent(((Component)westvilleDealer).transform); ((Component)hireCartel.PoILocation).transform.localPosition = Vector3.zero; hireCartel.AutoUpdatePoILocation = true; hireCartel.SetState((EQuestState)0, false); TimeManager instance = NetworkSingleton.Instance; Action action = ((Quest)this).OnMinPass; instance.onMinutePass += Action.op_Implicit(action); StartQuestDetail(); void OnFindCartelComplete() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Invalid comparison between Unknown and I4 if ((!((Object)(object)findCartel != (Object)null) || (int)findCartel.State != 3) && !((Object)(object)persuadeCartel == (Object)null)) { persuadeCartel.Begin(); EndGameQuest.UpdateQuestMapLogo(persuadeCartel); if ((Delegate)(object)findCartelAction != (Delegate)null) { findCartel.onComplete.RemoveListener(findCartelAction); findCartelAction = null; } } } void OnPersuadeCartelComplete() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Invalid comparison between Unknown and I4 if ((!((Object)(object)persuadeCartel != (Object)null) || (int)persuadeCartel.State != 3) && !((Object)(object)hireCartel == (Object)null)) { hireCartel.Begin(); EndGameQuest.UpdateQuestMapLogo(hireCartel); if ((Delegate)(object)persuadeCartelAction != (Delegate)null) { persuadeCartel.onComplete.RemoveListener(persuadeCartelAction); persuadeCartelAction = null; } } } } private void StartQuestDetail() { ((Quest)this).SetupHUDUI(); if ((Object)(object)((Quest)this).hudUI != (Object)null) { if ((Object)(object)((Quest)this).hudUI.MainLabel != (Object)null) { ((TMP_Text)((Quest)this).hudUI.MainLabel).text = "Truced Recruits"; } ((Component)((Quest)this).hudUI).gameObject.SetActive(true); } ((Quest)this).SetIsTracked(true); ((Quest)this).SetQuestState((EQuestState)1, true); EndGameQuest.UpdateQuestMapLogo(QuestEntry_FindCartel); } public override void OnMinPass() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Invalid comparison between Unknown and I4 //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Invalid comparison between Unknown and I4 //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Invalid comparison between Unknown and I4 //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Invalid comparison between Unknown and I4 //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Invalid comparison between Unknown and I4 //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Invalid comparison between Unknown and I4 //IL_0131: 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_00f3: Unknown result type (might be due to invalid IL or missing references) if (!CartelEnforcer.registered || Singleton.Instance.IsSaving || AlliedExtension.alliedQuests.alliedIntroCompleted || (int)((Quest)this).State != 1 || !InstanceFinder.IsServer) { return; } if ((int)NetworkSingleton.Instance.Status != 1) { ((Quest)this).Fail(true); } if ((Object)(object)westvilleDealer == (Object)null) { return; } if ((Object)(object)QuestEntry_GreetGoons != (Object)null && (int)QuestEntry_GreetGoons.State == 1) { if (!CartelGathering.areGoonsGathering) { QuestEntry_GreetGoons.SetState((EQuestState)4, false); } } else if ((Object)(object)QuestEntry_GreetGoons != (Object)null && ((int)QuestEntry_GreetGoons.State == 0 || (int)QuestEntry_GreetGoons.State == 4) && CartelGathering.areGoonsGathering && CartelGathering.currentGatheringLocation != null) { QuestEntry_GreetGoons.Begin(); EndGameQuest.UpdateQuestMapLogo(QuestEntry_GreetGoons); if (CartelGathering.currentGatheringLocation != null) { _ = CartelGathering.currentGatheringLocation.position; QuestEntry_GreetGoons.SetPoILocation(CartelGathering.currentGatheringLocation.position); } } if ((Object)(object)QuestEntry_FindCartel != (Object)null && (int)QuestEntry_FindCartel.State == 1 && !((NPC)westvilleDealer).isInBuilding && Player.Local.IsPointVisibleToPlayer(((NPC)westvilleDealer).CenterPoint, 20f, 1f)) { QuestEntry_FindCartel.Complete(); } else if ((Object)(object)QuestEntry_PersuadeCartelDealer != (Object)null && (int)QuestEntry_PersuadeCartelDealer.State == 1 && ((Dealer)westvilleDealer).HasBeenRecommended) { QuestEntry_PersuadeCartelDealer.Complete(); } else if ((Object)(object)QuestEntry_HireCartelDealer != (Object)null && (int)QuestEntry_HireCartelDealer.State == 1 && ((Dealer)westvilleDealer).IsRecruited && !Singleton.Instance.IsSaving && !CartelEnforcer.isSaving) { AlliedExtension.alliedQuests.alliedIntroCompleted = true; ((Quest)this).Complete(true); } } } [RegisterTypeInIl2Cpp] public class Quest_AlliedSupplies : Quest { public string title; public string Subtitle; public RectTransform groupRt; public SupplyLocation location; public bool playerNoticed; public bool playerInterrogated; public bool interrogatingPlayer; public QuestEntry QuestEntry_LocateSupplies; public QuestEntry QuestEntry_GatherSupplies; public Quest_AlliedSupplies(IntPtr ptr) : base(ptr) { } public Quest_AlliedSupplies() : base(ClassInjector.DerivedConstructorPointer()) { ClassInjector.DerivedConstructorBody((Il2CppObjectBase)(object)this); } public override void Complete(bool network = true) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 try { if ((int)((Quest)this).State != 2) { if (InstanceFinder.IsServer && !Singleton.Instance.IsLoading) { NetworkSingleton.Instance.AddXP(((Quest)this).CompletionXP); } ((Quest)this).SetQuestState((EQuestState)2, false); NetworkSingleton.Instance.PlayCompleteQuestSound(); ((Quest)this).End(); } } catch (Exception) { throw; } } public override void Fail(bool network = true) { try { ((Quest)this).SetQuestState((EQuestState)3, false); ((Quest)this).End(); } catch (Exception) { throw; } } public override void End() { try { if ((Object)(object)((Quest)this).hudUI != (Object)null) { ((Component)((Quest)this).hudUI).gameObject.SetActive(false); } CartelEnforcer.coros.Add(MelonCoroutines.Start(EndGameQuest.CleanupTruceSuppliesQuest(location))); } catch (Exception) { throw; } ((Component)this).gameObject.SetActive(false); } public void ResetSelf() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Invalid comparison between Unknown and I4 //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Invalid comparison between Unknown and I4 //IL_00a5: 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_017d: Unknown result type (might be due to invalid IL or missing references) EndGameQuest.alliedSuppliesActive = true; if (!((Object)(object)EndGameQuest.activeAlliedSupplies == (Object)null) && ((int)((Quest)this).State == 2 || (int)((Quest)this).State == 4)) { int num = Random.Range(0, SuppliesModule.supplyLocations.Count); if (SuppliesModule.supplyLocations[num] == location) { location = SuppliesModule.supplyLocations[(num + 1) % SuppliesModule.supplyLocations.Count]; } else { location = SuppliesModule.supplyLocations[num]; } interrogatingPlayer = false; playerInterrogated = false; playerNoticed = false; TimeManager instance = NetworkSingleton.Instance; ((Quest)this).Expiry = new GameDateTime(instance.ElapsedDays + 1, 401); Subtitle = "\n" + ((Quest)this).GetExpiryText() + " until supplies vanish"; title = "Allied Supplies"; ((Component)this).gameObject.SetActive(true); QuestEntry_GatherSupplies.SetState((EQuestState)0, false); QuestEntry_LocateSupplies.SetState((EQuestState)1, false); ((Quest)this).SetQuestState((EQuestState)1, true); if ((Object)(object)QuestEntry_GatherSupplies.PoI != (Object)null && (Object)(object)QuestEntry_GatherSupplies.PoI.UI != (Object)null) { ((Component)QuestEntry_GatherSupplies.PoI.UI).gameObject.SetActive(false); } ((Component)QuestEntry_GatherSupplies.PoILocation).transform.position = ((location.Type == ESupplyType.Van) ? location.CarPosition : location.BarrelObjects[0].transform.position); if (QuestEntry_GatherSupplies.compassElement != null && QuestEntry_GatherSupplies.compassElement.Visible) { QuestEntry_GatherSupplies.compassElement.Visible = false; } if (QuestEntry_LocateSupplies.compassElement != null && QuestEntry_LocateSupplies.compassElement.Visible) { QuestEntry_LocateSupplies.compassElement.Visible = false; } ((Component)((Quest)this).hudUI).gameObject.SetActive(true); QuestEntry_LocateSupplies.entryUI.FadeIn(); CartelEnforcer.coros.Add(MelonCoroutines.Start(SuppliesModule.SpawnSupply(location))); } } public void SetupSelf() { //IL_00aa: 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_00e1: Expected O, but got Unknown //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Expected O, but got Unknown //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Expected O, but got Unknown //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Expected O, but got Unknown //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Expected O, but got Unknown //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_0326: Unknown result type (might be due to invalid IL or missing references) //IL_0376: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Unknown result type (might be due to invalid IL or missing references) EndGameQuest.alliedSuppliesActive = true; ((Object)this).name = "Quest_AlliedSupplies"; ((Quest)this).Expires = true; title = "Allied Supplies"; ((Quest)this).CompletionXP = 300; ((Quest)this).Description = "Pick up Cartel supplies"; ((Quest)this).TrackOnBegin = false; ((Quest)this).autoInitialize = false; ((Quest)this).AutoCompleteOnAllEntriesComplete = false; ((Quest)this).AutoStartFirstEntry = false; ((Quest)this).ShouldSendExpiryReminder = true; Transform questContainer = NetworkSingleton.Instance.QuestContainer; Transform val = ((questContainer != null) ? questContainer.GetChild(0) : null); if ((Object)(object)val != (Object)null) { ((Component)this).transform.SetParent(val); } TimeManager instance = NetworkSingleton.Instance; ((Quest)this).Expiry = new GameDateTime(instance.ElapsedDays + 1, 401); ((Quest)this).ExpiryVisibility = (EExpiryVisibility)0; Subtitle = "\n" + ((Quest)this).GetExpiryText() + " until supplies vanish"; ((Quest)this).onActiveState = new UnityEvent(); ((Quest)this).onComplete = new UnityEvent(); ((Quest)this).onInitialComplete = new UnityEvent(); ((Quest)this).onQuestBegin = new UnityEvent(); ((Quest)this).onQuestEnd = new UnityEvent(); ((Quest)this).onTrackChange = new UnityEvent(); ((Quest)this).SetGUID(Guid.NewGuid()); location = SuppliesModule.supplyLocations[Random.Range(0, SuppliesModule.supplyLocations.Count)]; if (CartelEnforcer.currentConfig.debugMode) { foreach (SupplyLocation supplyLocation in SuppliesModule.supplyLocations) { if (supplyLocation.ID == "SUPPLY_DOCKS") { location = supplyLocation; break; } } } ((Quest)this).IconPrefab = EndGameQuest.MakeIcon(((Component)this).transform); ((Quest)this).PoIPrefab = EndGameQuest.MakePOI(); GameObject val2 = new GameObject("QuestEntry_LocateSupplies"); val2.transform.SetParent(((Component)this).transform); GameObject val3 = new GameObject("QuestEntry_GatherSupplies"); val3.transform.SetParent(((Component)this).transform); QuestEntry locateSupplies = val2.AddComponent(); QuestEntry gatherSupplies = val3.AddComponent(); QuestEntry_LocateSupplies = locateSupplies; QuestEntry_GatherSupplies = gatherSupplies; ((Quest)this).Entries = new List(); ((Quest)this).Entries.Add(QuestEntry_LocateSupplies); ((Quest)this).Entries.Add(QuestEntry_GatherSupplies); locateSupplies.SetEntryTitle("Read Thomas' message and locate the Cartel supplies"); locateSupplies.AutoCreatePoI = false; locateSupplies.ParentQuest = (Quest)(object)this; locateSupplies.CompleteParentQuest = false; locateSupplies.PoILocation = new GameObject("LocateSuppliesEntry_POI").transform; ((Component)locateSupplies.PoILocation).transform.SetParent(((Component)locateSupplies).transform); locateSupplies.SetState((EQuestState)1, false); UnityAction val4 = null; val4 = UnityAction.op_Implicit((Action)OnLocateSuppliesComplete); locateSupplies.onComplete.AddListener(val4); gatherSupplies.SetEntryTitle("Receive the Cartel supplies"); gatherSupplies.ParentQuest = (Quest)(object)this; gatherSupplies.CompleteParentQuest = false; gatherSupplies.PoILocation = new GameObject("GatherSuppliesEntry_POI").transform; ((Component)gatherSupplies.PoILocation).transform.position = ((location.Type == ESupplyType.Van) ? location.CarPosition : location.BarrelObjects[0].transform.position); ((Component)gatherSupplies.PoILocation).transform.SetParent(((Component)gatherSupplies).transform); gatherSupplies.SetState((EQuestState)0, false); StartQuestDetail(); void OnLocateSuppliesComplete() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Invalid comparison between Unknown and I4 //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) if ((!((Object)(object)locateSupplies != (Object)null) || (int)locateSupplies.State != 3) && !((Object)(object)gatherSupplies == (Object)null)) { gatherSupplies.Begin(); EndGameQuest.UpdateQuestMapLogo(gatherSupplies); gatherSupplies.SetPoILocation((location.Type == ESupplyType.Van) ? location.CarPosition : location.BarrelObjects[0].transform.position); } } } private void StartQuestDetail() { ((Quest)this).SetupHUDUI(); if ((Object)(object)((Quest)this).hudUI != (Object)null) { if ((Object)(object)((Quest)this).hudUI.MainLabel != (Object)null) { ((TMP_Text)((Quest)this).hudUI.MainLabel).text = "Allied Supplies"; } ((Component)((Quest)this).hudUI).gameObject.SetActive(true); } ((Quest)this).SetIsTracked(true); ((Quest)this).SetQuestState((EQuestState)1, true); if ((Object)(object)QuestEntry_LocateSupplies != (Object)null) { if (QuestEntry_LocateSupplies.compassElement != null) { QuestEntry_LocateSupplies.compassElement.Visible = false; } else { QuestEntry_LocateSupplies.CreateCompassElement(); QuestEntry_LocateSupplies.compassElement.Visible = false; } } TimeManager instance = NetworkSingleton.Instance; instance.onMinutePass += Action.op_Implicit((Action)SuppliesModule.MinPassSupply); CartelEnforcer.coros.Add(MelonCoroutines.Start(SuppliesModule.SpawnSupply(location))); } } public static class SuppliesModule { [CompilerGenerated] private sealed class <>c__DisplayClass9_0 { public StorageEntity rewardStorage; } [CompilerGenerated] private sealed class d__15 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__15(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Invalid comparison between Unknown and I4 //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: 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_0125: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; goto IL_0022; case 1: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } if ((Object)(object)EndGameQuest.activeAlliedSupplies == (Object)null || (int)((Quest)EndGameQuest.activeAlliedSupplies).State != 1) { return false; } if ((Object)(object)EndGameQuest.alliedGuard == (Object)null || ((NPC)EndGameQuest.alliedGuard).Health.IsDead || ((NPC)EndGameQuest.alliedGuard).Health.IsKnockedOut || (Object)(object)((NPC)EndGameQuest.alliedGuard).Behaviour.activeBehaviour == (Object)(object)((NPC)EndGameQuest.alliedGuard).Behaviour.CombatBehaviour) { return false; } if (EndGameQuest.activeAlliedSupplies.playerInterrogated || EndGameQuest.activeAlliedSupplies.interrogatingPlayer) { return false; } if (!(Vector3.Distance(Player.Local.CenterPointTransform.position, ((NPC)EndGameQuest.alliedGuard).CenterPoint) > 3f)) { <>2__current = (object)new WaitUntil(Func.op_Implicit((Func)CanStartInterrogate)); <>1__state = 2; return true; } goto IL_0022; case 2: { <>1__state = -1; if (!(Vector3.Distance(Player.Local.CenterPointTransform.position, ((NPC)EndGameQuest.alliedGuard).CenterPoint) > 3f)) { EndGameQuest.activeAlliedSupplies.playerInterrogated = true; if ((Object)(object)((NPC)EndGameQuest.alliedGuard).DialogueHandler != (Object)null) { EndGameQuest.activeAlliedSupplies.interrogatingPlayer = true; ((NPC)EndGameQuest.alliedGuard).Movement.EndSetDestination((WalkResult)4); DialogueController component = ((Component)((NPC)EndGameQuest.alliedGuard).DialogueHandler).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { component.StartGenericDialogue(false); } } return false; } goto IL_0022; } IL_0022: <>2__current = CartelEnforcer.Wait05; <>1__state = 1; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__13 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__13(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Invalid comparison between Unknown and I4 //IL_00e0: 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_019f: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; if (num != 0) { if (num != 1) { return false; } <>1__state = -1; if (!CartelEnforcer.registered) { return false; } if (!EndGameQuest.activeAlliedSupplies.interrogatingPlayer) { if ((Object)(object)EndGameQuest.activeAlliedSupplies == (Object)null || (int)((Quest)EndGameQuest.activeAlliedSupplies).State != 1 || (Object)(object)EndGameQuest.alliedGuard == (Object)null || ((NPC)EndGameQuest.alliedGuard).Health.IsDead || ((NPC)EndGameQuest.alliedGuard).Health.IsKnockedOut || (Object)(object)((NPC)EndGameQuest.alliedGuard).Behaviour.activeBehaviour == (Object)(object)((NPC)EndGameQuest.alliedGuard).Behaviour.CombatBehaviour) { return false; } float num2 = Vector3.Distance(((NPC)EndGameQuest.alliedGuard).CenterPoint, EndGameQuest.activeAlliedSupplies.location.GuardPosition); if (num2 > 30f || (EndGameQuest.activeAlliedSupplies.playerNoticed && EndGameQuest.activeAlliedSupplies.playerInterrogated && num2 > 2f)) { if (!((NPC)EndGameQuest.alliedGuard).Movement.HasDestination || !(Vector3.Distance(((NPC)EndGameQuest.alliedGuard).Movement.CurrentDestination, EndGameQuest.activeAlliedSupplies.location.GuardPosition) < 2f)) { ((NPC)EndGameQuest.alliedGuard).Movement.EndSetDestination((WalkResult)1); Action val = Action.op_Implicit((Action)g__OnGuardArrivedToPos|13_0); ((NPC)EndGameQuest.alliedGuard).Movement.SetDestination(EndGameQuest.activeAlliedSupplies.location.GuardPosition, val, true, 1f, 1f); if (((NPC)EndGameQuest.alliedGuard).Movement.IsPaused) { ((NPC)EndGameQuest.alliedGuard).Movement.ResumeMovement(); } } } else if (!(Vector3.Distance(((NPC)EndGameQuest.alliedGuard).CenterPoint, Player.Local.CenterPointTransform.position) > 40f)) { if (!EndGameQuest.activeAlliedSupplies.playerNoticed && !EndGameQuest.activeAlliedSupplies.playerInterrogated) { if (Player.Local.IsPointVisibleToPlayer(((NPC)EndGameQuest.alliedGuard).CenterPointTransform.position, 30f, 5f)) { ((NPC)EndGameQuest.alliedGuard).Movement.FacePoint(Player.Local.CenterPointTransform.position, 0.9f); } if (((NPC)EndGameQuest.alliedGuard).Awareness.VisionCone.IsPlayerVisible(Player.Local)) { EndGameQuest.activeAlliedSupplies.playerNoticed = true; } } if (EndGameQuest.activeAlliedSupplies.playerNoticed && !EndGameQuest.activeAlliedSupplies.playerInterrogated && !((NPC)EndGameQuest.alliedGuard).Movement.HasDestination && !((NPC)EndGameQuest.alliedGuard).Movement.IsMoving) { ((NPC)EndGameQuest.alliedGuard).Movement.SetDestination(Player.Local.CenterPointTransform); if (((NPC)EndGameQuest.alliedGuard).Movement.IsPaused) { ((NPC)EndGameQuest.alliedGuard).Movement.ResumeMovement(); } } } } } else { <>1__state = -1; CartelEnforcer.coros.Add(MelonCoroutines.Start(CheckInterrogate())); } <>2__current = CartelEnforcer.Wait1; <>1__state = 1; return true; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__8 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public SupplyLocation location; private List.Enumerator <>7__wrap1; private GameObject 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__8(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if (num == -3 || num == 1) { try { } finally { <>m__Finally1(); } } <>7__wrap1 = default(List.Enumerator); 5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Expected O, but got Unknown //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) try { switch (<>1__state) { default: return false; case 0: { <>1__state = -1; string value = ((location.Type == ESupplyType.Barrel) ? "the blue barrels" : "a white van"); string text = $"{thomasMessageTemplates[Random.Range(0, thomasMessageTemplates.Count)]} {value} at {location.Description}."; Thomas val = Object.FindObjectOfType(true); if ((Object)(object)val == (Object)null) { return false; } ((NPC)val).MSGConversation.SendMessage(new Message(text, (ESenderType)1, true, -1), true, true); if (location.Type == ESupplyType.Barrel) { <>7__wrap1 = location.BarrelObjects.GetEnumerator(); <>1__state = -3; goto IL_0196; } if (location.ID == "SUPPLY_MANOR") { for (int i = 0; i < Property.Properties.Count; i++) { if (!(Property.Properties[i].propertyCode == "manor")) { continue; } ManorGate componentInChildren = ((Component)Property.Properties[i]).gameObject.GetComponentInChildren(); if ((Object)(object)componentInChildren == (Object)null) { Transform val2 = ((Component)Property.Properties[i]).transform.Find("Manor Gate"); if ((Object)(object)val2 != (Object)null) { ManorGate component = ((Component)val2).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { component.SetEnterable(true); } } } else { componentInChildren.SetEnterable(true); } } } CartelEnforcer.coros.Add(MelonCoroutines.Start(SpawnSupplyVan(new Tuple(location.CarPosition, location.CarRotation)))); goto IL_02b5; } case 1: <>1__state = -3; SetBarrelInteractable(5__3, barrelLoot[Random.Range(0, barrelLoot.Count)], 20); 5__3 = null; goto IL_0196; case 2: { <>1__state = -1; return false; } IL_02b5: if ((Object)(object)EndGameQuest.activeAlliedSupplies != (Object)null) { SpawnGuardGoon(location.GuardPosition, location.GuardRotation); } <>2__current = null; <>1__state = 2; return true; IL_0196: if (<>7__wrap1.MoveNext()) { 5__3 = <>7__wrap1.Current; if (location.ID == "SUPPLY_DOCKS") { RemoveDragInteraction(5__3); } <>2__current = CartelEnforcer.Wait01; <>1__state = 1; return true; } <>m__Finally1(); <>7__wrap1 = default(List.Enumerator); goto IL_02b5; } } catch { //try-fault ((IDisposable)this).Dispose(); throw; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; ((IDisposable)<>7__wrap1).Dispose(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__9 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Tuple target; private <>c__DisplayClass9_0 <>8__1; private NetworkObject 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__9(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_0129: 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_0139: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: { <>1__state = -1; <>8__1 = new <>c__DisplayClass9_0(); NetworkManager val2 = Object.FindObjectOfType(true); PrefabObjects spawnablePrefabs = val2.SpawnablePrefabs; NetworkObject val3 = null; <>8__1.rewardStorage = null; for (int j = 0; j < spawnablePrefabs.GetObjectCount(); j++) { NetworkObject @object = spawnablePrefabs.GetObject(true, j); object obj; if (@object == null) { obj = null; } else { GameObject gameObject = ((Component)@object).gameObject; obj = ((gameObject != null) ? ((Object)gameObject).name : null); } if ((string?)obj == "Van") { val3 = @object; } } 5__2 = Object.Instantiate(val3); val2.ServerManager.Spawn(5__2, (NetworkConnection)null, default(Scene)); EndGameQuest.alliedVanObject = 5__2; <>2__current = CartelEnforcer.Wait01; <>1__state = 1; return true; } case 1: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } ((Component)5__2).transform.parent = ((Component)Singleton.Instance).transform; ((Component)5__2).gameObject.SetActive(true); ((Component)5__2).transform.SetPositionAndRotation(target.Item1, Quaternion.Euler(target.Item2)); <>8__1.rewardStorage = ((Component)5__2).GetComponent(); <>8__1.rewardStorage.AccessSettings = (EAccessSettings)2; <>2__current = CartelEnforcer.Wait05; <>1__state = 2; return true; case 2: { <>1__state = -1; if (!CartelEnforcer.registered) { return false; } ((Component)5__2).GetComponent().isKinematic = true; int num = Random.Range(2, 8); for (int i = 0; i < <>8__1.rewardStorage.ItemSlots.Count && i < num; i++) { ItemInstance copy = carLoot[Random.Range(0, carLoot.Count)].GetCopy(-1); if (Random.Range(0f, 1f) > 0.5f) { ((BaseItemInstance)copy).Quantity = ((BaseItemInstance)copy).Quantity - 1; } <>8__1.rewardStorage.ItemSlots[i].InsertItem(copy); } Action val = null; val = Action.op_Implicit((Action)<>8__1.g__CloseTrigger|0); StorageEntity rewardStorage = <>8__1.rewardStorage; rewardStorage.onClosed += val; <>8__1.rewardStorage.StorageEntitySubtitle = "Cartel Supply Delivery"; <>2__current = null; <>1__state = 3; return true; } case 3: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static List supplyLocations; public static readonly List barrelLootIds = new List { "acid", "phosphorus", "gasoline" }; public static List barrelLoot = new List(); public static readonly List carLootIds = new List { "fullspectrumgrowlight", "dryingrack", "airpot" }; public static List carLoot = new List(); public static readonly List thomasMessageTemplates = new List { "We need to expand production in Hyland Point. Help us unload supplies from", "New shipment just arrived. I need you to secure contents of", "Product demand is spiking. Go and recover the supplies from", "We're scaling the operation. Move quickly and get the contents of", "Run up some logistics for me. Pick up the contents of" }; public static void InitSuppliesModule() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008c: 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_00c6: 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_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0133: 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_018f: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_0308: 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) SupplyLocation supplyLocation = new SupplyLocation(); supplyLocation.CarPosition = new Vector3(167.3347f, 10.5078f, -68.9665f); supplyLocation.CarRotation = new Vector3(0f, 15.2327f, 0f); supplyLocation.Description = "the Uptown manor parking lot"; supplyLocation.Name = "Manor Supplies"; supplyLocation.ID = "SUPPLY_MANOR"; supplyLocation.Type = ESupplyType.Van; supplyLocation.GuardPosition = new Vector3(162.3889f, 10.99f, -73.1324f); supplyLocation.GuardRotation = new Vector3(0f, 92f, 0f); SupplyLocation supplyLocation2 = new SupplyLocation(); supplyLocation2.CarPosition = new Vector3(18.3931f, 0.5828f, 71.3268f); supplyLocation2.CarRotation = new Vector3(0f, 271.5327f, 0f); supplyLocation2.Description = "the Downtown supermarket"; supplyLocation2.Name = "Supermarket Supplies"; supplyLocation2.ID = "SUPPLY_SUPERMARKET"; supplyLocation2.Type = ESupplyType.Van; supplyLocation2.GuardPosition = new Vector3(24.7739f, 1.065f, 68.6945f); supplyLocation2.GuardRotation = Vector3.zero; SupplyLocation supplyLocation3 = new SupplyLocation(); supplyLocation3.CarPosition = new Vector3(-129.0546f, -3.5171f, 96.506f); supplyLocation3.CarRotation = new Vector3(0f, 27.2817f, 0f); supplyLocation3.Description = "the Westville construction site"; supplyLocation3.Name = "Construction Site Supplies"; supplyLocation3.ID = "SUPPLY_CONSTRUCTION_SITE"; supplyLocation3.Type = ESupplyType.Van; supplyLocation3.GuardPosition = new Vector3(-134.0546f, -3.5171f, 96.506f); supplyLocation3.GuardRotation = new Vector3(0f, 158f, 0f); string text = ""; SupplyLocation supplyLocation4 = new SupplyLocation(); supplyLocation4.Description = "the Northtown waterfront"; supplyLocation4.Name = "Northtown Waterfront Supplies"; supplyLocation4.ID = "SUPPLY_WATERFRONT"; supplyLocation4.Type = ESupplyType.Barrel; supplyLocation4.GuardPosition = new Vector3(-63.3022f, -4.035f, 163.7165f); supplyLocation4.GuardRotation = new Vector3(0f, 94.6f, 0f); supplyLocation4.BarrelObjects = new List(); text = "Pallet_LiquidDrum"; PopulateBarrels("Hyland Point/Region_Northtown/Waterfront/Pallet Rack/", text, supplyLocation4.BarrelObjects); SupplyLocation supplyLocation5 = new SupplyLocation(); supplyLocation5.Description = "the Northtown Thompsons' construction yard"; supplyLocation5.Name = "Northtown Thompsons' Supplies"; supplyLocation5.ID = "SUPPLY_THOMPSONS"; supplyLocation5.Type = ESupplyType.Barrel; supplyLocation5.GuardPosition = new Vector3(-31.4224f, 1.0639f, 97.6543f); supplyLocation5.GuardRotation = Vector3.zero; supplyLocation5.BarrelObjects = new List(); text = "Liquid Drum"; PopulateBarrels("Hyland Point/Region_Northtown/Construction yard/Fence/", text, supplyLocation5.BarrelObjects); SupplyLocation supplyLocation6 = new SupplyLocation(); supplyLocation6.Description = "the Docks"; supplyLocation6.Name = "Docks Supplies"; supplyLocation6.ID = "SUPPLY_DOCKS"; supplyLocation6.Type = ESupplyType.Barrel; supplyLocation6.GuardPosition = new Vector3(-71.1649f, -1.535f, -33.5302f); supplyLocation6.GuardRotation = new Vector3(0f, 240f, 0f); supplyLocation6.BarrelObjects = new List(); text = "Liquid Drum"; PopulateBarrels("Hyland Point/Region_Docks/", text, supplyLocation6.BarrelObjects); supplyLocations = new List { supplyLocation, supplyLocation2, supplyLocation3, supplyLocation4, supplyLocation5, supplyLocation6 }; Func func = Registry.GetItem; foreach (string barrelLootId in barrelLootIds) { ItemDefinition val = func(barrelLootId); barrelLoot.Add(val.GetDefaultInstance(5)); } foreach (string carLootId in carLootIds) { ItemDefinition val2 = func(carLootId); carLoot.Add(val2.GetDefaultInstance(7)); } } public static void PopulateBarrels(string transformPath, string searchName, List populateList) { Transform val = ((Component)Singleton.Instance).transform.Find(transformPath); if (!((Object)(object)val != (Object)null)) { return; } Transform val2 = null; for (int i = 0; i < val.childCount; i++) { val2 = val.GetChild(i); if ((Object)(object)val2 != (Object)null && ((Object)val2).name.Contains(searchName)) { populateList.Add(((Component)val2).gameObject); } } } [IteratorStateMachine(typeof(d__8))] public static IEnumerator SpawnSupply(SupplyLocation location) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__8(0) { location = location }; } [IteratorStateMachine(typeof(d__9))] public static IEnumerator SpawnSupplyVan(Tuple target) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__9(0) { target = target }; } public static void RemoveDragInteraction(GameObject target) { InteractableObject component = target.GetComponent(); Rigidbody component2 = target.GetComponent(); Draggable component3 = target.GetComponent(); if ((Object)(object)component3 != (Object)null) { Object.Destroy((Object)(object)component3); } if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } if ((Object)(object)component2 != (Object)null) { component2.isKinematic = true; } } public static void SetBarrelInteractable(GameObject target, ItemInstance item, int capacity) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown GameObject barrelMarker = new GameObject("CE_SUPPLY"); barrelMarker.transform.SetParent(target.transform); InteractableObject intObj = target.AddComponent(); intObj.message = "Take 5 x " + ((BaseItemInstance)item).Name; intObj.SetInteractableState((EInteractableState)0); int remainingCapacity = capacity; UnityAction val = null; val = UnityAction.op_Implicit((Action)OnBarrelInteracted); intObj.onInteractStart.AddListener(val); void OnBarrelInteracted() { if (PlayerSingleton.InstanceExists) { if (PlayerSingleton.Instance.CanItemFitInInventory(item, 5)) { PlayerSingleton.Instance.AddItemToInventory(item); remainingCapacity -= 5; } if (remainingCapacity <= 0) { Object.Destroy((Object)(object)barrelMarker); if ((Object)(object)intObj != (Object)null) { Object.Destroy((Object)(object)intObj); } } } } } public static void SpawnGuardGoon(Vector3 pos, Vector3 rot) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Expected O, but got Unknown //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Expected O, but got Unknown CartelGoon val = null; DialogueController controller; if (NetworkSingleton.Instance.GoonPool.unspawnedGoons.Count != 0) { val = NetworkSingleton.Instance.GoonPool.SpawnGoon(pos); ((Component)((NPC)val).Behaviour.ScheduleManager.ActionList[0]).gameObject.SetActive(false); ((NPC)val).Behaviour.ScheduleManager.DisableSchedule(); if (((NPC)val).isInBuilding) { ((NPC)val).ExitBuilding(((NPC)val).CurrentBuilding); ((NPC)val).Movement.Warp(pos); } ((Component)val).transform.rotation = Quaternion.Euler(rot); AvatarEquippable component = Object.Instantiate(((Il2CppObjectBase)Resources.Load("Avatar/Equippables/PumpShotgun")).TryCast(), new Vector3(0f, -5f, 0f), Quaternion.identity).GetComponent(); AvatarWeapon val2 = ((Il2CppObjectBase)component).TryCast(); AvatarRangedWeapon val3 = ((Il2CppObjectBase)component).TryCast(); if ((Object)(object)val2 != (Object)null) { ((NPC)val).Behaviour.CombatBehaviour.DefaultWeapon = val2; } if ((Object)(object)val3 != (Object)null) { val3.MaxFireRate = 0.6f; val3.RepositionAfterHit = true; val3.CanShootWhileMoving = true; val3.EquipTime = 0.1f; val3.HitChance_MinRange = 99f; val3.HitChance_MaxRange = 80f; val3.Damage = 98f; ((AvatarWeapon)val3).CooldownDuration = 0.8f; ((AvatarWeapon)val3).MaxUseRange = 36f; ((AvatarWeapon)val3).MinUseRange = 0.1f; } ((AvatarEquippable)((NPC)val).Behaviour.CombatBehaviour.DefaultWeapon).Equip(((NPC)val).Avatar); ((NPC)val).Health.MaxHealth = 500f; ((NPC)val).Health.Health = 500f; ((NPC)val).Movement.SpeedController.AddSpeedControl(new SpeedControl("combat", 5, 0.55f)); controller = ((Component)((NPC)val).DialogueHandler).gameObject.GetComponent(); DialogueChoice val4 = new DialogueChoice(); string text = "Relax buddy, the boss sent me."; val4.ChoiceText = text ?? ""; val4.Enabled = true; val4.onChoosen.AddListener(UnityAction.op_Implicit((Action)ReplyChosen)); EndGameQuest.guardChoiceIndex = controller.AddDialogueChoice(val4, 0); EndGameQuest.alliedGuard = val; CartelEnforcer.coros.Add(MelonCoroutines.Start(HandleGuardGoon())); } void ReplyChosen() { EndGameQuest.activeAlliedSupplies.interrogatingPlayer = false; controller.npc.PlayVO((EVOLineType)14, false); controller.handler.WorldspaceRend.ShowText("Go ahead and grab the supplies", 6f); controller.handler.ContinueSubmitted(); if (EndGameQuest.guardChoiceIndex != -1) { List choices = controller.Choices; choices.RemoveAt(EndGameQuest.guardChoiceIndex); controller.Choices = choices; EndGameQuest.guardChoiceIndex = -1; } } } [IteratorStateMachine(typeof(d__13))] public static IEnumerator HandleGuardGoon() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__13(0); } private static bool CanStartInterrogate() { if (!Singleton.Instance.isActive && !Singleton.Instance.IsOpen && PlayerSingleton.Instance.activeUIElementCount <= 0) { return !((NPC)EndGameQuest.alliedGuard).DialogueHandler.IsDialogueInProgress; } return false; } [IteratorStateMachine(typeof(d__15))] public static IEnumerator CheckInterrogate() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__15(0); } public static void OnHourPassEvaluateSupply() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Invalid comparison between Unknown and I4 if (!CartelEnforcer.registered || Singleton.Instance.IsSaving || CartelEnforcer.isSaving || !CartelEnforcer.currentConfig.alliedExtensions || (int)NetworkSingleton.Instance.Status != 1 || EndGameQuest.alliedSuppliesActive) { return; } if (AlliedExtension.alliedQuests.hoursUntilNextSupplies > 0) { AlliedExtension.alliedQuests.hoursUntilNextSupplies--; return; } int currentTime = NetworkSingleton.Instance.CurrentTime; if (currentTime <= 801 && currentTime >= 759) { if ((Object)(object)EndGameQuest.activeAlliedSupplies == (Object)null) { CartelEnforcer.coros.Add(MelonCoroutines.Start(EndGameQuest.SetupTruceSuppliesQuest())); } else { EndGameQuest.activeAlliedSupplies.ResetSelf(); } } } public static void UpdateQuestHUD() { if (!((Object)(object)((Quest)EndGameQuest.activeAlliedSupplies).hudUI != (Object)null) || ((Il2CppObjectBase)((Quest)EndGameQuest.activeAlliedSupplies).hudUI).WasCollected || !(((Il2CppObjectBase)((Quest)EndGameQuest.activeAlliedSupplies).hudUI).Pointer != IntPtr.Zero)) { return; } TextMeshProUGUI mainLabel = ((Quest)EndGameQuest.activeAlliedSupplies).hudUI.MainLabel; if ((Object)(object)mainLabel != (Object)null && !((Il2CppObjectBase)mainLabel).WasCollected && ((Il2CppObjectBase)mainLabel).Pointer != IntPtr.Zero) { ((TMP_Text)mainLabel).text = EndGameQuest.activeAlliedSupplies.title + EndGameQuest.activeAlliedSupplies.Subtitle; ((TMP_Text)mainLabel).ForceMeshUpdate(false, false); } VerticalLayoutGroup hudUILayout = ((Quest)EndGameQuest.activeAlliedSupplies).hudUI.hudUILayout; if ((Object)(object)hudUILayout != (Object)null && !((Il2CppObjectBase)hudUILayout).WasCollected && ((Il2CppObjectBase)hudUILayout).Pointer != IntPtr.Zero) { ((LayoutGroup)hudUILayout).CalculateLayoutInputVertical(); ((LayoutGroup)hudUILayout).SetLayoutVertical(); if ((Object)(object)EndGameQuest.activeAlliedSupplies.groupRt == (Object)null) { EndGameQuest.activeAlliedSupplies.groupRt = ((Component)hudUILayout).GetComponent(); } LayoutRebuilder.ForceRebuildLayoutImmediate(EndGameQuest.activeAlliedSupplies.groupRt); ((Behaviour)hudUILayout).enabled = false; ((Behaviour)hudUILayout).enabled = true; } } public static void MinPassSupply() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Invalid comparison between Unknown and I4 //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Invalid comparison between Unknown and I4 //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Invalid comparison between Unknown and I4 //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Invalid comparison between Unknown and I4 //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Invalid comparison between Unknown and I4 //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0164: 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_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) if (!CartelEnforcer.registered || Singleton.Instance.IsSaving || (Object)(object)EndGameQuest.activeAlliedSupplies == (Object)null || (int)((Quest)EndGameQuest.activeAlliedSupplies).State != 1 || !InstanceFinder.IsServer) { return; } if ((int)NetworkSingleton.Instance.Status != 1) { ((Quest)EndGameQuest.activeAlliedSupplies).Fail(true); } EndGameQuest.activeAlliedSupplies.Subtitle = "\n" + ((Quest)EndGameQuest.activeAlliedSupplies).GetExpiryText() + " until supplies vanish"; UpdateQuestHUD(); ((Quest)EndGameQuest.activeAlliedSupplies).CheckExpiry(); if ((int)((Quest)EndGameQuest.activeAlliedSupplies).State != 1) { return; } if ((Object)(object)EndGameQuest.activeAlliedSupplies.QuestEntry_LocateSupplies != (Object)null && (int)EndGameQuest.activeAlliedSupplies.QuestEntry_LocateSupplies.State == 1 && Vector3.Distance(Player.Local.CenterPointTransform.position, (EndGameQuest.activeAlliedSupplies.location.Type == ESupplyType.Van) ? EndGameQuest.activeAlliedSupplies.location.CarPosition : EndGameQuest.activeAlliedSupplies.location.BarrelObjects[0].transform.position) < 14f) { EndGameQuest.activeAlliedSupplies.QuestEntry_LocateSupplies.SetState((EQuestState)2, false); } else { if (!((Object)(object)EndGameQuest.activeAlliedSupplies.QuestEntry_GatherSupplies != (Object)null) || (int)EndGameQuest.activeAlliedSupplies.QuestEntry_GatherSupplies.State != 1) { return; } bool flag = false; if (EndGameQuest.activeAlliedSupplies.location.Type == ESupplyType.Barrel) { Vector3 val = Vector3.zero; int num = 0; foreach (GameObject barrelObject in EndGameQuest.activeAlliedSupplies.location.BarrelObjects) { Transform val2 = barrelObject.transform.Find("CE_SUPPLY"); if ((Object)(object)val2 == (Object)null) { num++; } else { val = val2.position; } } if (num == EndGameQuest.activeAlliedSupplies.location.BarrelObjects.Count) { flag = true; } else if (val != Vector3.zero && (Object)(object)EndGameQuest.activeAlliedSupplies.QuestEntry_GatherSupplies.PoI != (Object)null && (Object)(object)((Component)EndGameQuest.activeAlliedSupplies.QuestEntry_GatherSupplies.PoI).gameObject != (Object)null) { EndGameQuest.activeAlliedSupplies.QuestEntry_GatherSupplies.SetPoILocation(val); } } if (flag) { ((Quest)EndGameQuest.activeAlliedSupplies).Complete(false); } } } } public enum ESupplyType { Barrel, Van } public class SupplyLocation { public string Name { get; set; } public string ID { get; set; } public string Description { get; set; } public Vector3 CarPosition { get; set; } public Vector3 CarRotation { get; set; } public Vector3 GuardPosition { get; set; } public Vector3 GuardRotation { get; set; } public List BarrelObjects { get; set; } public ESupplyType Type { get; set; } } [Serializable] public class NewAmbushConfig { public int mapRegion; public Vector3 ambushPosition = Vector3.zero; public List spawnPoints = new List(); public float detectionRadius = 10f; } [Serializable] public class ListNewAmbush { public List addedAmbushes = new List(); } [Serializable] public class AmbushGeneralSettingsSerialized { public List RangedWeaponAssetPaths; public List MeleeWeaponAssetPaths; public int MinRankForRanged = 2; public bool AfterDealAmbushEnabled = true; public float AmbushTriggerProbability = 0.8f; public float AmbushWeaponLethality = 0.33f; } public static class AmbushOverrides { [HarmonyPatch(typeof(Ambush), "ContractReceiptRecorded")] public static class Ambush_ContractReceiptRecorded_Patch { [HarmonyPrefix] public static bool Prefix(Ambush __instance, ContractReceipt receipt) { return ambushSettings.AfterDealAmbushEnabled; } } [CompilerGenerated] private sealed class <>c__DisplayClass6_0 { public NewAmbushConfig config; internal bool b__0(CartelRegionActivities act) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Invalid comparison between Unknown and I4 return (int)act.Region == config.mapRegion; } } [CompilerGenerated] private sealed class d__6 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__6(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Expected O, but got Unknown //IL_0125: 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_014e: Expected O, but got Unknown //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Expected O, but got Unknown //IL_01dd: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = CartelEnforcer.Wait2; <>1__state = 1; return true; case 1: { <>1__state = -1; if (!CartelEnforcer.registered) { return false; } CartelRegionActivities[] source = Il2CppArrayBase.op_Implicit((Il2CppArrayBase)(object)NetworkSingleton.Instance.Activities.RegionalActivities); int num = 1; if (ambushConfig.addedAmbushes != null && ambushConfig.addedAmbushes.Count > 0) { using List.Enumerator enumerator = ambushConfig.addedAmbushes.GetEnumerator(); while (enumerator.MoveNext()) { <>c__DisplayClass6_0 CS$<>8__locals0 = new <>c__DisplayClass6_0 { config = enumerator.Current }; CartelRegionActivities val = ((IEnumerable)source).FirstOrDefault((Func)((CartelRegionActivities act) => (int)act.Region == CS$<>8__locals0.config.mapRegion)); Transform val2 = ((Component)val).transform.Find("Ambush locations"); GameObject val3 = new GameObject($"AmbushLocation ({val2.childCount})"); val3.SetActive(false); CartelAmbushLocation val4 = val3.AddComponent(); val3.transform.position = CS$<>8__locals0.config.ambushPosition; val4.DetectionRadius = CS$<>8__locals0.config.detectionRadius; GameObject val5 = new GameObject("SpawnPoints"); val5.transform.parent = val3.transform; val4.AmbushPoints = Il2CppReferenceArray.op_Implicit((Transform[])(object)new Transform[CS$<>8__locals0.config.spawnPoints.Count]); int num2 = 0; foreach (Vector3 spawnPoint in CS$<>8__locals0.config.spawnPoints) { GameObject val6 = new GameObject("SP" + ((num2 == 0) ? "" : (" (" + num2 + ")"))); val6.transform.position = spawnPoint; val6.transform.parent = val5.transform; ((Il2CppArrayBase)(object)val4.AmbushPoints)[num2] = val6.transform; ((Behaviour)val4).enabled = true; num2++; } num++; CartelAmbushLocation[] array = Il2CppArrayBase.op_Implicit((Il2CppArrayBase)(object)val.AmbushLocations); CartelAmbushLocation[] array2 = (CartelAmbushLocation[])(object)new CartelAmbushLocation[array.Length + 1]; Array.Copy(array, array2, array.Length); array2[^1] = val4; val.AmbushLocations = Il2CppReferenceArray.op_Implicit(array2); val3.SetActive(true); val3.transform.parent = val2; } } return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__5 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__5(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0117: 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_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = CartelEnforcer.Wait5; <>1__state = 1; return true; case 1: { <>1__state = -1; if (!CartelEnforcer.registered) { return false; } ambushConfig = ConfigLoader.LoadAmbushConfig(); gameDefaultAmbush = ConfigLoader.LoadDefaultAmbushConfig(); ambushSettings = ConfigLoader.LoadAmbushSettings(); CartelRegionActivities[] array = Il2CppArrayBase.op_Implicit(Object.FindObjectsOfType(true)); int num = 0; CartelRegionActivities[] array2 = array; for (int i = 0; i < array2.Length; i++) { foreach (CartelAmbushLocation item in (Il2CppArrayBase)(object)array2[i].AmbushLocations) { List list = ((IEnumerable)item.AmbushPoints).Select((Transform tr) => tr.position).ToList(); NewAmbushConfig newAmbushConfig = gameDefaultAmbush.addedAmbushes.ElementAt(num); num++; if (newAmbushConfig.spawnPoints.Count != list.Count) { continue; } if (((Component)item).transform.position != newAmbushConfig.ambushPosition) { ((Component)item).transform.position = newAmbushConfig.ambushPosition; } if (item.DetectionRadius != newAmbushConfig.detectionRadius) { item.DetectionRadius = newAmbushConfig.detectionRadius; } for (int j = 0; j < newAmbushConfig.spawnPoints.Count; j++) { if (newAmbushConfig.spawnPoints[j] != list[j]) { ((Il2CppArrayBase)(object)item.AmbushPoints)[j].position = newAmbushConfig.spawnPoints[j]; } } } } <>2__current = null; <>1__state = 2; return true; } case 2: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__7 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__7(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_045b: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: { <>1__state = -1; if (ambushSettings.RangedWeaponAssetPaths != null) { RangedWeapons = (AvatarWeapon[])(object)new AvatarWeapon[ambushSettings.RangedWeaponAssetPaths.Count]; } if (ambushSettings.MeleeWeaponAssetPaths != null) { MeleeWeapons = (AvatarWeapon[])(object)new AvatarWeapon[ambushSettings.MeleeWeaponAssetPaths.Count]; } int count = ambushSettings.RangedWeaponAssetPaths.Count; for (int i = 0; i < count; i++) { AvatarEquippable component = Object.Instantiate(((Il2CppObjectBase)Resources.Load(ambushSettings.RangedWeaponAssetPaths[i])).TryCast(), new Vector3(0f, -5f, 0f), Quaternion.identity, (Transform)null).GetComponent(); if (!((Object)(object)component == (Object)null)) { if (!((Component)component).gameObject.activeSelf) { ((Component)component).gameObject.SetActive(true); } AvatarWeapon val = ((Il2CppObjectBase)component).TryCast(); if ((Object)(object)val != (Object)null) { RangedWeapons[i] = val; } AvatarRangedWeapon val2 = ((Il2CppObjectBase)component).TryCast(); if ((Object)(object)val2 != (Object)null && ambushSettings.AmbushWeaponLethality > 0f) { val2.Damage = Mathf.Lerp(val2.Damage, val2.Damage * 2f, ambushSettings.AmbushWeaponLethality); val2.AimTime_Max = Mathf.Lerp(val2.AimTime_Max, val2.AimTime_Max * 0.5f, ambushSettings.AmbushWeaponLethality); val2.AimTime_Min = Mathf.Lerp(val2.AimTime_Min, val2.AimTime_Min * 0.5f, ambushSettings.AmbushWeaponLethality); val2.HitChance_MaxRange = Mathf.Lerp(val2.HitChance_MaxRange, val2.HitChance_MaxRange * 2f, ambushSettings.AmbushWeaponLethality); val2.HitChance_MinRange = Mathf.Lerp(val2.HitChance_MinRange, val2.HitChance_MinRange * 2f, ambushSettings.AmbushWeaponLethality); ((AvatarWeapon)val2).MaxUseRange = Mathf.Lerp(((AvatarWeapon)val2).MaxUseRange, ((AvatarWeapon)val2).MaxUseRange * 2f, ambushSettings.AmbushWeaponLethality); ((AvatarWeapon)val2).MinUseRange = Mathf.Lerp(((AvatarWeapon)val2).MinUseRange, ((AvatarWeapon)val2).MinUseRange * 0.5f, ambushSettings.AmbushWeaponLethality); val2.MaxFireRate = Mathf.Lerp(val2.MaxFireRate, val2.MaxFireRate * 0.5f, ambushSettings.AmbushWeaponLethality); val2.ReloadTime = Mathf.Lerp(val2.ReloadTime, val2.ReloadTime * 0.5f, ambushSettings.AmbushWeaponLethality); } } } count = ambushSettings.MeleeWeaponAssetPaths.Count; for (int j = 0; j < count; j++) { AvatarEquippable component2 = Object.Instantiate(((Il2CppObjectBase)Resources.Load(ambushSettings.MeleeWeaponAssetPaths[j])).TryCast(), new Vector3(0f, -5f, 0f), Quaternion.identity, (Transform)null).GetComponent(); if (!((Object)(object)component2 == (Object)null)) { if (!((Component)component2).gameObject.activeSelf) { ((Component)component2).gameObject.SetActive(true); } AvatarWeapon val3 = ((Il2CppObjectBase)component2).TryCast(); if ((Object)(object)val3 != (Object)null) { MeleeWeapons[j] = val3; } AvatarMeleeWeapon val4 = ((Il2CppObjectBase)component2).TryCast(); if ((Object)(object)val4 != (Object)null && ambushSettings.AmbushWeaponLethality > 0f) { val4.Damage = Mathf.Lerp(val4.Damage, val4.Damage * 2f, ambushSettings.AmbushWeaponLethality); ((AvatarWeapon)val4).CooldownDuration = Mathf.Lerp(((AvatarWeapon)val4).CooldownDuration, ((AvatarWeapon)val4).CooldownDuration * 0.5f, ambushSettings.AmbushWeaponLethality); val4.AttackRange = Mathf.Lerp(val4.AttackRange, val4.AttackRange * 2f, ambushSettings.AmbushWeaponLethality); val4.AttackRadius = Mathf.Lerp(val4.AttackRadius, val4.AttackRadius * 2f, ambushSettings.AmbushWeaponLethality); ((AvatarWeapon)val4).MaxUseRange = Mathf.Lerp(((AvatarWeapon)val4).MaxUseRange, ((AvatarWeapon)val4).MaxUseRange * 2f, ambushSettings.AmbushWeaponLethality); } } } Ambush.MIN_RANK_FOR_RANGED_WEAPONS = new FullRank((ERank)ambushSettings.MinRankForRanged, 1); Enumerator enumerator = NetworkSingleton.Instance.Activities.GlobalActivities.GetEnumerator(); while (enumerator.MoveNext()) { Ambush val5 = ((Il2CppObjectBase)enumerator.Current).TryCast(); if ((Object)(object)val5 != (Object)null) { val5.RangedWeapons = Il2CppReferenceArray.op_Implicit(RangedWeapons); val5.MeleeWeapons = Il2CppReferenceArray.op_Implicit(MeleeWeapons); } } <>2__current = null; <>1__state = 1; return true; } case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static ListNewAmbush ambushConfig; public static ListNewAmbush gameDefaultAmbush; public static AmbushGeneralSettingsSerialized ambushSettings; public static AvatarWeapon[] MeleeWeapons; public static AvatarWeapon[] RangedWeapons; [IteratorStateMachine(typeof(d__5))] public static IEnumerator ApplyGameDefaultAmbush() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__5(0); } [IteratorStateMachine(typeof(d__6))] public static IEnumerator AddUserModdedAmbush() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__6(0); } [IteratorStateMachine(typeof(d__7))] public static IEnumerator SetAmbushGeneralSettings() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__7(0); } } public static class BuildInfo { public const string Name = "Cartel Enforcer"; public const string Description = "Cartel - Modded and configurable"; public const string Author = "XOWithSauce"; public const string Company = null; public const string Version = "1.8.6"; public const string DownloadLink = null; } public class CartelEnforcer : MelonMod { [HarmonyPatch(typeof(SaveManager), "Save", new Type[] { typeof(string) })] public static class SaveManager_Save_String_Patch { public static bool Prefix(SaveManager __instance, string saveFolderPath) { if (!isSaving) { isSaving = true; ConfigLoader.Save(CartelInventory.cartelStolenItems); if (currentConfig.alliedExtensions) { ConfigLoader.Save(AlliedExtension.alliedQuests); } CurrentEventCooldowns currentCooldowns = new CurrentEventCooldowns(); currentCooldowns.StealDeadDropCooldown = FrequencyOverrides.regActivityHours.First((CartelRegActivityHours x) => x.cartelActivityClass == 0).hoursUntilEnable; currentCooldowns.CartelCustomerDealCooldown = FrequencyOverrides.regActivityHours.First((CartelRegActivityHours x) => x.cartelActivityClass == 1).hoursUntilEnable; currentCooldowns.RobDealerCooldown = FrequencyOverrides.regActivityHours.First((CartelRegActivityHours x) => x.cartelActivityClass == 2).hoursUntilEnable; currentCooldowns.SprayGraffitiCooldown = FrequencyOverrides.regActivityHours.First((CartelRegActivityHours x) => x.cartelActivityClass == 3).hoursUntilEnable; currentCooldowns.DriveByCooldown = DriveByEvent.hoursUntilDriveBy; currentCooldowns.GatheringCooldown = CartelGathering.hoursUntilNextGathering; currentCooldowns.InterceptDealsCooldown = InterceptEvent.hoursUntilInterceptEvent; currentCooldowns.SabotageCooldowns = new Dictionary(); SabotageEvent.locations.ForEach(delegate(SabotageEvent.SabotageEventLocation x) { currentCooldowns.SabotageCooldowns.Add(((Property)x.business).PropertyName, x.hoursUntilEnabled); }); ConfigLoader.Save(currentCooldowns); } isSaving = false; return true; } } [HarmonyPatch(typeof(SaveManager), "Save", new Type[] { })] public static class SaveManager_Save_Patch { public static bool Prefix(SaveManager __instance) { return true; } } [HarmonyPatch(typeof(LoadManager), "ExitToMenu")] public static class LoadManager_ExitToMenu_Patch { public static bool Prefix(LoadManager __instance, SaveInfo autoLoadSave = null, Data mainMenuPopup = null, bool preventLeaveLobby = false) { ExitPreTask(); return true; } } [HarmonyPatch(typeof(DeathScreen), "LoadSaveClicked")] public static class DeathScreen_LoadSaveClicked_Patch { public static bool Prefix(DeathScreen __instance) { ExitPreTask(); return true; } } [HarmonyPatch(typeof(CartelGoon), "Spawn")] public static class CartelGoon_Spawn_Patch { [HarmonyPrefix] public static bool Prefix(CartelGoon __instance, GoonPool pool, Vector3 spawnPoint) { if (!((Behaviour)((NPC)__instance).Awareness).enabled) { ((NPC)__instance).Awareness.SetAwarenessActive(true); } if (__instance.goonMates.Count > 0) { __instance.goonMates.Clear(); } return true; } } [HarmonyPatch(typeof(CartelGoon), "Despawn")] public static class CartelGoon_Despawn_Patch { [HarmonyPostfix] public static void Postfix(CartelGoon __instance) { if (__instance.IsGoonSpawned) { __instance.IsGoonSpawned = false; } if (NetworkSingleton.Instance.GoonPool.spawnedGoons.Contains(__instance)) { NetworkSingleton.Instance.GoonPool.spawnedGoons.Remove(__instance); } if (!NetworkSingleton.Instance.GoonPool.unspawnedGoons.Contains(__instance)) { NetworkSingleton.Instance.GoonPool.unspawnedGoons.Add(__instance); } if ((Object)(object)((NPC)__instance).Behaviour.activeBehaviour != (Object)null && (Object)(object)((NPC)__instance).Behaviour.activeBehaviour == (Object)(object)((NPC)__instance).Behaviour.CombatBehaviour) { ((Behaviour)((NPC)__instance).Behaviour.CombatBehaviour).Disable(); } if (((Behaviour)((NPC)__instance).Movement.Agent).enabled) { ((Behaviour)((NPC)__instance).Movement.Agent).enabled = false; } if (((Behaviour)((NPC)__instance).Awareness).enabled) { ((NPC)__instance).Awareness.SetAwarenessActive(false); } if (__instance.goonMates.Count > 0) { __instance.goonMates.Clear(); } } } [CompilerGenerated] private sealed class d__36 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private GoonPool 5__2; private NetworkManager 5__3; private NetworkObject 5__4; private int 5__5; private CartelGoon[] 5__6; private int 5__7; private NetworkObject 5__8; private CartelGoon 5__9; private IEnumerator <>7__wrap9; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__36(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if (num == -3 || (uint)(num - 4) <= 1u) { try { } finally { <>m__Finally1(); } } 5__2 = null; 5__3 = null; 5__4 = null; 5__6 = null; 5__8 = null; 5__9 = null; <>7__wrap9 = null; <>1__state = -2; } private bool MoveNext() { //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) bool result; try { switch (<>1__state) { default: result = false; goto end_IL_0000; case 0: { <>1__state = -1; 5__2 = NetworkSingleton.Instance.GoonPool; CartelGoon[] array = Il2CppArrayBase.op_Implicit((Il2CppArrayBase)(object)5__2.goons); 5__3 = Object.FindObjectOfType(true); PrefabObjects spawnablePrefabs = 5__3.SpawnablePrefabs; 5__4 = null; for (int i = 0; i < spawnablePrefabs.GetObjectCount(); i++) { NetworkObject @object = spawnablePrefabs.GetObject(true, i); object obj; if (@object == null) { obj = null; } else { GameObject gameObject = ((Component)@object).gameObject; obj = ((gameObject != null) ? ((Object)gameObject).name : null); } if ((string?)obj == "CartelGoon") { 5__4 = @object; break; } } int num = array.Length; int num2 = 5; 5__5 = num + num2; 5__6 = (CartelGoon[])(object)new CartelGoon[5__5]; Array.Copy(array, 5__6, num); if ((Object)(object)array.FirstOrDefault() != (Object)null) { 5__7 = num; goto IL_02ac; } goto IL_02d3; } case 1: <>1__state = -1; if (!registered) { result = false; } else { 5__3.ServerManager.Spawn(5__8, (NetworkConnection)null, default(Scene)); <>2__current = Wait05; <>1__state = 2; result = true; } goto end_IL_0000; case 2: <>1__state = -1; if (!registered) { result = false; } else { ((Component)5__9).gameObject.SetActive(true); <>2__current = Wait01; <>1__state = 3; result = true; } goto end_IL_0000; case 3: <>1__state = -1; if (registered) { ((Behaviour)((NPC)5__9).Movement).enabled = true; ((Component)5__9).gameObject.SetActive(true); 5__6[5__7] = 5__9; 5__2.unspawnedGoons.Add(5__9); 5__8 = null; 5__9 = null; 5__7++; goto IL_02ac; } result = false; goto end_IL_0000; case 4: <>1__state = -3; if (!registered) { result = false; break; } if (((NPC)5__9).Behaviour.ScheduleManager.ActionList.Count > 0) { ((NPC)5__9).Behaviour.ScheduleManager.ActionList[0].Resume(); } 5__9.IsGoonSpawned = true; <>2__current = Wait05; <>1__state = 5; result = true; goto end_IL_0000; case 5: { <>1__state = -3; if (!registered) { result = false; break; } 5__9.Despawn_Client((NetworkConnection)null); 5__9 = null; goto IL_03f3; } IL_03f3: if (<>7__wrap9.MoveNext()) { 5__9 = <>7__wrap9.Current; if (((NPC)5__9).Health.IsDead || ((NPC)5__9).Health.IsKnockedOut) { ((NPC)5__9).Health.Revive(); } <>2__current = Wait01; <>1__state = 4; result = true; } else { <>m__Finally1(); <>7__wrap9 = null; result = false; } goto end_IL_0000; IL_02d3: <>7__wrap9 = ((Il2CppArrayBase)(object)NetworkSingleton.Instance.GoonPool.goons).GetEnumerator(); <>1__state = -3; goto IL_03f3; IL_02ac: if (5__7 >= 5__5) { 5__2.goons = Il2CppReferenceArray.op_Implicit(5__6); goto IL_02d3; } 5__8 = Object.Instantiate(5__4); 5__9 = ((Component)5__8).GetComponent(); ((Object)5__9).name = ((Object)5__9).name + 5__7; ((Component)5__9).transform.parent = NetworkSingleton.Instance.NPCContainer; NPCManager.NPCRegistry.Add((NPC)(object)5__9); <>2__current = Wait05; <>1__state = 1; result = true; goto end_IL_0000; } <>m__Finally1(); end_IL_0000:; } catch { //try-fault ((IDisposable)this).Dispose(); throw; } return result; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; if (<>7__wrap9 != null) { <>7__wrap9.Dispose(); } } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__32 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__32(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = MelonCoroutines.Start(AmbushOverrides.ApplyGameDefaultAmbush()); <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = MelonCoroutines.Start(AmbushOverrides.AddUserModdedAmbush()); <>1__state = 2; return true; case 2: <>1__state = -1; <>2__current = MelonCoroutines.Start(AmbushOverrides.SetAmbushGeneralSettings()); <>1__state = 3; return true; case 3: <>1__state = -1; if (currentConfig.debugMode) { <>2__current = MelonCoroutines.Start(DebugModule.SpawnAmbushAreaVisual()); <>1__state = 4; return true; } break; case 4: <>1__state = -1; break; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__31 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__31(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = MelonCoroutines.Start(DriveByEvent.InitializeDriveByData()); <>1__state = 1; return true; case 1: { <>1__state = -1; TimeManager instance = NetworkSingleton.Instance; instance.onHourPass += Action.op_Implicit((Action)ReduceDriveByHours); coros.Add(MelonCoroutines.Start(DriveByEvent.EvaluateDriveBy())); if (currentConfig.debugMode) { <>2__current = MelonCoroutines.Start(DebugModule.SpawnDriveByAreaVisual()); <>1__state = 2; return true; } break; } case 2: <>1__state = -1; break; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__34 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__34(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = Wait10; <>1__state = 1; return true; case 1: <>1__state = -1; if (!registered) { return false; } <>2__current = MiniQuest.InitMiniQuest(); <>1__state = 2; return true; case 2: { <>1__state = -1; TimeManager instance = NetworkSingleton.Instance; instance.onDayPass += Action.op_Implicit((Action)MiniQuest.OnDayPassNewDiag); coros.Add(MelonCoroutines.Start(MiniQuest.EvaluateMiniQuestCreation())); return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__33 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__33(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = Wait2; <>1__state = 1; return true; case 1: { <>1__state = -1; if (!registered) { return false; } TimeManager instance = NetworkSingleton.Instance; instance.onHourPass += Action.op_Implicit((Action)SabotageEvent.ReduceSabotageHours); coros.Add(MelonCoroutines.Start(SabotageEvent.EvaluateBombEvent())); return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__35 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private bool 5__2; private bool 5__3; private bool 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__35(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = Wait10; <>1__state = 1; return true; case 1: <>1__state = -1; if (!registered) { return false; } coros.Add(MelonCoroutines.Start(RandomManorGenerator.InitManorItemRef())); 5__2 = false; 5__3 = false; 5__4 = false; break; case 2: <>1__state = -1; if (!registered) { return false; } if (currentConfig.endGameQuest) { if (EndGameQuest.PreRequirementsMet() && !EndGameQuest.completed && !5__2 && (Object)(object)EndGameQuest.activeQuest == (Object)null) { 5__2 = true; coros.Add(MelonCoroutines.Start(EndGameQuest.GenDialogOption())); } if (EndGameQuest.PreRequirementsMet() && !EndGameQuest.manorCompleted && !5__3 && (Object)(object)EndGameQuest.activeManorQuest == (Object)null) { 5__3 = true; coros.Add(MelonCoroutines.Start(EndGameQuest.GenManorDialogOption())); } bool flag = NetworkSingleton.Instance.CurrentTime >= 1559 && NetworkSingleton.Instance.CurrentTime <= 1801; if (EndGameQuest.CarQuestPreRequirementsMet() && !EndGameQuest.carMeetupCompleted && !5__4 && EndGameQuest.frankDiagIndex == -1 && flag && (Object)(object)EndGameQuest.activeCarMeetupQuest == (Object)null) { 5__4 = true; coros.Add(MelonCoroutines.Start(EndGameQuest.GenFrankOption())); } else if (5__4 && !EndGameQuest.carMeetupCompleted && EndGameQuest.frankDiagIndex != -1 && !flag && (Object)(object)EndGameQuest.crankyFrank != (Object)null && (Object)(object)EndGameQuest.activeCarMeetupQuest == (Object)null) { 5__4 = false; DialogueController component = ((Component)EndGameQuest.crankyFrank.DialogueHandler).gameObject.GetComponent(); coros.Add(MelonCoroutines.Start(EndGameQuest.DisposeFrankChoice(component))); } } break; } if (registered) { <>2__current = Wait30; <>1__state = 2; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__29 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__29(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitUntil(Func.op_Implicit((Func)(() => Singleton.Instance.IsGameLoaded))); <>1__state = 1; return true; case 1: { <>1__state = -1; currentConfig = ConfigLoader.Load(); influenceConfig = ConfigLoader.LoadInfluenceConfig(); CartelInventory.cartelStolenItems = ConfigLoader.LoadStolenItems(); FrequencyOverrides.frequencyConfig = ConfigLoader.LoadEventFrequencyConfig(); eventCooldowns = ConfigLoader.LoadPersistentCooldowns(); DealerActivity.dealerConfig = ConfigLoader.LoadDealerConfig(); TimeManager instance = NetworkSingleton.Instance; instance.onDayPass += Action.op_Implicit((Action)InfluenceOverrides.OnDayPassChangePassive); CartelInventory.PreparePackagingRefs(); SabotageEvent.PopulateBombLocations(); SabotageEvent.PrepareBombFXObjects(); coros.Add(MelonCoroutines.Start(InterceptEvent.FetchUIElementsInit())); coros.Add(MelonCoroutines.Start(InitializeAndEvaluateDriveBy())); coros.Add(MelonCoroutines.Start(InitializeAmbush())); FrequencyOverrides.InitFrequencyOverrides(); TimeManager instance2 = NetworkSingleton.Instance; instance2.onHourPass += Action.op_Implicit((Action)FrequencyOverrides.OnHourPassReduceCartelRegActHours); coros.Add(MelonCoroutines.Start(InitializeAndEvaluateMiniQuest())); coros.Add(MelonCoroutines.Start(InterceptEvent.EvaluateCartelIntercepts())); TimeManager instance3 = NetworkSingleton.Instance; instance3.onHourPass += Action.op_Implicit((Action)InterceptEvent.HourPassInterceptCooldown); coros.Add(MelonCoroutines.Start(InitializeEndGameQuest())); coros.Add(MelonCoroutines.Start(DealerActivity.EvaluateDealerState())); coros.Add(MelonCoroutines.Start(AlliedExtension.SetupAlliedExtension())); TimeManager instance4 = NetworkSingleton.Instance; instance4.onHourPass += Action.op_Implicit((Action)CartelGathering.OnHourPassTryGather); coros.Add(MelonCoroutines.Start(InitializeAndEvaluateSabotage())); TimeManager instance5 = NetworkSingleton.Instance; instance5.onSleepEnd += Action.op_Implicit((Action)StealBackCustomer.OnDayPassTrySteal); if (currentConfig.debugMode) { coros.Add(MelonCoroutines.Start(DebugModule.GodMode())); MelonCoroutines.Start(DebugModule.MakeUI()); } coros.Add(MelonCoroutines.Start(ExtendGoonPool())); return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static ModConfig currentConfig; public static InfluenceConfig influenceConfig; public static CurrentEventCooldowns eventCooldowns; public static List coros = new List(); public static bool registered = false; private bool firstTimeLoad; public static bool isSaving = false; public static WaitForSeconds Wait01 = new WaitForSeconds(0.1f); public static WaitForSeconds Wait025 = new WaitForSeconds(0.25f); public static WaitForSeconds Wait05 = new WaitForSeconds(0.5f); public static WaitForSeconds Wait1 = new WaitForSeconds(1f); public static WaitForSeconds Wait2 = new WaitForSeconds(2f); public static WaitForSeconds Wait5 = new WaitForSeconds(5f); public static WaitForSeconds Wait10 = new WaitForSeconds(10f); public static WaitForSeconds Wait30 = new WaitForSeconds(30f); public static WaitForSeconds Wait60 = new WaitForSeconds(60f); public static ModPrefsHandler Prefs { get; private set; } public static CartelEnforcer Instance { get; private set; } public static void SyncConfig() { bool flag = false; FieldInfo[] fields = currentConfig.GetType().GetFields(); foreach (FieldInfo fieldInfo in fields) { if (!fieldInfo.Name.Contains("endGameQuestMonologueSpeed")) { MelonPreferences_Entry entry = Prefs.modConfigCategory.GetEntry(fieldInfo.Name); if (entry != null && (bool)fieldInfo.GetValue(currentConfig) != (bool)entry.BoxedValue) { flag = true; fieldInfo.SetValue(currentConfig, entry.BoxedValue); } } } if (currentConfig.alliedExtensions && !currentConfig.endGameQuest) { flag = true; currentConfig.endGameQuest = true; } if (flag) { ConfigLoader.Save(currentConfig); } } public override void OnInitializeMelon() { ((MelonBase)this).OnInitializeMelon(); Instance = this; currentConfig = ConfigLoader.Load(); influenceConfig = ConfigLoader.LoadInfluenceConfig(); Prefs = new ModPrefsHandler(); Prefs.SetupMelonPreferences(); SyncConfig(); MelonLogger.Msg("Cartel Enforcer Mod Loaded"); } public override void OnUpdate() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) if (!registered || currentConfig == null || !currentConfig.debugMode) { return; } if ((Object)(object)DebugModule._playerTransform != (Object)null && (Object)(object)DebugModule._positionText != (Object)null) { Vector3 position = DebugModule._playerTransform.position; string text = $"X: {position.x:F2}\nY: {position.y:F2}\nZ: {position.z:F2}"; ((TMP_Text)DebugModule._positionText).text = text; } if (Input.GetKey((KeyCode)306)) { if (Input.GetKeyDown((KeyCode)114)) { MelonCoroutines.Start(DebugModule.OnInputStartRob()); } else if (Input.GetKeyDown((KeyCode)103)) { MelonCoroutines.Start(DebugModule.OnInputStartDriveBy()); } else if (Input.GetKeyDown((KeyCode)104)) { MelonCoroutines.Start(DebugModule.OnInputGiveMiniQuest()); } else if (Input.GetKeyDown((KeyCode)108)) { MelonCoroutines.Start(DebugModule.OnInputInternalLog()); } else if (Input.GetKeyDown((KeyCode)116)) { MelonCoroutines.Start(DebugModule.OnInputInterceptContract()); } else if (Input.GetKeyDown((KeyCode)121)) { MelonCoroutines.Start(DebugModule.OnInputGenerateEndQuest()); } else if (Input.GetKeyDown((KeyCode)117)) { MelonCoroutines.Start(DebugModule.OnInputGenerateManorQuest()); } else if (Input.GetKeyDown((KeyCode)112)) { CartelGathering.hoursUntilNextGathering = 1; MelonCoroutines.Start(CartelGathering.TryStartGathering()); } else if (Input.GetKeyDown((KeyCode)110)) { coros.Add(MelonCoroutines.Start(DebugModule.OnInputStartSabotage())); } else if (Input.GetKeyDown((KeyCode)111)) { coros.Add(MelonCoroutines.Start(DebugModule.OnInputStealNearestCustomer())); } else if (Input.GetKeyDown((KeyCode)105)) { coros.Add(MelonCoroutines.Start(DebugModule.OnInputGenerateAlliedIntroQuest())); } else if (Input.GetKeyDown((KeyCode)107)) { coros.Add(MelonCoroutines.Start(DebugModule.OnInputGenerateAlliedSupplyQuest())); } } } public override void OnSceneWasInitialized(int buildIndex, string sceneName) { if (buildIndex == 1 && (Object)(object)Singleton.Instance != (Object)null && !registered && !firstTimeLoad) { firstTimeLoad = true; Singleton.Instance.onLoadComplete.AddListener(UnityAction.op_Implicit((Action)OnLoadCompleteCb)); } if (buildIndex != 1 && registered) { ExitPreTask(); } } private void OnLoadCompleteCb() { if (!registered) { registered = true; coros.Add(MelonCoroutines.Start(Setup())); } } [IteratorStateMachine(typeof(d__29))] public static IEnumerator Setup() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__29(0); } public static void ReduceDriveByHours() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Invalid comparison between Unknown and I4 if (!isSaving && currentConfig.driveByEnabled && (int)NetworkSingleton.Instance.Status == 2) { DriveByEvent.hoursUntilDriveBy = Mathf.Clamp(DriveByEvent.hoursUntilDriveBy - 1, 0, int.MaxValue); } } [IteratorStateMachine(typeof(d__31))] public static IEnumerator InitializeAndEvaluateDriveBy() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__31(0); } [IteratorStateMachine(typeof(d__32))] public static IEnumerator InitializeAmbush() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__32(0); } [IteratorStateMachine(typeof(d__33))] public static IEnumerator InitializeAndEvaluateSabotage() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__33(0); } [IteratorStateMachine(typeof(d__34))] public static IEnumerator InitializeAndEvaluateMiniQuest() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__34(0); } [IteratorStateMachine(typeof(d__35))] public static IEnumerator InitializeEndGameQuest() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__35(0); } [IteratorStateMachine(typeof(d__36))] public static IEnumerator ExtendGoonPool() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__36(0); } private static void ExitPreTask() { registered = false; foreach (object coro in coros) { if (coro != null) { MelonCoroutines.Stop(coro); } } coros.Clear(); DriveByEvent.driveByLocations.Clear(); FrequencyOverrides.regActivityHours.Clear(); MiniQuest.targetNPCs.Clear(); CartelInventory.cartelStolenItems.Clear(); MiniQuest.emptyDrops.Clear(); MiniQuest.targetNPCsList.Clear(); MiniQuest.targetNPCs.Clear(); EndGameQuest.manorGoons.Clear(); EndGameQuest.manorGoonGuids.Clear(); CartelGathering.spawnedGatherGoons.Clear(); SabotageEvent.burningPlayers.Clear(); SabotageEvent.locations.Clear(); DealerActivity.playerDealerStolen.Clear(); DealerActivity.consumedGUIDs.Clear(); DealerActivity.stolenInDealerInv.Clear(); StealBackCustomer.stolenNPCs.Clear(); SuppliesModule.supplyLocations.Clear(); SuppliesModule.carLoot.Clear(); SuppliesModule.barrelLoot.Clear(); foreach (string alliedDialogueKey in AlliedCartelDialogue.alliedDialogueKeys) { AlliedCartelDialogue.persuasionChances[alliedDialogueKey] = 0f; } DealerActivity.allCartelDealers = null; influenceConfig = null; eventCooldowns = null; isSaving = false; EndGameQuest.activeQuest = null; EndGameQuest.completed = false; EndGameQuest.activeManorQuest = null; EndGameQuest.manorCompleted = false; EndGameQuest.activeCarMeetupQuest = null; EndGameQuest.carMeetupCompleted = false; RandomManorGenerator.ResetManorItemRef(); EndGameQuest.activeTruceIntro = null; EndGameQuest.activeAlliedSupplies = null; EndGameQuest.alliedSuppliesActive = false; EndGameQuest.alliedGuard = null; EndGameQuest.alliedVanObject = null; EndGameQuest.guardChoiceIndex = -1; EndGameQuest.fixer = null; EndGameQuest.ray = null; EndGameQuest.jeremy = null; EndGameQuest.crankyFrank = null; EndGameQuest.bossGoon = null; EndGameQuest.fixerDiagIndex = 0; EndGameQuest.rayChoiceIndex = 0; EndGameQuest.jeremyDiagIndex = -1; EndGameQuest.frankDiagIndex = -1; EndGameQuest.jeremyDialogueActive = false; EndGameQuest.inContactDialogue = false; CartelGathering.lootGoblinIndex = -1; EndGameQuest.StageDeadDropsObserved = 0; EndGameQuest.StageGatheringsDefeated = 0; DriveByEvent.driveByActive = false; InterceptEvent.interceptingDeal = false; InterceptEvent.interceptor = null; CartelGathering.startedCombat = false; CartelGathering.areGoonsGathering = false; CartelGathering.currentGatheringLocation = null; CartelGathering.previousGatheringLocation = null; SabotageEvent.bombDefused = false; SabotageEvent.sabotageEventActive = false; SabotageEvent.interactionsUntilDefuse = 6; SabotageEvent.intBomb = null; SabotageEvent.reactiveFire = null; SabotageEvent.bombInteractable = null; SabotageEvent.bombLight = null; SabotageEvent.bombCubeMat = null; SabotageEvent.bombSound = null; SabotageEvent.fireHandler = null; SabotageEvent.fireLight = null; CartelInventory.jarPackaging = null; CartelInventory.brickPackaging = null; CartelInventory.cartelCashAmount = 0f; CartelInfluenceChangePopup_Show_Patch.showEnqueued = false; CartelGathering.hoursUntilNextGathering = 3; DealerActivity.currentDealerActivity = 0f; DealerActivity.previousDealerActivity = 0f; } } [Serializable] public class ModConfig { public bool debugMode; public bool driveByEnabled = true; public bool realRobberyEnabled = true; public bool defaultRobberyEnabled = true; public bool miniQuestsEnabled = true; public bool interceptDeals = true; public bool enhancedDealers = true; public bool cartelGatherings = true; public bool businessSabotage = true; public bool stealBackCustomers = true; public bool alliedExtensions = true; public bool endGameQuest = true; public float endGameQuestMonologueSpeed = 1f; } public class UnityContractResolver : DefaultContractResolver { protected override JsonObjectContract CreateObjectContract(Type objectType) { JsonObjectContract val = ((DefaultContractResolver)this).CreateObjectContract(objectType); if (objectType == typeof(Vector3)) { for (int num = ((Collection)(object)val.Properties).Count - 1; num >= 0; num--) { JsonProperty val2 = ((Collection)(object)val.Properties)[num]; if (val2.PropertyName == "normalized" || val2.PropertyName == "magnitude" || val2.PropertyName == "sqrMagnitude") { ((Collection)(object)val.Properties).RemoveAt(num); } } } return val; } } public static class ConfigLoader { [Serializable] public class DriveByTriggersSerialized { public List triggers; } [Serializable] public class CartelAlliedConfig { public float WestvilleCartelDealerCut = 0.3f; public float WestvilleCartelSigningFee = 6000f; public float DowntownCartelDealerCut = 0.4f; public float DowntownCartelSigningFee = 12000f; public float DocksCartelDealerCut = 0.5f; public float DocksCartelSigningFee = 18000f; public float SuburbiaCartelDealerCut = 0.55f; public float SuburbiaCartelSigningFee = 24000f; public float UptownCartelDealerCut = 0.6f; public float UptownCartelSigningFee = 36000f; public int PersuadeCooldownMins = 60; public int SupplyQuestCooldownHours = 48; } [Serializable] public class CartelAlliedQuests { public bool alliedIntroCompleted; public int timesPersuaded; public int hoursUntilNextSupplies = 48; } public static ModConfig Load() { //IL_0061: Expected O, but got Unknown string pathTo = ModDataPaths.GetPathTo(ModDataPaths.pathModConfig); ModConfig modConfig; if (File.Exists(pathTo)) { try { modConfig = JsonConvert.DeserializeObject(File.ReadAllText(pathTo)); modConfig.endGameQuestMonologueSpeed = Mathf.Clamp(modConfig.endGameQuestMonologueSpeed, 0f, 1f); if (modConfig.alliedExtensions && !modConfig.endGameQuest) { MelonLogger.Warning("Cartel Enforcer Allied Extensions depend on End Game Quests. Enabling End Game Quest config automatically."); modConfig.endGameQuest = true; } } catch (JsonSerializationException val) { JsonSerializationException val2 = val; modConfig = new ModConfig(); MelonLogger.Error("Failed to deserialize CartelEnforcer config: " + ((Exception)(object)val2).Message); } catch (Exception ex) { modConfig = new ModConfig(); MelonLogger.Warning("Failed to read CartelEnforcer config: " + ex); } } else { MelonLogger.Warning("Missing CartelEnforcer basic mod config, creating directory and template."); modConfig = new ModConfig(); Save(modConfig); } return modConfig; } public static void Save(ModConfig config) { try { string pathTo = ModDataPaths.GetPathTo(ModDataPaths.pathModConfig); string contents = JsonConvert.SerializeObject((object)config, (Formatting)1); Directory.CreateDirectory(Path.GetDirectoryName(pathTo)); File.WriteAllText(pathTo, contents); } catch (Exception ex) { MelonLogger.Warning("Failed to save CartelEnforcer config: " + ex); } } public static ListNewAmbush LoadAmbushConfig() { //IL_0022: Expected O, but got Unknown string pathTo = ModDataPaths.GetPathTo(ModDataPaths.pathAmbushes); ListNewAmbush listNewAmbush; if (File.Exists(pathTo)) { try { listNewAmbush = JsonConvert.DeserializeObject(File.ReadAllText(pathTo)); } catch (JsonSerializationException val) { JsonSerializationException val2 = val; listNewAmbush = new ListNewAmbush(); MelonLogger.Error("Failed to deserialize CartelEnforcer User Added Ambush config: " + ((Exception)(object)val2).Message); } catch (Exception ex) { listNewAmbush = new ListNewAmbush(); listNewAmbush.addedAmbushes = new List(); MelonLogger.Warning("Failed to read CartelEnforcer User Added Ambush config: " + ex); } } else { MelonLogger.Warning("Missing CartelEnforcer User Added Ambush config, creating directory and template."); listNewAmbush = new ListNewAmbush(); listNewAmbush.addedAmbushes = new List(); Save(listNewAmbush); } return listNewAmbush; } public static void Save(ListNewAmbush config) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown try { JsonSerializerSettings val = new JsonSerializerSettings { ContractResolver = (IContractResolver)(object)new UnityContractResolver() }; string pathTo = ModDataPaths.GetPathTo(ModDataPaths.pathAmbushes); string contents = JsonConvert.SerializeObject((object)config, (Formatting)1, val); Directory.CreateDirectory(Path.GetDirectoryName(pathTo)); File.WriteAllText(pathTo, contents); MelonLogger.Warning(" CartelEnforcer User Added Ambush config written to: " + pathTo); } catch (Exception ex) { MelonLogger.Warning("Failed to save CartelEnforcer config: " + ex); } } public static ListNewAmbush LoadDefaultAmbushConfig() { //IL_0022: Expected O, but got Unknown string pathTo = ModDataPaths.GetPathTo(ModDataPaths.pathDefAmbushes); ListNewAmbush result; if (File.Exists(pathTo)) { try { result = JsonConvert.DeserializeObject(File.ReadAllText(pathTo)); } catch (JsonSerializationException val) { JsonSerializationException val2 = val; result = new ListNewAmbush(); MelonLogger.Error("Failed to deserialize CartelEnforcer Default ambush config: " + ((Exception)(object)val2).Message); } catch (Exception ex) { result = new ListNewAmbush(); MelonLogger.Warning("Failed to read Cartel Enforcer Default ambush config: " + ex); } } else { MelonLogger.Warning("Missing CartelEnforcer Default ambush config, creating directory and template."); result = GenerateAmbushState(); } return result; } public static ListNewAmbush GenerateAmbushState() { //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Expected O, but got Unknown //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Expected I4, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) ListNewAmbush listNewAmbush = new ListNewAmbush(); listNewAmbush.addedAmbushes = new List(); try { CartelRegionActivities[] array = Il2CppArrayBase.op_Implicit(Object.FindObjectsOfType(true)); foreach (CartelRegionActivities val in array) { foreach (CartelAmbushLocation item in (Il2CppArrayBase)(object)val.AmbushLocations) { NewAmbushConfig config = new NewAmbushConfig(); config.mapRegion = (int)val.Region; config.ambushPosition = ((Component)item).transform.position; config.spawnPoints = ((IEnumerable)item.AmbushPoints).Select((Transform tr) => tr.position).ToList(); config.detectionRadius = item.DetectionRadius; if (!listNewAmbush.addedAmbushes.Any((NewAmbushConfig existingConfig) => existingConfig.mapRegion == config.mapRegion && existingConfig.ambushPosition == config.ambushPosition)) { listNewAmbush.addedAmbushes.Add(config); } } } JsonSerializerSettings val2 = new JsonSerializerSettings { ContractResolver = (IContractResolver)(object)new UnityContractResolver() }; string contents = JsonConvert.SerializeObject((object)listNewAmbush, (Formatting)1, val2); string pathTo = ModDataPaths.GetPathTo(ModDataPaths.pathDefAmbushes); Directory.CreateDirectory(Path.GetDirectoryName(pathTo)); File.WriteAllText(pathTo, contents); MelonLogger.Warning(" CartelEnforcer Default Ambush config written to: " + pathTo); } catch (Exception ex) { MelonLogger.Warning("Failed to save default.json config: " + ex); } return listNewAmbush; } public static AmbushGeneralSettingsSerialized LoadAmbushSettings() { //IL_007a: Expected O, but got Unknown string pathTo = ModDataPaths.GetPathTo(ModDataPaths.pathSettingsAmbushes); AmbushGeneralSettingsSerialized ambushGeneralSettingsSerialized; if (File.Exists(pathTo)) { try { ambushGeneralSettingsSerialized = JsonConvert.DeserializeObject(File.ReadAllText(pathTo)); int num = Enum.GetValues(typeof(ERank)).Cast().Max(); if (ambushGeneralSettingsSerialized.MinRankForRanged >= num || ambushGeneralSettingsSerialized.MinRankForRanged < 0) { ambushGeneralSettingsSerialized.MinRankForRanged = Mathf.Clamp(ambushGeneralSettingsSerialized.MinRankForRanged, 0, num - 1); } ambushGeneralSettingsSerialized.AmbushWeaponLethality = Mathf.Clamp01(ambushGeneralSettingsSerialized.AmbushWeaponLethality); } catch (JsonSerializationException val) { JsonSerializationException val2 = val; ambushGeneralSettingsSerialized = new AmbushGeneralSettingsSerialized(); ambushGeneralSettingsSerialized.RangedWeaponAssetPaths = new List { "Avatar/Equippables/M1911" }; ambushGeneralSettingsSerialized.MeleeWeaponAssetPaths = new List { "Avatar/Equippables/Knife" }; MelonLogger.Error("Failed to deserialize CartelEnforcer Ambush/settings.json config: " + ((Exception)(object)val2).Message); } catch (Exception ex) { ambushGeneralSettingsSerialized = new AmbushGeneralSettingsSerialized(); ambushGeneralSettingsSerialized.RangedWeaponAssetPaths = new List { "Avatar/Equippables/M1911" }; ambushGeneralSettingsSerialized.MeleeWeaponAssetPaths = new List { "Avatar/Equippables/Knife" }; MelonLogger.Warning("Failed to read Ambush/settings.json config: " + ex); } } else { MelonLogger.Warning("Could not find settings.json at Ambush/settings.json. Generating default template."); ambushGeneralSettingsSerialized = new AmbushGeneralSettingsSerialized(); ambushGeneralSettingsSerialized.RangedWeaponAssetPaths = new List { "Avatar/Equippables/M1911" }; ambushGeneralSettingsSerialized.MeleeWeaponAssetPaths = new List { "Avatar/Equippables/Knife" }; string contents = JsonConvert.SerializeObject((object)ambushGeneralSettingsSerialized, (Formatting)1); Directory.CreateDirectory(Path.GetDirectoryName(pathTo)); File.WriteAllText(pathTo, contents); } return ambushGeneralSettingsSerialized; } private static DriveByTriggersSerialized GenerateDefault() { DriveByTriggersSerialized driveByTriggersSerialized = new DriveByTriggersSerialized(); driveByTriggersSerialized.triggers = new List(); DriveByEvent.GenerateDefaultDriveByTriggers(); foreach (KeyValuePair driveByLocation in DriveByEvent.driveByLocations) { driveByTriggersSerialized.triggers.Add(driveByLocation.Key); } return driveByTriggersSerialized; } public static DriveByTriggersSerialized LoadDriveByConfig() { //IL_0027: Expected O, but got Unknown //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Expected O, but got Unknown DriveByTriggersSerialized driveByTriggersSerialized = null; string pathTo = ModDataPaths.GetPathTo(ModDataPaths.pathDriveBys); if (File.Exists(pathTo)) { try { driveByTriggersSerialized = JsonConvert.DeserializeObject(File.ReadAllText(pathTo)); } catch (JsonSerializationException val) { JsonSerializationException val2 = val; driveByTriggersSerialized = GenerateDefault(); MelonLogger.Error("Failed to deserialize CartelEnforcer DriveBy/driveby.json config: " + ((Exception)(object)val2).Message); } catch (Exception ex) { driveByTriggersSerialized = GenerateDefault(); MelonLogger.Warning("Failed to read DriveBy/driveby.json config: " + ex); } } else { MelonLogger.Warning("Could not find a file at DriveBy/driveby.json. Generating default template."); driveByTriggersSerialized = GenerateDefault(); JsonSerializerSettings val3 = new JsonSerializerSettings { ContractResolver = (IContractResolver)(object)new UnityContractResolver() }; string contents = JsonConvert.SerializeObject((object)driveByTriggersSerialized, (Formatting)1, val3); Directory.CreateDirectory(Path.GetDirectoryName(pathTo)); File.WriteAllText(pathTo, contents); } return driveByTriggersSerialized; } public static string SanitizeAndFormatName(string orgName) { string text = orgName; if (text != null) { text = text.Replace(" ", "_").ToLower(); text = text.Replace(",", ""); text = text.Replace(".", ""); text = text.Replace("<", ""); text = text.Replace(">", ""); text = text.Replace(":", ""); text = text.Replace("\"", ""); text = text.Replace("/", ""); text = text.Replace("\\", ""); text = text.Replace("|", ""); text = text.Replace("?", ""); text = text.Replace("*", ""); } return text + ".json"; } public static List LoadStolenItems() { //IL_0084: Expected O, but got Unknown StolenItemsList stolenItemsList = new StolenItemsList(); string organisationName = Singleton.Instance.ActiveSaveInfo.OrganisationName; int saveSlotNumber = Singleton.Instance.ActiveSaveInfo.SaveSlotNumber; string path = $"{saveSlotNumber}_{SanitizeAndFormatName(organisationName)}"; string pathTo = ModDataPaths.GetPathTo(Path.Combine(ModDataPaths.pathCartelStolen, path)); if (File.Exists(pathTo)) { try { stolenItemsList = JsonConvert.DeserializeObject(File.ReadAllText(pathTo)); } catch (JsonSerializationException val) { JsonSerializationException val2 = val; stolenItemsList = new StolenItemsList(); MelonLogger.Error("Failed to deserialize Cartel Stolen items data: " + ((Exception)(object)val2).Message); } catch (Exception ex) { stolenItemsList = new StolenItemsList(); MelonLogger.Warning("Failed to read Cartel Stolen Items data: " + ex); } } else { stolenItemsList = new StolenItemsList(); } CartelInventory.cartelCashAmount = stolenItemsList.balance; List list = new List(); if (stolenItemsList.items != null && stolenItemsList.items.Count > 0) { foreach (SerializeStolenItems item in stolenItemsList.items) { if (item.ID == null || item.ID == string.Empty) { MelonLogger.Msg("Stolen Item ID is null"); continue; } if (item.Quality < 0 || item.Quality > 4) { MelonLogger.Msg("Stolen Quality not allowed"); continue; } if (item.Quantity >= int.MaxValue) { MelonLogger.Msg("Stolen Quantity is over the max limit"); continue; } QualityItemInstance val3 = ((Il2CppObjectBase)Registry.GetItem(item.ID).GetDefaultInstance(item.Quantity)).TryCast(); if (val3 != null) { switch (item.Quality) { case 0: val3.Quality = (EQuality)0; break; case 1: val3.Quality = (EQuality)1; break; case 2: val3.Quality = (EQuality)2; break; case 3: val3.Quality = (EQuality)3; break; case 4: val3.Quality = (EQuality)4; break; } list.Add(val3); } else { MelonLogger.Msg("Tried to load item thats not quality item instance"); } } } return list; } public static void Save(List stolenItems) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected I4, but got Unknown StolenItemsList stolenItemsList = new StolenItemsList(); stolenItemsList.items = new List(); lock (CartelInventory.cartelItemLock) { foreach (QualityItemInstance stolenItem in stolenItems) { SerializeStolenItems item = new SerializeStolenItems { ID = ((BaseItemInstance)stolenItem).ID, Quality = (int)stolenItem.Quality, Quantity = ((BaseItemInstance)stolenItem).Quantity }; stolenItemsList.items.Add(item); } stolenItemsList.balance = Mathf.Round(CartelInventory.cartelCashAmount); try { string organisationName = Singleton.Instance.ActiveSaveInfo.OrganisationName; int saveSlotNumber = Singleton.Instance.ActiveSaveInfo.SaveSlotNumber; string path = $"{saveSlotNumber}_{SanitizeAndFormatName(organisationName)}"; string pathTo = ModDataPaths.GetPathTo(Path.Combine(ModDataPaths.pathCartelStolen, path)); string contents = JsonConvert.SerializeObject((object)stolenItemsList, (Formatting)1); Directory.CreateDirectory(Path.GetDirectoryName(pathTo)); File.WriteAllText(pathTo, contents); } catch (Exception ex) { MelonLogger.Warning("Failed to save Cartel Stolen Items data: " + ex); } } } public static CartelDealerConfig LoadDealerConfig() { //IL_00f9: Expected O, but got Unknown CartelDealerConfig cartelDealerConfig = new CartelDealerConfig(); string pathTo = ModDataPaths.GetPathTo(ModDataPaths.pathDealerConfig); if (File.Exists(pathTo)) { try { cartelDealerConfig = JsonConvert.DeserializeObject(File.ReadAllText(pathTo)); cartelDealerConfig.CartelDealerWalkSpeed = Mathf.Clamp(cartelDealerConfig.CartelDealerWalkSpeed, 1f, 7f); cartelDealerConfig.CartelDealerHP = Mathf.Clamp(cartelDealerConfig.CartelDealerHP, 10f, 2000f); cartelDealerConfig.CartelDealerLethality = Mathf.Clamp01(cartelDealerConfig.CartelDealerLethality); cartelDealerConfig.SafetyThreshold = Mathf.Clamp(cartelDealerConfig.SafetyThreshold, -1f, 1f); cartelDealerConfig.DealerActivityIncreasePerDay = Mathf.Clamp(cartelDealerConfig.DealerActivityIncreasePerDay, 0f, 1f); cartelDealerConfig.DealerActivityDecreasePerKill = Mathf.Clamp(cartelDealerConfig.DealerActivityDecreasePerKill, 0f, 1f); cartelDealerConfig.StealDealerContractChance = Mathf.Clamp(cartelDealerConfig.StealDealerContractChance, 0f, 1f); cartelDealerConfig.StealPlayerPendingChance = Mathf.Clamp(cartelDealerConfig.StealPlayerPendingChance, 0f, 1f); } catch (JsonSerializationException val) { JsonSerializationException val2 = val; cartelDealerConfig = new CartelDealerConfig(); MelonLogger.Error("Failed to deserialize CartelEnforcer Dealer config: " + ((Exception)(object)val2).Message); } catch (Exception ex) { cartelDealerConfig = new CartelDealerConfig(); MelonLogger.Warning("Failed to read CartelEnforcer Dealer config: " + ex); } } else { MelonLogger.Warning("Missing CartelEnforcer Dealer config, creating directory and template."); cartelDealerConfig = new CartelDealerConfig(); Save(cartelDealerConfig); } return cartelDealerConfig; } public static void Save(CartelDealerConfig dealerConfig) { try { string contents = JsonConvert.SerializeObject((object)dealerConfig, (Formatting)1); string pathTo = ModDataPaths.GetPathTo(ModDataPaths.pathDealerConfig); Directory.CreateDirectory(Path.GetDirectoryName(pathTo)); File.WriteAllText(pathTo, contents); MelonLogger.Warning(" CartelEnforcer Dealer config written to: " + pathTo); } catch (Exception ex) { MelonLogger.Warning("Failed to save CartelEnforcer Dealer config: " + ex); } } public static InfluenceConfig LoadInfluenceConfig() { //IL_016f: Expected O, but got Unknown InfluenceConfig influenceConfig = new InfluenceConfig(); string pathTo = ModDataPaths.GetPathTo(ModDataPaths.pathInfluenceConfig); if (File.Exists(pathTo)) { try { influenceConfig = JsonConvert.DeserializeObject(File.ReadAllText(pathTo)); influenceConfig.interceptFail = ClampInfluence(influenceConfig.interceptFail, clampPositive: true); influenceConfig.interceptSuccess = ClampInfluence(influenceConfig.interceptSuccess, clampPositive: false); influenceConfig.deadDropFail = ClampInfluence(influenceConfig.deadDropFail, clampPositive: true); influenceConfig.deadDropSuccess = ClampInfluence(influenceConfig.deadDropSuccess, clampPositive: false); influenceConfig.gatheringFail = ClampInfluence(influenceConfig.gatheringFail, clampPositive: true); influenceConfig.gatheringSuccess = ClampInfluence(influenceConfig.gatheringSuccess, clampPositive: false); influenceConfig.robberyPlayerEscape = ClampInfluence(influenceConfig.robberyPlayerEscape, clampPositive: true); influenceConfig.robberyGoonEscapeSuccess = ClampInfluence(influenceConfig.robberyGoonEscapeSuccess, clampPositive: true); influenceConfig.robberyGoonDead = ClampInfluence(influenceConfig.robberyGoonDead, clampPositive: false); influenceConfig.robberyGoonEscapeDead = ClampInfluence(influenceConfig.robberyGoonEscapeDead, clampPositive: false); influenceConfig.sabotageBombDefused = ClampInfluence(influenceConfig.sabotageBombDefused, clampPositive: false); influenceConfig.sabotageGoonKilled = ClampInfluence(influenceConfig.sabotageGoonKilled, clampPositive: false); influenceConfig.sabotageBombExploded = ClampInfluence(influenceConfig.sabotageBombExploded, clampPositive: true); influenceConfig.passiveInfluenceGainPerDay = ClampInfluence(influenceConfig.passiveInfluenceGainPerDay, clampPositive: true); influenceConfig.cartelDealerDied = ClampInfluence(influenceConfig.cartelDealerDied, clampPositive: false); influenceConfig.ambushDefeated = ClampInfluence(influenceConfig.ambushDefeated, clampPositive: false); influenceConfig.graffitiInfluenceReduction = ClampInfluence(influenceConfig.graffitiInfluenceReduction, clampPositive: false); influenceConfig.customerUnlockInfluenceChange = ClampInfluence(influenceConfig.customerUnlockInfluenceChange, clampPositive: false); } catch (JsonSerializationException val) { JsonSerializationException val2 = val; influenceConfig = new InfluenceConfig(); MelonLogger.Error("Failed to deserialize CartelEnforcer influence config: " + ((Exception)(object)val2).Message); } catch (Exception ex) { influenceConfig = new InfluenceConfig(); MelonLogger.Warning("Failed to read CartelEnforcer influence config: " + ex); } } else { MelonLogger.Warning("Missing CartelEnforcer Influence config, creating directory and template."); influenceConfig = new InfluenceConfig(); Save(influenceConfig); } return influenceConfig; } public static void Save(InfluenceConfig influenceConfig) { try { string contents = JsonConvert.SerializeObject((object)influenceConfig, (Formatting)1); string pathTo = ModDataPaths.GetPathTo(ModDataPaths.pathInfluenceConfig); Directory.CreateDirectory(Path.GetDirectoryName(pathTo)); File.WriteAllText(pathTo, contents); MelonLogger.Warning(" CartelEnforcer Influence config written to: " + pathTo); } catch (Exception ex) { MelonLogger.Warning("Failed to save CartelEnforcer Influence config: " + ex); } } private static float ClampInfluence(float value, bool clampPositive) { if (!clampPositive) { return Mathf.Clamp(value, -1f, 0f); } return Mathf.Clamp(value, 0f, 1f); } public static CartelAlliedConfig LoadAlliedConfig() { //IL_0028: Expected O, but got Unknown CartelAlliedConfig cartelAlliedConfig = new CartelAlliedConfig(); string pathTo = ModDataPaths.GetPathTo(ModDataPaths.pathAlliedConfig); if (File.Exists(pathTo)) { try { cartelAlliedConfig = JsonConvert.DeserializeObject(File.ReadAllText(pathTo)); } catch (JsonSerializationException val) { JsonSerializationException val2 = val; cartelAlliedConfig = new CartelAlliedConfig(); MelonLogger.Error("Failed to deserialize CartelEnforcer Allied config: " + ((Exception)(object)val2).Message); } catch (Exception ex) { cartelAlliedConfig = new CartelAlliedConfig(); MelonLogger.Warning("Failed to read CartelEnforcer Allied config: " + ex); } } else { MelonLogger.Warning("Missing CartelEnforcer Allied config, creating directory and template."); cartelAlliedConfig = new CartelAlliedConfig(); Save(cartelAlliedConfig); } return cartelAlliedConfig; } public static void Save(CartelAlliedConfig alliedConfig) { try { string contents = JsonConvert.SerializeObject((object)alliedConfig, (Formatting)1); string pathTo = ModDataPaths.GetPathTo(ModDataPaths.pathAlliedConfig); Directory.CreateDirectory(Path.GetDirectoryName(pathTo)); File.WriteAllText(pathTo, contents); } catch (Exception ex) { MelonLogger.Warning("Failed to save CartelEnforcer Allied Config Data: " + ex); } } public static CartelAlliedQuests LoadAlliedQuests() { //IL_0084: Expected O, but got Unknown CartelAlliedQuests cartelAlliedQuests = new CartelAlliedQuests(); string organisationName = Singleton.Instance.ActiveSaveInfo.OrganisationName; int saveSlotNumber = Singleton.Instance.ActiveSaveInfo.SaveSlotNumber; string path = $"{saveSlotNumber}_{SanitizeAndFormatName(organisationName)}"; string pathTo = ModDataPaths.GetPathTo(Path.Combine(ModDataPaths.pathAlliedPersist, path)); if (File.Exists(pathTo)) { try { cartelAlliedQuests = JsonConvert.DeserializeObject(File.ReadAllText(pathTo)); } catch (JsonSerializationException val) { JsonSerializationException val2 = val; cartelAlliedQuests = new CartelAlliedQuests(); MelonLogger.Error("Failed to deserialize CartelEnforcer Allied Quests config: " + ((Exception)(object)val2).Message); } catch (Exception ex) { cartelAlliedQuests = new CartelAlliedQuests(); MelonLogger.Warning("Failed to read CartelEnforcer Allied Quests config: " + ex); } } else { MelonLogger.Warning("Missing CartelEnforcer Allied Quests config, creating directory and template."); cartelAlliedQuests = new CartelAlliedQuests(); Save(cartelAlliedQuests); } return cartelAlliedQuests; } public static void Save(CartelAlliedQuests alliedQuestsState) { try { string organisationName = Singleton.Instance.ActiveSaveInfo.OrganisationName; int saveSlotNumber = Singleton.Instance.ActiveSaveInfo.SaveSlotNumber; string path = $"{saveSlotNumber}_{SanitizeAndFormatName(organisationName)}"; string pathTo = ModDataPaths.GetPathTo(Path.Combine(ModDataPaths.pathAlliedPersist, path)); string contents = JsonConvert.SerializeObject((object)alliedQuestsState, (Formatting)1); Directory.CreateDirectory(Path.GetDirectoryName(pathTo)); File.WriteAllText(pathTo, contents); } catch (Exception ex) { MelonLogger.Warning("Failed to save CartelEnforcer Allied Quests Data: " + ex); } } public static EventFrequencyConfig LoadEventFrequencyConfig() { //IL_014f: Expected O, but got Unknown EventFrequencyConfig eventFrequencyConfig = new EventFrequencyConfig(); string pathTo = ModDataPaths.GetPathTo(ModDataPaths.pathEventFrequency); if (File.Exists(pathTo)) { try { eventFrequencyConfig = JsonConvert.DeserializeObject(File.ReadAllText(pathTo)); List list = new List(); for (int i = 0; i < eventFrequencyConfig.events.Count; i++) { if (eventFrequencyConfig.events[i].Identifier == string.Empty) { list.Add(i); MelonLogger.Warning("Identifier cannot be empty for event frequency found in file at: " + pathTo); } else { eventFrequencyConfig.events[i].CooldownHours = Mathf.Clamp(eventFrequencyConfig.events[i].CooldownHours, 0, int.MaxValue); eventFrequencyConfig.events[i].InfluenceRequirement = Mathf.Clamp01(eventFrequencyConfig.events[i].InfluenceRequirement); eventFrequencyConfig.events[i].RandomTimeRangePercentage = Mathf.Clamp01(eventFrequencyConfig.events[i].RandomTimeRangePercentage); } } if (list.Count > 0) { List list2 = new List(); for (int j = 0; j < eventFrequencyConfig.events.Count; j++) { if (!list.Contains(j)) { list2.Add(eventFrequencyConfig.events[j]); } } eventFrequencyConfig.events = list2; } } catch (JsonSerializationException val) { JsonSerializationException val2 = val; eventFrequencyConfig = new EventFrequencyConfig(); eventFrequencyConfig.InitializeDefault(); MelonLogger.Error("Failed to deserialize CartelEnforcer Event Frequency config: " + ((Exception)(object)val2).Message); } catch (Exception ex) { eventFrequencyConfig = new EventFrequencyConfig(); eventFrequencyConfig.InitializeDefault(); MelonLogger.Warning("Failed to read CartelEnforcer Event Frequency config: " + ex); } } else { MelonLogger.Warning("Missing CartelEnforcer Event Frequency config, creating directory and template."); eventFrequencyConfig = new EventFrequencyConfig(); eventFrequencyConfig.InitializeDefault(); Save(eventFrequencyConfig); } return eventFrequencyConfig; } public static void Save(EventFrequencyConfig config) { try { string contents = JsonConvert.SerializeObject((object)config, (Formatting)1); string pathTo = ModDataPaths.GetPathTo(ModDataPaths.pathEventFrequency); Directory.CreateDirectory(Path.GetDirectoryName(pathTo)); File.WriteAllText(pathTo, contents); MelonLogger.Warning(" CartelEnforcer Event frequency config written to: " + pathTo); } catch (Exception ex) { MelonLogger.Warning("Failed to save CartelEnforcer Event frequency config: " + ex); } } public static CurrentEventCooldowns LoadPersistentCooldowns() { //IL_0155: Expected O, but got Unknown CurrentEventCooldowns currentEventCooldowns = new CurrentEventCooldowns(); string organisationName = Singleton.Instance.ActiveSaveInfo.OrganisationName; int saveSlotNumber = Singleton.Instance.ActiveSaveInfo.SaveSlotNumber; string path = $"{saveSlotNumber}_{SanitizeAndFormatName(organisationName)}"; string pathTo = ModDataPaths.GetPathTo(Path.Combine(ModDataPaths.pathEventFrequencyPersist, path)); if (File.Exists(pathTo)) { try { currentEventCooldowns = JsonConvert.DeserializeObject(File.ReadAllText(pathTo)); bool flag = true; if (currentEventCooldowns.SabotageCooldowns != null) { if (currentEventCooldowns.SabotageCooldowns.Count != 3) { flag = false; } if (!currentEventCooldowns.SabotageCooldowns.Keys.Contains("Laundromat")) { flag = false; } if (!currentEventCooldowns.SabotageCooldowns.Keys.Contains("Post Office")) { flag = false; } if (!currentEventCooldowns.SabotageCooldowns.Keys.Contains("Taco Ticklers")) { flag = false; } } else { flag = false; } if (!flag) { MelonLogger.Error("Cartel Enforcer Frequency persistent data has incorrect sagotage cooldowns. Resetting values"); int activityHours = FrequencyOverrides.GetActivityHours("Sabotage"); activityHours = ((activityHours != 0) ? activityHours : Random.Range(16, 64)); currentEventCooldowns.SabotageCooldowns = new Dictionary { { "Laundromat", activityHours }, { "Post Office", activityHours }, { "Taco Ticklers", activityHours } }; } } catch (JsonSerializationException val) { JsonSerializationException val2 = val; currentEventCooldowns = new CurrentEventCooldowns(); currentEventCooldowns.InitializeDefault(); MelonLogger.Error("Failed to deserialize CartelEnforcer Frequency persistent data: " + ((Exception)(object)val2).Message); } catch (Exception ex) { currentEventCooldowns = new CurrentEventCooldowns(); currentEventCooldowns.InitializeDefault(); MelonLogger.Warning("Failed to read CartelEnforcer Frequency persistent data: " + ex); } } else { MelonLogger.Warning("Missing CartelEnforcer Frequency persistent data, creating directory and template."); currentEventCooldowns = new CurrentEventCooldowns(); currentEventCooldowns.InitializeDefault(); Save(currentEventCooldowns); } return currentEventCooldowns; } public static void Save(CurrentEventCooldowns cooldowns) { try { string organisationName = Singleton.Instance.ActiveSaveInfo.OrganisationName; int saveSlotNumber = Singleton.Instance.ActiveSaveInfo.SaveSlotNumber; string path = $"{saveSlotNumber}_{SanitizeAndFormatName(organisationName)}"; string pathTo = ModDataPaths.GetPathTo(Path.Combine(ModDataPaths.pathEventFrequencyPersist, path)); string contents = JsonConvert.SerializeObject((object)cooldowns, (Formatting)1); Directory.CreateDirectory(Path.GetDirectoryName(pathTo)); File.WriteAllText(pathTo, contents); } catch (Exception ex) { MelonLogger.Warning("Failed to save CartelEnforcer Frequency persistent data: " + ex); } } } public class ModPrefsHandler { public MelonPreferences_Category modConfigCategory; public void SetupMelonPreferences() { modConfigCategory = MelonPreferences.CreateCategory("Cartel Enforcer XOWithSauce", "Cartel Enforcer"); modConfigCategory.CreateEntry("debugMode", CartelEnforcer.currentConfig.debugMode, "Debug Mode Enabled", "Enable keybinds & display visual cues", false, false, (ValueValidator)null, (string)null); modConfigCategory.CreateEntry("driveByEnabled", CartelEnforcer.currentConfig.driveByEnabled, "Drive By Enabled", "Enables drive-by events where Thomas shoots the player", false, false, (ValueValidator)null, (string)null); modConfigCategory.CreateEntry("realRobberyEnabled", CartelEnforcer.currentConfig.realRobberyEnabled, "Real Robbery Enabled", "Enables robberies where a goon is spawned to fight the dealer", false, false, (ValueValidator)null, (string)null); modConfigCategory.CreateEntry("defaultRobberyEnabled", CartelEnforcer.currentConfig.defaultRobberyEnabled, "Default Robbery Enabled", "Enables the robberies where you only get a text message", false, false, (ValueValidator)null, (string)null); modConfigCategory.CreateEntry("miniQuestsEnabled", CartelEnforcer.currentConfig.miniQuestsEnabled, "Mini Quests Enabled", "Enables mini quest generation for finding cartels dead drops", false, false, (ValueValidator)null, (string)null); modConfigCategory.CreateEntry("interceptDeals", CartelEnforcer.currentConfig.interceptDeals, "Intercept Deals Enabled", "Enables an event where Cartel Dealers try to steal your active deals", false, false, (ValueValidator)null, (string)null); modConfigCategory.CreateEntry("enhancedDealers", CartelEnforcer.currentConfig.enhancedDealers, "Enhanced Dealers Enabled", "Use custom behaviour for Cartel Dealers", false, false, (ValueValidator)null, (string)null); modConfigCategory.CreateEntry("cartelGatherings", CartelEnforcer.currentConfig.cartelGatherings, "Cartel Gatherings Enabled", "Enables an event where Cartel Goons gather around randomly during the day", false, false, (ValueValidator)null, (string)null); modConfigCategory.CreateEntry("businessSabotage", CartelEnforcer.currentConfig.businessSabotage, "Business Sabotage Enabled", "Enables an event where a Cartel Goon tries to plant a bomb at your business", false, false, (ValueValidator)null, (string)null); modConfigCategory.CreateEntry("stealBackCustomers", CartelEnforcer.currentConfig.stealBackCustomers, "Steal Back Customers Enabled", "Enables a feature where the Cartel can steal back your customers and lock them", false, false, (ValueValidator)null, (string)null); modConfigCategory.CreateEntry("alliedExtensions", CartelEnforcer.currentConfig.alliedExtensions, "Allied Extensions Enabled", "Allows you to hire cartel dealers and partake in supply quests while enabled. Requires End Game Quests to be enabled.", false, false, (ValueValidator)null, (string)null); modConfigCategory.CreateEntry("endGameQuest", CartelEnforcer.currentConfig.endGameQuest, "End Game Quests Enabled", "Enables the generation of custom quests for Cartel", false, false, (ValueValidator)null, (string)null); for (int i = 0; i < modConfigCategory.Entries.Count; i++) { string id = modConfigCategory.Entries[i].Identifier; ((MelonEventBase>)(object)modConfigCategory.Entries[i].OnEntryValueChangedUntyped).Subscribe((LemonAction)ThisEntryChanged, 0, false); void ThisEntryChanged(object objOld, object objNew) { OnEntryChange(id, objOld, objNew); } } MelonPreferences.Save(); } public static void OnEntryChange(string identifier, object objOld, object objNew) { FieldInfo[] fields = CartelEnforcer.currentConfig.GetType().GetFields(); foreach (FieldInfo fieldInfo in fields) { if (fieldInfo.Name.Contains(identifier) && fieldInfo.Name.Contains("endGameQuestMonologueSpeed")) { if (fieldInfo.Name.Contains("endGameQuest") && CartelEnforcer.currentConfig.alliedExtensions && !(bool)objNew) { break; } fieldInfo.SetValue(CartelEnforcer.currentConfig, (bool)objNew); } } ConfigLoader.Save(CartelEnforcer.currentConfig); } } public static class ModDataPaths { private static readonly string BASE_USERDATA_NAME = "XO_WithSauce-CartelEnforcer"; private static readonly string TS_PACKAGE_NAME = "XO_WithSauce-CartelEnforcer_"; private static readonly string packagePathUserData = Path.Combine(MelonEnvironment.UserDataDirectory, TS_PACKAGE_NAME + "IL2CPP", BASE_USERDATA_NAME); private static readonly string manualPathUserData = Path.Combine(MelonEnvironment.UserDataDirectory, BASE_USERDATA_NAME); public static readonly string pathModConfig = "config.json"; public static readonly string pathAmbushes = Path.Combine("Ambush", "ambush.json"); public static readonly string pathDefAmbushes = Path.Combine("Ambush", "default.json"); public static readonly string pathSettingsAmbushes = Path.Combine("Ambush", "settings.json"); public static readonly string pathDriveBys = Path.Combine("DriveBy", "driveby.json"); public static readonly string pathDealerConfig = Path.Combine("Dealers", "dealer.json"); public static readonly string pathCartelStolen = "CartelItems"; public static readonly string pathInfluenceConfig = Path.Combine("Influence", "influence.json"); public static readonly string pathAlliedConfig = Path.Combine("Allied", "config.json"); public static readonly string pathAlliedPersist = Path.Combine("Allied", "QuestData"); public static readonly string pathEventFrequency = Path.Combine("EventFrequency", "config.json"); public static readonly string pathEventFrequencyPersist = Path.Combine("EventFrequency", "Cooldowns"); private static bool hasCheckedInstallationPath = false; private static bool isModManagerInstallation = false; public static string GetPathTo(string modDataDestination) { if (!hasCheckedInstallationPath) { if (Directory.Exists(packagePathUserData)) { isModManagerInstallation = true; } if (Directory.Exists(manualPathUserData)) { isModManagerInstallation = false; } hasCheckedInstallationPath = true; } return Path.Combine(isModManagerInstallation ? packagePathUserData : manualPathUserData, modDataDestination); } } public static class DebugModule { [CompilerGenerated] private sealed class d__14 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__14(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; if (num != 0) { if (num != 1) { return false; } <>1__state = -1; if (!CartelEnforcer.registered) { return false; } if (Player.Local.Health.CurrentHealth < 100f) { Player.Local.Health.RecoverHealth(100f); } } else { <>1__state = -1; } <>2__current = CartelEnforcer.Wait01; <>1__state = 1; return true; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__15 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__15(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: { <>1__state = -1; _playerTransform = Player.Local.CenterPointTransform; HUD instance = Singleton.Instance; _positionText = new GameObject("PlayerPositionText").AddComponent(); ((TMP_Text)_positionText).transform.SetParent(((Component)instance.canvas).transform, false); ((TMP_Text)_positionText).alignment = (TextAlignmentOptions)257; ((TMP_Text)_positionText).fontSize = 16f; ((Graphic)_positionText).color = Color.red; ((TMP_Text)_positionText).rectTransform.anchorMin = new Vector2(0f, 1f); ((TMP_Text)_positionText).rectTransform.anchorMax = new Vector2(0f, 1f); ((TMP_Text)_positionText).rectTransform.pivot = new Vector2(0f, 1f); ((TMP_Text)_positionText).rectTransform.anchoredPosition = new Vector2(40f, -40f); <>2__current = null; <>1__state = 1; return true; } case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__5 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__5(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (!AlliedExtension.alliedQuests.alliedIntroCompleted && (Object)(object)EndGameQuest.activeTruceIntro == (Object)null) { CartelEnforcer.coros.Add(MelonCoroutines.Start(EndGameQuest.SetupTruceIntroQuest())); } <>2__current = null; <>1__state = 1; return true; case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__6 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__6(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; if ((Object)(object)EndGameQuest.activeAlliedSupplies == (Object)null && !EndGameQuest.alliedSuppliesActive) { CartelEnforcer.coros.Add(MelonCoroutines.Start(EndGameQuest.SetupTruceSuppliesQuest())); } else if ((Object)(object)EndGameQuest.activeAlliedSupplies != (Object)null && !EndGameQuest.alliedSuppliesActive) { EndGameQuest.activeAlliedSupplies.ResetSelf(); } <>2__current = null; <>1__state = 1; return true; case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__4 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; CartelEnforcer.coros.Add(MelonCoroutines.Start(EndGameQuest.GenDialogOption())); <>2__current = null; <>1__state = 1; return true; case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__3 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__3(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; CartelEnforcer.coros.Add(MelonCoroutines.Start(EndGameQuest.GenManorDialogOption())); <>2__current = null; <>1__state = 1; return true; case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__9 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__9(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: { <>1__state = -1; List list = MiniQuest.targetNPCs.Keys.ToList(); NPC val = list[Random.Range(0, list.Count)]; if (MiniQuest.targetNPCs.ContainsKey(val) && !MiniQuest.targetNPCs[val].HasActiveQuest && !MiniQuest.targetNPCs[val].HasAskedQuestToday) { MiniQuest.targetNPCs[val].HasActiveQuest = true; MiniQuest.InitMiniQuestDialogue(val); } <>2__current = null; <>1__state = 1; return true; } case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__11 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__11(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; MelonCoroutines.Start(InterceptEvent.StartInterceptDeal()); <>2__current = null; <>1__state = 1; return true; case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__10 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__10(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: { <>1__state = -1; _ = NetworkSingleton.Instance.Activities.HoursUntilNextGlobalActivity; CartelRegionActivities[] array = Il2CppArrayBase.op_Implicit((Il2CppArrayBase)(object)NetworkSingleton.Instance.Activities.RegionalActivities); for (int i = 0; i < array.Length; i++) { _ = array[i]; } <>2__current = CartelEnforcer.Wait05; <>1__state = 1; return true; } case 1: <>1__state = -1; foreach (CartelRegActivityHours regActivityHour in FrequencyOverrides.regActivityHours) { _ = regActivityHour; } <>2__current = CartelEnforcer.Wait05; <>1__state = 2; return true; case 2: <>1__state = -1; foreach (QualityItemInstance cartelStolenItem in CartelInventory.cartelStolenItems) { _ = cartelStolenItem; } <>2__current = CartelEnforcer.Wait05; <>1__state = 3; return true; case 3: <>1__state = -1; foreach (NPC item in MiniQuest.targetNPCs.Keys.ToList()) { _ = item; } <>2__current = CartelEnforcer.Wait05; <>1__state = 4; return true; case 4: <>1__state = -1; foreach (SabotageEvent.SabotageEventLocation location in SabotageEvent.locations) { _ = location; } <>2__current = CartelEnforcer.Wait05; <>1__state = 5; return true; case 5: <>1__state = -1; <>2__current = CartelEnforcer.Wait05; <>1__state = 6; return true; case 6: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__7 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__7(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) if (<>1__state != 0) { return false; } <>1__state = -1; Player.Local.Health.RecoverHealth(100f); float num = 150f; DriveByEvent.DriveByTrigger trig = null; foreach (KeyValuePair driveByLocation in DriveByEvent.driveByLocations) { float num2 = Vector3.Distance(Player.Local.CenterPointTransform.position, driveByLocation.Key.triggerPosition); if (num2 <= num) { trig = driveByLocation.Key; num = num2; } } CartelEnforcer.coros.Add(MelonCoroutines.Start(DriveByEvent.BeginDriveBy(trig))); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__8 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private Transform 5__2; private Dealer 5__3; private float 5__4; private Dealer[] <>7__wrap4; private int <>7__wrap5; private Dealer 5__7; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__8(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; 5__3 = null; <>7__wrap4 = null; 5__7 = null; <>1__state = -2; } private bool MoveNext() { //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Invalid comparison between Unknown and I4 switch (<>1__state) { default: return false; case 0: { <>1__state = -1; 5__2 = ((Component)Player.Local).transform; Dealer[] array = Il2CppArrayBase.op_Implicit(Object.FindObjectsOfType(true)); 5__3 = null; 5__4 = 160f; <>7__wrap4 = array; <>7__wrap5 = 0; goto IL_010b; } case 1: { <>1__state = -1; float num = Vector3.Distance(((Component)5__7).transform.position, 5__2.position); if (num < 5__4) { 5__4 = num; 5__3 = 5__7; } 5__7 = null; goto IL_00fd; } case 2: { <>1__state = -1; return false; } IL_00fd: <>7__wrap5++; goto IL_010b; IL_010b: if (<>7__wrap5 < <>7__wrap4.Length) { 5__7 = <>7__wrap4[<>7__wrap5]; if ((int)5__7.DealerType != 1 && 5__7.IsRecruited && !((NPC)5__7).isInBuilding) { <>2__current = CartelEnforcer.Wait01; <>1__state = 1; return true; } goto IL_00fd; } <>7__wrap4 = null; 5__3.TryRobDealer(); <>2__current = null; <>1__state = 2; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__12 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private SabotageEvent.SabotageEventLocation 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__12(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: { <>1__state = -1; SabotageEvent.sabotageEventActive = true; 5__2 = null; float num = 500f; foreach (SabotageEvent.SabotageEventLocation location in SabotageEvent.locations) { if (Vector3.Distance(((Component)location.business).transform.position, Player.Local.CenterPointTransform.position) < num) { num = Vector3.Distance(((Component)location.business).transform.position, Player.Local.CenterPointTransform.position); 5__2 = location; } } <>2__current = CartelEnforcer.Wait10; <>1__state = 1; return true; } case 1: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } CartelEnforcer.coros.Add(MelonCoroutines.Start(SabotageEvent.GoonPlantBomb(5__2))); <>2__current = null; <>1__state = 2; return true; case 2: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__13 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__13(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004d: 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_0073: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: { <>1__state = -1; Customer val = null; float num = 15f; Enumerator enumerator = Customer.UnlockedCustomers.GetEnumerator(); while (enumerator.MoveNext()) { Customer current = enumerator.Current; if (Vector3.Distance(Player.Local.CenterPointTransform.position, current.NPC.CenterPoint) < num) { val = current; num = Vector3.Distance(Player.Local.CenterPointTransform.position, current.NPC.CenterPoint); } } if ((Object)(object)val == (Object)null) { return false; } StealBackCustomer.StealCustomer(val.NPC); <>2__current = null; <>1__state = 1; return true; } case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__16 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__16(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Expected O, but got Unknown //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007c: 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_00ac: Expected O, but got Unknown //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Expected O, but got Unknown //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: { <>1__state = -1; Shader val = Shader.Find("Unlit/Color"); if ((Object)(object)val == (Object)null) { val = Shader.Find("Standard"); } Dictionary dictionary = new Dictionary(); foreach (EMapRegion value2 in Enum.GetValues(typeof(EMapRegion))) { Material val3 = new Material(val); val3.color = GetColorCorrespondance(value2); dictionary[value2] = val3; } Material val4 = new Material(val); val4.color = Color.cyan; CartelRegionActivities[] array = Il2CppArrayBase.op_Implicit(Object.FindObjectsOfType(true)); Vector3 val7 = default(Vector3); foreach (CartelRegionActivities val5 in array) { foreach (CartelAmbushLocation item in (Il2CppArrayBase)(object)val5.AmbushLocations) { float detectionRadius = item.DetectionRadius; GameObject val6 = GameObject.CreatePrimitive((PrimitiveType)3); MeshRenderer component = val6.GetComponent(); if (dictionary.TryGetValue(val5.Region, out var value)) { ((Renderer)component).material = value; } else { ((Renderer)component).material = new Material(val); ((Renderer)component).material.color = Color.white; } ((Renderer)component).receiveShadows = false; ((Renderer)component).shadowCastingMode = (ShadowCastingMode)0; val6.transform.parent = ((Component)Singleton.Instance).transform; val6.transform.localScale = new Vector3(detectionRadius, detectionRadius, detectionRadius); val6.transform.position = ((Component)item).transform.position + new Vector3(0f, 25f + detectionRadius, 0f); val6.SetActive(true); foreach (Transform item2 in (Il2CppArrayBase)(object)item.AmbushPoints) { GameObject obj = GameObject.CreatePrimitive((PrimitiveType)1); MeshRenderer component2 = obj.GetComponent(); ((Renderer)component2).material = val4; ((Renderer)component2).receiveShadows = false; ((Renderer)component2).shadowCastingMode = (ShadowCastingMode)0; obj.transform.position = ((Component)item2).transform.position + new Vector3(0f, 20f, 0f); obj.transform.parent = val6.transform; ((Vector3)(ref val7))..ctor(0.2f, 12f, 0.2f); Vector3 lossyScale = val6.transform.lossyScale; obj.transform.localScale = new Vector3(val7.x / lossyScale.x, val7.y / lossyScale.y, val7.z / lossyScale.z); obj.SetActive(true); } } } <>2__current = null; <>1__state = 1; return true; } case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__17 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__17(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: 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) //IL_0105: Unknown result type (might be due to invalid IL or missing references) if (<>1__state != 0) { return false; } <>1__state = -1; Shader val = Shader.Find("Unlit/Color"); if ((Object)(object)val == (Object)null) { val = Shader.Find("Standard"); } Material val2 = new Material(val); val2.color = new Color(1f, 29f / 51f, 0f); foreach (KeyValuePair driveByLocation in DriveByEvent.driveByLocations) { DriveByEvent.DriveByTrigger key = driveByLocation.Key; float radius = key.radius; GameObject obj = GameObject.CreatePrimitive((PrimitiveType)0); MeshRenderer component = obj.GetComponent(); ((Renderer)component).material = val2; ((Renderer)component).receiveShadows = false; ((Renderer)component).shadowCastingMode = (ShadowCastingMode)0; obj.transform.parent = ((Component)Singleton.Instance).transform; obj.transform.localScale = new Vector3(radius * 2f, radius * 2f, radius * 2f); obj.transform.position = key.triggerPosition + new Vector3(0f, 20f + radius * 2f, 0f); obj.SetActive(true); } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static TextMeshProUGUI _positionText; public static Transform _playerTransform; [Conditional("DEBUG")] public static void Log(string msg, [CallerMemberName] string memberName = "") { if (CartelEnforcer.currentConfig.debugMode) { MelonLogger.Msg("[" + memberName + "] " + msg); } } [IteratorStateMachine(typeof(d__3))] public static IEnumerator OnInputGenerateManorQuest() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__3(0); } [IteratorStateMachine(typeof(d__4))] public static IEnumerator OnInputGenerateEndQuest() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__4(0); } [IteratorStateMachine(typeof(d__5))] public static IEnumerator OnInputGenerateAlliedIntroQuest() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__5(0); } [IteratorStateMachine(typeof(d__6))] public static IEnumerator OnInputGenerateAlliedSupplyQuest() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__6(0); } [IteratorStateMachine(typeof(d__7))] public static IEnumerator OnInputStartDriveBy() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__7(0); } [IteratorStateMachine(typeof(d__8))] public static IEnumerator OnInputStartRob() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__8(0); } [IteratorStateMachine(typeof(d__9))] public static IEnumerator OnInputGiveMiniQuest() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__9(0); } [IteratorStateMachine(typeof(d__10))] public static IEnumerator OnInputInternalLog() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__10(0); } [IteratorStateMachine(typeof(d__11))] public static IEnumerator OnInputInterceptContract() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__11(0); } [IteratorStateMachine(typeof(d__12))] public static IEnumerator OnInputStartSabotage() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__12(0); } [IteratorStateMachine(typeof(d__13))] public static IEnumerator OnInputStealNearestCustomer() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__13(0); } [IteratorStateMachine(typeof(d__14))] public static IEnumerator GodMode() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__14(0); } [IteratorStateMachine(typeof(d__15))] public static IEnumerator MakeUI() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__15(0); } [IteratorStateMachine(typeof(d__16))] public static IEnumerator SpawnAmbushAreaVisual() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__16(0); } [IteratorStateMachine(typeof(d__17))] public static IEnumerator SpawnDriveByAreaVisual() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__17(0); } private static Color GetColorCorrespondance(EMapRegion reg) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected I4, but got Unknown //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003e: 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) return (Color)((int)reg switch { 0 => Color.yellow, 1 => Color.blue, 2 => Color.red, 3 => Color.green, 4 => Color.magenta, 5 => Color.black, _ => Color.white, }); } } public static class DriveByEvent { [Serializable] public class DriveByTrigger { public string name; public Vector3 triggerPosition; public float radius; public Vector3 spawnEulerAngles; public Vector3 startPosition; public Vector3 endPosition; } public class HitComparer : IComparer { public int Compare(RaycastHit x, RaycastHit y) { bool flag = (Object)(object)((RaycastHit)(ref x)).collider != (Object)null; bool flag2 = (Object)(object)((RaycastHit)(ref y)).collider != (Object)null; if (flag && !flag2) { return -1; } if (!flag && flag2) { return 1; } if (!flag && !flag2) { return 0; } return ((RaycastHit)(ref x)).distance.CompareTo(((RaycastHit)(ref y)).distance); } } [CompilerGenerated] private sealed class d__13 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DriveByTrigger trig; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__13(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: { <>1__state = -1; if (driveByActive || !CartelEnforcer.registered) { return false; } driveByActive = true; float num = default(float); Player closestPlayer = Player.GetClosestPlayer(trig.triggerPosition, ref num, (List)null); driveByVeh.ExitPark_Networked((NetworkConnection)null, false); driveByVeh.SetTransform_Server(trig.startPosition, Quaternion.Euler(trig.spawnEulerAngles)); driveByTp.MoveToRoadNetwork(false); driveByAgent.Navigate(trig.endPosition, (NavigationSettings)null, NavigationCallback.op_Implicit((Action)DriveByNavComplete)); driveByAgent.AutoDriving = true; ((Component)thomasInstance).gameObject.SetActive(true); CartelEnforcer.coros.Add(MelonCoroutines.Start(DriveByShooting(closestPlayer))); <>2__current = null; <>1__state = 1; return true; } case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__14 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Player player; private int 5__2; private int 5__3; private int 5__4; private int 5__5; private int 5__6; private int 5__7; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__14(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_011f: 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_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__2 = Random.Range(4, 9); 5__3 = 0; ((NPC)thomasInstance).Behaviour.CombatBehaviour.SetTarget(((Component)player).GetComponent().NetworkObject); ((NPC)thomasInstance).Behaviour.CombatBehaviour.SetWeaponRaised(true); 5__4 = LayerMask.NameToLayer("Player"); 5__5 = LayerMask.GetMask(new string[3] { "Terrain", "Default", "Vehicle" }); 5__6 = 80; 5__7 = 0; goto IL_043e; case 1: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } if (5__3 < 5__2 && 5__7 < 5__6) { float num = Vector3.Distance(((Component)thomasInstance).transform.position, player.CenterPointTransform.position); Vector3 val = ((Component)thomasInstance).transform.position + ((Component)thomasInstance).transform.up * 1.7f - ((Component)thomasInstance).transform.right * 0.8f; Vector3 val2 = player.CenterPointTransform.position - val; float num2 = Vector3.SignedAngle(((Component)thomasInstance).transform.forward, val2, Vector3.up); bool flag = false; int num3 = Physics.RaycastNonAlloc(val, val2, _raycastHitBuffer, 50f); Array.Sort(Il2CppArrayBase.op_Implicit((Il2CppArrayBase)(object)_raycastHitBuffer), 0, num3, new HitComparer()); flag = false; for (int i = 0; i < num3; i++) { RaycastHit val3 = ((Il2CppArrayBase)(object)_raycastHitBuffer)[i]; if ((5__5 & (1 << ((Component)((RaycastHit)(ref val3)).collider).gameObject.layer)) != 0) { flag = false; break; } if (((Component)((RaycastHit)(ref val3)).collider).gameObject.layer == 5__4) { flag = true; break; } } if (flag && num2 < -10f && num2 > -80f) { if (num < 15f) { if (Random.Range(0f, 1f) > 0.1f || (num2 < -20f && num2 > -80f)) { ((NPC)thomasInstance).Behaviour.CombatBehaviour.Shoot(); 5__3++; } } else if (num < 25f) { if (Random.Range(0f, 1f) > 0.2f || (num2 < -25f && num2 > -70f)) { ((NPC)thomasInstance).Behaviour.CombatBehaviour.Shoot(); 5__3++; } } else if (num < 35f) { if (Random.Range(0f, 1f) > 0.4f || (num2 < -30f && num2 > -60f)) { ((NPC)thomasInstance).Behaviour.CombatBehaviour.Shoot(); 5__3++; } } else if (num < 45f) { if (Random.Range(0f, 1f) > 0.7f || (num2 < -40f && num2 > -80f)) { ((NPC)thomasInstance).Behaviour.CombatBehaviour.Shoot(); 5__3++; } } else if (flag && num2 < -30f && num2 > -80f && Random.Range(0f, 1f) > 0.9f) { ((NPC)thomasInstance).Behaviour.CombatBehaviour.Shoot(); 5__3++; } } goto IL_043e; } goto IL_0448; case 2: { <>1__state = -1; return false; } IL_043e: if (driveByActive) { 5__7++; <>2__current = CartelEnforcer.Wait025; <>1__state = 1; return true; } goto IL_0448; IL_0448: <>2__current = null; <>1__state = 2; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__12 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private float 5__2; private Dictionary.Enumerator <>7__wrap2; private KeyValuePair 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__12(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if (num == -3 || num == 4) { try { } finally { <>m__Finally1(); } } <>7__wrap2 = default(Dictionary.Enumerator); 5__4 = default(KeyValuePair); <>1__state = -2; } private bool MoveNext() { //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Invalid comparison between Unknown and I4 //IL_0209: Unknown result type (might be due to invalid IL or missing references) bool result; try { switch (<>1__state) { default: result = false; goto end_IL_0000; case 0: <>1__state = -1; <>2__current = CartelEnforcer.Wait5; <>1__state = 1; result = true; goto end_IL_0000; case 1: <>1__state = -1; if (!CartelEnforcer.registered) { result = false; } else { if (InstanceFinder.NetworkManager.IsServer) { 5__2 = FrequencyOverrides.GetByID("DriveBy").InfluenceRequirement; break; } result = false; } goto end_IL_0000; case 2: <>1__state = -1; if (!CartelEnforcer.registered) { result = false; } else { if (Singleton.Instance.IsSaving || CartelEnforcer.isSaving || !CartelEnforcer.currentConfig.driveByEnabled) { break; } bool num = (int)NetworkSingleton.Instance.Status == 2; bool flag = NetworkSingleton.Instance.IsCurrentTimeWithinRange(2230, 500); if (num && !driveByActive && flag && hoursUntilDriveBy <= 0) { <>7__wrap2 = driveByLocations.GetEnumerator(); <>1__state = -3; goto IL_0254; } <>2__current = CartelEnforcer.Wait60; <>1__state = 3; result = true; } goto end_IL_0000; case 3: <>1__state = -1; if (CartelEnforcer.registered) { break; } result = false; goto end_IL_0000; case 4: { <>1__state = -3; if (CartelEnforcer.registered) { if (!(Vector3.Distance(Player.Local.CenterPointTransform.position, 5__4.Key.triggerPosition) > 5__4.Key.radius) && !((Object)(object)Player.Local.CurrentVehicle != (Object)null) && (!(5__2 >= 0f) || !(NetworkSingleton.Instance.Influence.GetRegionData(5__4.Value).Influence < 5__2))) { if (!driveByActive) { CartelEnforcer.coros.Add(MelonCoroutines.Start(BeginDriveBy(5__4.Key))); goto IL_0264; } 5__4 = default(KeyValuePair); } goto IL_0254; } result = false; <>m__Finally1(); goto end_IL_0000; } IL_0254: if (!<>7__wrap2.MoveNext()) { goto IL_0264; } 5__4 = <>7__wrap2.Current; <>2__current = CartelEnforcer.Wait05; <>1__state = 4; result = true; goto end_IL_0000; IL_0264: <>m__Finally1(); <>7__wrap2 = default(Dictionary.Enumerator); break; } if (CartelEnforcer.registered) { <>2__current = CartelEnforcer.Wait2; <>1__state = 2; result = true; } else { result = false; } end_IL_0000:; } catch { //try-fault ((IDisposable)this).Dispose(); throw; } return result; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; ((IDisposable)<>7__wrap2).Dispose(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__10 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private Transform 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__10(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_0052: 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_0142: 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_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Expected O, but got Unknown Transform val4; switch (<>1__state) { default: return false; case 0: { <>1__state = -1; ConfigLoader.DriveByTriggersSerialized driveByTriggersSerialized = ConfigLoader.LoadDriveByConfig(); driveByLocations = new Dictionary(); foreach (DriveByTrigger trigger in driveByTriggersSerialized.triggers) { driveByLocations.Add(trigger, Singleton.Instance.GetRegionFromPosition(trigger.triggerPosition)); } <>2__current = CartelEnforcer.Wait2; <>1__state = 1; return true; } case 1: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } 5__2 = ((Component)NetworkSingleton.Instance).transform.Find("ThomasBoxSUV"); if ((Object)(object)5__2 != (Object)null) { if (!((Component)5__2).gameObject.activeSelf) { ((Component)5__2).gameObject.SetActive(true); } driveByVeh = ((Component)5__2).GetComponent(); driveByAgent = ((Component)5__2).GetComponent(); driveByTp = ((Component)5__2).GetComponent(); thomasInstance = Object.FindObjectOfType(); if ((Object)(object)driveByVeh != (Object)null) { driveByVeh.TopSpeed = 100f; ParkData val2 = new ParkData { spotIndex = -1 }; ParkingLot val3 = Object.FindObjectOfType(); val2.lotGUID = new Guid(val3.BakedGUID); driveByParking = val2; } else { MelonLogger.Warning("Drive By Vehicle is null!"); } if ((Object)(object)driveByAgent != (Object)null) { driveByAgent.Flags.OverriddenSpeed = 75f; driveByAgent.Flags.OverrideSpeed = true; driveByAgent.Flags.IgnoreTrafficLights = true; driveByAgent.Flags.ObstacleMode = (EObstacleMode)1; driveByAgent.turnSpeedReductionDivisor = 150f; driveByAgent.turnSpeedReductionMaxRange = 20f; driveByAgent.turnSpeedReductionMinRange = 6f; } else { MelonLogger.Warning("Drive By Vehicle Agent is null!"); } if ((Object)(object)thomasInstance != (Object)null) { ((NPC)thomasInstance).Behaviour.CombatBehaviour.SetWeapon("Avatar/Equippables/M1911"); <>2__current = CartelEnforcer.Wait2; <>1__state = 2; return true; } MelonLogger.Warning("Failed to configure Thomas Instance for Drive By events"); goto IL_02fa; } MelonLogger.Warning("Failed to find Thomas Car Instance"); break; case 2: { <>1__state = -1; if (!CartelEnforcer.registered) { return false; } AvatarRangedWeapon val = null; try { val = ((Il2CppObjectBase)((NPC)thomasInstance).Behaviour.CombatBehaviour.currentWeapon).Cast(); } catch (InvalidCastException ex) { MelonLogger.Warning("Failed to Cast Thomas Gun Weapon Instance: " + ex); } if ((Object)(object)val != (Object)null) { ((AvatarWeapon)val).MaxUseRange = 45f; ((AvatarWeapon)val).MinUseRange = 8f; val.HitChance_MaxRange = 0.4f; val.HitChance_MinRange = 0.9f; val.MaxFireRate = 0.1f; ((AvatarWeapon)val).CooldownDuration = 0.1f; val.Damage = 33f; } goto IL_02fa; } IL_02fa: val4 = 5__2.Find("Box SUV"); if (!((Component)val4).gameObject.activeSelf) { ((Component)val4).gameObject.SetActive(true); } break; } hoursUntilDriveBy = CartelEnforcer.eventCooldowns.DriveByCooldown; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__16 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__16(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (Singleton.Instance.IsSaving || CartelEnforcer.isSaving) { WaitUntil val = new WaitUntil(Func.op_Implicit((Func)(() => !Singleton.Instance.IsSaving && !CartelEnforcer.isSaving))); <>2__current = val; <>1__state = 1; return true; } break; case 1: <>1__state = -1; break; } int activityHours = FrequencyOverrides.GetActivityHours("DriveBy"); if (activityHours != 0) { hoursUntilDriveBy = activityHours; } else { hoursUntilDriveBy = Random.Range(24, 68); } driveByActive = false; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static LandVehicle driveByVeh; public static VehicleAgent driveByAgent; public static VehicleTeleporter driveByTp; public static bool driveByActive = false; public static Thomas thomasInstance; public static ParkData driveByParking; public static int hoursUntilDriveBy = 5; public static Dictionary driveByLocations = new Dictionary(); private static Il2CppStructArray _raycastHitBuffer = new Il2CppStructArray(8L); [IteratorStateMachine(typeof(d__10))] public static IEnumerator InitializeDriveByData() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__10(0); } public static void GenerateDefaultDriveByTriggers() { //IL_0020: 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_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: 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_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: 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_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: 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) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_0317: Unknown result type (might be due to invalid IL or missing references) //IL_031c: Unknown result type (might be due to invalid IL or missing references) //IL_0331: Unknown result type (might be due to invalid IL or missing references) //IL_0336: Unknown result type (might be due to invalid IL or missing references) //IL_034b: Unknown result type (might be due to invalid IL or missing references) //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_03a9: Unknown result type (might be due to invalid IL or missing references) //IL_03ae: Unknown result type (might be due to invalid IL or missing references) //IL_03c3: Unknown result type (might be due to invalid IL or missing references) //IL_03c8: Unknown result type (might be due to invalid IL or missing references) //IL_03dd: Unknown result type (might be due to invalid IL or missing references) //IL_03e2: Unknown result type (might be due to invalid IL or missing references) //IL_0416: Unknown result type (might be due to invalid IL or missing references) //IL_041b: Unknown result type (might be due to invalid IL or missing references) //IL_043b: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Unknown result type (might be due to invalid IL or missing references) //IL_0455: Unknown result type (might be due to invalid IL or missing references) //IL_045a: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0474: Unknown result type (might be due to invalid IL or missing references) //IL_04a8: Unknown result type (might be due to invalid IL or missing references) //IL_04ad: Unknown result type (might be due to invalid IL or missing references) //IL_04cd: Unknown result type (might be due to invalid IL or missing references) //IL_04d2: Unknown result type (might be due to invalid IL or missing references) //IL_04e7: Unknown result type (might be due to invalid IL or missing references) //IL_04ec: Unknown result type (might be due to invalid IL or missing references) //IL_0501: Unknown result type (might be due to invalid IL or missing references) //IL_0506: Unknown result type (might be due to invalid IL or missing references) //IL_053a: Unknown result type (might be due to invalid IL or missing references) //IL_053f: Unknown result type (might be due to invalid IL or missing references) //IL_055f: Unknown result type (might be due to invalid IL or missing references) //IL_0564: Unknown result type (might be due to invalid IL or missing references) //IL_0579: Unknown result type (might be due to invalid IL or missing references) //IL_057e: Unknown result type (might be due to invalid IL or missing references) //IL_0593: Unknown result type (might be due to invalid IL or missing references) //IL_0598: Unknown result type (might be due to invalid IL or missing references) //IL_05cc: Unknown result type (might be due to invalid IL or missing references) //IL_05d1: Unknown result type (might be due to invalid IL or missing references) //IL_05f1: Unknown result type (might be due to invalid IL or missing references) //IL_05f6: Unknown result type (might be due to invalid IL or missing references) //IL_060b: Unknown result type (might be due to invalid IL or missing references) //IL_0610: Unknown result type (might be due to invalid IL or missing references) //IL_0625: Unknown result type (might be due to invalid IL or missing references) //IL_062a: Unknown result type (might be due to invalid IL or missing references) //IL_065e: Unknown result type (might be due to invalid IL or missing references) //IL_0663: Unknown result type (might be due to invalid IL or missing references) //IL_0683: Unknown result type (might be due to invalid IL or missing references) //IL_0688: Unknown result type (might be due to invalid IL or missing references) //IL_069d: Unknown result type (might be due to invalid IL or missing references) //IL_06a2: Unknown result type (might be due to invalid IL or missing references) //IL_06b7: Unknown result type (might be due to invalid IL or missing references) //IL_06bc: Unknown result type (might be due to invalid IL or missing references) //IL_06f0: Unknown result type (might be due to invalid IL or missing references) //IL_06f5: Unknown result type (might be due to invalid IL or missing references) //IL_0715: Unknown result type (might be due to invalid IL or missing references) //IL_071a: Unknown result type (might be due to invalid IL or missing references) //IL_072f: Unknown result type (might be due to invalid IL or missing references) //IL_0734: Unknown result type (might be due to invalid IL or missing references) //IL_0749: Unknown result type (might be due to invalid IL or missing references) //IL_074e: Unknown result type (might be due to invalid IL or missing references) //IL_0782: Unknown result type (might be due to invalid IL or missing references) //IL_0787: Unknown result type (might be due to invalid IL or missing references) //IL_07a7: Unknown result type (might be due to invalid IL or missing references) //IL_07ac: Unknown result type (might be due to invalid IL or missing references) //IL_07c1: Unknown result type (might be due to invalid IL or missing references) //IL_07c6: Unknown result type (might be due to invalid IL or missing references) //IL_07db: Unknown result type (might be due to invalid IL or missing references) //IL_07e0: Unknown result type (might be due to invalid IL or missing references) //IL_0814: Unknown result type (might be due to invalid IL or missing references) //IL_0819: Unknown result type (might be due to invalid IL or missing references) //IL_0839: Unknown result type (might be due to invalid IL or missing references) //IL_083e: Unknown result type (might be due to invalid IL or missing references) //IL_0853: Unknown result type (might be due to invalid IL or missing references) //IL_0858: Unknown result type (might be due to invalid IL or missing references) //IL_086d: Unknown result type (might be due to invalid IL or missing references) //IL_0872: Unknown result type (might be due to invalid IL or missing references) DriveByTrigger key = new DriveByTrigger { name = "Suburbia Bus Stop", triggerPosition = new Vector3(110.39f, 5.36f, -111.69f), radius = 2f, startPosition = new Vector3(144.68f, 5.6f, -103.69f), spawnEulerAngles = new Vector3(0f, 270f, 0f), endPosition = new Vector3(17.4f, 1.37f, -103.53f) }; driveByLocations.Add(key, (EMapRegion)4); DriveByTrigger key2 = new DriveByTrigger { name = "Suburbia Gazebo Park", triggerPosition = new Vector3(84.99f, 5.36f, -122.38f), radius = 7f, startPosition = new Vector3(144.68f, 5.6f, -103.69f), spawnEulerAngles = new Vector3(0f, 270f, 0f), endPosition = new Vector3(17.4f, 1.37f, -103.53f) }; driveByLocations.Add(key2, (EMapRegion)4); DriveByTrigger key3 = new DriveByTrigger { name = "Barn path towards road", triggerPosition = new Vector3(163.29f, 1.18f, -9.95f), radius = 6f, startPosition = new Vector3(155.2f, 1.37f, 22.79f), spawnEulerAngles = new Vector3(0f, 240f, 0f), endPosition = new Vector3(89.85f, 5.37f, -81.81f) }; driveByLocations.Add(key3, (EMapRegion)5); DriveByTrigger key4 = new DriveByTrigger { name = "Mollys apartment", triggerPosition = new Vector3(-168.44f, -2.54f, 88.32f), radius = 15f, startPosition = new Vector3(-146.4f, -2.63f, 39.92f), spawnEulerAngles = new Vector3(0f, 310f, 0f), endPosition = new Vector3(-111.28f, -2.64f, 123.4f) }; driveByLocations.Add(key4, (EMapRegion)1); DriveByTrigger key5 = new DriveByTrigger { name = "Car Wash Computer", triggerPosition = new Vector3(-6.05f, 1.21f, -17.83f), radius = 5f, startPosition = new Vector3(-19.96f, 1.37f, 20.44f), spawnEulerAngles = new Vector3(0f, 180f, 0f), endPosition = new Vector3(-10.61f, 1.37f, -102.43f) }; driveByLocations.Add(key5, (EMapRegion)2); DriveByTrigger key6 = new DriveByTrigger { name = "Laundromat computer", triggerPosition = new Vector3(-29.19f, 1.96f, 26.13f), radius = 4f, startPosition = new Vector3(-17.17f, 1.37f, -22.86f), spawnEulerAngles = new Vector3(0f, 0f, 0f), endPosition = new Vector3(-16.98f, -2.51f, 123.42f) }; driveByLocations.Add(key6, (EMapRegion)3); DriveByTrigger key7 = new DriveByTrigger { name = "Grocery Market Downtown", triggerPosition = new Vector3(17.62f, 1.61f, -3.31f), radius = 6f, startPosition = new Vector3(-11.64f, 1.15f, -43.54f), spawnEulerAngles = new Vector3(0f, 60f, 0f), endPosition = new Vector3(33.02f, 1.15f, 65.28f) }; driveByLocations.Add(key7, (EMapRegion)2); DriveByTrigger key8 = new DriveByTrigger { name = "Jane's RV", triggerPosition = new Vector3(-36.74f, 0.14f, -77.14f), radius = 11f, startPosition = new Vector3(3.98f, 1.37f, -103.35f), spawnEulerAngles = new Vector3(0f, 270f, 0f), endPosition = new Vector3(-16.9f, 1.37f, 52f) }; driveByLocations.Add(key8, (EMapRegion)3); DriveByTrigger key9 = new DriveByTrigger { name = "Town hall stairs", triggerPosition = new Vector3(51.28f, 1.48f, 31.03f), radius = 6f, startPosition = new Vector3(29.97f, 1.37f, 81.63f), spawnEulerAngles = new Vector3(0f, 180f, 0f), endPosition = new Vector3(-12.39f, 1.37f, -40.43f) }; driveByLocations.Add(key9, (EMapRegion)2); DriveByTrigger key10 = new DriveByTrigger { name = "Alley between Ham Legal and Hyland Tower", triggerPosition = new Vector3(84.01f, 1.46f, 63.21f), radius = 2f, startPosition = new Vector3(61.99f, 1.37f, 49.59f), spawnEulerAngles = new Vector3(0f, 90f, 0f), endPosition = new Vector3(90.05f, 5.37f, -79.52f) }; driveByLocations.Add(key10, (EMapRegion)5); DriveByTrigger key11 = new DriveByTrigger { name = "Road in front of Ray's Estate and Blueball Boutique", triggerPosition = new Vector3(74.65f, 1.37f, -3.24f), radius = 8f, startPosition = new Vector3(93.06f, 2.3f, -37.39f), spawnEulerAngles = new Vector3(6f, 0f, 0f), endPosition = new Vector3(30.11f, 1.37f, 72.9f) }; driveByLocations.Add(key11, (EMapRegion)5); DriveByTrigger key12 = new DriveByTrigger { name = "Behind the Taco Ticklers", triggerPosition = new Vector3(-33.19f, 1.46f, 85.58f), radius = 6f, startPosition = new Vector3(-17.13f, 1.37f, 61f), spawnEulerAngles = new Vector3(0f, 0f, 0f), endPosition = new Vector3(-28.73f, -2.63f, 132.68f) }; driveByLocations.Add(key12, (EMapRegion)0); DriveByTrigger key13 = new DriveByTrigger { name = "Skatepark and surrounding area", triggerPosition = new Vector3(-49.25f, 1.09f, 75.8f), radius = 10f, startPosition = new Vector3(-93.33f, -1.43f, 70.9f), spawnEulerAngles = new Vector3(-8f, 110f, 0f), endPosition = new Vector3(-16.86f, 1.37f, -5.03f) }; driveByLocations.Add(key13, (EMapRegion)0); DriveByTrigger key14 = new DriveByTrigger { name = "Behind Crimson Canary", triggerPosition = new Vector3(48.51f, 1.46f, 66.55f), radius = 8f, startPosition = new Vector3(27.37f, 1.37f, 49.58f), spawnEulerAngles = new Vector3(0f, 90f, 0f), endPosition = new Vector3(90.05f, 1.37f, 22.96f) }; driveByLocations.Add(key14, (EMapRegion)2); DriveByTrigger key15 = new DriveByTrigger { name = "Suburbia Jeremys house", triggerPosition = new Vector3(69.55f, 5.93f, -117.93f), radius = 2f, startPosition = new Vector3(144.68f, 5.6f, -103.69f), spawnEulerAngles = new Vector3(0f, 270f, 0f), endPosition = new Vector3(17.4f, 1.37f, -103.53f) }; driveByLocations.Add(key15, (EMapRegion)4); } [IteratorStateMachine(typeof(d__12))] public static IEnumerator EvaluateDriveBy() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__12(0); } [IteratorStateMachine(typeof(d__13))] public static IEnumerator BeginDriveBy(DriveByTrigger trig) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__13(0) { trig = trig }; } [IteratorStateMachine(typeof(d__14))] public static IEnumerator DriveByShooting(Player player) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__14(0) { player = player }; } public static void DriveByNavComplete(ENavigationResult result) { if (CartelEnforcer.registered) { driveByAgent.storedNavigationCallback = null; driveByAgent.StopNavigating(); driveByVeh.Park_Networked((NetworkConnection)null, driveByParking); ((Component)thomasInstance).gameObject.SetActive(false); CartelEnforcer.coros.Add(MelonCoroutines.Start(ResetDriveByHours())); } } [IteratorStateMachine(typeof(d__16))] public static IEnumerator ResetDriveByHours() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__16(0); } } public static class CartelGathering { [CompilerGenerated] private sealed class <>c__DisplayClass14_0 { public GatheringLocation location; } [CompilerGenerated] private sealed class <>c__DisplayClass14_1 { public DrinkItem drinkAct; public <>c__DisplayClass14_0 CS$<>8__locals1; } [CompilerGenerated] private sealed class <>c__DisplayClass14_2 { public SmokeCigarette smokeAct; public <>c__DisplayClass14_0 CS$<>8__locals2; } [StructLayout(LayoutKind.Auto)] [CompilerGenerated] private struct <>c__DisplayClass15_0 { public List controllers; } [CompilerGenerated] private sealed class d__16 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GatheringLocation location; public bool defeated; private List.Enumerator <>7__wrap1; private CartelGoon 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__16(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if (num == -3 || num == 2) { try { } finally { <>m__Finally1(); } } <>7__wrap1 = default(List.Enumerator); 5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Invalid comparison between Unknown and I4 //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Invalid comparison between Unknown and I4 //IL_0324: Unknown result type (might be due to invalid IL or missing references) //IL_032a: Invalid comparison between Unknown and I4 //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03e7: Invalid comparison between Unknown and I4 bool result; try { switch (<>1__state) { default: result = false; goto end_IL_0000; case 0: { <>1__state = -1; EMapRegion val = (EMapRegion)location.region; if (defeated) { if (InfluenceOverrides.ShouldChangeInfluence(val)) { NetworkSingleton.Instance.Influence.ChangeInfluence(val, CartelEnforcer.influenceConfig.gatheringSuccess); } if ((Object)(object)EndGameQuest.activeQuest != (Object)null && (int)((Quest)EndGameQuest.activeQuest).State == 1 && (Object)(object)EndGameQuest.activeQuest.QuestEntry_Investigate != (Object)null && (int)EndGameQuest.activeQuest.QuestEntry_Investigate.State == 1 && EndGameQuest.StageGatheringsDefeated == 0) { EndGameQuest.StageGatheringsDefeated++; } } else if ((int)val != 0 && NetworkSingleton.Instance.Influence.GetRegionData(val).Influence < 0.4f && InfluenceOverrides.ShouldChangeInfluence(val)) { NetworkSingleton.Instance.Influence.ChangeInfluence(val, CartelEnforcer.influenceConfig.gatheringFail); } <>2__current = CartelEnforcer.Wait30; <>1__state = 1; result = true; goto end_IL_0000; } case 1: <>1__state = -1; if (CartelEnforcer.registered) { <>7__wrap1 = spawnedGatherGoons.GetEnumerator(); <>1__state = -3; break; } result = false; goto end_IL_0000; case 2: <>1__state = -3; if (CartelEnforcer.registered) { ((Behaviour)((NPC)5__3).Behaviour.CombatBehaviour).Disable_Networked((NetworkConnection)null); ((NPC)5__3).Health.MaxHealth = 100f; ((NPC)5__3).Health.Revive(); if (5__3.IsGoonSpawned) { 5__3.Despawn(); } 5__3 = null; break; } result = false; <>m__Finally1(); goto end_IL_0000; } if (<>7__wrap1.MoveNext()) { 5__3 = <>7__wrap1.Current; <>2__current = CartelEnforcer.Wait05; <>1__state = 2; result = true; } else { <>m__Finally1(); <>7__wrap1 = default(List.Enumerator); if ((Delegate)(object)combatStartedAction != (Delegate)null) { foreach (CartelGoon spawnedGatherGoon in spawnedGatherGoons) { ((Behaviour)((NPC)spawnedGatherGoon).Behaviour.CombatBehaviour).onBegin.RemoveListener(combatStartedAction); } combatStartedAction = null; } if ((Delegate)(object)endDrinkAction != (Delegate)null) { ((Behaviour)((NPC)spawnedGatherGoons[0]).Behaviour.CombatBehaviour).onBegin.RemoveListener(endDrinkAction); endDrinkAction = null; } if ((Delegate)(object)endSmokeAction != (Delegate)null) { ((Behaviour)((NPC)spawnedGatherGoons[1]).Behaviour.CombatBehaviour).onBegin.RemoveListener(endSmokeAction); endSmokeAction = null; } if (!defeated) { if (lootGoblinIndex != -1) { List list = new List(); Enumerator enumerator2 = ((NPC)spawnedGatherGoons[lootGoblinIndex]).Inventory.ItemSlots.GetEnumerator(); while (enumerator2.MoveNext()) { ItemSlot current = enumerator2.Current; if (current.ItemInstance == null) { continue; } if ((int)((BaseItemInstance)current.ItemInstance).Category == 6) { if ((float)((BaseItemInstance)current.ItemInstance).Quantity >= 500f) { CartelInventory.cartelCashAmount += 500f; } current.ClearItemInstanceRequested(); } else { list.Add(current.ItemInstance); } } CartelInventory.CartelStealsItems(list); ((NPC)spawnedGatherGoons[lootGoblinIndex]).Inventory.Clear(); spawnedGatherGoons.RemoveAt(lootGoblinIndex); } foreach (CartelGoon spawnedGatherGoon2 in spawnedGatherGoons) { Enumerator enumerator2 = ((NPC)spawnedGatherGoon2).Inventory.ItemSlots.GetEnumerator(); while (enumerator2.MoveNext()) { ItemSlot current2 = enumerator2.Current; if (current2.ItemInstance != null && (int)((BaseItemInstance)current2.ItemInstance).Category == 6) { if ((float)((BaseItemInstance)current2.ItemInstance).Quantity >= 500f) { CartelInventory.cartelCashAmount += 500f; } current2.ClearItemInstanceRequested(); } } } } startedCombat = false; areGoonsGathering = false; spawnedGatherGoons.Clear(); currentGatheringLocation = null; endSmokeAction = null; endDrinkAction = null; combatStartedAction = null; lootGoblinIndex = -1; result = false; } end_IL_0000:; } catch { //try-fault ((IDisposable)this).Dispose(); throw; } return result; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; ((IDisposable)<>7__wrap1).Dispose(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__15 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GatheringLocation location; private <>c__DisplayClass15_0 <>8__1; private int 5__2; private int 5__3; private int 5__4; private int 5__5; private int 5__6; private bool 5__7; private Player

5__8; private int 5__9; private List.Enumerator <>7__wrap9; private CartelGoon 5__11; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__15(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if (num == -3 || num == 6) { try { } finally { <>m__Finally1(); } } <>8__1 = default(<>c__DisplayClass15_0);

5__8 = null; <>7__wrap9 = default(List.Enumerator); 5__11 = null; <>1__state = -2; } private bool MoveNext() { //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Invalid comparison between Unknown and I4 //IL_0370: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_0547: Unknown result type (might be due to invalid IL or missing references) //IL_054d: Invalid comparison between Unknown and I4 //IL_03d2: Unknown result type (might be due to invalid IL or missing references) //IL_03d8: Invalid comparison between Unknown and I4 //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_082d: Unknown result type (might be due to invalid IL or missing references) //IL_0805: Unknown result type (might be due to invalid IL or missing references) //IL_041c: Unknown result type (might be due to invalid IL or missing references) //IL_0455: Unknown result type (might be due to invalid IL or missing references) //IL_06b2: Unknown result type (might be due to invalid IL or missing references) //IL_048f: Unknown result type (might be due to invalid IL or missing references) //IL_04c8: Unknown result type (might be due to invalid IL or missing references) //IL_0610: Unknown result type (might be due to invalid IL or missing references) //IL_0616: Invalid comparison between Unknown and I4 //IL_0622: Unknown result type (might be due to invalid IL or missing references) //IL_0628: Invalid comparison between Unknown and I4 bool result; try { float num = default(float); float num2; switch (<>1__state) { default: result = false; break; case 0: <>1__state = -1; <>2__current = CartelEnforcer.Wait2; <>1__state = 1; result = true; break; case 1: <>1__state = -1; if (!CartelEnforcer.registered) { result = false; break; } 5__2 = 0; 5__3 = 0; 5__4 = 0; 5__5 = 0; 5__6 = 0; 5__7 = false; <>8__1.controllers = new List(); if ((int)NetworkSingleton.Instance.Status == 1) { foreach (CartelGoon spawnedGatherGoon in spawnedGatherGoons) { DialogueController component = ((Component)((NPC)spawnedGatherGoon).DialogueHandler).gameObject.GetComponent(); if (!((Object)(object)component == (Object)null) && !<>8__1.controllers.Contains(component)) { <>8__1.controllers.Add(component); } } } goto IL_0878; case 2: <>1__state = -1; if (!CartelEnforcer.registered) { result = false; break; } if (!startedCombat) { if (((NPC)spawnedGatherGoons[5__9]).Awareness.VisionCone.IsPlayerVisible(

5__8) || DealerActivity.currentDealerActivity < -0.75f) { spawnedGatherGoons[5__9].AttackEntity(((Component)

5__8).GetComponent(), true); goto IL_037f; } <>2__current = CartelEnforcer.Wait05; <>1__state = 3; result = true; break; } goto IL_0878; case 3: <>1__state = -1; if (!CartelEnforcer.registered) { result = false; break; } if (!startedCombat) { ((NPC)spawnedGatherGoons[5__9]).Movement.FacePoint(location.position, 0.5f); goto IL_037f; } goto IL_0878; case 4: <>1__state = -1; if (!CartelEnforcer.registered) { result = false; break; } 5__2 += 2; if (!startedCombat) { switch (Random.Range(0, 3)) { case 0: ((NPC)spawnedGatherGoons[5__9]).PlayVO((EVOLineType)3, true); break; case 1: ((NPC)spawnedGatherGoons[5__9]).PlayVO((EVOLineType)11, true); break; case 2: ((NPC)spawnedGatherGoons[5__9]).PlayVO((EVOLineType)2, true); break; } goto IL_083c; } goto IL_0878; case 5: <>1__state = -1; if (!CartelEnforcer.registered) { result = false; break; } 5__2 += 2; goto IL_0878; case 6: <>1__state = -3; if (!CartelEnforcer.registered) { result = false; <>m__Finally1(); break; } ((Component)((NPC)5__11).Behaviour.ScheduleManager.ActionList[0]).gameObject.SetActive(true); ((NPC)5__11).Behaviour.ScheduleManager.EnableSchedule(); 5__11 = null; goto IL_091b; case 7: { <>1__state = -1; result = false; break; } IL_091b: if (<>7__wrap9.MoveNext()) { 5__11 = <>7__wrap9.Current; <>2__current = CartelEnforcer.Wait05; <>1__state = 6; result = true; } else { <>m__Finally1(); <>7__wrap9 = default(List.Enumerator); bool defeated = 5__3 == 3 && 5__2 < 180; CartelEnforcer.coros.Add(MelonCoroutines.Start(EndGatherEvent(defeated, location))); <>2__current = null; <>1__state = 7; result = true; } break; IL_03dd: 5__5 += 2; if (5__5 >= 4) { 5__4++; 5__5 = 0; } if (5__4 == 1) { Player closestPlayer = Player.GetClosestPlayer(location.position, ref num, (List)null); int index = Random.Range(0, spawnedGatherGoons.Count); ((NPC)spawnedGatherGoons[index]).Movement.FacePoint(closestPlayer.CenterPointTransform.position, 1.4f); ((NPC)spawnedGatherGoons[index]).PlayVO((EVOLineType)9, true); } else if (5__4 > 1) { Player closestPlayer2 = Player.GetClosestPlayer(location.position, ref num, (List)null); int index2 = Random.Range(0, spawnedGatherGoons.Count); ((NPC)spawnedGatherGoons[index2]).Movement.FacePoint(closestPlayer2.CenterPointTransform.position, 1.4f); ((NPC)spawnedGatherGoons[index2]).PlayVO((EVOLineType)10, true); ((NPC)spawnedGatherGoons[index2]).Avatar.EmotionManager.AddEmotionOverride("Annoyed", "product_rejected", 6f, 1); if ((float)5__4 >= num2) { spawnedGatherGoons[index2].AttackEntity(((Component)closestPlayer2).GetComponent(), true); } } goto IL_083c; IL_083c: <>2__current = CartelEnforcer.Wait2; <>1__state = 5; result = true; break; IL_0878: while (CartelEnforcer.registered) { 5__3 = 0; foreach (CartelGoon spawnedGatherGoon2 in spawnedGatherGoons) { if (((NPC)spawnedGatherGoon2).Health.IsDead || ((NPC)spawnedGatherGoon2).Health.IsKnockedOut) { 5__3++; } } if (5__2 > 180 || 5__3 == 3 || NetworkSingleton.Instance.CurrentTime < startEarliest) { break; } if (!startedCombat) { float num3 = Vector3.Distance(Player.Local.CenterPointTransform.position, location.position); bool flag = false; if ((Object)(object)Player.Local.CurrentProperty != (Object)null) { flag = true; } if (DealerActivity.currentDealerActivity < 0f) { float num4 = Mathf.Lerp(8f, 18f, 0f - DealerActivity.currentDealerActivity); if (num3 < num4 && !flag) {

5__8 = Player.GetClosestPlayer(location.position, ref num, (List)null); 5__9 = Random.Range(0, spawnedGatherGoons.Count); ((NPC)spawnedGatherGoons[5__9]).Movement.FacePoint(

5__8.CenterPointTransform.position, 0.5f); <>2__current = CartelEnforcer.Wait05; <>1__state = 2; result = true; goto end_IL_0008; } } else { float num5 = Mathf.Lerp(9f, 5f, DealerActivity.currentDealerActivity); num2 = Mathf.RoundToInt(Mathf.Lerp(3f, 6f, DealerActivity.currentDealerActivity)); if (num3 < num5 && !flag && (int)NetworkSingleton.Instance.Status != 1) { goto IL_03dd; } if ((int)NetworkSingleton.Instance.Status != 1) { 5__6 += 2; if (5__6 >= 8) { 5__4 = Mathf.Clamp(5__4 - 1, 0, 8); 5__6 = 0; } } else if (CartelEnforcer.currentConfig.alliedExtensions && !5__7 && location.region != 0) { float num6 = g__GetSumOfLastGreet|15_0(ref <>8__1); if (num6 > 0f && num6 <= 7f) { 5__7 = true; NetworkSingleton.Instance.Influence.ChangeInfluence((EMapRegion)location.region, CartelEnforcer.influenceConfig.trucedGreetingChallenge); if ((Object)(object)EndGameQuest.activeTruceIntro != (Object)null && (int)((Quest)EndGameQuest.activeTruceIntro).State == 1 && (int)EndGameQuest.activeTruceIntro.QuestEntry_GreetGoons.State == 1) { EndGameQuest.activeTruceIntro.QuestEntry_GreetGoons.SetState((EQuestState)2, false); } } } int num7 = Random.Range(0, spawnedGatherGoons.Count); if (num3 < 40f) { if (Random.Range(0f, 1f) > 0.8f) { 5__9 = (num7 + 1) % spawnedGatherGoons.Count; if (!startedCombat) { ((NPC)spawnedGatherGoons[num7]).Movement.FacePoint(((NPC)spawnedGatherGoons[5__9]).CenterPoint, 0.5f); switch (Random.Range(0, 4)) { case 0: ((NPC)spawnedGatherGoons[num7]).PlayVO((EVOLineType)14, true); break; case 1: ((NPC)spawnedGatherGoons[num7]).PlayVO((EVOLineType)17, true); break; case 2: ((NPC)spawnedGatherGoons[num7]).PlayVO((EVOLineType)19, true); break; case 3: ((NPC)spawnedGatherGoons[num7]).PlayVO((EVOLineType)6, true); break; } <>2__current = CartelEnforcer.Wait2; <>1__state = 4; result = true; goto end_IL_0008; } continue; } ((NPC)spawnedGatherGoons[num7]).Movement.FacePoint(location.position, 0.5f); } else { ((NPC)spawnedGatherGoons[num7]).Movement.FacePoint(location.position, 0.5f); } } } goto IL_083c; } <>7__wrap9 = spawnedGatherGoons.GetEnumerator(); <>1__state = -3; goto IL_091b; IL_037f:

5__8 = null; goto IL_083c; end_IL_0008: break; } } catch { //try-fault ((IDisposable)this).Dispose(); throw; } return result; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; ((IDisposable)<>7__wrap9).Dispose(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__14 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__14(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //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_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected I4, but got Unknown //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_0390: Unknown result type (might be due to invalid IL or missing references) if (<>1__state != 0) { return false; } <>1__state = -1; <>c__DisplayClass14_0 <>c__DisplayClass14_ = new <>c__DisplayClass14_0(); if (areGoonsGathering || CartelEnforcer.isSaving) { return false; } if (NetworkSingleton.Instance.GoonPool.unspawnedGoons.Count < 3) { return false; } hoursUntilNextGathering = Mathf.Clamp(hoursUntilNextGathering - 1, 0, int.MaxValue); if (hoursUntilNextGathering > 0) { return false; } if (DealerActivity.currentDealerActivity >= 0f) { startEarliest = 1200; startLatest = 1800; } else { startEarliest = 1000; startLatest = 2000; } if (!NetworkSingleton.Instance.IsCurrentTimeWithinRange(startEarliest, startLatest)) { return false; } float influenceRequirement = FrequencyOverrides.GetByID("Gathering").InfluenceRequirement; List list = new List(); List value = null; Enumerator enumerator = Singleton.Instance.GetUnlockedRegions().GetEnumerator(); while (enumerator.MoveNext()) { EMapRegion current = enumerator.Current; if (influenceRequirement >= 0f && NetworkSingleton.Instance.Influence.GetRegionData(current).Influence < influenceRequirement) { continue; } gatheringLocationsByRegion.TryGetValue((int)current, out value); if (value == null) { continue; } foreach (GatheringLocation item in value) { if (previousGatheringLocation != null && item != previousGatheringLocation && !list.Contains(item)) { list.Add(item); } else if (!list.Contains(item)) { list.Add(item); } } } if (list.Count == 0) { return false; } int activityHours = FrequencyOverrides.GetActivityHours("Gathering"); if (activityHours != 0) { hoursUntilNextGathering = activityHours; } else if (DealerActivity.currentDealerActivity >= 0f) { hoursUntilNextGathering = Random.Range(6, 15); } else if (DealerActivity.currentDealerActivity < 0f && DealerActivity.currentDealerActivity > -0.5f) { hoursUntilNextGathering = Random.Range(5, 12); } else { hoursUntilNextGathering = Random.Range(4, 9); } <>c__DisplayClass14_.location = list[Random.Range(0, list.Count)]; currentGatheringLocation = <>c__DisplayClass14_.location; previousGatheringLocation = <>c__DisplayClass14_.location; areGoonsGathering = true; float num = 0.67f; Vector3 val = <>c__DisplayClass14_.location.position + Vector3.forward * (num + Random.Range(-0.05f, 0.05f)); Vector3 val2 = <>c__DisplayClass14_.location.position + Vector3.right * (num + Random.Range(-0.05f, 0.05f)); Vector3 val3 = <>c__DisplayClass14_.location.position + Vector3.left * (num + Random.Range(-0.05f, 0.05f)); spawnedGatherGoons.Add(NetworkSingleton.Instance.GoonPool.SpawnGoon(val)); spawnedGatherGoons.Add(NetworkSingleton.Instance.GoonPool.SpawnGoon(val2)); spawnedGatherGoons.Add(NetworkSingleton.Instance.GoonPool.SpawnGoon(val3)); combatStartedAction = UnityAction.op_Implicit((Action)<>c__DisplayClass14_.g__CombatStarted|0); for (int i = 0; i < spawnedGatherGoons.Count; i++) { ((Component)((NPC)spawnedGatherGoons[i]).Behaviour.ScheduleManager.ActionList[0]).gameObject.SetActive(false); ((NPC)spawnedGatherGoons[i]).Behaviour.ScheduleManager.DisableSchedule(); ((NPC)spawnedGatherGoons[i]).Movement.FacePoint(<>c__DisplayClass14_.location.position, 0.5f); ((Behaviour)((NPC)spawnedGatherGoons[i]).Behaviour.CombatBehaviour).onBegin.AddListener(combatStartedAction); if (DealerActivity.currentDealerActivity < 0f) { ((NPC)spawnedGatherGoons[i]).Health.MaxHealth = Mathf.Lerp(100f, 250f, 0f - DealerActivity.currentDealerActivity); ((NPC)spawnedGatherGoons[i]).Health.Health = Mathf.Lerp(100f, 250f, 0f - DealerActivity.currentDealerActivity); } } List fromPool = CartelInventory.GetFromPool(3); lootGoblinIndex = -1; if (fromPool.Count > 0) { lootGoblinIndex = Random.Range(0, spawnedGatherGoons.Count); ((NPC)spawnedGatherGoons[lootGoblinIndex]).Inventory.Clear(); foreach (ItemInstance item2 in fromPool) { if (((NPC)spawnedGatherGoons[lootGoblinIndex]).Inventory.CanItemFit(item2)) { ((NPC)spawnedGatherGoons[lootGoblinIndex]).Inventory.InsertItem(item2, true); } } } if (CartelInventory.cartelCashAmount > 2500f) { foreach (CartelGoon spawnedGatherGoon in spawnedGatherGoons) { CashInstance cashInstance = NetworkSingleton.Instance.GetCashInstance(500f); if (((NPC)spawnedGatherGoon).Inventory.CanItemFit((ItemInstance)(object)cashInstance)) { ((NPC)spawnedGatherGoon).Inventory.InsertItem((ItemInstance)(object)cashInstance, true); CartelInventory.cartelCashAmount -= 500f; } } } if (Random.Range(0f, 1f) > 0.2f) { <>c__DisplayClass14_1 obj = new <>c__DisplayClass14_1 { CS$<>8__locals1 = <>c__DisplayClass14_, drinkAct = ((Component)((Component)spawnedGatherGoons[0]).transform.Find("Aux/Drink")).GetComponent() }; obj.drinkAct.Begin(); endDrinkAction = UnityAction.op_Implicit((Action)obj.g__CombatStartedEndAct|1); ((Behaviour)((NPC)spawnedGatherGoons[0]).Behaviour.CombatBehaviour).onBegin.AddListener(endDrinkAction); } if (Random.Range(0f, 1f) > 0.2f) { <>c__DisplayClass14_2 obj2 = new <>c__DisplayClass14_2 { CS$<>8__locals2 = <>c__DisplayClass14_, smokeAct = ((Component)((Component)spawnedGatherGoons[1]).transform.Find("Aux/SmokeCigarette")).GetComponent() }; obj2.smokeAct.Begin(); endSmokeAction = UnityAction.op_Implicit((Action)obj2.g__CombatStartedEndAct|2); ((Behaviour)((NPC)spawnedGatherGoons[1]).Behaviour.CombatBehaviour).onBegin.AddListener(endSmokeAction); } CartelEnforcer.coros.Add(MelonCoroutines.Start(EvaluateCurrentGathering(<>c__DisplayClass14_.location))); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static Dictionary> gatheringLocationsByRegion = new Dictionary> { { 5, new List { new GatheringLocation(new Vector3(151.39f, 2.18f, -16.93f), 5, "forest next to the barn in the Uptown region."), new GatheringLocation(new Vector3(98.23f, 1.43f, 3.16f), 5, "sewer entrance next to Handy Hank's in the Uptown region."), new GatheringLocation(new Vector3(126.84f, 1.46f, 55.52f), 5, "parking lot infront of the Church in the Uptown region."), new GatheringLocation(new Vector3(65.94f, 1.46f, 65.51f), 5, "alley between the Hyland towers.") } }, { 4, new List { new GatheringLocation(new Vector3(92.06f, 5.61f, -128.88f), 4, "park in the Suburbia region."), new GatheringLocation(new Vector3(13.5f, 1.31f, -77.06f), 4, "broken RV in the Suburbia region.") } }, { 3, new List { new GatheringLocation(new Vector3(-53.69f, -1.14f, -84.46f), 3, "shipping containers in the Docks region."), new GatheringLocation(new Vector3(-19.31f, -3.17f, -5.31f), 3, "canal in the Docks region."), new GatheringLocation(new Vector3(-66.38f, -1.14f, 21.06f), 3, "southern wharf next to warehouse.") } }, { 2, new List { new GatheringLocation(new Vector3(43.65f, 1.46f, 24.2f), 2, "town hall."), new GatheringLocation(new Vector3(-8.86f, 1.56f, 79.54f), 2, "parking garage in the Downtown region."), new GatheringLocation(new Vector3(3.5f, 5.56f, 84f), 2, "parking garage in the Downtown region."), new GatheringLocation(new Vector3(23.46f, 1.46f, 84.16f), 2, "casino in the Downtown region.") } }, { 1, new List { new GatheringLocation(new Vector3(-139.19f, -2.57f, 71.38f), 1, "Top Tattoo in the Westville region."), new GatheringLocation(new Vector3(-175.95f, -2.54f, 81.69f), 1, "brown apartment block parking lot."), new GatheringLocation(new Vector3(-97.42f, -2.72f, 60.7f), 1, "small RV next to western gas mart.") } }, { 0, new List { new GatheringLocation(new Vector3(-62.84f, -3.64f, 166.34f), 0, "northern waterfront in the Northtown region."), new GatheringLocation(new Vector3(-86.51f, -4.12f, 108.41f), 0, "western canal in the Northtown region."), new GatheringLocation(new Vector3(-31.51f, 1.46f, 100.46f), 0, "area in front of Thompson's Construction"), new GatheringLocation(new Vector3(-76.09f, -2.54f, 140.6f), 0, "basketball court in the Northtown region.") } } }; public static bool areGoonsGathering = false; public static int hoursUntilNextGathering = 3; public static List spawnedGatherGoons = new List(); public static bool startedCombat = false; public static GatheringLocation currentGatheringLocation = null; public static GatheringLocation previousGatheringLocation = null; public static int lootGoblinIndex = -1; public static int startEarliest = 0; public static int startLatest = 0; public static UnityAction combatStartedAction = null; public static UnityAction endSmokeAction = null; public static UnityAction endDrinkAction = null; public static void OnHourPassTryGather() { if (CartelEnforcer.currentConfig.cartelGatherings) { CartelEnforcer.coros.Add(MelonCoroutines.Start(TryStartGathering())); } } [IteratorStateMachine(typeof(d__14))] public static IEnumerator TryStartGathering() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__14(0); } [IteratorStateMachine(typeof(d__15))] public static IEnumerator EvaluateCurrentGathering(GatheringLocation location) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__15(0) { location = location }; } [IteratorStateMachine(typeof(d__16))] public static IEnumerator EndGatherEvent(bool defeated, GatheringLocation location) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__16(0) { defeated = defeated, location = location }; } [CompilerGenerated] internal static float g__GetSumOfLastGreet|15_0(ref <>c__DisplayClass15_0 P_0) { if (P_0.controllers.Count == 0) { return 0f; } float num = 0f; foreach (DialogueController controller in P_0.controllers) { num += Time.time - controller.lastGreetingTime; } return num; } } public class GatheringLocation { public Vector3 position; public int region; public string description; public GatheringLocation(Vector3 pos, int region, string desc) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) position = pos; this.region = region; description = desc; } } public static class InterceptEvent { public class InterceptContractState { public bool CompletedByPlayer { get; set; } public bool CompletedByCartel { get; set; } public InterceptContractState() { CompletedByPlayer = false; CompletedByCartel = false; } } [CompilerGenerated] private sealed class <>c__DisplayClass12_0 { public bool runOnce; public string cGuid; public Action cb; public Contract contract; public CartelDealer dealer; public Customer customer; public int originalXP; public int currentStayInsideStart; public int currentStayInsideEnd; public int currentStayInsideDur; public EMapRegion region; public bool changeInfluence; } [CompilerGenerated] private sealed class <>c__DisplayClass13_0 { public string cGuid; internal bool b__0() { if (!contractGuids[cGuid].CompletedByPlayer && !contractGuids[cGuid].CompletedByCartel) { return !CartelEnforcer.registered; } return true; } } [CompilerGenerated] private sealed class d__14 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Contract contract; public Customer customer; public int XP; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__14(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Invalid comparison between Unknown and I4 switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = CartelEnforcer.Wait01; <>1__state = 1; return true; case 1: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } if ((int)((Quest)contract).State != 1) { ((Quest)contract).SetQuestState((EQuestState)1, true); } customer.AssignContract(contract); ((Quest)customer.CurrentContract).CompletionXP = XP; customer.ConfigureDealSignal((NetworkConnection)null, NetworkSingleton.Instance.CurrentTime, true); customer.DealSignal.SetContract(contract); ((NPCAction)customer.DealSignal).Started(); customer.UpdateDealAttendance(); customer.SetIsAwaitingDelivery(true); ((Quest)contract).SetIsTracked(true); if (!((Object)(object)((Quest)customer.CurrentContract).hudUI == (Object)null)) { QuestHUDUI hudUI = ((Quest)customer.CurrentContract).hudUI; if (!((Object)(object)((hudUI != null) ? ((Component)hudUI).gameObject : null) == (Object)null)) { goto IL_013d; } } ((Quest)customer.CurrentContract).SetupHUDUI(); goto IL_013d; case 2: <>1__state = -1; <>2__current = CartelEnforcer.Wait01; <>1__state = 3; return true; case 3: { <>1__state = -1; if (!CartelEnforcer.registered) { return false; } if (!((Component)((Quest)customer.CurrentContract).hudUI).gameObject.activeSelf) { ((Component)((Quest)customer.CurrentContract).hudUI).gameObject.SetActive(true); } customer.HasChanged = true; ((Quest)contract).HasChanged = true; ((Quest)customer.CurrentContract).hudUI.FadeIn(); if (((Quest)contract).Entries.Count != 0) { ((Quest)contract).Entries[0].CreateEntryUI(); } Action action = ((Quest)contract).OnMinPass; TimeManager instance = NetworkSingleton.Instance; instance.onMinutePass += Action.op_Implicit(action); <>2__current = null; <>1__state = 4; return true; } case 4: { <>1__state = -1; return false; } IL_013d: if (!Contract.Contracts.Contains(contract)) { Contract.Contracts.Add(contract); } if ((Object)(object)contract.DeliveryLocation != (Object)null && !contract.DeliveryLocation.ScheduledContracts.Contains(contract)) { contract.DeliveryLocation.ScheduledContracts.Add(contract); } <>2__current = CartelEnforcer.Wait05; <>1__state = 2; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__12 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public string cGuid; public Contract contract; public CartelDealer dealer; public Customer customer; public EMapRegion region; private <>c__DisplayClass12_0 <>8__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__12(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: 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_0103: Invalid comparison between Unknown and I4 //IL_0122: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass12_0(); <>8__1.cGuid = cGuid; <>8__1.contract = contract; <>8__1.dealer = dealer; <>8__1.customer = customer; <>8__1.region = region; <>2__current = CartelEnforcer.Wait30; <>1__state = 1; return true; case 1: { <>1__state = -1; if (!CartelEnforcer.registered) { return false; } <>8__1.changeInfluence = InfluenceOverrides.ShouldChangeInfluence(<>8__1.region); if ((Object)(object)<>8__1.customer.CurrentContract == (Object)null && (Object)(object)<>8__1.contract != (Object)null && (int)((Quest)<>8__1.contract).State == 2) { if (<>8__1.changeInfluence) { NetworkSingleton.Instance.Influence.ChangeInfluence(<>8__1.region, CartelEnforcer.influenceConfig.interceptSuccess); } if (contractGuids.Keys.Contains(<>8__1.cGuid)) { contractGuids.Remove(<>8__1.cGuid); } interceptingDeal = false; interceptor = null; return false; } <>8__1.originalXP = ((Quest)<>8__1.contract).CompletionXP; ((Quest)<>8__1.contract).CompletionXP = 0; ((Quest)<>8__1.contract).BopHUDUI(); CartelInventory.FulfillContractItems(<>8__1.contract, <>8__1.dealer); for (int i = 0; i < ((NPC)<>8__1.dealer).Inventory.ItemSlots.Count; i++) { if (((NPC)<>8__1.dealer).Inventory.ItemSlots[i].ItemInstance != null) { continue; } List fromPool = CartelInventory.GetFromPool(1); if (fromPool.Count <= 0) { break; } ((NPC)<>8__1.dealer).Inventory.InsertItem(fromPool[0], true); if (DealerActivity.stolenInDealerInv.TryGetValue(<>8__1.dealer, out var value)) { if (value == null) { value = new List(); } value.AddRange(fromPool); } break; } <>8__1.currentStayInsideStart = ((NPCAction)((Dealer)<>8__1.dealer).HomeEvent).StartTime; <>8__1.currentStayInsideEnd = ((NPCEvent)((Dealer)<>8__1.dealer).HomeEvent).EndTime; <>8__1.currentStayInsideDur = ((NPCEvent)((Dealer)<>8__1.dealer).HomeEvent).Duration; <>8__1.runOnce = false; <>8__1.cb = null; <>8__1.cb = OnQuestEndEvaluateResult; ((Quest)<>8__1.contract).onQuestEnd.AddListener(UnityAction.op_Implicit(<>8__1.cb)); if (!<>8__1.dealer.IsAcceptingDeals) { <>8__1.dealer.SetIsAcceptingDeals(true); } ((Dealer)<>8__1.dealer).AddContract(<>8__1.contract); <>8__1.dealer.SetIsAcceptingDeals(false); ((NPCAction)((Dealer)<>8__1.dealer).HomeEvent).StartTime = 420; ((NPCEvent)((Dealer)<>8__1.dealer).HomeEvent).EndTime = 1620; ((NPCEvent)((Dealer)<>8__1.dealer).HomeEvent).Duration = 720; ((NPCAction)((Dealer)<>8__1.dealer).HomeEvent).End(); ((NPCAction)((Dealer)<>8__1.dealer).HomeEvent).HasStarted = false; ((Behaviour)((Dealer)<>8__1.dealer).HomeEvent).enabled = false; ((Dealer)<>8__1.dealer).CheckAttendStart(); if ((Object)(object)<>8__1.customer.CurrentContract != (Object)null && (Object)(object)<>8__1.customer.CurrentContract.Dealer != (Object)null) { <>8__1.customer.CurrentContract.Dealer = null; } <>2__current = null; <>1__state = 2; return true; } case 2: <>1__state = -1; return false; } void OnQuestEndEvaluateResult(EQuestState state) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Invalid comparison between Unknown and I4 //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Invalid comparison between Unknown and I4 //IL_015f: Unknown result type (might be due to invalid IL or missing references) if (!((<>c__DisplayClass12_0)this).runOnce) { ((<>c__DisplayClass12_0)this).runOnce = true; if (contractGuids.ContainsKey(((<>c__DisplayClass12_0)this).cGuid)) { if (((<>c__DisplayClass12_0)this).cb != null) { ((Quest)((<>c__DisplayClass12_0)this).contract).onQuestEnd.RemoveListener(UnityAction.op_Implicit(((<>c__DisplayClass12_0)this).cb)); } if ((int)state == 3 && (((NPC)((<>c__DisplayClass12_0)this).dealer).Health.IsDead || ((NPC)((<>c__DisplayClass12_0)this).dealer).Health.IsKnockedOut)) { CartelEnforcer.coros.Add(MelonCoroutines.Start(AssignContractSoon(((<>c__DisplayClass12_0)this).customer, ((<>c__DisplayClass12_0)this).contract, ((<>c__DisplayClass12_0)this).originalXP))); if (contractGuids.Keys.Contains(((<>c__DisplayClass12_0)this).cGuid)) { contractGuids.Remove(((<>c__DisplayClass12_0)this).cGuid); } ((Behaviour)((Dealer)((<>c__DisplayClass12_0)this).dealer).HomeEvent).enabled = true; ((NPCAction)((Dealer)((<>c__DisplayClass12_0)this).dealer).HomeEvent).StartTime = ((<>c__DisplayClass12_0)this).currentStayInsideStart; ((NPCEvent)((Dealer)((<>c__DisplayClass12_0)this).dealer).HomeEvent).EndTime = ((<>c__DisplayClass12_0)this).currentStayInsideEnd; ((NPCEvent)((Dealer)((<>c__DisplayClass12_0)this).dealer).HomeEvent).Duration = ((<>c__DisplayClass12_0)this).currentStayInsideDur; ((NPCAction)((Dealer)((<>c__DisplayClass12_0)this).dealer).HomeEvent).HasStarted = true; ((NPCAction)((Dealer)((<>c__DisplayClass12_0)this).dealer).HomeEvent).Resume(); interceptingDeal = false; interceptor = null; } else if ((int)state == 2) { CartelEnforcer.coros.Add(MelonCoroutines.Start(WaitForContractState(((<>c__DisplayClass12_0)this).dealer, ((<>c__DisplayClass12_0)this).contract, ((<>c__DisplayClass12_0)this).customer, ((<>c__DisplayClass12_0)this).region, ((<>c__DisplayClass12_0)this).cGuid, ((<>c__DisplayClass12_0)this).changeInfluence, ((<>c__DisplayClass12_0)this).originalXP))); } else { if (contractGuids.Keys.Contains(((<>c__DisplayClass12_0)this).cGuid)) { contractGuids.Remove(((<>c__DisplayClass12_0)this).cGuid); } ((Behaviour)((Dealer)((<>c__DisplayClass12_0)this).dealer).HomeEvent).enabled = true; ((NPCAction)((Dealer)((<>c__DisplayClass12_0)this).dealer).HomeEvent).StartTime = ((<>c__DisplayClass12_0)this).currentStayInsideStart; ((NPCEvent)((Dealer)((<>c__DisplayClass12_0)this).dealer).HomeEvent).EndTime = ((<>c__DisplayClass12_0)this).currentStayInsideEnd; ((NPCEvent)((Dealer)((<>c__DisplayClass12_0)this).dealer).HomeEvent).Duration = ((<>c__DisplayClass12_0)this).currentStayInsideDur; ((NPCAction)((Dealer)((<>c__DisplayClass12_0)this).dealer).HomeEvent).HasStarted = true; ((NPCAction)((Dealer)((<>c__DisplayClass12_0)this).dealer).HomeEvent).Resume(); interceptingDeal = false; interceptor = null; } } } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__10 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__10(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Invalid comparison between Unknown and I4 switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = CartelEnforcer.Wait5; <>1__state = 1; return true; case 1: <>1__state = -1; allCartelDealers = Il2CppArrayBase.op_Implicit(Object.FindObjectsOfType(true)); break; case 2: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } if (CartelEnforcer.currentConfig.interceptDeals && hoursUntilInterceptEvent <= 0 && (NetworkSingleton.Instance.CurrentTime >= 1620 || NetworkSingleton.Instance.CurrentTime <= 420) && (int)NetworkSingleton.Instance.Status == 2 && !interceptingDeal) { int activityHours = FrequencyOverrides.GetActivityHours("InterceptDeals"); if (activityHours != 0) { hoursUntilInterceptEvent = activityHours; } else { hoursUntilInterceptEvent = Random.Range(2, 8); } CartelEnforcer.coros.Add(MelonCoroutines.Start(StartInterceptDeal())); } break; } if (CartelEnforcer.registered) { <>2__current = CartelEnforcer.Wait60; <>1__state = 2; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__15 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__15(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = CartelEnforcer.Wait5; <>1__state = 1; return true; case 1: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } benziesLogo = ((NPC)Object.FindObjectOfType(true)).GetMessagingIcon(); <>2__current = null; <>1__state = 2; return true; case 2: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__18 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Image background; private Color 5__2; private Color 5__3; private float 5__4; private float 5__5; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__18(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__2 = ((Graphic)background).color; 5__3 = Color.white; 5__4 = 2f; 5__5 = 0f; goto IL_00b7; case 1: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } goto IL_00b7; case 2: { <>1__state = -1; return false; } IL_00b7: if (5__5 < 5__4 && CartelEnforcer.registered) { float num = 5__5 / 5__4; ((Graphic)background).color = Color.Lerp(5__2, 5__3, num); 5__5 += Time.deltaTime; <>2__current = CartelEnforcer.Wait01; <>1__state = 1; return true; } <>2__current = null; <>1__state = 2; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__16 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Contract contract; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__16(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: { <>1__state = -1; if ((Object)(object)((Quest)contract).hudUI == (Object)null || (Object)(object)((Quest)contract).hudUI.MainLabel == (Object)null || (Object)(object)((TMP_Text)((Quest)contract).hudUI.MainLabel).transform == (Object)null) { return false; } Transform val = ((TMP_Text)((Quest)contract).hudUI.MainLabel).transform.Find("IconContainer"); if ((Object)(object)val == (Object)null) { return false; } Transform val2 = val.Find("ContractIcon(Clone)"); if ((Object)(object)val2 == (Object)null) { return false; } Transform val3 = val2.Find("Background"); if ((Object)(object)val3 == (Object)null) { return false; } Image component = ((Component)val3).GetComponent(); questIconBack = ((Graphic)component).color; CartelEnforcer.coros.Add(MelonCoroutines.Start(LerpQuestColor(component))); Transform val4 = val2.Find("Fill"); if ((Object)(object)val4 == (Object)null) { return false; } Image component2 = ((Component)val4).GetComponent(); handshake = component2.sprite; ((Quest)contract).hudUI.BopIcon(); component2.overrideSprite = benziesLogo; CartelEnforcer.coros.Add(MelonCoroutines.Start(ResetQuestUIEffect(component2, component))); <>2__current = null; <>1__state = 1; return true; } case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__17 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Image background; public Image fillImg; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__17(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0061: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; goto IL_003f; case 1: <>1__state = -1; goto IL_003f; case 2: { <>1__state = -1; return false; } IL_003f: if (interceptingDeal && CartelEnforcer.registered) { <>2__current = CartelEnforcer.Wait5; <>1__state = 1; return true; } if ((Object)(object)background != (Object)null) { ((Graphic)background).color = questIconBack; } if (Object.op_Implicit((Object)(object)fillImg)) { fillImg.overrideSprite = handshake; } <>2__current = null; <>1__state = 2; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__11 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private float 5__2; private List 5__3; private Customer 5__4; private Contract 5__5; private CartelDealer 5__6; private EMapRegion 5__7; private bool 5__8; private CartelDealer[] <>7__wrap8; private int <>7__wrap9; private CartelDealer 5__11; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__11(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__3 = null; 5__4 = null; 5__5 = null; 5__6 = null; <>7__wrap8 = null; 5__11 = null; <>1__state = -2; } private bool MoveNext() { //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_03ae: Unknown result type (might be due to invalid IL or missing references) //IL_03b3: Unknown result type (might be due to invalid IL or missing references) //IL_03b8: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Invalid comparison between Unknown and I4 //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_03ef: Unknown result type (might be due to invalid IL or missing references) //IL_03d5: Unknown result type (might be due to invalid IL or missing references) //IL_05a4: Unknown result type (might be due to invalid IL or missing references) //IL_05a9: Unknown result type (might be due to invalid IL or missing references) //IL_052f: Unknown result type (might be due to invalid IL or missing references) //IL_053f: Unknown result type (might be due to invalid IL or missing references) //IL_041f: Unknown result type (might be due to invalid IL or missing references) //IL_032f: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Invalid comparison between Unknown and I4 //IL_068a: Unknown result type (might be due to invalid IL or missing references) //IL_0696: Expected O, but got Unknown //IL_06d9: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) Guid gUID; string text; string text2; switch (<>1__state) { default: return false; case 0: { <>1__state = -1; List list = new List(); int num = 0; 5__2 = FrequencyOverrides.GetByID("InterceptDeals").InfluenceRequirement; CartelDealer[] allCartelDealers = InterceptEvent.allCartelDealers; foreach (CartelDealer obj in allCartelDealers) { bool flag = false; Enumerator enumerator = ((Dealer)obj).ActiveContracts.GetEnumerator(); while (enumerator.MoveNext()) { Contract current = enumerator.Current; flag = true; gUID = ((Quest)current).GUID; if (!list.Contains(((object)(Guid)(ref gUID)).ToString())) { gUID = ((Quest)current).GUID; list.Add(((object)(Guid)(ref gUID)).ToString()); } } if (flag) { num++; } } if (InterceptEvent.allCartelDealers.Length == num) { return false; } 5__3 = new List(); for (int num2 = Contract.Contracts.Count - 1; num2 >= 0; num2--) { Contract val = Contract.Contracts[num2]; if ((Object)(object)val != (Object)null && !((Object)(object)val.Dealer != (Object)null) && !((Object)(object)val.Customer == (Object)null) && (int)((Quest)val).State == 1 && ((Quest)val).hudUIExists && !((Object)(object)((Quest)val).hudUI == (Object)null) && !((Object)(object)((Component)((Quest)val).hudUI).gameObject == (Object)null) && ((Component)((Quest)val).hudUI).gameObject.activeSelf) { gUID = ((Quest)val).GUID; if (!list.Contains(((object)(Guid)(ref gUID)).ToString()) && ((Quest)val).GetMinsUntilExpiry() <= 300 && ((Quest)val).GetMinsUntilExpiry() >= 90) { Dictionary.KeyCollection keys = contractGuids.Keys; gUID = ((Quest)val).GUID; if (!keys.Contains(((object)(Guid)(ref gUID)).ToString()) && !5__3.Contains(val)) { 5__3.Add(val); } } } } if (5__3.Count == 0) { return false; } 5__4 = null; 5__5 = null; goto IL_022d; } case 1: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } if (5__3.Count != 0) { int index = Random.Range(0, 5__3.Count); 5__5 = 5__3[index]; if ((Object)(object)5__5 == (Object)null || ((Object)(object)5__5 != (Object)null && (int)((Quest)5__5).State == 2)) { 5__3.RemoveAt(index); 5__5 = null; } else { 5__4 = ((Component)5__5.Customer).GetComponent(); if (5__4.NPC.Health.IsDead || 5__4.NPC.Health.IsKnockedOut) { 5__3.RemoveAt(index); 5__5 = null; } else { float num3 = default(float); if (!((Object)(object)Player.GetClosestPlayer(5__4.NPC.CenterPoint, ref num3, (List)null) != (Object)null) || !(num3 < 40f)) { goto IL_0378; } 5__3.RemoveAt(index); 5__5 = null; } } if (CartelEnforcer.registered && 5__3.Count != 0) { goto IL_022d; } } goto IL_0378; case 2: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } if (!((Object)(object)5__11 == (Object)(object)5__6) && !((NPC)5__11).Health.IsDead && !((NPC)5__11).Health.IsKnockedOut && (((Dealer)5__11).ActiveContracts == null || ((Dealer)5__11).ActiveContracts.Count < 1)) { if (Vector3.Distance(((NPC)5__11).CenterPoint, 5__4.NPC.CenterPoint) < 80f) { 5__8 = true; 5__6 = 5__11; goto IL_058d; } 5__11 = null; } <>7__wrap9++; goto IL_057a; case 3: { <>1__state = -1; return false; } IL_059e: gUID = ((Quest)5__5).GUID; text = ((object)(Guid)(ref gUID)).ToString(); if (!contractGuids.Keys.Contains(text)) { contractGuids.Add(text, new InterceptContractState()); } text2 = ""; switch (Random.Range(0, 7)) { case 0: text2 = "What's taking so long? I will just find another dealer..."; break; case 1: text2 = "Nevermind! I made a deal with someone else."; break; case 2: text2 = "Are you coming or not? I might just buy from someone else."; break; case 3: text2 = "Yo where are you?! I've been waiting at our spot. I'll message another dealer then..."; break; case 4: text2 = "This isn't working out. I'm taking my business elsewhere."; break; case 5: text2 = "I'm not waiting around all day. Don't bother texting me back."; break; case 6: text2 = "You snooze, you lose. Found another dealer to sell me my shit."; break; case 7: text2 = "I'll hustle with someone else if you ghost me like this..."; break; } 5__4.NPC.RelationData.ChangeRelationship(-0.15f, true); 5__4.NPC.MSGConversation.SendMessage(new Message(text2, (ESenderType)1, true, -1), true, true); interceptingDeal = true; interceptor = 5__6; CartelEnforcer.coros.Add(MelonCoroutines.Start(QuestUIEffect(5__5))); CartelEnforcer.coros.Add(MelonCoroutines.Start(BeginIntercept(5__6, 5__5, 5__4, 5__7, text))); <>2__current = null; <>1__state = 3; return true; IL_022d: <>2__current = CartelEnforcer.Wait01; <>1__state = 1; return true; IL_0378: if ((Object)(object)5__4 == (Object)null || (Object)(object)5__5 == (Object)null) { return false; } 5__6 = null; 5__7 = Singleton.Instance.GetRegionFromPosition(5__4.NPC.CenterPoint); if (5__2 >= 0f && NetworkSingleton.Instance.Influence.GetRegionData(5__7).Influence < 5__2) { return false; } if ((int)5__7 == 0) { 5__6 = NetworkSingleton.Instance.Activities.GetRegionalActivities((EMapRegion)1).CartelDealer; } else { 5__6 = NetworkSingleton.Instance.Activities.GetRegionalActivities(5__7).CartelDealer; } if ((((Dealer)5__6).ActiveContracts != null && ((Dealer)5__6).ActiveContracts.Count >= 1) || ((NPC)5__6).Health.IsDead || ((NPC)5__6).Health.IsKnockedOut) { 5__8 = false; <>7__wrap8 = InterceptEvent.allCartelDealers; <>7__wrap9 = 0; goto IL_057a; } goto IL_059e; IL_057a: if (<>7__wrap9 < <>7__wrap8.Length) { 5__11 = <>7__wrap8[<>7__wrap9]; <>2__current = CartelEnforcer.Wait01; <>1__state = 2; return true; } goto IL_058d; IL_058d: <>7__wrap8 = null; if (!5__8) { return false; } goto IL_059e; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__13 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public string cGuid; private <>c__DisplayClass13_0 <>8__1; public int originalXP; public bool changeInfluence; public EMapRegion region; public Customer customer; public CartelDealer dealer; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__13(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass13_0(); <>8__1.cGuid = cGuid; <>2__current = (object)new WaitUntil(Func.op_Implicit((Func)(() => contractGuids[<>8__1.cGuid].CompletedByPlayer || contractGuids[<>8__1.cGuid].CompletedByCartel || !CartelEnforcer.registered))); <>1__state = 1; return true; case 1: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } if (contractGuids[<>8__1.cGuid].CompletedByPlayer) { NetworkSingleton.Instance.AddXP(originalXP); if (changeInfluence) { NetworkSingleton.Instance.Influence.ChangeInfluence(region, CartelEnforcer.influenceConfig.interceptSuccess); } customer.NPC.RelationData.ChangeRelationship(0.15f, true); } else if (contractGuids[<>8__1.cGuid].CompletedByCartel) { if (changeInfluence) { NetworkSingleton.Instance.Influence.ChangeInfluence(region, CartelEnforcer.influenceConfig.interceptFail); } customer.NPC.RelationData.ChangeRelationship(-0.6f, true); } contractGuids.Remove(<>8__1.cGuid); ((Behaviour)((Dealer)dealer).HomeEvent).enabled = true; ((NPCAction)((Dealer)dealer).HomeEvent).StartTime = DealerActivity.currentStayInsideStart; ((NPCEvent)((Dealer)dealer).HomeEvent).EndTime = DealerActivity.currentStayInsideEnd; ((NPCEvent)((Dealer)dealer).HomeEvent).Duration = DealerActivity.currentStayInsideDur; ((NPCAction)((Dealer)dealer).HomeEvent).HasStarted = true; ((NPCAction)((Dealer)dealer).HomeEvent).Resume(); interceptingDeal = false; interceptor = null; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static Color questIconBack; public static Sprite handshake; public static Sprite benziesLogo; private static CartelDealer[] allCartelDealers; public static Dictionary contractGuids = new Dictionary(); public static bool interceptingDeal = false; public static CartelDealer interceptor = null; public static int hoursUntilInterceptEvent = 4; public static void HourPassInterceptCooldown() { if (CartelEnforcer.registered && CartelEnforcer.currentConfig.interceptDeals && !CartelEnforcer.isSaving) { hoursUntilInterceptEvent = Mathf.Clamp(hoursUntilInterceptEvent - 1, 0, int.MaxValue); } } [IteratorStateMachine(typeof(d__10))] public static IEnumerator EvaluateCartelIntercepts() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__10(0); } [IteratorStateMachine(typeof(d__11))] public static IEnumerator StartInterceptDeal() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__11(0); } [IteratorStateMachine(typeof(d__12))] public static IEnumerator BeginIntercept(CartelDealer dealer, Contract contract, Customer customer, EMapRegion region, string cGuid) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__12(0) { dealer = dealer, contract = contract, customer = customer, region = region, cGuid = cGuid }; } [IteratorStateMachine(typeof(d__13))] public static IEnumerator WaitForContractState(CartelDealer dealer, Contract contract, Customer customer, EMapRegion region, string cGuid, bool changeInfluence, int originalXP) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__13(0) { dealer = dealer, customer = customer, region = region, cGuid = cGuid, changeInfluence = changeInfluence, originalXP = originalXP }; } [IteratorStateMachine(typeof(d__14))] public static IEnumerator AssignContractSoon(Customer customer, Contract contract, int XP) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__14(0) { customer = customer, contract = contract, XP = XP }; } [IteratorStateMachine(typeof(d__15))] public static IEnumerator FetchUIElementsInit() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__15(0); } [IteratorStateMachine(typeof(d__16))] public static IEnumerator QuestUIEffect(Contract contract) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__16(0) { contract = contract }; } [IteratorStateMachine(typeof(d__17))] public static IEnumerator ResetQuestUIEffect(Image fillImg, Image background) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__17(0) { fillImg = fillImg, background = background }; } [IteratorStateMachine(typeof(d__18))] public static IEnumerator LerpQuestColor(Image background) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__18(0) { background = background }; } } [Serializable] public class SerializeStolenItems { public string ID; public int Quality; public int Quantity; } [Serializable] public class StolenItemsList { public float balance; public List items; } public static class CartelInventory { [CompilerGenerated] private sealed class d__8 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public List items; public Action cb; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__8(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; lock (cartelItemLock) { for (int i = 0; i < items.Count; i++) { int num = 1; QualityItemInstance val = ((Il2CppObjectBase)items[i]).TryCast(); if (val == null) { continue; } int num2 = -1; if (cartelStolenItems.Count > 0) { for (int j = 0; j < cartelStolenItems.Count; j++) { if (((BaseItemInstance)cartelStolenItems[j]).ID == ((BaseItemInstance)val).ID && cartelStolenItems[j].Quality == val.Quality) { num2 = j; break; } } } ProductItemInstance val2 = ((Il2CppObjectBase)items[i]).TryCast(); if (val2 != null && val2.PackagingID != null) { string packagingID = val2.PackagingID; num = ((packagingID == "jar") ? jarQuantity : ((!(packagingID == "brick")) ? 1 : brickQuantity)); } if (num2 >= 0) { QualityItemInstance obj = cartelStolenItems[num2]; ((BaseItemInstance)obj).Quantity = ((BaseItemInstance)obj).Quantity + ((BaseItemInstance)val).Quantity * num; } else { ((BaseItemInstance)val).Quantity = ((BaseItemInstance)val).Quantity * num; cartelStolenItems.Add(val); } } } if (cb != null) { cb(); } <>2__current = null; <>1__state = 1; return true; case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static List cartelStolenItems = new List(); public static float cartelCashAmount = 0f; public static readonly object cartelItemLock = new object(); public static PackagingDefinition jarPackaging = null; public static PackagingDefinition brickPackaging = null; public static readonly int brickQuantity = 20; public static readonly int jarQuantity = 5; public static void PreparePackagingRefs() { PrefabObjects spawnablePrefabs = Object.FindObjectOfType(true).SpawnablePrefabs; NetworkObject val = null; for (int i = 0; i < spawnablePrefabs.GetObjectCount(); i++) { NetworkObject @object = spawnablePrefabs.GetObject(true, i); object obj; if (@object == null) { obj = null; } else { GameObject gameObject = ((Component)@object).gameObject; obj = ((gameObject != null) ? ((Object)gameObject).name : null); } if ((string?)obj == "BrickPress") { val = @object; } } BrickPress component = ((Component)val).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)component.BrickPackaging != (Object)null) { brickPackaging = component.BrickPackaging; } ItemDefinition val2 = new Func(Registry.GetItem)("jar"); if (!((Object)(object)val2 == (Object)null)) { PackagingDefinition val3 = ((Il2CppObjectBase)val2).TryCast(); if ((Object)(object)val3 != (Object)null) { jarPackaging = val3; } } } [IteratorStateMachine(typeof(d__8))] public static IEnumerator CartelStealsItems(List items, Action cb = null) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__8(0) { items = items, cb = cb }; } public static List GetFromPool(int maxEmptySlotsToFill) { //IL_01f6: Unknown result type (might be due to invalid IL or missing references) List list = new List(); lock (cartelItemLock) { int num = Mathf.Min(maxEmptySlotsToFill, cartelStolenItems.Count); for (int i = 0; i < num; i++) { if (cartelStolenItems.Count == 0) { break; } int index = Random.Range(0, cartelStolenItems.Count); ItemDefinition item = Registry.GetItem(((BaseItemInstance)cartelStolenItems[index]).ID); int num2 = Mathf.Min(Mathf.FloorToInt((float)(((BaseItemInstance)cartelStolenItems[index]).Quantity / brickQuantity)), 20); int num3 = Mathf.Min(Mathf.FloorToInt((float)(((BaseItemInstance)cartelStolenItems[index]).Quantity / jarQuantity)), 20); ItemInstance val = null; PackagingDefinition val2 = null; int num4; if (num2 > 5) { num4 = brickQuantity * num2; float num5 = num4 / ((BaseItemInstance)cartelStolenItems[index]).Quantity; int num6 = Mathf.RoundToInt(Mathf.Lerp((float)num2, Mathf.Clamp((float)num2 / 2f, 1f, 20f), num5)); num4 = brickQuantity * num6; val = item.GetDefaultInstance(num6); val2 = brickPackaging; } else if (num3 > 1) { num4 = jarQuantity * num3; float num7 = num4 / ((BaseItemInstance)cartelStolenItems[index]).Quantity; int num8 = Mathf.RoundToInt(Mathf.Lerp((float)num3, Mathf.Clamp((float)num3 / 2f, 1f, 20f), num7)); num4 = jarQuantity * num8; val = item.GetDefaultInstance(num8); val2 = jarPackaging; } else { num4 = Mathf.Min(((BaseItemInstance)cartelStolenItems[index]).Quantity, 1); val = item.GetDefaultInstance(num4); } if ((Object)(object)val2 != (Object)null) { ProductItemInstance val3 = ((Il2CppObjectBase)val).TryCast(); if (val3 != null) { val3.SetPackaging(val2); } } QualityItemInstance val4 = ((Il2CppObjectBase)val).TryCast(); if (val4 != null) { val4.Quality = cartelStolenItems[index].Quality; } list.Add(val); if (num4 >= ((BaseItemInstance)cartelStolenItems[index]).Quantity) { cartelStolenItems.RemoveAt(index); continue; } QualityItemInstance obj = cartelStolenItems[index]; ((BaseItemInstance)obj).Quantity = ((BaseItemInstance)obj).Quantity - num4; } } return list; } public static List GetFromPool(string id, EQuality quality, int qty, out int returnedQty) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) if (cartelStolenItems.Count == 0) { returnedQty = 0; return new List(); } List list = new List(); lock (cartelItemLock) { ItemDefinition item2 = Registry.GetItem(id); QualityItemInstance val = cartelStolenItems.First((QualityItemInstance item) => ((BaseItemInstance)item).ID == id && item.Quality >= quality); if (val == null || ((BaseItemInstance)val).Quantity <= 5) { returnedQty = 0; return list; } int index = cartelStolenItems.IndexOf(val); int num = Mathf.FloorToInt((float)((BaseItemInstance)val).Quantity / (float)jarQuantity); int num2 = Mathf.CeilToInt((float)qty / (float)jarQuantity); PackagingDefinition val2 = jarPackaging; int num3 = 0; int num4 = 0; if (num2 > num) { returnedQty = num * jarQuantity; num4 = num; num3 = Mathf.CeilToInt((float)num / 20f); } else { returnedQty = num2 * jarQuantity; num4 = num2; num3 = Mathf.CeilToInt((float)num2 / 20f); } for (int i = 0; i < num3; i++) { ItemInstance val3 = null; if (num4 > 20) { val3 = item2.GetDefaultInstance(20); num4 -= 20; } else { val3 = item2.GetDefaultInstance(num4); } if ((Object)(object)val2 != (Object)null) { ProductItemInstance val4 = ((Il2CppObjectBase)val3).TryCast(); if (val4 != null) { val4.SetPackaging(val2); } } QualityItemInstance val5 = ((Il2CppObjectBase)val3).TryCast(); if (val5 != null) { val5.Quality = quality; } list.Add(val3); } if (returnedQty >= ((BaseItemInstance)val).Quantity) { cartelStolenItems.Remove(val); } else { QualityItemInstance obj = cartelStolenItems[index]; ((BaseItemInstance)obj).Quantity = ((BaseItemInstance)obj).Quantity - returnedQty; } } return list; } public static List MakeItem(string id, EQuality quality, int qty) { //IL_008a: Unknown result type (might be due to invalid IL or missing references) List list = new List(); ItemDefinition item = Registry.GetItem(id); int num = Mathf.CeilToInt((float)qty / (float)jarQuantity); PackagingDefinition val = jarPackaging; int num2 = 0; int num3 = num; num2 = Mathf.CeilToInt((float)num / 20f); for (int i = 0; i < num2; i++) { ItemInstance val2 = null; if (num3 > 20) { val2 = item.GetDefaultInstance(20); num3 -= 20; } else { val2 = item.GetDefaultInstance(num3); } if ((Object)(object)val != (Object)null) { ProductItemInstance val3 = ((Il2CppObjectBase)val2).TryCast(); if (val3 != null) { val3.SetPackaging(val); } } QualityItemInstance val4 = ((Il2CppObjectBase)val2).TryCast(); if (val4 != null) { val4.Quality = quality; } list.Add(val2); } return list; } public static bool ExistsInInventory(string id, EQuality quality, out int qty) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) bool flag = false; lock (cartelItemLock) { flag = cartelStolenItems.Any((QualityItemInstance item) => ((BaseItemInstance)item).ID == id && item.Quality >= quality); if (flag) { qty = ((BaseItemInstance)cartelStolenItems.First((QualityItemInstance item) => ((BaseItemInstance)item).ID == id && item.Quality >= quality)).Quantity; } else { qty = 0; } } return flag; } public static void FulfillContractItems(Contract contract, CartelDealer dealer) { //IL_002f: 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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) List list = new List(); Enumerator enumerator = contract.ProductList.entries.GetEnumerator(); while (enumerator.MoveNext()) { Entry current = enumerator.Current; bool flag = false; int num = -1; if (ExistsInInventory(current.ProductID, current.Quality, out var _)) { list.AddRange(GetFromPool(current.ProductID, current.Quality, current.Quantity, out var returnedQty)); if (returnedQty < current.Quantity) { num = current.Quantity - returnedQty; } else { flag = true; } } if (!flag || num > 0) { if (num > 0) { list.AddRange(MakeItem(current.ProductID, current.Quality, num)); } else { list.AddRange(MakeItem(current.ProductID, current.Quality, current.Quantity)); } } } for (int i = 0; i < list.Count; i++) { if (list[i] != null && ((NPC)dealer).Inventory.CanItemFit(list[i])) { ((NPC)dealer).Inventory.InsertItem(list[i], true); } } } } [RegisterTypeInIl2Cpp] public class Quest_CarMeetup : Quest { [CompilerGenerated] private sealed class <>c__DisplayClass25_0 { public CartelGoon goonHandler; public Quest_CarMeetup <>4__this; } [CompilerGenerated] private sealed class d__31 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Quest_CarMeetup <>4__this; private List.Enumerator <>7__wrap1; private GameObject 5__3; private Dictionary.Enumerator <>7__wrap3; private KeyValuePair 5__5; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__31(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { switch (<>1__state) { case -3: case 2: try { } finally { <>m__Finally1(); } break; case -4: case 3: try { } finally { <>m__Finally2(); } break; } <>7__wrap1 = default(List.Enumerator); 5__3 = null; <>7__wrap3 = default(Dictionary.Enumerator); 5__5 = default(KeyValuePair); <>1__state = -2; } private bool MoveNext() { bool result; try { int num = <>1__state; Quest_CarMeetup quest_CarMeetup = <>4__this; switch (num) { default: result = false; break; case 0: <>1__state = -1; <>2__current = CartelEnforcer.Wait10; <>1__state = 1; result = true; break; case 1: <>1__state = -1; if (!CartelEnforcer.registered) { result = false; break; } <>7__wrap1 = quest_CarMeetup.spawnedDecor.GetEnumerator(); <>1__state = -3; goto IL_00dc; case 2: <>1__state = -3; if (!CartelEnforcer.registered) { result = false; <>m__Finally1(); break; } if ((Object)(object)5__3 != (Object)null) { Object.Destroy((Object)(object)5__3); } 5__3 = null; goto IL_00dc; case 3: <>1__state = -4; if (!CartelEnforcer.registered) { result = false; <>m__Finally2(); break; } if ((Delegate)(object)quest_CarMeetup.combatStartedAction != (Delegate)null) { ((Behaviour)((NPC)5__5.Value).Behaviour.CombatBehaviour).onBegin.RemoveListener(quest_CarMeetup.combatStartedAction); } if ((Delegate)(object)quest_CarMeetup.goonDiedAction != (Delegate)null) { ((NPC)5__5.Value).Health.onDieOrKnockedOut.RemoveListener(quest_CarMeetup.goonDiedAction); } if ((Delegate)(object)quest_CarMeetup.combatEndCrouchAction != (Delegate)null) { ((NPC)5__5.Value).Health.onDieOrKnockedOut.RemoveListener(quest_CarMeetup.combatEndCrouchAction); } if (((NPC)5__5.Value).Health.IsDead) { ((NPC)5__5.Value).Health.Revive(); } ((Behaviour)((NPC)5__5.Value).Behaviour.CombatBehaviour).Disable_Networked((NetworkConnection)null); ((NPC)5__5.Value).Movement.MoveSpeedMultiplier = 1f; ((NPC)5__5.Value).Health.MaxHealth = 100f; ((NPC)5__5.Value).Health.Health = 100f; ((NPC)5__5.Value).Behaviour.CombatBehaviour.GiveUpRange = quest_CarMeetup.GiveUpRange; ((NPC)5__5.Value).Behaviour.CombatBehaviour.GiveUpAfterSuccessfulHits = quest_CarMeetup.GiveUpAfterSuccessfulHits; ((NPC)5__5.Value).Behaviour.CombatBehaviour.DefaultSearchTime = quest_CarMeetup.DefaultSearchTime; ((NPC)5__5.Value).Behaviour.ScheduleManager.EnableSchedule(); ((Component)((NPC)5__5.Value).Behaviour.ScheduleManager.ActionList[0]).gameObject.SetActive(true); if (5__5.Value.IsGoonSpawned) { 5__5.Value.Despawn(); } 5__5 = default(KeyValuePair); goto IL_0368; case 4: { <>1__state = -1; result = false; break; } IL_0368: if (<>7__wrap3.MoveNext()) { 5__5 = <>7__wrap3.Current; <>2__current = CartelEnforcer.Wait05; <>1__state = 3; result = true; break; } <>m__Finally2(); <>7__wrap3 = default(Dictionary.Enumerator); quest_CarMeetup.spawnedGoons.Clear(); quest_CarMeetup.spawnedGoonsGuids.Clear(); quest_CarMeetup.combatStartedAction = null; quest_CarMeetup.goonDiedAction = null; quest_CarMeetup.combatEndCrouchAction = null; <>2__current = null; <>1__state = 4; result = true; break; IL_00dc: if (<>7__wrap1.MoveNext()) { 5__3 = <>7__wrap1.Current; <>2__current = CartelEnforcer.Wait05; <>1__state = 2; result = true; break; } <>m__Finally1(); <>7__wrap1 = default(List.Enumerator); quest_CarMeetup.spawnedDecor.Clear(); <>7__wrap3 = quest_CarMeetup.spawnedGoons.GetEnumerator(); <>1__state = -4; goto IL_0368; } } catch { //try-fault ((IDisposable)this).Dispose(); throw; } return result; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; ((IDisposable)<>7__wrap1).Dispose(); } private void <>m__Finally2() { <>1__state = -1; ((IDisposable)<>7__wrap3).Dispose(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__26 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Quest_CarMeetup <>4__this; public Player p; private DialogueController 5__2; private int 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__26(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_03a9: Unknown result type (might be due to invalid IL or missing references) //IL_0448: 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_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0106: 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) int num = <>1__state; Quest_CarMeetup quest_CarMeetup = <>4__this; Vector3 zero = default(Vector3); switch (num) { default: return false; case 0: <>1__state = -1; if (!quest_CarMeetup.spawnedGoons.Keys.Contains("guard")) { return false; } 5__2 = ((Component)((NPC)quest_CarMeetup.spawnedGoons["guard"]).DialogueHandler).gameObject.GetComponent(); 5__3 = 0; zero = Vector3.zero; goto IL_0457; case 1: <>1__state = -1; if (CartelEnforcer.registered && !quest_CarMeetup.combatBegun) { ((NPC)quest_CarMeetup.spawnedGoons["guard"]).Movement.FacePoint(p.CenterPointTransform.position, 0.5f); if (5__3 < 2) { switch (Random.Range(0, 4)) { case 0: 5__2.handler.WorldspaceRend.ShowText("Get out of here you punk!", 3f); break; case 1: 5__2.handler.WorldspaceRend.ShowText("This ain't your business!", 3f); break; case 2: 5__2.handler.WorldspaceRend.ShowText("Screw off mate!", 3f); break; case 3: 5__2.handler.WorldspaceRend.ShowText("You're not invited here, get lost!", 3f); break; } 5__3++; ((NPC)quest_CarMeetup.spawnedGoons["guard"]).PlayVO((EVOLineType)2, false); } else { if (5__3 == 2) { switch (Random.Range(0, 3)) { case 0: 5__2.handler.WorldspaceRend.ShowText("Last warning buddy!", 3f); break; case 1: 5__2.handler.WorldspaceRend.ShowText("Walk away or you get shot.", 3f); break; case 2: 5__2.handler.WorldspaceRend.ShowText("One of us is going to leave in a casket...", 5f); break; } ((NPC)quest_CarMeetup.spawnedGoons["guard"]).PlayVO((EVOLineType)10, false); ((NPC)quest_CarMeetup.spawnedGoons["guard"]).Avatar.EmotionManager.AddEmotionOverride("Annoyed", "product_rejected", 10f, 1); ((NPC)quest_CarMeetup.spawnedGoons["guard"]).Behaviour.CombatBehaviour.SetWeaponRaised(true); <>2__current = CartelEnforcer.Wait05; <>1__state = 2; return true; } if (5__3 == 3 && !quest_CarMeetup.combatBegun) { quest_CarMeetup.spawnedGoons["guard"].AttackEntity(((Component)p).GetComponent(), true); goto IL_0469; } } goto IL_03fe; } goto IL_0469; case 2: <>1__state = -1; if (CartelEnforcer.registered && !quest_CarMeetup.combatBegun) { ((NPC)quest_CarMeetup.spawnedGoons["guard"]).Movement.FacePoint(p.CenterPointTransform.position, 0.5f); 5__3++; goto IL_03fe; } goto IL_0469; case 3: <>1__state = -1; if (CartelEnforcer.registered && !quest_CarMeetup.combatBegun) { ((NPC)quest_CarMeetup.spawnedGoons["guard"]).Movement.FacePoint(p.CenterPointTransform.position, 0.5f); goto IL_0457; } goto IL_0469; case 4: { <>1__state = -1; return false; } IL_0457: if (CartelEnforcer.registered && !quest_CarMeetup.combatBegun) { if (!quest_CarMeetup.spawnedGoons.Keys.Contains("guard")) { return false; } if (!((NPC)quest_CarMeetup.spawnedGoons["guard"]).Health.IsDead && !((NPC)quest_CarMeetup.spawnedGoons["guard"]).Health.IsKnockedOut) { ((NPC)quest_CarMeetup.spawnedGoons["guard"]).Movement.GetClosestReachablePoint(p.CenterPointTransform.position, ref zero); if (zero != Vector3.zero) { ((NPC)quest_CarMeetup.spawnedGoons["guard"]).Movement.SetDestination(zero); } <>2__current = CartelEnforcer.Wait2; <>1__state = 1; return true; } } goto IL_0469; IL_0469: <>2__current = null; <>1__state = 4; return true; IL_03fe: <>2__current = CartelEnforcer.Wait2; <>1__state = 3; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__25 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Quest_CarMeetup <>4__this; private <>c__DisplayClass25_0 <>8__1; private NetworkManager 5__2; private NetworkObject 5__3; private NetworkObject 5__4; private ItemDefinition 5__5; private NetworkObject 5__6; private NetworkObject 5__7; private NetworkObject 5__8; private List.Enumerator <>7__wrap8; private Vector3 5__10; private int 5__11; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__25(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if (num == -3 || num == 6) { try { } finally { <>m__Finally1(); } } <>8__1 = null; 5__2 = null; 5__3 = null; 5__4 = null; 5__5 = null; 5__6 = null; 5__7 = null; 5__8 = null; <>7__wrap8 = default(List.Enumerator); <>1__state = -2; } private bool MoveNext() { //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_0486: Unknown result type (might be due to invalid IL or missing references) //IL_049a: Unknown result type (might be due to invalid IL or missing references) //IL_052f: Unknown result type (might be due to invalid IL or missing references) //IL_0535: Unknown result type (might be due to invalid IL or missing references) //IL_05af: Unknown result type (might be due to invalid IL or missing references) //IL_06a6: Unknown result type (might be due to invalid IL or missing references) //IL_06d5: 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_040c: 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) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0613: Unknown result type (might be due to invalid IL or missing references) //IL_0618: Unknown result type (might be due to invalid IL or missing references) //IL_0825: Unknown result type (might be due to invalid IL or missing references) //IL_0898: Unknown result type (might be due to invalid IL or missing references) //IL_08f1: Unknown result type (might be due to invalid IL or missing references) //IL_0946: Unknown result type (might be due to invalid IL or missing references) //IL_097b: Unknown result type (might be due to invalid IL or missing references) //IL_09d0: Unknown result type (might be due to invalid IL or missing references) //IL_0a05: Unknown result type (might be due to invalid IL or missing references) //IL_0a5a: Unknown result type (might be due to invalid IL or missing references) //IL_0d2c: Unknown result type (might be due to invalid IL or missing references) //IL_0d31: Unknown result type (might be due to invalid IL or missing references) //IL_0d9b: Unknown result type (might be due to invalid IL or missing references) //IL_0da0: Unknown result type (might be due to invalid IL or missing references) //IL_0cd9: Unknown result type (might be due to invalid IL or missing references) //IL_0cde: Unknown result type (might be due to invalid IL or missing references) //IL_0e0d: Unknown result type (might be due to invalid IL or missing references) //IL_0e12: Unknown result type (might be due to invalid IL or missing references) bool result; try { int num = <>1__state; Quest_CarMeetup quest_CarMeetup = <>4__this; CartelGoon val5; CartelGoon val6; CartelGoon val7; AvatarWeapon val8; AvatarWeapon val9; AvatarWeapon val10; switch (num) { default: result = false; break; case 0: { <>1__state = -1; <>8__1 = new <>c__DisplayClass25_0(); <>8__1.<>4__this = <>4__this; 5__2 = Object.FindObjectOfType(true); PrefabObjects spawnablePrefabs = 5__2.SpawnablePrefabs; 5__3 = null; 5__4 = null; for (int i = 0; i < spawnablePrefabs.GetObjectCount(); i++) { NetworkObject @object = spawnablePrefabs.GetObject(true, i); object obj; if (@object == null) { obj = null; } else { GameObject gameObject = ((Component)@object).gameObject; obj = ((gameObject != null) ? ((Object)gameObject).name : null); } if ((string?)obj == "BoxSUV") { 5__3 = @object; continue; } object obj2; if (@object == null) { obj2 = null; } else { GameObject gameObject2 = ((Component)@object).gameObject; obj2 = ((gameObject2 != null) ? ((Object)gameObject2).name : null); } if ((string?)obj2 == "Pallet") { 5__4 = @object; } } Func func = Registry.GetItem; ItemInstance val2 = null; 5__5 = func("cocaine"); val2 = 5__5.GetDefaultInstance(1); ProductItemInstance val3 = ((Il2CppObjectBase)val2).TryCast(); if (val3 != null) { if ((Object)(object)CartelInventory.brickPackaging != (Object)null) { val3.SetPackaging(CartelInventory.brickPackaging); } if ((Object)(object)((StorableItemInstance)val3).StoredItem != (Object)null) { FilledPackaging_StoredItem val4 = ((Il2CppObjectBase)((StorableItemInstance)val3).StoredItem).TryCast(); if ((Object)(object)val4 != (Object)null) { GameObject gameObject3 = ((Component)((ProductVisualsSetter)val4.Visuals.CocaineVisuals).VisualsContainer).gameObject; if ((Object)(object)gameObject3 != (Object)null) { quest_CarMeetup.brickBase = Object.Instantiate(gameObject3); ((Object)quest_CarMeetup.brickBase).name = "CokeBrickDecor"; quest_CarMeetup.brickBase.transform.SetParent(((Component)quest_CarMeetup).transform); } } } } 5__6 = Object.Instantiate(5__3); 5__2.ServerManager.Spawn(5__6, (NetworkConnection)null, default(Scene)); <>2__current = CartelEnforcer.Wait01; <>1__state = 1; result = true; break; } case 1: <>1__state = -1; if (!CartelEnforcer.registered) { result = false; break; } ((Component)5__6).transform.parent = ((Component)Singleton.Instance).transform; ((Component)5__6).gameObject.SetActive(true); ((Component)5__6).transform.SetPositionAndRotation(new Vector3(-19.0712f, -4.1883f, 174.4196f), Quaternion.Euler(0.0009f, 0.4645f, 0f)); quest_CarMeetup.rewardStorage = ((Component)5__6).GetComponent(); <>2__current = CartelEnforcer.Wait05; <>1__state = 2; result = true; break; case 2: { <>1__state = -1; if (!CartelEnforcer.registered) { result = false; break; } ((Component)5__6).GetComponent().isKinematic = true; quest_CarMeetup.spawnedDecor.Add(((Component)5__6).gameObject); int num3 = Mathf.RoundToInt(Mathf.Lerp(2f, 4f, quest_CarMeetup.questDifficultyScalar - 1f)); int num4 = Random.Range(1, num3); for (int j = 0; j < num4; j++) { int num5 = Mathf.RoundToInt(Mathf.Lerp(5f, 10f, quest_CarMeetup.questDifficultyScalar - 1f)); int num6 = Random.Range(3, num5); ItemInstance val2 = 5__5.GetDefaultInstance(num6); ProductItemInstance val11 = ((Il2CppObjectBase)val2).TryCast(); if (val11 != null && (Object)(object)CartelInventory.brickPackaging != (Object)null) { val11.SetPackaging(CartelInventory.brickPackaging); } if (j < quest_CarMeetup.rewardStorage.ItemSlots.Count) { quest_CarMeetup.rewardStorage.ItemSlots[j].InsertItem(val2); } } 5__7 = Object.Instantiate(5__3); 5__2.ServerManager.Spawn(5__7, (NetworkConnection)null, default(Scene)); <>2__current = CartelEnforcer.Wait01; <>1__state = 3; result = true; break; } case 3: <>1__state = -1; if (!CartelEnforcer.registered) { result = false; break; } ((Component)5__7).transform.parent = ((Component)Singleton.Instance).transform; ((Component)5__7).gameObject.SetActive(true); ((Component)5__7).transform.SetPositionAndRotation(new Vector3(-21.7171f, -4.1801f, 167.101f), Quaternion.Euler(0.2846f, 78.2566f, 359.4543f)); <>2__current = CartelEnforcer.Wait05; <>1__state = 4; result = true; break; case 4: <>1__state = -1; if (!CartelEnforcer.registered) { result = false; break; } ((Component)5__7).GetComponent().isKinematic = true; ((Component)5__7).GetComponent().HeadlightsOn = true; quest_CarMeetup.spawnedDecor.Add(((Component)5__7).gameObject); 5__8 = Object.Instantiate(5__4); 5__2.ServerManager.Spawn(5__8, (NetworkConnection)null, default(Scene)); <>2__current = CartelEnforcer.Wait01; <>1__state = 5; result = true; break; case 5: { <>1__state = -1; if (!CartelEnforcer.registered) { result = false; break; } ((Component)5__8).transform.parent = ((Component)Singleton.Instance).transform; ((Component)5__8).gameObject.SetActive(true); ((Component)5__8).transform.position = new Vector3(-14.93f, -5f, 168.7f); Rigidbody component = ((Component)5__8).GetComponent(); if ((Object)(object)component != (Object)null) { component.isKinematic = true; } quest_CarMeetup.spawnedDecor.Add(((Component)5__8).gameObject); <>7__wrap8 = quest_CarMeetup.pileBasePos.GetEnumerator(); <>1__state = -3; goto IL_071e; } case 6: { <>1__state = -3; if (!CartelEnforcer.registered) { result = false; <>m__Finally1(); break; } GameObject val = Object.Instantiate(quest_CarMeetup.brickBase, ((Component)5__8).transform); val.transform.position = new Vector3(5__10.x, 5__10.y + 0.06f * (float)5__11, 5__10.z); val.transform.rotation = Quaternion.Euler(0f, Mathf.Round(Random.Range(85f, 95f)), 0f); val.gameObject.SetActive(true); quest_CarMeetup.spawnedDecor.Add(val); 5__11++; goto IL_070b; } case 7: { <>1__state = -1; result = false; break; } IL_070b: if (5__11 < Random.Range(4, 9)) { <>2__current = CartelEnforcer.Wait01; <>1__state = 6; result = true; break; } goto IL_071e; IL_071e: if (<>7__wrap8.MoveNext()) { 5__10 = <>7__wrap8.Current; 5__11 = 0; goto IL_070b; } <>m__Finally1(); <>7__wrap8 = default(List.Enumerator); if (NetworkSingleton.Instance.GoonPool.unspawnedGoons.Count < 4) { foreach (CartelGoon item in (Il2CppArrayBase)(object)NetworkSingleton.Instance.GoonPool.goons) { if (NetworkSingleton.Instance.GoonPool.unspawnedGoons.Count < 4) { if (NetworkSingleton.Instance.GoonPool.spawnedGoons.Contains(item) && item.IsGoonSpawned && (((NPC)item).Health.IsDead || ((NPC)item).Health.IsKnockedOut)) { ((NPC)item).Health.Revive(); item.Despawn(); } continue; } break; } } <>8__1.goonHandler = NetworkSingleton.Instance.GoonPool.SpawnGoon(new Vector3(-16.11f, -3.64f, 169.57f)); ((Component)((NPC)<>8__1.goonHandler).Behaviour.ScheduleManager.ActionList[0]).gameObject.SetActive(false); ((NPC)<>8__1.goonHandler).Behaviour.ScheduleManager.DisableSchedule(); ((Component)<>8__1.goonHandler).transform.rotation = Quaternion.Euler(0f, 116f, 0f); ((NPC)<>8__1.goonHandler).Avatar.Animation.SetCrouched(true); quest_CarMeetup.spawnedGoons.Add("handler", <>8__1.goonHandler); val5 = NetworkSingleton.Instance.GoonPool.SpawnGoon(new Vector3(-32.68f, -2.54f, 168.73f)); ((Component)((NPC)val5).Behaviour.ScheduleManager.ActionList[0]).gameObject.SetActive(false); ((NPC)val5).Behaviour.ScheduleManager.DisableSchedule(); ((Component)val5).transform.rotation = Quaternion.Euler(0f, 226f, 0f); quest_CarMeetup.spawnedGoons.Add("guard", val5); val6 = NetworkSingleton.Instance.GoonPool.SpawnGoon(new Vector3(-16.2101f, -3.64f, 173.96f)); ((Component)((NPC)val6).Behaviour.ScheduleManager.ActionList[0]).gameObject.SetActive(false); ((NPC)val6).Behaviour.ScheduleManager.DisableSchedule(); ((Component)val6).transform.rotation = Quaternion.Euler(0f, 180f, 0f); quest_CarMeetup.spawnedGoons.Add("extra1", val6); val7 = NetworkSingleton.Instance.GoonPool.SpawnGoon(new Vector3(-29.09f, -2.64f, 158.73f)); ((Component)((NPC)val7).Behaviour.ScheduleManager.ActionList[0]).gameObject.SetActive(false); ((NPC)val7).Behaviour.ScheduleManager.DisableSchedule(); ((Component)val7).transform.rotation = Quaternion.Euler(0f, 0f, 0f); quest_CarMeetup.spawnedGoons.Add("extra2", val7); val5.AddGoonMate(val7); val5.AddGoonMate(val6); val5.AddGoonMate(<>8__1.goonHandler); val6.AddGoonMate(<>8__1.goonHandler); quest_CarMeetup.combatStartedAction = UnityAction.op_Implicit((Action)quest_CarMeetup.CombatStarted); quest_CarMeetup.goonDiedAction = UnityAction.op_Implicit((Action)quest_CarMeetup.OnCarMeetupGoonDie); foreach (KeyValuePair spawnedGoon in quest_CarMeetup.spawnedGoons) { if (((NPC)spawnedGoon.Value).Health.IsDead || ((NPC)spawnedGoon.Value).Health.IsKnockedOut) { ((NPC)spawnedGoon.Value).Health.Revive(); } float num2 = Mathf.Round(Random.Range(160f, 230f) / 10f) * 10f; ((NPC)spawnedGoon.Value).Health.MaxHealth = Mathf.Round(Mathf.Lerp(100f, num2, quest_CarMeetup.questDifficultyScalar - 1f)); ((NPC)spawnedGoon.Value).Health.Health = Mathf.Round(Mathf.Lerp(100f, num2, quest_CarMeetup.questDifficultyScalar - 1f)); ((NPC)spawnedGoon.Value).Movement.MoveSpeedMultiplier = Mathf.Lerp(Random.Range(1.1f, 1.3f), 1.5f, quest_CarMeetup.questDifficultyScalar - 1f); ((Behaviour)((NPC)spawnedGoon.Value).Behaviour.CombatBehaviour).onBegin.AddListener(quest_CarMeetup.combatStartedAction); ((NPC)spawnedGoon.Value).Health.onDieOrKnockedOut.AddListener(quest_CarMeetup.goonDiedAction); if (quest_CarMeetup.GiveUpRange == 0f) { quest_CarMeetup.GiveUpRange = ((NPC)spawnedGoon.Value).Behaviour.CombatBehaviour.GiveUpRange; quest_CarMeetup.GiveUpAfterSuccessfulHits = ((NPC)spawnedGoon.Value).Behaviour.CombatBehaviour.GiveUpAfterSuccessfulHits; quest_CarMeetup.DefaultSearchTime = ((NPC)spawnedGoon.Value).Behaviour.CombatBehaviour.DefaultSearchTime; } ((NPC)spawnedGoon.Value).Behaviour.CombatBehaviour.GiveUpRange = 120f; ((NPC)spawnedGoon.Value).Behaviour.CombatBehaviour.GiveUpAfterSuccessfulHits = 60; ((NPC)spawnedGoon.Value).Behaviour.CombatBehaviour.DefaultSearchTime = 300f; List spawnedGoonsGuids = quest_CarMeetup.spawnedGoonsGuids; Guid gUID = ((NPC)spawnedGoon.Value).GUID; spawnedGoonsGuids.Add(((object)(Guid)(ref gUID)).ToString()); } val8 = ((Il2CppObjectBase)Object.Instantiate(((Il2CppObjectBase)Resources.Load("Avatar/Equippables/M1911")).TryCast(), new Vector3(0f, -5f, 0f), Quaternion.identity, ((Component)quest_CarMeetup).transform).GetComponent()).TryCast(); if ((Object)(object)val8 != (Object)null) { ((NPC)val6).Behaviour.CombatBehaviour.DefaultWeapon = val8; ((NPC)val7).Behaviour.CombatBehaviour.DefaultWeapon = val8; } val9 = ((Il2CppObjectBase)Object.Instantiate(((Il2CppObjectBase)Resources.Load("Avatar/Equippables/PumpShotgun")).TryCast(), new Vector3(0f, -5f, 0f), Quaternion.identity, ((Component)quest_CarMeetup).transform).GetComponent()).TryCast(); if ((Object)(object)val9 != (Object)null) { ((NPC)val5).Behaviour.CombatBehaviour.DefaultWeapon = val9; } ((NPC)val5).Behaviour.CombatBehaviour.SetWeapon("Avatar/Equippables/PumpShotgun"); val10 = ((Il2CppObjectBase)Object.Instantiate(((Il2CppObjectBase)Resources.Load("Avatar/Equippables/Knife")).TryCast(), new Vector3(0f, -5f, 0f), Quaternion.identity, ((Component)quest_CarMeetup).transform).GetComponent()).TryCast(); if ((Object)(object)val10 != (Object)null) { ((NPC)<>8__1.goonHandler).Behaviour.CombatBehaviour.DefaultWeapon = val10; } quest_CarMeetup.combatEndCrouchAction = UnityAction.op_Implicit((Action)EndCrouchOnCombat); ((Behaviour)((NPC)<>8__1.goonHandler).Behaviour.CombatBehaviour).onBegin.AddListener(quest_CarMeetup.combatEndCrouchAction); <>2__current = null; <>1__state = 7; result = true; break; } } catch { //try-fault ((IDisposable)this).Dispose(); throw; } return result; void EndCrouchOnCombat() { ((NPC)((<>c__DisplayClass25_0)this).goonHandler).Avatar.Animation.SetCrouched(false); if ((Delegate)(object)((<>c__DisplayClass25_0)this).<>4__this.combatEndCrouchAction != (Delegate)null) { ((Behaviour)((NPC)((<>c__DisplayClass25_0)this).goonHandler).Behaviour.CombatBehaviour).onBegin.RemoveListener(((<>c__DisplayClass25_0)this).<>4__this.combatEndCrouchAction); ((<>c__DisplayClass25_0)this).<>4__this.combatEndCrouchAction = null; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; ((IDisposable)<>7__wrap8).Dispose(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__28 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Quest_CarMeetup <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__28(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; Quest_CarMeetup quest_CarMeetup = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = CartelEnforcer.Wait10; <>1__state = 1; return true; case 1: <>1__state = -1; Player.Local.CrimeData.SetPursuitLevel((EPursuitLevel)1); PoliceStation.PoliceStations[0].Dispatch(1, Player.Local, (EDispatchType)0, true); quest_CarMeetup.investigationActive = true; <>2__current = null; <>1__state = 2; return true; case 2: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private float questDifficultyScalar = 1f; private readonly List pileBasePos = new List { new Vector3(-14.6f, -4.77f, 168.2f), new Vector3(-14.6f, -4.77f, 168.6f), new Vector3(-14.4f, -4.77f, 168.2f), new Vector3(-14.4f, -4.77f, 168.6f), new Vector3(-14.8f, -4.77f, 168.7f), new Vector3(-15.3f, -4.77f, 168.6f) }; private GameObject brickBase; private List spawnedDecor = new List(); private Dictionary spawnedGoons = new Dictionary(); public List spawnedGoonsGuids = new List(); private StorageEntity rewardStorage; private bool combatBegun; private bool playerSightedActive; private bool investigationActive; private float GiveUpRange; private int GiveUpAfterSuccessfulHits; private float DefaultSearchTime; private UnityAction combatStartedAction; private UnityAction goonDiedAction; private UnityAction combatEndCrouchAction; public QuestEntry QuestEntry_TalkToJeremy; public QuestEntry QuestEntry_StopCarMeetup; public QuestEntry QuestEntry_EscapeNorthWaterfront; public Quest_CarMeetup(IntPtr ptr) : base(ptr) { }//IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) public Quest_CarMeetup() : base(ClassInjector.DerivedConstructorPointer()) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) ClassInjector.DerivedConstructorBody((Il2CppObjectBase)(object)this); } public override void Complete(bool network = true) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 try { if ((int)((Quest)this).State != 2) { if (InstanceFinder.IsServer && !Singleton.Instance.IsLoading) { NetworkSingleton.Instance.AddXP(((Quest)this).CompletionXP); } ((Quest)this).SetQuestState((EQuestState)2, false); NetworkSingleton.Instance.PlayCompleteQuestSound(); ((Quest)this).End(); } } catch (Exception) { throw; } } public override void Fail(bool network = true) { try { ((Quest)this).SetQuestState((EQuestState)3, false); ((Quest)this).End(); } catch (Exception) { throw; } } public override void End() { try { if ((Object)(object)((Quest)this).hudUI != (Object)null) { ((Quest)this).hudUI.Complete(); } TimeManager instance = NetworkSingleton.Instance; if ((Object)(object)instance == (Object)null) { return; } Action action = ((Quest)this).OnMinPass; instance.onHourPass -= Action.op_Implicit((Action)HourPass); instance.onMinutePass.Remove(Action.op_Implicit(action)); investigationActive = false; playerSightedActive = false; combatBegun = false; } catch (Exception) { throw; } ((Component)this).gameObject.SetActive(false); } public void SetupSelf() { //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Expected O, but got Unknown //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Expected O, but got Unknown //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Expected O, but got Unknown //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Expected O, but got Unknown //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Expected O, but got Unknown //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Expected O, but got Unknown //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Expected O, but got Unknown //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_0386: Unknown result type (might be due to invalid IL or missing references) //IL_0410: Unknown result type (might be due to invalid IL or missing references) float num = 0f; Enumerator enumerator = NetworkSingleton.Instance.Influence.regionInfluence.GetEnumerator(); while (enumerator.MoveNext()) { RegionInfluenceData current = enumerator.Current; num += current.Influence; } float num2 = num / (float)NetworkSingleton.Instance.Influence.regionInfluence.Count; questDifficultyScalar = 1f + num2; ((Object)this).name = "Quest_CarMeetup"; ((Quest)this).Expires = false; ((Quest)this).title = "Four Wheels"; ((Quest)this).CompletionXP = Mathf.RoundToInt(300f * questDifficultyScalar); ((Quest)this).Description = "Stop the Cartel from transporting Cocaine"; ((Quest)this).TrackOnBegin = true; ((Quest)this).autoInitialize = false; ((Quest)this).AutoCompleteOnAllEntriesComplete = false; ((Quest)this).onActiveState = new UnityEvent(); ((Quest)this).onComplete = new UnityEvent(); ((Quest)this).onInitialComplete = new UnityEvent(); ((Quest)this).onQuestBegin = new UnityEvent(); ((Quest)this).onQuestEnd = new UnityEvent(); ((Quest)this).onTrackChange = new UnityEvent(); ((Quest)this).SetGUID(Guid.NewGuid()); Transform questContainer = NetworkSingleton.Instance.QuestContainer; Transform val = ((questContainer != null) ? questContainer.GetChild(0) : null); if ((Object)(object)val != (Object)null) { ((Component)this).transform.SetParent(val); } ((Quest)this).IconPrefab = EndGameQuest.MakeIcon(((Component)this).transform); ((Quest)this).PoIPrefab = EndGameQuest.MakePOI(); GameObject val2 = new GameObject("QuestEntry_TalkToJeremy"); val2.transform.SetParent(((Component)this).transform); GameObject val3 = new GameObject("QuestEntry_StopCarMeetup"); val3.transform.SetParent(((Component)this).transform); GameObject val4 = new GameObject("QuestEntry_EscapeNorthWaterfront"); val4.transform.SetParent(((Component)this).transform); QuestEntry talkToJeremy = val2.AddComponent(); QuestEntry stopMeetup = val3.AddComponent(); QuestEntry escape = val4.AddComponent(); QuestEntry_TalkToJeremy = talkToJeremy; QuestEntry_StopCarMeetup = stopMeetup; QuestEntry_EscapeNorthWaterfront = escape; ((Quest)this).Entries = new List(); ((Quest)this).Entries.Add(talkToJeremy); ((Quest)this).Entries.Add(stopMeetup); ((Quest)this).Entries.Add(escape); talkToJeremy.SetEntryTitle("Ask Jeremy about the cars at their home after curfew"); talkToJeremy.ParentQuest = (Quest)(object)this; talkToJeremy.CompleteParentQuest = false; talkToJeremy.PoILocation = new GameObject("TalkToJeremyEntry_POI").transform; ((Component)talkToJeremy.PoILocation).transform.SetParent(((Component)talkToJeremy).transform); ((Component)talkToJeremy.PoILocation).transform.position = new Vector3(69f, 5.93f, -119.09f); talkToJeremy.SetState((EQuestState)1, true); UnityAction talkToJeremyAction = null; talkToJeremyAction = UnityAction.op_Implicit((Action)OnTalkToJeremyComplete); talkToJeremy.onComplete.AddListener(talkToJeremyAction); stopMeetup.SetEntryTitle("• Stop the Benzies from transporting cocaine\n• Avoid police attention"); stopMeetup.ParentQuest = (Quest)(object)this; stopMeetup.CompleteParentQuest = false; stopMeetup.PoILocation = new GameObject("StopCarMeetupEntry_POI").transform; ((Component)stopMeetup.PoILocation).transform.SetParent(((Component)stopMeetup).transform); ((Component)stopMeetup.PoILocation).transform.position = new Vector3(-32.68f, -2.54f, 168.73f); stopMeetup.SetState((EQuestState)0, false); UnityAction stopMeetupAction = null; stopMeetupAction = UnityAction.op_Implicit((Action)OnStopMeetupComplete); stopMeetup.onComplete.AddListener(stopMeetupAction); escape.SetEntryTitle("• Steal Cocaine from the SUV\n• Escape before police arrive"); escape.ParentQuest = (Quest)(object)this; escape.CompleteParentQuest = false; escape.AutoCreatePoI = false; escape.PoILocation = new GameObject("EscapeEntry_POI").transform; ((Component)escape.PoILocation).transform.SetParent(((Component)escape).transform); escape.SetState((EQuestState)0, false); TimeManager instance = NetworkSingleton.Instance; Action action = ((Quest)this).OnMinPass; instance.onHourPass += Action.op_Implicit((Action)HourPass); instance.onMinutePass += Action.op_Implicit(action); StartQuestDetail(); void OnStopMeetupComplete() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Invalid comparison between Unknown and I4 if ((!((Object)(object)stopMeetup != (Object)null) || (int)stopMeetup.State != 3) && !((Object)(object)escape == (Object)null)) { CartelEnforcer.coros.Add(MelonCoroutines.Start(StartLateInvestigation())); rewardStorage.AccessSettings = (EAccessSettings)2; escape.Begin(); if (escape.compassElement != null) { escape.compassElement.Visible = false; } if ((Delegate)(object)stopMeetupAction != (Delegate)null) { stopMeetup.onComplete.RemoveListener(stopMeetupAction); stopMeetupAction = null; } } } void OnTalkToJeremyComplete() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Invalid comparison between Unknown and I4 if ((!((Object)(object)talkToJeremy != (Object)null) || (int)talkToJeremy.State != 3) && !((Object)(object)stopMeetup == (Object)null)) { stopMeetup.Begin(); EndGameQuest.UpdateQuestMapLogo(stopMeetup); CartelEnforcer.coros.Add(MelonCoroutines.Start(SpawnCarMeetup())); if ((Delegate)(object)talkToJeremyAction != (Delegate)null) { talkToJeremy.onComplete.RemoveListener(talkToJeremyAction); talkToJeremyAction = null; } } } } private void StartQuestDetail() { ((Quest)this).SetupHUDUI(); if ((Object)(object)((Quest)this).hudUI != (Object)null) { if ((Object)(object)((Quest)this).hudUI.MainLabel != (Object)null) { ((TMP_Text)((Quest)this).hudUI.MainLabel).text = "Four Wheels"; } ((Component)((Quest)this).hudUI).gameObject.SetActive(true); } ((Quest)this).SetIsTracked(true); ((Quest)this).SetQuestState((EQuestState)1, true); EndGameQuest.UpdateQuestMapLogo(QuestEntry_TalkToJeremy); } private void CombatStarted() { //IL_00ad: Unknown result type (might be due to invalid IL or missing references) if (combatBegun) { return; } combatBegun = true; foreach (KeyValuePair spawnedGoon in spawnedGoons) { if ((Delegate)(object)combatStartedAction != (Delegate)null) { ((Behaviour)((NPC)spawnedGoon.Value).Behaviour.CombatBehaviour).onBegin.RemoveListener(combatStartedAction); } if ((Delegate)(object)goonDiedAction != (Delegate)null) { ((NPC)spawnedGoon.Value).Health.onDieOrKnockedOut.RemoveListener(goonDiedAction); } } float num = default(float); Player closestPlayer = Player.GetClosestPlayer(((NPC)spawnedGoons["guard"]).CenterPointTransform.position, ref num, (List)null); spawnedGoons["guard"].AttackEntity(((Component)closestPlayer).GetComponent(), true); spawnedGoons["extra1"].AttackEntity(((Component)closestPlayer).GetComponent(), true); combatStartedAction = null; goonDiedAction = null; } private void OnCarMeetupGoonDie() { //IL_00e2: Unknown result type (might be due to invalid IL or missing references) if (combatBegun) { return; } combatBegun = true; foreach (KeyValuePair spawnedGoon in spawnedGoons) { if ((Delegate)(object)combatStartedAction != (Delegate)null) { ((Behaviour)((NPC)spawnedGoon.Value).Behaviour.CombatBehaviour).onBegin.RemoveListener(combatStartedAction); } if ((Delegate)(object)goonDiedAction != (Delegate)null) { ((NPC)spawnedGoon.Value).Health.onDieOrKnockedOut.RemoveListener(goonDiedAction); } } CartelGoon val = null; if (spawnedGoons.Keys.Contains("guard")) { val = spawnedGoons["guard"]; } Player val2 = null; if ((Object)(object)val != (Object)null) { float num = default(float); val2 = Player.GetClosestPlayer(((NPC)spawnedGoons["guard"]).CenterPointTransform.position, ref num, (List)null); spawnedGoons["guard"].AttackEntity(((Component)val2).GetComponent(), true); } if ((Object)(object)val2 != (Object)null && spawnedGoons.Keys.Contains("extra1")) { spawnedGoons["extra1"].AttackEntity(((Component)val2).GetComponent(), true); } combatStartedAction = null; goonDiedAction = null; } [IteratorStateMachine(typeof(d__25))] private IEnumerator SpawnCarMeetup() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__25(0) { <>4__this = this }; } [IteratorStateMachine(typeof(d__26))] private IEnumerator PlayerSightedByGuard(Player p) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__26(0) { <>4__this = this, p = p }; } public override void OnMinPass() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Invalid comparison between Unknown and I4 //IL_0304: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Invalid comparison between Unknown and I4 //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0324: Unknown result type (might be due to invalid IL or missing references) //IL_036c: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Invalid comparison between Unknown and I4 //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: 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_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) if (!CartelEnforcer.registered || Singleton.Instance.IsSaving || EndGameQuest.carMeetupCompleted || (int)((Quest)this).State != 1 || !InstanceFinder.IsServer) { return; } if ((Object)(object)QuestEntry_StopCarMeetup != (Object)null && (int)QuestEntry_StopCarMeetup.State == 1) { if ((int)Player.Local.CrimeData.CurrentPursuitLevel != 0) { EndGameQuest.carMeetupCompleted = true; QuestEntry_StopCarMeetup.SetState((EQuestState)3, true); ((Quest)this).Fail(true); CartelEnforcer.coros.Add(MelonCoroutines.Start(CleanupCarMeetup())); return; } if (NetworkSingleton.Instance.CurrentTime < 2100 && NetworkSingleton.Instance.CurrentTime > 359) { EndGameQuest.carMeetupCompleted = true; QuestEntry_StopCarMeetup.SetState((EQuestState)3, true); ((Quest)this).Fail(true); CartelEnforcer.coros.Add(MelonCoroutines.Start(CleanupCarMeetup())); return; } if (combatBegun) { int num = 0; foreach (KeyValuePair spawnedGoon in spawnedGoons) { if (((NPC)spawnedGoon.Value).Health.IsDead || ((NPC)spawnedGoon.Value).Health.IsKnockedOut) { num++; } } if (num == spawnedGoons.Count) { QuestEntry_StopCarMeetup.Complete(); } return; } if (!playerSightedActive && spawnedGoons.Keys.Contains("guard")) { float num2 = default(float); Player closestPlayer = Player.GetClosestPlayer(((Component)QuestEntry_StopCarMeetup.PoI).transform.position, ref num2, (List)null); if (Vector3.Distance(closestPlayer.CenterPointTransform.position, ((Component)QuestEntry_StopCarMeetup.PoI).transform.position) < 30f) { if (closestPlayer.IsPointVisibleToPlayer(((NPC)spawnedGoons["guard"]).CenterPointTransform.position, 30f, 5f)) { if (Random.Range(0f, 1f) > 0.8f) { ((NPC)spawnedGoons["guard"]).Movement.FacePoint(closestPlayer.CenterPointTransform.position, 1f); } } else if (Random.Range(0f, 1f) > 0.9f && Vector3.Distance(closestPlayer.CenterPointTransform.position, ((Component)QuestEntry_StopCarMeetup.PoI).transform.position) < 15f) { ((NPC)spawnedGoons["guard"]).Movement.FacePoint(closestPlayer.CenterPointTransform.position, 1f); } if (((NPC)spawnedGoons["guard"]).Awareness.VisionCone.IsPlayerVisible(closestPlayer)) { playerSightedActive = true; CartelEnforcer.coros.Add(MelonCoroutines.Start(PlayerSightedByGuard(closestPlayer))); } } } } if ((Object)(object)QuestEntry_EscapeNorthWaterfront != (Object)null && (int)QuestEntry_EscapeNorthWaterfront.State == 1 && investigationActive) { if ((int)Player.Local.CrimeData.CurrentPursuitLevel == 0) { EndGameQuest.carMeetupCompleted = true; CartelEnforcer.coros.Add(MelonCoroutines.Start(EndGameQuest.QuestCarMeetupReward())); ((Quest)this).Complete(true); CartelEnforcer.coros.Add(MelonCoroutines.Start(CleanupCarMeetup())); } else if ((int)Player.Local.CrimeData.CurrentPursuitLevel != 0 && (int)Player.Local.CrimeData.CurrentPursuitLevel != 1) { EndGameQuest.carMeetupCompleted = true; ((Quest)this).Fail(true); CartelEnforcer.coros.Add(MelonCoroutines.Start(CleanupCarMeetup())); } } } [IteratorStateMachine(typeof(d__28))] private IEnumerator StartLateInvestigation() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__28(0) { <>4__this = this }; } private void OnDialogComplete() { QuestEntry_TalkToJeremy.Complete(); } private void HourPass() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Invalid comparison between Unknown and I4 //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Invalid comparison between Unknown and I4 if (CartelEnforcer.registered && !Singleton.Instance.IsSaving && !EndGameQuest.carMeetupCompleted && !((Object)(object)this == (Object)null) && (int)((Quest)this).State == 1 && InstanceFinder.IsServer && (Object)(object)QuestEntry_TalkToJeremy != (Object)null && (int)QuestEntry_TalkToJeremy.State == 1) { if (NetworkSingleton.Instance.CurrentTime >= 2059 && NetworkSingleton.Instance.CurrentTime <= 2102) { Action cb = OnDialogComplete; CartelEnforcer.coros.Add(MelonCoroutines.Start(EndGameQuest.GenJeremyOption(cb))); } else if (EndGameQuest.jeremyDiagIndex != -1 && NetworkSingleton.Instance.CurrentTime < 2059 && !EndGameQuest.jeremyDialogueActive) { DialogueController component = ((Component)EndGameQuest.jeremy.DialogueHandler).gameObject.GetComponent(); CartelEnforcer.coros.Add(MelonCoroutines.Start(EndGameQuest.DisposeJeremyChoice(component))); } } } [IteratorStateMachine(typeof(d__31))] private IEnumerator CleanupCarMeetup() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__31(0) { <>4__this = this }; } } [RegisterTypeInIl2Cpp] public class Quest_DefeatEnforcer : Quest { [CompilerGenerated] private sealed class <>c__DisplayClass17_0 { public Quest_DefeatEnforcer <>4__this; public NPC myNpc; } [CompilerGenerated] private sealed class d__17 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Quest_DefeatEnforcer <>4__this; private <>c__DisplayClass17_0 <>8__1; private NetworkManager 5__2; private NetworkObject 5__3; private PoliceOfficer 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__17(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; 5__2 = null; 5__3 = null; 5__4 = null; <>1__state = -2; } private bool MoveNext() { //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_06e2: Unknown result type (might be due to invalid IL or missing references) //IL_0771: Unknown result type (might be due to invalid IL or missing references) //IL_07b8: Unknown result type (might be due to invalid IL or missing references) //IL_07c4: Expected O, but got Unknown //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Expected O, but got Unknown //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_0320: 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_0332: Expected O, but got Unknown //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_039d: Unknown result type (might be due to invalid IL or missing references) //IL_03ea: Unknown result type (might be due to invalid IL or missing references) //IL_0425: Unknown result type (might be due to invalid IL or missing references) //IL_0460: Unknown result type (might be due to invalid IL or missing references) //IL_049b: Unknown result type (might be due to invalid IL or missing references) //IL_04d6: Unknown result type (might be due to invalid IL or missing references) //IL_0511: Unknown result type (might be due to invalid IL or missing references) //IL_0601: Unknown result type (might be due to invalid IL or missing references) //IL_0621: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; Quest_DefeatEnforcer quest_DefeatEnforcer = <>4__this; switch (num) { default: return false; case 0: { <>1__state = -1; <>8__1 = new <>c__DisplayClass17_0(); <>8__1.<>4__this = <>4__this; 5__2 = Object.FindObjectOfType(true); PrefabObjects spawnablePrefabs = 5__2.SpawnablePrefabs; NetworkObject val11 = null; for (int k = 0; k < spawnablePrefabs.GetObjectCount(); k++) { NetworkObject @object = spawnablePrefabs.GetObject(true, k); object obj; if (@object == null) { obj = null; } else { GameObject gameObject = ((Component)@object).gameObject; obj = ((gameObject != null) ? ((Object)gameObject).name : null); } if ((string?)obj == "PoliceNPC") { val11 = @object; break; } } if ((Object)(object)val11 == (Object)null) { return false; } 5__3 = Object.Instantiate(val11); <>8__1.myNpc = ((Component)5__3).gameObject.GetComponent(); <>8__1.myNpc.ID = "CartelEnforcer_Contact_NPC"; <>8__1.myNpc.FirstName = "Unknown"; <>8__1.myNpc.LastName = ""; ((Component)<>8__1.myNpc).transform.parent = NetworkSingleton.Instance.NPCContainer; NPCManager.NPCRegistry.Add(<>8__1.myNpc); <>2__current = CartelEnforcer.Wait05; <>1__state = 1; return true; } case 1: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } 5__2.ServerManager.Spawn(5__3, (NetworkConnection)null, default(Scene)); <>2__current = CartelEnforcer.Wait05; <>1__state = 2; return true; case 2: { <>1__state = -1; if (!CartelEnforcer.registered) { return false; } ((Component)5__3).gameObject.SetActive(true); <>8__1.myNpc.Health.Invincible = true; ((Behaviour)<>8__1.myNpc.Behaviour.CombatBehaviour).Disable_Networked((NetworkConnection)null); ((Behaviour)<>8__1.myNpc.Behaviour.CombatBehaviour).enabled = false; ((UnityEventBase)<>8__1.myNpc.intObj.onHovered).RemoveAllListeners(); <>8__1.myNpc.intObj.SetMessage("Talk"); <>8__1.myNpc.intObj.interactionState = (EInteractableState)0; 5__4 = ((Component)5__3).gameObject.GetComponent(); List bodyLayerSettings = ((NPC)5__4).Avatar.CurrentSettings.BodyLayerSettings; List val = new List(); Enumerator enumerator = bodyLayerSettings.GetEnumerator(); while (enumerator.MoveNext()) { LayerSetting current = enumerator.Current; val.Add(new LayerSetting { layerPath = current.layerPath, layerTint = current.layerTint }); } List accessorySettings = ((NPC)5__4).Avatar.CurrentSettings.AccessorySettings; List val2 = new List(); Enumerator enumerator2 = accessorySettings.GetEnumerator(); while (enumerator2.MoveNext()) { AccessorySetting current2 = enumerator2.Current; val2.Add(new AccessorySetting { path = current2.path, color = current2.color }); } for (int i = 0; i < val.Count; i++) { LayerSetting val3 = val[i]; val3.layerPath = ""; val3.layerTint = Color.white; val[i] = val3; } for (int j = 0; j < val2.Count; j++) { AccessorySetting val4 = val2[j]; val4.path = ""; val4.color = Color.white; val2[j] = val4; } LayerSetting val5 = val[2]; val5.layerPath = "Avatar/Layers/Bottom/Jeans"; val5.layerTint = new Color(0.306f, 0.416f, 0.569f); val[2] = val5; LayerSetting val6 = val[3]; val6.layerPath = "Avatar/Layers/Top/RolledButtonUp"; val6.layerTint = new Color(0.02f, 0.188f, 0.42f); val[3] = val6; AccessorySetting val7 = val2[0]; val7.path = "Avatar/Accessories/Head/Cap/Cap"; val7.color = new Color(0.149f, 0.149f, 0.149f); val2[0] = val7; AccessorySetting val8 = val2[1]; val8.path = "Avatar/Accessories/Chest/BulletproofVest/BulletproofVest"; val8.color = new Color(0.3962f, 0.3962f, 0.3962f); val2[1] = val8; AccessorySetting val9 = val2[2]; val9.path = "Avatar/Accessories/Feet/Sneakers/Sneakers"; val9.color = new Color(0.149f, 0.149f, 0.149f); val2[2] = val9; AccessorySetting val10 = val2[3]; val10.path = "Avatar/Accessories/Head/LegendSunglasses/LegendSunglasses"; val10.color = new Color(0.717f, 0.717f, 0.717f); val2[3] = val10; ((NPC)5__4).Avatar.CurrentSettings.BodyLayerSettings = val; ((NPC)5__4).Avatar.CurrentSettings.AccessorySettings = val2; ((NPC)5__4).Avatar.ApplyBodyLayerSettings(((NPC)5__4).Avatar.CurrentSettings, -1); ((NPC)5__4).Avatar.ApplyAccessorySettings(((NPC)5__4).Avatar.CurrentSettings); ((NPC)5__4).Avatar.Impostor.SetAvatarSettings(((NPC)5__4).Avatar.CurrentSettings); if (((NPC)5__4).Avatar.onSettingsLoaded != null) { ((NPC)5__4).Avatar.onSettingsLoaded.Invoke(); } ((Behaviour)((NPC)5__4).Movement.Agent).enabled = false; _ = quest_DefeatEnforcer.QuestEntry_WaitForContact.PoILocation.position; ((NPC)5__4).Movement.Warp(new Vector3(128.27f, 1.56f, 88.96f)); ((NPC)5__4).Behaviour.ScheduleManager.DisableSchedule(); ((Behaviour)((NPC)5__4).Awareness.VisionCone).enabled = false; 5__4.ChatterEnabled = false; ((Behaviour)((NPC)5__4).Movement.Agent).enabled = true; <>2__current = CartelEnforcer.Wait2; <>1__state = 3; return true; } case 3: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } ((Behaviour)((NPC)5__4).Movement.Agent).enabled = true; ((Component)((NPC)5__4).Avatar).gameObject.SetActive(true); ((NPC)5__4).Movement.Warp(new Vector3(128.27f, 1.56f, 88.96f)); ((NPC)5__4).Movement.WarpToNavMesh(); <>2__current = CartelEnforcer.Wait01; <>1__state = 4; return true; case 4: { <>1__state = -1; if (!CartelEnforcer.registered) { return false; } ((NPC)5__4).Movement.Stop(); ((Behaviour)((NPC)5__4).Movement.Agent).enabled = false; ((Behaviour)((NPC)5__4).Movement).enabled = false; ((Component)5__4).transform.rotation = Quaternion.Euler(0f, 160f, 0f); Action cb = OnDialogComplete; MelonCoroutines.Start(EndGameQuest.GenContactDialog(<>8__1.myNpc, cb)); EndGameQuest.fixer.MSGConversation.SendMessage(new Message("I set up a meeting for you. He is waiting near the church until 4am.", (ESenderType)1, true, -1), true, true); quest_DefeatEnforcer.contactNPC = <>8__1.myNpc; <>2__current = null; <>1__state = 5; return true; } case 5: <>1__state = -1; return false; } void OnDialogComplete() { ((<>c__DisplayClass17_0)this).<>4__this.QuestEntry_WaitForContact.Complete(); MelonCoroutines.Start(((<>c__DisplayClass17_0)this).<>4__this.RunContactDespawn(((<>c__DisplayClass17_0)this).myNpc)); MelonCoroutines.Start(((<>c__DisplayClass17_0)this).<>4__this.RunBossSpawn()); } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__20 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Quest_DefeatEnforcer <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__20(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; Quest_DefeatEnforcer quest_DefeatEnforcer = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; ((NPC)EndGameQuest.bossGoon).Behaviour.CombatBehaviour.SetWeapon("Avatar/Equippables/PumpShotgun"); <>2__current = CartelEnforcer.Wait05; <>1__state = 1; return true; case 1: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } if ((Object)(object)((NPC)EndGameQuest.bossGoon).Behaviour.CombatBehaviour.currentWeapon != (Object)null) { AvatarRangedWeapon val = null; try { val = ((Il2CppObjectBase)((NPC)EndGameQuest.bossGoon).Behaviour.CombatBehaviour.currentWeapon).Cast(); } catch (InvalidCastException ex) { MelonLogger.Warning("Failed to Cast Gun Weapon Instance: " + ex); } if ((Object)(object)val != (Object)null) { ((AvatarWeapon)val).MaxUseRange = Mathf.Round(25f * quest_DefeatEnforcer.questDifficultyScalar); ((AvatarWeapon)val).MinUseRange = 0.4f; val.HitChance_MaxRange = Mathf.Lerp(0.08f, 0.15f, quest_DefeatEnforcer.questDifficultyScalar - 1f); val.HitChance_MinRange = Mathf.Lerp(0.65f, 0.85f, quest_DefeatEnforcer.questDifficultyScalar - 1f); val.MaxFireRate = 2.6f - (quest_DefeatEnforcer.questDifficultyScalar - 1f); ((AvatarWeapon)val).CooldownDuration = 0.8f; val.Damage = 55f; val.ReloadTime = 2.3f; val.RaiseTime = 1.3f; val.ImpactForce = 28f; val.AimTime_Max = 1.2f; val.RepositionAfterHit = true; val.CanShootWhileMoving = true; if (CartelEnforcer.currentConfig.debugMode) { val.Damage = 0f; } } } if ((Object)(object)((NPC)EndGameQuest.bossGoon).Behaviour.CombatBehaviour.DefaultWeapon == (Object)null && (Object)(object)((NPC)EndGameQuest.bossGoon).Behaviour.CombatBehaviour.currentWeapon != (Object)null) { ((NPC)EndGameQuest.bossGoon).Behaviour.CombatBehaviour.DefaultWeapon = ((NPC)EndGameQuest.bossGoon).Behaviour.CombatBehaviour.currentWeapon; } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__19 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Quest_DefeatEnforcer <>4__this; private Vector3 5__2; private CartelGoon <_bossGoon>5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__19(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <_bossGoon>5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0375: Unknown result type (might be due to invalid IL or missing references) //IL_037a: Unknown result type (might be due to invalid IL or missing references) //IL_0387: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Unknown result type (might be due to invalid IL or missing references) //IL_0399: Expected O, but got Unknown //IL_03bf: 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_043e: Unknown result type (might be due to invalid IL or missing references) //IL_0477: Unknown result type (might be due to invalid IL or missing references) //IL_0535: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; Quest_DefeatEnforcer CS$<>8__locals0 = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; 5__2 = CS$<>8__locals0.QuestEntry_DefeatBoss.PoILocation.position; if (NetworkSingleton.Instance.GoonPool.unspawnedGoons.Count == 0) { foreach (CartelGoon item in (Il2CppArrayBase)(object)NetworkSingleton.Instance.GoonPool.goons) { if (NetworkSingleton.Instance.GoonPool.unspawnedGoons.Count >= 1) { break; } if (NetworkSingleton.Instance.GoonPool.spawnedGoons.Contains(item) && item.IsGoonSpawned && (((NPC)item).Health.IsDead || ((NPC)item).Health.IsKnockedOut)) { ((NPC)item).Health.Revive(); item.Despawn(); } } } <_bossGoon>5__3 = NetworkSingleton.Instance.GoonPool.SpawnGoon(5__2); ((Component)((NPC)<_bossGoon>5__3).Behaviour.ScheduleManager.ActionList[0]).gameObject.SetActive(false); ((NPC)<_bossGoon>5__3).Behaviour.ScheduleManager.DisableSchedule(); EndGameQuest.bossGoon = <_bossGoon>5__3; if (((NPC)<_bossGoon>5__3).Health.IsDead || ((NPC)<_bossGoon>5__3).Health.IsKnockedOut) { ((NPC)<_bossGoon>5__3).Health.Revive(); } <>2__current = CartelEnforcer.Wait05; <>1__state = 1; return true; case 1: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } if (((NPC)<_bossGoon>5__3).isInBuilding) { ((NPC)<_bossGoon>5__3).ExitBuilding(""); } if (!((Component)((NPC)<_bossGoon>5__3).Avatar).gameObject.activeSelf) { ((Component)((NPC)<_bossGoon>5__3).Avatar).gameObject.SetActive(true); } if ((Object)(object)((NPC)<_bossGoon>5__3).Movement.Agent != (Object)null && !((Behaviour)((NPC)<_bossGoon>5__3).Movement.Agent).enabled) { ((Behaviour)((NPC)<_bossGoon>5__3).Movement.Agent).enabled = true; } <>2__current = CartelEnforcer.Wait05; <>1__state = 2; return true; case 2: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } ((NPC)<_bossGoon>5__3).Health.MaxHealth = Mathf.Round(Mathf.Lerp(500f, 1000f, CS$<>8__locals0.questDifficultyScalar - 1f) / 10f) * 10f; ((NPC)<_bossGoon>5__3).Health.Health = Mathf.Round(Mathf.Lerp(500f, 1000f, CS$<>8__locals0.questDifficultyScalar - 1f) / 10f) * 10f; ((NPC)<_bossGoon>5__3).Movement.MoveSpeedMultiplier = 0.4f; ((NPC)<_bossGoon>5__3).SetScale(1.35f); <>2__current = CartelEnforcer.Wait05; <>1__state = 3; return true; case 3: { <>1__state = -1; if (!CartelEnforcer.registered) { return false; } CartelEnforcer.coros.Add(MelonCoroutines.Start(CS$<>8__locals0.EquipBossWeapon())); List accessorySettings = ((NPC)<_bossGoon>5__3).Avatar.CurrentSettings.AccessorySettings; List val = new List(); Enumerator enumerator2 = accessorySettings.GetEnumerator(); while (enumerator2.MoveNext()) { AccessorySetting current2 = enumerator2.Current; val.Add(new AccessorySetting { path = current2.path, color = current2.color }); } for (int i = 0; i < val.Count; i++) { AccessorySetting val2 = val[i]; val2.path = ""; val2.color = Color.white; val[i] = val2; } AccessorySetting val3 = val[0]; val3.path = "Avatar/Accessories/Chest/BulletproofVest/BulletproofVest"; val3.color = new Color(0.1f, 0.5f, 0.1f); val[0] = val3; AccessorySetting val4 = val[1]; val4.path = "Avatar/Accessories/Neck/GoldChain/GoldChain"; val4.color = new Color(0.96f, 0.79f, 0.23f); val[1] = val4; AccessorySetting val5 = val[2]; val5.path = "Avatar/Accessories/Hands/Polex/Polex"; val5.color = new Color(0.96f, 0.79f, 0.23f); val[2] = val5; ((NPC)<_bossGoon>5__3).Avatar.CurrentSettings.AccessorySettings = val; ((NPC)<_bossGoon>5__3).Avatar.ApplyAccessorySettings(((NPC)<_bossGoon>5__3).Avatar.CurrentSettings); ((NPC)<_bossGoon>5__3).Avatar.Impostor.SetAvatarSettings(((NPC)<_bossGoon>5__3).Avatar.CurrentSettings); if (((NPC)<_bossGoon>5__3).Avatar.onSettingsLoaded != null) { ((NPC)<_bossGoon>5__3).Avatar.onSettingsLoaded.Invoke(); } if (((NPC)<_bossGoon>5__3).isInBuilding) { ((NPC)<_bossGoon>5__3).ExitBuilding(""); } ((NPC)<_bossGoon>5__3).Movement.Warp(5__2); if (((NPC)<_bossGoon>5__3).Health.IsKnockedOut || ((NPC)<_bossGoon>5__3).Health.IsDead) { ((NPC)<_bossGoon>5__3).Health.Revive(); } <>2__current = CartelEnforcer.Wait05; <>1__state = 4; return true; } case 4: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } if (!((Component)((NPC)<_bossGoon>5__3).Avatar).gameObject.activeSelf) { ((Component)((NPC)<_bossGoon>5__3).Avatar).gameObject.SetActive(true); } if ((Object)(object)((NPC)<_bossGoon>5__3).Movement.Agent != (Object)null && !((Behaviour)((NPC)<_bossGoon>5__3).Movement.Agent).enabled) { ((Behaviour)((NPC)<_bossGoon>5__3).Movement.Agent).enabled = true; } if (CS$<>8__locals0.GiveUpRange == 0f) { CS$<>8__locals0.GiveUpRange = ((NPC)<_bossGoon>5__3).Behaviour.CombatBehaviour.GiveUpRange; CS$<>8__locals0.GiveUpAfterSuccessfulHits = ((NPC)<_bossGoon>5__3).Behaviour.CombatBehaviour.GiveUpAfterSuccessfulHits; CS$<>8__locals0.DefaultSearchTime = ((NPC)<_bossGoon>5__3).Behaviour.CombatBehaviour.DefaultSearchTime; } ((NPC)<_bossGoon>5__3).Behaviour.CombatBehaviour.GiveUpRange = 70f; ((NPC)<_bossGoon>5__3).Behaviour.CombatBehaviour.GiveUpAfterSuccessfulHits = 200; ((NPC)<_bossGoon>5__3).Behaviour.CombatBehaviour.DefaultSearchTime = 300f; CS$<>8__locals0.bossDiedAction = UnityAction.op_Implicit((Action)OnBossDied); ((NPC)EndGameQuest.bossGoon).Health.onDieOrKnockedOut.AddListener(CS$<>8__locals0.bossDiedAction); <>2__current = null; <>1__state = 5; return true; case 5: <>1__state = -1; return false; } void OnBossDied() { EndGameQuest.completed = true; MelonCoroutines.Start(EndGameQuest.QuestReward(EndGameQuest.bossGoon)); ((Quest)CS$<>8__locals0).Complete(true); if ((Delegate)(object)CS$<>8__locals0.bossDiedAction != (Delegate)null) { ((NPC)EndGameQuest.bossGoon).Health.onDieOrKnockedOut.RemoveListener(CS$<>8__locals0.bossDiedAction); CS$<>8__locals0.bossDiedAction = null; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__18 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public bool immediate; public NPC npc; public Quest_DefeatEnforcer <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__18(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; Quest_DefeatEnforcer quest_DefeatEnforcer = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; if (!immediate) { <>2__current = CartelEnforcer.Wait30; <>1__state = 1; return true; } goto IL_004c; case 1: <>1__state = -1; goto IL_004c; case 2: { <>1__state = -1; return false; } IL_004c: if (!CartelEnforcer.registered) { return false; } if ((Object)(object)npc == (Object)null && (Object)(object)quest_DefeatEnforcer.contactNPC != (Object)null) { npc = quest_DefeatEnforcer.contactNPC; } if ((Object)(object)npc != (Object)null) { NPCManager.NPCRegistry.Remove(npc); } if ((Object)(object)npc != (Object)null && (Object)(object)((Component)npc).gameObject != (Object)null) { Object.Destroy((Object)(object)((Component)npc).gameObject); } <>2__current = null; <>1__state = 2; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__21 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Quest_DefeatEnforcer <>4__this; private DrinkItem 5__2; private bool 5__3; private Player

5__4; private int 5__5; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__21(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null;

5__4 = null; <>1__state = -2; } private bool MoveNext() { //IL_0225: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; Quest_DefeatEnforcer quest_DefeatEnforcer = <>4__this; float num2 = default(float); switch (num) { default: return false; case 0: <>1__state = -1; 5__2 = ((Component)((Component)EndGameQuest.bossGoon).transform.Find("Aux/Drink")).GetComponent(); 5__3 = false; goto IL_04ba; case 1: <>1__state = -1; if (CartelEnforcer.registered && !((NPC)EndGameQuest.bossGoon).Health.IsDead && !((NPC)EndGameQuest.bossGoon).Health.IsKnockedOut) { if (!((Behaviour)((NPC)EndGameQuest.bossGoon).Behaviour.CombatBehaviour).isActiveAndEnabled) { ((Behaviour)((NPC)EndGameQuest.bossGoon).Behaviour.CombatBehaviour).Enable_Networked(); } if ((Object)(object)((NPC)EndGameQuest.bossGoon).Behaviour.CombatBehaviour.currentWeapon == (Object)null) { CartelEnforcer.coros.Add(MelonCoroutines.Start(quest_DefeatEnforcer.EquipBossWeapon())); } if (Random.Range(0f, 1f) > 0.95f && !5__3) { if ((Object)(object)5__2 != (Object)null) { ((NPC)EndGameQuest.bossGoon).Movement.PauseMovement(); 5__2.Begin(); 5__5 = 0; goto IL_01fc; } goto IL_021a; } goto IL_030e; } goto IL_04c4; case 2: { <>1__state = -1; if (!CartelEnforcer.registered || ((NPC)EndGameQuest.bossGoon).Health.IsDead || ((NPC)EndGameQuest.bossGoon).Health.IsKnockedOut) { return false; } NPCHealth health = ((NPC)EndGameQuest.bossGoon).Health; health.Health += (float)Mathf.RoundToInt(Mathf.Lerp(35f, 65f, quest_DefeatEnforcer.questDifficultyScalar - 1f)); 5__5++; goto IL_01fc; } case 3: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } ((NPC)EndGameQuest.bossGoon).Movement.ResumeMovement(); if (((NPC)EndGameQuest.bossGoon).Behaviour.CombatBehaviour.Target == null) { ((NPC)EndGameQuest.bossGoon).Behaviour.CombatBehaviour.SetTarget(((Component)

5__4).GetComponent().NetworkObject); } if (!((Behaviour)((NPC)EndGameQuest.bossGoon).Behaviour.CombatBehaviour).isActiveAndEnabled) { ((Behaviour)((NPC)EndGameQuest.bossGoon).Behaviour.CombatBehaviour).Enable_Networked(); } <>2__current = CartelEnforcer.Wait01; <>1__state = 4; return true; case 4: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } CartelEnforcer.coros.Add(MelonCoroutines.Start(quest_DefeatEnforcer.EquipBossWeapon()));

5__4 = null; goto IL_030e; case 5: <>1__state = -1; if (CartelEnforcer.registered && !((NPC)EndGameQuest.bossGoon).Health.IsDead && !((NPC)EndGameQuest.bossGoon).Health.IsKnockedOut) { if (Random.Range(0f, 1f) > 0.95f) { 5__5 = 0; goto IL_0401; } goto IL_04ba; } goto IL_04c4; case 6: <>1__state = -1; if (CartelEnforcer.registered && !((NPC)EndGameQuest.bossGoon).Health.IsDead && !((NPC)EndGameQuest.bossGoon).Health.IsKnockedOut) { ((NPC)EndGameQuest.bossGoon).Movement.MoveSpeedMultiplier = Mathf.Lerp(((NPC)EndGameQuest.bossGoon).Movement.MoveSpeedMultiplier, 2.6f, 0.33f); 5__5++; goto IL_0401; } goto IL_040d; case 7: <>1__state = -1; if (CartelEnforcer.registered && !((NPC)EndGameQuest.bossGoon).Health.IsDead && !((NPC)EndGameQuest.bossGoon).Health.IsKnockedOut) { ((NPC)EndGameQuest.bossGoon).Movement.MoveSpeedMultiplier = Mathf.Lerp(((NPC)EndGameQuest.bossGoon).Movement.MoveSpeedMultiplier, 0.4f, 0.33f); 5__5++; goto IL_049a; } goto IL_04a6; case 8: { <>1__state = -1; return false; } IL_01fc: if (5__5 < 3) { <>2__current = CartelEnforcer.Wait2; <>1__state = 2; return true; } 5__2.End(); 5__3 = true; goto IL_021a; IL_021a:

5__4 = Player.GetClosestPlayer(((Component)EndGameQuest.bossGoon).transform.position, ref num2, (List)null); <>2__current = CartelEnforcer.Wait01; <>1__state = 3; return true; IL_04c4: <>2__current = null; <>1__state = 8; return true; IL_030e: <>2__current = CartelEnforcer.Wait05; <>1__state = 5; return true; IL_04ba: if (CartelEnforcer.registered) { <>2__current = CartelEnforcer.Wait2; <>1__state = 1; return true; } goto IL_04c4; IL_0401: if (5__5 < 3) { <>2__current = CartelEnforcer.Wait05; <>1__state = 6; return true; } goto IL_040d; IL_040d: 5__5 = 0; goto IL_049a; IL_049a: if (5__5 < 3) { <>2__current = CartelEnforcer.Wait05; <>1__state = 7; return true; } goto IL_04a6; IL_04a6: ((NPC)EndGameQuest.bossGoon).Movement.MoveSpeedMultiplier = 0.4f; goto IL_04ba; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private bool contactMade; private bool bossCombatBegun; private bool rageStageStarted; private int fightElapsed; private float questDifficultyScalar; private NPC contactNPC; private float GiveUpRange; private int GiveUpAfterSuccessfulHits; private float DefaultSearchTime; private UnityAction bossDiedAction; public QuestEntry QuestEntry_Investigate; public QuestEntry QuestEntry_WaitForContact; public QuestEntry QuestEntry_DefeatBoss; public Quest_DefeatEnforcer(IntPtr ptr) : base(ptr) { } public Quest_DefeatEnforcer() : base(ClassInjector.DerivedConstructorPointer()) { ClassInjector.DerivedConstructorBody((Il2CppObjectBase)(object)this); } public override void Complete(bool network = true) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 try { if ((int)((Quest)this).State != 2) { if (InstanceFinder.IsServer && !Singleton.Instance.IsLoading) { NetworkSingleton.Instance.AddXP(((Quest)this).CompletionXP); } ((Quest)this).SetQuestState((EQuestState)2, false); NetworkSingleton.Instance.PlayCompleteQuestSound(); ((Quest)this).End(); } } catch (Exception) { throw; } } public override void Fail(bool network = true) { try { ((Quest)this).SetQuestState((EQuestState)3, false); ((Quest)this).End(); } catch (Exception) { throw; } } public override void End() { try { if ((Object)(object)((Quest)this).hudUI != (Object)null) { ((Quest)this).hudUI.Complete(); } TimeManager instance = NetworkSingleton.Instance; if ((Object)(object)instance == (Object)null) { return; } Action action = ((Quest)this).OnMinPass; instance.onHourPass -= Action.op_Implicit((Action)HourPass); instance.onMinutePass.Remove(Action.op_Implicit(action)); } catch (Exception) { throw; } ((Component)this).gameObject.SetActive(false); } public void SetupSelf() { //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Expected O, but got Unknown //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Expected O, but got Unknown //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Expected O, but got Unknown //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Expected O, but got Unknown //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Expected O, but got Unknown //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Expected O, but got Unknown //IL_0265: 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_0362: Unknown result type (might be due to invalid IL or missing references) //IL_03e0: Unknown result type (might be due to invalid IL or missing references) //IL_042e: Unknown result type (might be due to invalid IL or missing references) float num = 0f; Enumerator enumerator = NetworkSingleton.Instance.Influence.regionInfluence.GetEnumerator(); while (enumerator.MoveNext()) { RegionInfluenceData current = enumerator.Current; num += current.Influence; } float num2 = num / (float)NetworkSingleton.Instance.Influence.regionInfluence.Count; questDifficultyScalar = 1f + num2; ((Object)this).name = "Quest_DefeatEnforcer"; ((Quest)this).Expires = false; ((Quest)this).title = "Unexpected Alliances"; ((Quest)this).CompletionXP = Mathf.RoundToInt(850f * questDifficultyScalar); ((Quest)this).Description = "Investigate and intercept Cartel Activity"; ((Quest)this).TrackOnBegin = true; ((Quest)this).autoInitialize = false; ((Quest)this).AutoCompleteOnAllEntriesComplete = false; ((Quest)this).onActiveState = new UnityEvent(); ((Quest)this).onComplete = new UnityEvent(); ((Quest)this).onInitialComplete = new UnityEvent(); ((Quest)this).onQuestBegin = new UnityEvent(); ((Quest)this).onQuestEnd = new UnityEvent(); ((Quest)this).onTrackChange = new UnityEvent(); ((Quest)this).SetGUID(Guid.NewGuid()); Transform questContainer = NetworkSingleton.Instance.QuestContainer; Transform val = ((questContainer != null) ? questContainer.GetChild(0) : null); if ((Object)(object)val != (Object)null) { ((Component)this).transform.SetParent(val); } ((Quest)this).IconPrefab = EndGameQuest.MakeIcon(((Component)this).transform); ((Quest)this).PoIPrefab = EndGameQuest.MakePOI(); GameObject val2 = new GameObject("QuestEntry_Investigate"); val2.transform.SetParent(((Component)this).transform); GameObject val3 = new GameObject("QuestEntry_WaitForContact"); val3.transform.SetParent(((Component)this).transform); GameObject val4 = new GameObject("QuestEntry_DefeatEnforcer"); val4.transform.SetParent(((Component)this).transform); QuestEntry investigate = val2.AddComponent(); QuestEntry contact = val3.AddComponent(); QuestEntry defeat = val4.AddComponent(); QuestEntry_Investigate = investigate; QuestEntry_WaitForContact = contact; QuestEntry_DefeatBoss = defeat; ((Quest)this).Entries = new List(); ((Quest)this).Entries.Add(investigate); ((Quest)this).Entries.Add(contact); ((Quest)this).Entries.Add(defeat); investigate.SetEntryTitle("• Intercept Cartel Dead Drops (0/2)\nOR\n• Defeat Cartel Gatherings (0/1)"); investigate.ParentQuest = (Quest)(object)this; investigate.CompleteParentQuest = false; investigate.PoILocation = new GameObject("InvestigateEntry_POI").transform; ((Component)investigate.PoILocation).transform.SetParent(((Component)investigate).transform); investigate.AutoCreatePoI = false; investigate.SetState((EQuestState)1, true); UnityAction investigateAction = null; investigateAction = UnityAction.op_Implicit((Action)OnInvestigateComplete); investigate.onComplete.AddListener(investigateAction); contact.SetEntryTitle("Wait for Manny to contact you"); contact.ParentQuest = (Quest)(object)this; contact.CompleteParentQuest = false; contact.PoILocation = new GameObject("ContactEntry_POI").transform; ((Component)contact.PoILocation).transform.SetParent(((Component)contact).transform); ((Component)contact.PoILocation).transform.position = new Vector3(128.27f, 1.56f, 88.96f); contact.SetState((EQuestState)0, false); UnityAction contactAction = null; contactAction = UnityAction.op_Implicit((Action)OnContactComplete); contact.onComplete.AddListener(contactAction); defeat.SetEntryTitle("Defeat the Cartel Brute"); defeat.ParentQuest = (Quest)(object)this; defeat.CompleteParentQuest = false; defeat.PoILocation = new GameObject("DefeatEntry_POI").transform; ((Component)defeat.PoILocation).transform.SetParent(((Component)defeat).transform); ((Component)defeat.PoILocation).transform.position = new Vector3(156.38f, 6.7f, 123.95f); defeat.SetState((EQuestState)0, false); TimeManager instance = NetworkSingleton.Instance; Action action = ((Quest)this).OnMinPass; instance.onHourPass += Action.op_Implicit((Action)HourPass); instance.onMinutePass += Action.op_Implicit(action); StartQuestDetail(); void OnContactComplete() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Invalid comparison between Unknown and I4 if ((!((Object)(object)contact != (Object)null) || (int)contact.State != 3) && !((Object)(object)defeat == (Object)null)) { defeat.Begin(); EndGameQuest.UpdateQuestMapLogo(defeat); if ((Delegate)(object)contactAction != (Delegate)null) { contact.onComplete.RemoveListener(contactAction); contactAction = null; } } } void OnInvestigateComplete() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Invalid comparison between Unknown and I4 if ((!((Object)(object)investigate != (Object)null) || (int)investigate.State != 3) && !((Object)(object)contact == (Object)null)) { contact.Begin(); EndGameQuest.UpdateQuestMapLogo(contact); if ((Object)(object)contact.PoI != (Object)null && (Object)(object)contact.PoI.UI != (Object)null) { ((Component)contact.PoI.UI).gameObject.SetActive(false); } if (contact.compassElement != null) { contact.compassElement.Visible = false; } if ((Delegate)(object)investigateAction != (Delegate)null) { investigate.onComplete.RemoveListener(investigateAction); investigateAction = null; } } } } private void StartQuestDetail() { ((Quest)this).SetupHUDUI(); if ((Object)(object)((Quest)this).hudUI != (Object)null) { if ((Object)(object)((Quest)this).hudUI.MainLabel != (Object)null) { ((TMP_Text)((Quest)this).hudUI.MainLabel).text = "Unexpected Alliances"; } ((Component)((Quest)this).hudUI).gameObject.SetActive(true); } ((Quest)this).SetIsTracked(true); ((Quest)this).SetQuestState((EQuestState)1, true); if ((Object)(object)QuestEntry_Investigate != (Object)null) { if (QuestEntry_Investigate.compassElement != null) { QuestEntry_Investigate.compassElement.Visible = false; return; } QuestEntry_Investigate.CreateCompassElement(); QuestEntry_Investigate.compassElement.Visible = false; } } [IteratorStateMachine(typeof(d__17))] private IEnumerator ContactSpawn() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__17(0) { <>4__this = this }; } [IteratorStateMachine(typeof(d__18))] public IEnumerator RunContactDespawn(NPC npc = null, bool immediate = false) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__18(0) { <>4__this = this, npc = npc, immediate = immediate }; } [IteratorStateMachine(typeof(d__19))] private IEnumerator RunBossSpawn() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__19(0) { <>4__this = this }; } [IteratorStateMachine(typeof(d__20))] private IEnumerator EquipBossWeapon() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__20(0) { <>4__this = this }; } [IteratorStateMachine(typeof(d__21))] private IEnumerator RunRageStage() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__21(0) { <>4__this = this }; } public override void OnMinPass() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Invalid comparison between Unknown and I4 //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Invalid comparison between Unknown and I4 //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_0325: Unknown result type (might be due to invalid IL or missing references) if (!CartelEnforcer.registered || Singleton.Instance.IsSaving || EndGameQuest.completed || (int)((Quest)this).State != 1 || !InstanceFinder.IsServer) { return; } if ((Object)(object)QuestEntry_Investigate != (Object)null && (int)QuestEntry_Investigate.State == 1 && !EndGameQuest.completed) { if ((Object)(object)QuestEntry_Investigate != (Object)null && (Object)(object)QuestEntry_Investigate.entryUI != (Object)null && ((Quest)this).hudUIExists) { QuestEntry_Investigate.SetEntryTitle($"• Intercept Cartel Dead Drops ({EndGameQuest.StageDeadDropsObserved}/2)\nOR\n• Defeat Cartel Gatherings ({EndGameQuest.StageGatheringsDefeated}/1)"); } if (EndGameQuest.StageDeadDropsObserved >= 2 || EndGameQuest.StageGatheringsDefeated >= 1) { QuestEntry_Investigate.Complete(); } } else { if (!((Object)(object)QuestEntry_DefeatBoss != (Object)null) || (int)QuestEntry_DefeatBoss.State != 1 || EndGameQuest.completed) { return; } if (NetworkSingleton.Instance.CurrentTime >= 659 && NetworkSingleton.Instance.CurrentTime <= 800) { EndGameQuest.completed = true; QuestEntry_DefeatBoss.SetState((EQuestState)3, true); EndGameQuest.bossGoon.Despawn(); ResetGoonBoss(); ((Quest)this).Fail(true); } else { if (!((Object)(object)EndGameQuest.bossGoon != (Object)null) || EndGameQuest.completed) { return; } QuestEntry_DefeatBoss.SetEntryTitle($"Defeat the Cartel Brute \nHP:{Mathf.RoundToInt(((NPC)EndGameQuest.bossGoon).Health.Health)}"); float num = default(float); Player closestPlayer = Player.GetClosestPlayer(((Component)EndGameQuest.bossGoon).transform.position, ref num, (List)null); if (num < 16f && !bossCombatBegun) { bossCombatBegun = true; ((NPC)EndGameQuest.bossGoon).Behaviour.CombatBehaviour.SetTarget(((Component)closestPlayer).GetComponent().NetworkObject); ((Behaviour)((NPC)EndGameQuest.bossGoon).Behaviour.CombatBehaviour).Enable_Networked(); } if (!bossCombatBegun) { return; } fightElapsed++; if (!rageStageStarted) { if (!((Behaviour)((NPC)EndGameQuest.bossGoon).Behaviour.CombatBehaviour).isActiveAndEnabled) { ((Behaviour)((NPC)EndGameQuest.bossGoon).Behaviour.CombatBehaviour).Enable_Networked(); } if ((Object)(object)((NPC)EndGameQuest.bossGoon).Behaviour.CombatBehaviour.currentWeapon == (Object)null || ((NPC)EndGameQuest.bossGoon).Behaviour.CombatBehaviour.IsCurrentWeaponMelee()) { CartelEnforcer.coros.Add(MelonCoroutines.Start(EquipBossWeapon())); } if (((NPC)EndGameQuest.bossGoon).Health.Health < 230f || fightElapsed > 40) { rageStageStarted = true; CartelEnforcer.coros.Add(MelonCoroutines.Start(RunRageStage())); } } _ = rageStageStarted; if (num > 70f || Vector3.Distance(((NPC)EndGameQuest.bossGoon).CenterPoint, QuestEntry_DefeatBoss.PoILocation.position) > 70f || fightElapsed > 300) { EndGameQuest.completed = true; QuestEntry_DefeatBoss.SetState((EQuestState)3, true); EndGameQuest.bossGoon.Despawn(); ResetGoonBoss(); ((Quest)this).Fail(true); } } } } private void HourPass() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Invalid comparison between Unknown and I4 //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Invalid comparison between Unknown and I4 if (!CartelEnforcer.registered || Singleton.Instance.IsSaving || EndGameQuest.completed || (int)((Quest)this).State != 1 || !InstanceFinder.IsServer || (int)QuestEntry_Investigate.State == 1 || (int)QuestEntry_WaitForContact.State != 1) { return; } if (!contactMade) { if (NetworkSingleton.Instance.CurrentTime < 0 || NetworkSingleton.Instance.CurrentTime > 100) { return; } contactMade = true; try { if ((Object)(object)QuestEntry_WaitForContact.PoI != (Object)null && (Object)(object)QuestEntry_WaitForContact.PoI.UI != (Object)null) { ((Component)QuestEntry_WaitForContact.PoI.UI).gameObject.SetActive(true); } if (QuestEntry_WaitForContact.compassElement != null) { QuestEntry_WaitForContact.compassElement.Visible = true; } QuestEntry_WaitForContact.SetEntryTitle("Read Manny's text message."); } catch (NullReferenceException ex) { MelonLogger.Warning("Quest Entry encountered an error: " + ex); } CartelEnforcer.coros.Add(MelonCoroutines.Start(ContactSpawn())); } else if (NetworkSingleton.Instance.CurrentTime >= 359 && NetworkSingleton.Instance.CurrentTime <= 402 && !EndGameQuest.inContactDialogue && contactMade) { EndGameQuest.completed = true; QuestEntry_WaitForContact.SetState((EQuestState)3, true); QuestEntry_DefeatBoss.SetState((EQuestState)3, true); MelonCoroutines.Start(RunContactDespawn(contactNPC, immediate: true)); ((Quest)this).Fail(true); } else { _ = contactMade; } } private void ResetGoonBoss() { //IL_00ab: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)EndGameQuest.bossGoon != (Object)null) { if (((Behaviour)((NPC)EndGameQuest.bossGoon).Behaviour.CombatBehaviour).Active) { ((Behaviour)((NPC)EndGameQuest.bossGoon).Behaviour.CombatBehaviour).Disable_Networked((NetworkConnection)null); } if ((Delegate)(object)bossDiedAction != (Delegate)null) { ((NPC)EndGameQuest.bossGoon).Health.onDieOrKnockedOut.RemoveListener(bossDiedAction); bossDiedAction = null; } ((NPC)EndGameQuest.bossGoon).Health.MaxHealth = 100f; ((NPC)EndGameQuest.bossGoon).Movement.MoveSpeedMultiplier = 0.8f; ((Component)EndGameQuest.bossGoon).transform.localScale = new Vector3(1f, 1f, 1f); ((NPC)EndGameQuest.bossGoon).Behaviour.ScheduleManager.EnableSchedule(); ((Component)((NPC)EndGameQuest.bossGoon).Behaviour.ScheduleManager.ActionList[0]).gameObject.SetActive(true); ((NPC)EndGameQuest.bossGoon).Behaviour.CombatBehaviour.GiveUpRange = GiveUpRange; ((NPC)EndGameQuest.bossGoon).Behaviour.CombatBehaviour.GiveUpAfterSuccessfulHits = GiveUpAfterSuccessfulHits; ((NPC)EndGameQuest.bossGoon).Behaviour.CombatBehaviour.DefaultSearchTime = DefaultSearchTime; } } } [HarmonyPatch(typeof(NPC), "ProcessImpactForce")] public static class NPC_ProcessImpactForce_Patch { [HarmonyPrefix] public static bool Prefix(NPC __instance, Vector3 forcePoint, Vector3 forceDirection, ref float force) { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)EndGameQuest.activeQuest == (Object)null && (Object)(object)EndGameQuest.activeManorQuest == (Object)null && (Object)(object)EndGameQuest.activeCarMeetupQuest == (Object)null) { return true; } Guid gUID; if ((Object)(object)EndGameQuest.activeQuest != (Object)null && ((Component)EndGameQuest.activeQuest).gameObject.activeSelf) { if ((Object)(object)EndGameQuest.bossGoon != (Object)null && ((NPC)EndGameQuest.bossGoon).GUID == __instance.GUID) { force = 10f; } } else if ((Object)(object)EndGameQuest.activeManorQuest != (Object)null && ((Component)EndGameQuest.activeManorQuest).gameObject.activeSelf) { if (EndGameQuest.manorGoonGuids.Count > 0) { List manorGoonGuids = EndGameQuest.manorGoonGuids; gUID = __instance.GUID; if (manorGoonGuids.Contains(((object)(Guid)(ref gUID)).ToString())) { force = 10f; } } } else if ((Object)(object)EndGameQuest.activeCarMeetupQuest != (Object)null && ((Component)EndGameQuest.activeCarMeetupQuest).gameObject.activeSelf && EndGameQuest.activeCarMeetupQuest.spawnedGoonsGuids.Count > 0) { List spawnedGoonsGuids = EndGameQuest.activeCarMeetupQuest.spawnedGoonsGuids; gUID = __instance.GUID; if (spawnedGoonsGuids.Contains(((object)(Guid)(ref gUID)).ToString())) { force = 10f; } } return true; } } [HarmonyPatch(typeof(CallPoliceBehaviour), "IsTargetValid")] public static class Behaviour_IsTargetValid_Patch { [HarmonyPrefix] public static bool Prefix(CallPoliceBehaviour __instance) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Invalid comparison between Unknown and I4 if ((Object)(object)EndGameQuest.activeCarMeetupQuest != (Object)null) { QuestEntry questEntry_StopCarMeetup = EndGameQuest.activeCarMeetupQuest.QuestEntry_StopCarMeetup; if (questEntry_StopCarMeetup != null && (int)questEntry_StopCarMeetup.State == 1) { __instance.Target = null; } } return true; } } public static class EndGameQuest { [CompilerGenerated] private sealed class <>c__DisplayClass12_0 { public DialogueController controller; public Action cb; } [CompilerGenerated] private sealed class <>c__DisplayClass27_0 { public DialogueController controller; } [CompilerGenerated] private sealed class <>c__DisplayClass33_0 { public DialogueController controller; public Action cb; } [CompilerGenerated] private sealed class <>c__DisplayClass49_0 { public DialogueController controller; } [CompilerGenerated] private sealed class <>c__DisplayClass55_0 { public DialogueController controller; public Action cb; } [CompilerGenerated] private sealed class <>c__DisplayClass70_0 { public QuestEntry entry; } [CompilerGenerated] private sealed class <>c__DisplayClass9_0 { public DialogueController controller; } [CompilerGenerated] private sealed class d__68 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public SupplyLocation location; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__68(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (location.Type == ESupplyType.Barrel) { foreach (GameObject barrelObject in location.BarrelObjects) { InteractableObject component2 = barrelObject.GetComponent(); if ((Object)(object)component2 != (Object)null) { Object.Destroy((Object)(object)component2); } } } <>2__current = CartelEnforcer.Wait30; <>1__state = 1; return true; case 1: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } if (location.Type == ESupplyType.Van) { if ((Object)(object)alliedVanObject != (Object)null) { Object.Destroy((Object)(object)((Component)alliedVanObject).gameObject); } alliedVanObject = null; } if ((Object)(object)alliedGuard != (Object)null) { if (((NPC)alliedGuard).Health.IsDead) { ((NPC)alliedGuard).Health.Revive(); } ((Behaviour)((NPC)alliedGuard).Behaviour.CombatBehaviour).Disable_Networked((NetworkConnection)null); ((NPC)alliedGuard).Behaviour.ScheduleManager.EnableSchedule(); ((Component)((NPC)alliedGuard).Behaviour.ScheduleManager.ActionList[0]).gameObject.SetActive(true); ((NPC)alliedGuard).Movement.SpeedController.RemoveSpeedControl("combat"); alliedGuard.Despawn(); alliedGuard = null; } if (location.ID == "SUPPLY_MANOR") { for (int i = 0; i < Property.Properties.Count; i++) { if (!(Property.Properties[i].propertyCode == "manor")) { continue; } ManorGate componentInChildren = ((Component)Property.Properties[i]).gameObject.GetComponentInChildren(); if ((Object)(object)componentInChildren == (Object)null) { Transform val = ((Component)Property.Properties[i]).transform.Find("Manor Gate"); if ((Object)(object)val != (Object)null) { ManorGate component = ((Component)val).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { component.SetEnterable(false); } } } else { componentInChildren.SetEnterable(false); } } } if (!Singleton.Instance.IsSaving && !CartelEnforcer.isSaving) { AlliedExtension.alliedQuests.hoursUntilNextSupplies = AlliedExtension.alliedConfig.SupplyQuestCooldownHours; goto IL_02b1; } <>2__current = (object)new WaitUntil((Func)(object)Object.op_Implicit(!Singleton.Instance.IsSaving && !CartelEnforcer.isSaving)); <>1__state = 2; return true; case 2: <>1__state = -1; AlliedExtension.alliedQuests.hoursUntilNextSupplies = AlliedExtension.alliedConfig.SupplyQuestCooldownHours; goto IL_02b1; case 3: { <>1__state = -1; return false; } IL_02b1: alliedSuppliesActive = false; <>2__current = null; <>1__state = 3; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__15 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DialogueController controller; public Action cb; private float 5__2; private WaitForSeconds 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__15(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; inContactDialogue = true; 5__2 = Mathf.Lerp(10f, 5f, CartelEnforcer.currentConfig.endGameQuestMonologueSpeed); 5__3 = new WaitForSeconds(5__2); _ = dialogOptions[Random.Range(0, dialogOptions.Count)]; controller.npc.PlayVO((EVOLineType)5, false); controller.handler.WorldspaceRend.ShowText("It doesn't matter who I am. We have a bigger issue at our hands.", 5__2); <>2__current = 5__3; <>1__state = 1; return true; case 1: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } controller.npc.PlayVO((EVOLineType)14, false); controller.handler.WorldspaceRend.ShowText("The cartel has been running Hyland Point for too long.", 5__2); <>2__current = 5__3; <>1__state = 2; return true; case 2: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } controller.handler.WorldspaceRend.ShowText("We have intel that Thomas' high ranking soldier is nearby that house up the dirt road.", 5__2); <>2__current = 5__3; <>1__state = 3; return true; case 3: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } controller.handler.WorldspaceRend.ShowText("This is not your basic goon, they are a Brute. One of the best soldiers he has.", 5__2); <>2__current = 5__3; <>1__state = 4; return true; case 4: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } controller.handler.WorldspaceRend.ShowText("Go and take them down. I'll make sure nobody comes snooping around.", 5__2); <>2__current = 5__3; <>1__state = 5; return true; case 5: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } if (cb != null) { cb(); } inContactDialogue = false; <>2__current = null; <>1__state = 6; return true; case 6: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__10 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DialogueController controller; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__10(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = CartelEnforcer.Wait05; <>1__state = 1; return true; case 1: { <>1__state = -1; if (!CartelEnforcer.registered) { return false; } List choices = controller.Choices; choices.RemoveAt(fixerDiagIndex); controller.Choices = choices; <>2__current = null; <>1__state = 2; return true; } case 2: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__13 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DialogueController controller; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__13(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = CartelEnforcer.Wait05; <>1__state = 1; return true; case 1: { <>1__state = -1; if (!CartelEnforcer.registered) { return false; } List choices = controller.Choices; choices.RemoveAt(0); controller.Choices = choices; <>2__current = null; <>1__state = 2; return true; } case 2: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__51 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DialogueController controller; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__51(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = CartelEnforcer.Wait05; <>1__state = 1; return true; case 1: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } if (frankDiagIndex != -1) { List choices = controller.Choices; choices.RemoveAt(frankDiagIndex); controller.Choices = choices; frankDiagIndex = -1; } <>2__current = null; <>1__state = 2; return true; case 2: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__57 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DialogueController controller; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__57(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = CartelEnforcer.Wait05; <>1__state = 1; return true; case 1: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } if (jeremyDiagIndex != -1) { List choices = controller.Choices; choices.RemoveAt(jeremyDiagIndex); controller.Choices = choices; jeremyDiagIndex = -1; } <>2__current = null; <>1__state = 2; return true; case 2: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__29 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DialogueController controller; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__29(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = CartelEnforcer.Wait05; <>1__state = 1; return true; case 1: { <>1__state = -1; if (!CartelEnforcer.registered) { return false; } NPCEvent_LocationBasedAction val = ((Il2CppObjectBase)ray.Behaviour.ScheduleManager.ActiveAction).TryCast(); if ((Object)(object)val != (Object)null) { ((NPCEvent)val).EndTime = 2200; ((NPCEvent)val).Duration = 240; ((NPCAction)val).Start(); } ray.Behaviour.ScheduleManager.DisableSchedule(); List choices = controller.Choices; choices.RemoveAt(rayChoiceIndex); controller.Choices = choices; <>2__current = null; <>1__state = 2; return true; } case 2: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__35 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DialogueController controller; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__35(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = CartelEnforcer.Wait05; <>1__state = 1; return true; case 1: { <>1__state = -1; if (!CartelEnforcer.registered) { return false; } List choices = controller.Choices; choices.RemoveAt(rayChoiceIndex); controller.Choices = choices; <>2__current = CartelEnforcer.Wait30; <>1__state = 2; return true; } case 2: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } CartelEnforcer.coros.Add(MelonCoroutines.Start(ResetRayAFK())); <>2__current = null; <>1__state = 3; return true; case 3: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__53 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DialogueController controller; private float 5__2; private WaitForSeconds 5__3; private List 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__53(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__3 = null; 5__4 = null; <>1__state = -2; } private bool MoveNext() { //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Expected O, but got Unknown //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; controller.npc.Behaviour.ScheduleManager.DisableSchedule(); 5__2 = Mathf.Lerp(11f, 6f, CartelEnforcer.currentConfig.endGameQuestMonologueSpeed); 5__3 = new WaitForSeconds(5__2); 5__4 = frankDialogOptions[Random.Range(0, frankDialogOptions.Count)]; controller.npc.PlayVO((EVOLineType)10, false); controller.handler.WorldspaceRend.ShowText(5__4[0], 5__2); <>2__current = 5__3; <>1__state = 1; return true; case 1: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } controller.npc.PlayVO((EVOLineType)9, false); controller.handler.WorldspaceRend.ShowText(5__4[1], 5__2 + 2f); controller.npc.Movement.FacePoint(new Vector3(-32.68f, -2.54f, 168.73f), 1f); <>2__current = CartelEnforcer.Wait2; <>1__state = 2; return true; case 2: { <>1__state = -1; if (!CartelEnforcer.registered) { return false; } float num = default(float); controller.npc.Movement.FacePoint(Player.GetClosestPlayer(controller.npc.CenterPoint, ref num, (List)null).CenterPointTransform.position, 1f); <>2__current = 5__3; <>1__state = 3; return true; } case 3: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } controller.npc.PlayVO((EVOLineType)19, false); controller.handler.WorldspaceRend.ShowText(5__4[2], 5__2); <>2__current = 5__3; <>1__state = 4; return true; case 4: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } controller.npc.Behaviour.ScheduleManager.EnableSchedule(); MelonCoroutines.Start(GenerateCarQuestState()); <>2__current = null; <>1__state = 5; return true; case 5: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__17 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DialogueController controller; private float 5__2; private WaitForSeconds 5__3; private List 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__17(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__3 = null; 5__4 = null; <>1__state = -2; } private bool MoveNext() { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__2 = Mathf.Lerp(10f, 5f, CartelEnforcer.currentConfig.endGameQuestMonologueSpeed); 5__3 = new WaitForSeconds(5__2); 5__4 = dialogOptions[Random.Range(0, dialogOptions.Count)]; controller.handler.WorldspaceRend.ShowText(5__4[0], 5__2); <>2__current = 5__3; <>1__state = 1; return true; case 1: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } controller.npc.PlayVO((EVOLineType)19, false); controller.handler.WorldspaceRend.ShowText(5__4[1], 5__2); <>2__current = 5__3; <>1__state = 2; return true; case 2: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } controller.handler.WorldspaceRend.ShowText(5__4[2], 5__2); <>2__current = 5__3; <>1__state = 3; return true; case 3: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } controller.npc.PlayVO((EVOLineType)14, false); controller.handler.WorldspaceRend.ShowText(5__4[3], 5__2); <>2__current = 5__3; <>1__state = 4; return true; case 4: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } <>2__current = null; <>1__state = 5; return true; case 5: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__31 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DialogueController controller; private float 5__2; private WaitForSeconds 5__3; private List 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__31(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__3 = null; 5__4 = null; <>1__state = -2; } private bool MoveNext() { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__2 = Mathf.Lerp(10f, 5f, CartelEnforcer.currentConfig.endGameQuestMonologueSpeed); 5__3 = new WaitForSeconds(5__2); 5__4 = dialogManorOptions[Random.Range(0, dialogManorOptions.Count)]; controller.npc.PlayVO((EVOLineType)14, false); controller.handler.WorldspaceRend.ShowText(5__4[0], 5__2); <>2__current = 5__3; <>1__state = 1; return true; case 1: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } controller.npc.PlayVO((EVOLineType)5, false); controller.handler.WorldspaceRend.ShowText(5__4[1], 5__2); <>2__current = 5__3; <>1__state = 2; return true; case 2: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } controller.handler.WorldspaceRend.ShowText(5__4[2], 5__2); <>2__current = 5__3; <>1__state = 3; return true; case 3: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } controller.npc.PlayVO((EVOLineType)11, false); controller.handler.WorldspaceRend.ShowText(5__4[3], 5__2); <>2__current = 5__3; <>1__state = 4; return true; case 4: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } <>2__current = null; <>1__state = 5; return true; case 5: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__12 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Action cb; public NPC npc; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__12(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: { <>1__state = -1; <>c__DisplayClass12_0 CS$<>8__locals0 = new <>c__DisplayClass12_0 { cb = cb, controller = ((Component)npc.DialogueHandler).gameObject.GetComponent() }; DialogueChoice val = new DialogueChoice(); val.ChoiceText = "Who are you?"; val.Enabled = true; val.onChoosen.AddListener(UnityAction.op_Implicit((Action)OnOptionSelectedWrapped)); CS$<>8__locals0.controller.AddDialogueChoice(val, 0); <>2__current = null; <>1__state = 1; return true; } case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__9 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__9(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: { <>1__state = -1; <>c__DisplayClass9_0 CS$<>8__locals0 = new <>c__DisplayClass9_0(); NPC val = (NPC)(object)Object.FindObjectOfType(true); if ((Object)(object)val != (Object)null) { fixer = val; } CS$<>8__locals0.controller = ((Component)val.DialogueHandler).gameObject.GetComponent(); DialogueChoice val2 = new DialogueChoice(); string text = "How do we get rid of the Benzies?"; val2.ChoiceText = text + " (Bribe -$5000)"; val2.Enabled = true; val2.onChoosen.AddListener(UnityAction.op_Implicit((Action)OnQuestChosenWrapped)); fixerDiagIndex = CS$<>8__locals0.controller.AddDialogueChoice(val2, 0); <>2__current = null; <>1__state = 1; return true; } case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__49 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__49(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: { <>1__state = -1; <>c__DisplayClass49_0 CS$<>8__locals0 = new <>c__DisplayClass49_0(); if ((Object)(object)crankyFrank == (Object)null) { NPC val = (NPC)(object)Object.FindObjectOfType(true); if ((Object)(object)val != (Object)null) { crankyFrank = val; } } CS$<>8__locals0.controller = ((Component)crankyFrank.DialogueHandler).gameObject.GetComponent(); DialogueChoice val2 = new DialogueChoice(); string text = "Have you seen any Benzies around here?"; val2.ChoiceText = text + " (Bribe -$3500)"; val2.Enabled = true; val2.onChoosen.AddListener(UnityAction.op_Implicit((Action)OnQuestChosenWrapped)); frankDiagIndex = CS$<>8__locals0.controller.AddDialogueChoice(val2, 0); <>2__current = null; <>1__state = 1; return true; } case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__55 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Action cb; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__55(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: { <>1__state = -1; <>c__DisplayClass55_0 CS$<>8__locals0 = new <>c__DisplayClass55_0 { cb = cb }; if ((Object)(object)jeremy == (Object)null) { NPC val = (NPC)(object)Object.FindObjectOfType(true); if ((Object)(object)val != (Object)null) { jeremy = val; } } CS$<>8__locals0.controller = ((Component)jeremy.DialogueHandler).gameObject.GetComponent(); DialogueChoice val2 = new DialogueChoice(); string text = "Who is buying green cars from you?"; val2.ChoiceText = text + " (Bribe -$6000)"; val2.Enabled = true; val2.onChoosen.AddListener(UnityAction.op_Implicit((Action)OnQuestChosenWrapped)); jeremyDiagIndex = CS$<>8__locals0.controller.AddDialogueChoice(val2, 0); <>2__current = null; <>1__state = 1; return true; } case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__27 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__27(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: { <>1__state = -1; <>c__DisplayClass27_0 CS$<>8__locals0 = new <>c__DisplayClass27_0(); NPC val = (NPC)(object)Object.FindObjectOfType(true); if ((Object)(object)val != (Object)null) { ray = val; } CS$<>8__locals0.controller = ((Component)val.DialogueHandler).gameObject.GetComponent(); DialogueChoice val2 = new DialogueChoice(); string text = "What can you tell me about the owner of that manor?"; val2.ChoiceText = text + " (Bribe -$2500)"; val2.Enabled = true; val2.onChoosen.AddListener(UnityAction.op_Implicit((Action)OnQuestChosenWrapped)); rayChoiceIndex = CS$<>8__locals0.controller.AddDialogueChoice(val2, 0); <>2__current = null; <>1__state = 1; return true; } case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__33 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Action cb; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__33(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: { <>1__state = -1; <>c__DisplayClass33_0 CS$<>8__locals0 = new <>c__DisplayClass33_0 { cb = cb, controller = ((Component)ray.DialogueHandler).gameObject.GetComponent() }; DialogueChoice val = new DialogueChoice(); string text = "Is there any way I can get in the Manor?"; val.ChoiceText = text ?? ""; val.Enabled = true; val.onChoosen.AddListener(UnityAction.op_Implicit((Action)OnQuestChosenWrapped)); rayChoiceIndex = CS$<>8__locals0.controller.AddDialogueChoice(val, 0); <>2__current = null; <>1__state = 1; return true; } case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__54 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__54(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: { <>1__state = -1; GameObject val = new GameObject(); activeCarMeetupQuest = val.AddComponent(); val.SetActive(true); ((Behaviour)activeCarMeetupQuest).enabled = true; activeCarMeetupQuest.SetupSelf(); <>2__current = null; <>1__state = 1; return true; } case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__32 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__32(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: { <>1__state = -1; GameObject val = new GameObject(); activeManorQuest = val.AddComponent(); val.SetActive(true); ((Behaviour)activeManorQuest).enabled = true; activeManorQuest.SetupSelf(); <>2__current = null; <>1__state = 1; return true; } case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__18 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__18(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: { <>1__state = -1; GameObject val = new GameObject(); activeQuest = val.AddComponent(); val.SetActive(true); ((Behaviour)activeQuest).enabled = true; activeQuest.SetupSelf(); <>2__current = null; <>1__state = 1; return true; } case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__58 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DialogueController controller; public Action cb; private float 5__2; private WaitForSeconds 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__58(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; jeremyDialogueActive = true; 5__2 = Mathf.Lerp(10f, 5f, CartelEnforcer.currentConfig.endGameQuestMonologueSpeed); 5__3 = new WaitForSeconds(5__2); controller.npc.PlayVO((EVOLineType)3, false); controller.handler.WorldspaceRend.ShowText("You got to be careful now. The Benzies Cartel is no joke.", 5__2); <>2__current = 5__3; <>1__state = 1; return true; case 1: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } controller.npc.PlayVO((EVOLineType)19, false); controller.handler.WorldspaceRend.ShowText("Thomas Benzie has been putting in alot of orders for those Green SUVs.", 5__2); <>2__current = 5__3; <>1__state = 2; return true; case 2: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } controller.npc.PlayVO((EVOLineType)14, false); controller.handler.WorldspaceRend.ShowText("I don't really ask around. He always pays more than the retail price.", 5__2); <>2__current = 5__3; <>1__state = 3; return true; case 3: { <>1__state = -1; if (!CartelEnforcer.registered) { return false; } jeremyDialogueActive = false; if (cb != null) { cb(); } Transform child = ((Component)controller.npc.Behaviour.ScheduleManager).transform.GetChild(0); if (child != null) { GameObject gameObject = ((Component)child).gameObject; if (gameObject != null) { gameObject.SetActive(true); } } <>2__current = null; <>1__state = 4; return true; } case 4: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__37 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DialogueController controller; public Action cb; private float 5__2; private WaitForSeconds 5__3; private float 5__4; private WaitForSeconds 5__5; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__37(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__3 = null; 5__5 = null; <>1__state = -2; } private bool MoveNext() { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Expected O, but got Unknown //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__2 = Mathf.Lerp(10f, 5f, CartelEnforcer.currentConfig.endGameQuestMonologueSpeed); 5__3 = new WaitForSeconds(5__2); 5__4 = Mathf.Lerp(15f, 7f, CartelEnforcer.currentConfig.endGameQuestMonologueSpeed); 5__5 = new WaitForSeconds(5__4); controller.npc.PlayVO((EVOLineType)17, false); controller.handler.WorldspaceRend.ShowText("I don't think so. The whole place is fenced off.", 5__2); <>2__current = 5__3; <>1__state = 1; return true; case 1: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } controller.npc.PlayVO((EVOLineType)19, false); controller.handler.WorldspaceRend.ShowText("If you manage to make it over the fence, there is a way for me to get you inside.", 5__4); <>2__current = 5__5; <>1__state = 2; return true; case 2: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } controller.handler.WorldspaceRend.ShowText("Here, take my master key. It's from back when the Manor was built.", 5__2 + 2f); <>2__current = CartelEnforcer.Wait2; <>1__state = 3; return true; case 3: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } controller.npc.PlayVO((EVOLineType)14, false); controller.npc.SetAnimationTrigger("GrabItem"); <>2__current = 5__3; <>1__state = 4; return true; case 4: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } controller.handler.WorldspaceRend.ShowText("It won't work on the main entrance, but try the back door.", 5f); <>2__current = 5__3; <>1__state = 5; return true; case 5: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } if (cb != null) { cb(); } <>2__current = null; <>1__state = 6; return true; case 6: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__59 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private Enumerator <>7__wrap1; private EMapRegion 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__59(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>7__wrap1 = null; <>1__state = -2; } private bool MoveNext() { //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = CartelEnforcer.Wait5; <>1__state = 1; return true; case 1: <>1__state = -1; if (InstanceFinder.IsServer) { <>7__wrap1 = Singleton.Instance.GetUnlockedRegions().GetEnumerator(); goto IL_00f9; } goto IL_0110; case 2: { <>1__state = -1; if (!CartelEnforcer.registered) { return false; } float influence = NetworkSingleton.Instance.Influence.GetRegionData(5__3).Influence; if (influence > 0f) { float num = influence * 0.9f; float num2 = Mathf.Round((influence - num) * 100f) / 100f; NetworkSingleton.Instance.Influence.ChangeInfluence(5__3, 0f - num2); } goto IL_00f9; } case 3: { <>1__state = -1; return false; } IL_00f9: while (<>7__wrap1.MoveNext()) { 5__3 = <>7__wrap1.Current; if ((int)5__3 != 0) { <>2__current = CartelEnforcer.Wait5; <>1__state = 2; return true; } } <>7__wrap1 = null; goto IL_0110; IL_0110: <>2__current = null; <>1__state = 3; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__38 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private int 5__2; private Enumerator <>7__wrap2; private EMapRegion 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__38(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>7__wrap2 = null; <>1__state = -2; } private bool MoveNext() { //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = CartelEnforcer.Wait025; <>1__state = 1; return true; case 1: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } 5__2 = 0; goto IL_00bf; case 2: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } ((Property)Business.Businesses[5__2]).Price = ((Property)Business.Businesses[5__2]).Price * 0.85f; 5__2++; goto IL_00bf; case 3: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } Property.Properties[5__2].Price = Property.Properties[5__2].Price * 0.85f; 5__2++; goto IL_013e; case 4: { <>1__state = -1; if (!CartelEnforcer.registered) { return false; } float influence = NetworkSingleton.Instance.Influence.GetRegionData(5__4).Influence; if (influence > 0f) { float num = influence * 0.85f; float num2 = Mathf.Round((influence - num) * 100f) / 100f; NetworkSingleton.Instance.Influence.ChangeInfluence(5__4, 0f - num2); } goto IL_020a; } case 5: { <>1__state = -1; return false; } IL_020a: while (<>7__wrap2.MoveNext()) { 5__4 = <>7__wrap2.Current; if ((int)5__4 != 0) { <>2__current = CartelEnforcer.Wait5; <>1__state = 4; return true; } } <>7__wrap2 = null; goto IL_0221; IL_00bf: if (5__2 < Business.Businesses.Count) { <>2__current = CartelEnforcer.Wait025; <>1__state = 2; return true; } 5__2 = 0; goto IL_013e; IL_013e: if (5__2 < Property.Properties.Count) { <>2__current = CartelEnforcer.Wait025; <>1__state = 3; return true; } if (InstanceFinder.IsServer) { <>7__wrap2 = Singleton.Instance.GetUnlockedRegions().GetEnumerator(); goto IL_020a; } goto IL_0221; IL_0221: <>2__current = null; <>1__state = 5; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__19 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public CartelGoon goon; private int 5__2; private Enumerator <>7__wrap2; private EMapRegion 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__19(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>7__wrap2 = null; <>1__state = -2; } private bool MoveNext() { //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_035f: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: 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_01ed: Unknown result type (might be due to invalid IL or missing references) float num3; switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = CartelEnforcer.Wait025; <>1__state = 1; return true; case 1: { <>1__state = -1; if (!CartelEnforcer.registered) { return false; } ((NPC)goon).Inventory.Clear(); Func func = Registry.GetItem; ItemInstance defaultInstance = func("goldwatch").GetDefaultInstance(1); ((NPC)goon).Inventory.InsertItem(defaultInstance, true); ItemInstance defaultInstance2 = func("goldchain").GetDefaultInstance(1); ((NPC)goon).Inventory.InsertItem(defaultInstance2, true); ItemInstance defaultInstance3 = func("pumpshotgun").GetDefaultInstance(1); ((NPC)goon).Inventory.InsertItem(defaultInstance3, true); ItemInstance defaultInstance4 = func("shotgunshell").GetDefaultInstance(Random.Range(4, 10)); ((NPC)goon).Inventory.InsertItem(defaultInstance4, true); 5__2 = 0; goto IL_01a2; } case 2: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } if (Customer.UnlockedCustomers[5__2].NPC.RelationData.RelationDelta != 5f) { Customer.UnlockedCustomers[5__2].NPC.RelationData.ChangeRelationship(0.25f, true); } 5__2++; goto IL_01a2; case 3: { <>1__state = -1; if (!CartelEnforcer.registered) { return false; } float influence = NetworkSingleton.Instance.Influence.GetRegionData(5__4).Influence; if (influence > 0f) { float num = influence * 0.75f; float num2 = Mathf.Round((influence - num) * 100f) / 100f; NetworkSingleton.Instance.Influence.ChangeInfluence(5__4, 0f - num2); } goto IL_027a; } case 4: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } if (bossGoon.IsGoonSpawned) { ((NPC)bossGoon).Health.MaxHealth = 100f; ((NPC)bossGoon).Health.Health = 100f; ((NPC)bossGoon).Health.Revive(); ((NPC)bossGoon).Movement.MoveSpeedMultiplier = 0.8f; ((Component)bossGoon).transform.localScale = new Vector3(1f, 1f, 1f); ((NPC)bossGoon).Behaviour.ScheduleManager.EnableSchedule(); bossGoon.Despawn(); ((Behaviour)((NPC)bossGoon).Behaviour.CombatBehaviour).Disable_Networked((NetworkConnection)null); bossGoon = null; } <>2__current = null; <>1__state = 5; return true; case 5: { <>1__state = -1; return false; } IL_01a2: if (5__2 < Customer.UnlockedCustomers.Count) { <>2__current = CartelEnforcer.Wait025; <>1__state = 2; return true; } if (InstanceFinder.IsServer) { <>7__wrap2 = Singleton.Instance.GetUnlockedRegions().GetEnumerator(); goto IL_027a; } goto IL_0291; IL_027a: while (<>7__wrap2.MoveNext()) { 5__4 = <>7__wrap2.Current; if ((int)5__4 != 0) { <>2__current = CartelEnforcer.Wait5; <>1__state = 3; return true; } } <>7__wrap2 = null; goto IL_0291; IL_0291: num3 = Mathf.Clamp(Singleton.Instance.internalLawIntensity * 0.25f, 0f, 2.5f); if (num3 != 0f) { Singleton.Instance.ChangeInternalIntensity(0f - num3); } <>2__current = CartelEnforcer.Wait60; <>1__state = 4; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__36 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__36(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: { <>1__state = -1; NPCEvent_LocationBasedAction val = ((Il2CppObjectBase)ray.Behaviour.ScheduleManager.ActiveAction).TryCast(); if ((Object)(object)val != (Object)null) { ((NPCEvent)val).EndTime = 1800; ((NPCEvent)val).Duration = 60; } ray.Behaviour.ScheduleManager.EnableSchedule(); <>2__current = null; <>1__state = 1; return true; } case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__61 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__61(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: { <>1__state = -1; GameObject val = new GameObject(); activeTruceIntro = val.AddComponent(); val.SetActive(true); ((Behaviour)activeTruceIntro).enabled = true; activeTruceIntro.SetupSelf(); <>2__current = null; <>1__state = 1; return true; } case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__67 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__67(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: { <>1__state = -1; GameObject val = new GameObject(); activeAlliedSupplies = val.AddComponent(); val.SetActive(true); ((Behaviour)activeAlliedSupplies).enabled = true; activeAlliedSupplies.SetupSelf(); <>2__current = null; <>1__state = 1; return true; } case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__70 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public QuestEntry entry; private <>c__DisplayClass70_0 <>8__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__70(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_00df: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass70_0(); <>8__1.entry = entry; <>2__current = (object)new WaitUntil(Func.op_Implicit((Func)EntryPoIExists)); <>1__state = 1; return true; case 1: <>1__state = -1; if ((Object)(object)<>8__1.entry.PoIIcon == (Object)null) { <>8__1.entry.PoIIcon = Object.Instantiate(((Component)<>8__1.entry.ParentQuest.IconPrefab).gameObject, (Transform)(object)<>8__1.entry.PoI.IconContainer).GetComponent(); <>8__1.entry.PoIIcon.sizeDelta = new Vector2(20f, 20f); } if ((Object)(object)<>8__1.entry.PoI != (Object)null && (Object)(object)<>8__1.entry.PoI.IconContainer != (Object)null) { Transform val = ((Transform)<>8__1.entry.PoI.IconContainer).Find("Shade"); if (Object.op_Implicit((Object)(object)val)) { ((Component)val).gameObject.SetActive(false); } } return false; } bool EntryPoIExists() { if ((Object)(object)((<>c__DisplayClass70_0)this).entry.PoI != (Object)null && (Object)(object)((<>c__DisplayClass70_0)this).entry.PoI.IconContainer != (Object)null) { return ((<>c__DisplayClass70_0)this).entry.PoI.UISetup; } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static bool completed = false; public static int StageDeadDropsObserved = 0; public static int StageGatheringsDefeated = 0; public static NPC fixer; public static CartelGoon bossGoon; public static Quest_DefeatEnforcer activeQuest = null; public static int fixerDiagIndex = 0; public static bool inContactDialogue = false; public static List> dialogOptions = new List> { new List { "I ain't having the Benzies come messing with my operation. Not here, not ever.", "First move, we gotta rattle them a little bit.", "Go make a couple of their dead drops disappear.", "After that, I'll set you up with the right people to finish the job." }, new List { "The Benzies are getting bold. I can't have that.", "I'm about to show them how we do things out here. No games.", "Find their dead drops and clean 'em out. A couple of them going missing will send a message.", "Once you get that done, I'll get you a meeting with someone who can help with the rest." }, new List { "I don't want the Benzies to ruin my business here either.", "We need to send a message. They got to leave.", "They have been moving product through dead drops. You know what to do.", "Get started and I'll set up a meeting with someone who can help..." } }; public static NPC ray; public static Quest_InfiltrateManor activeManorQuest = null; public static bool manorCompleted = false; public static int rayChoiceIndex = 0; public static readonly Vector3 standPos = new Vector3(70.96f, 1.46f, 16.03f); public static List manorGoons = new List(); public static List manorGoonGuids = new List(); public static List> dialogManorOptions = new List> { new List { "Look, the Benzies family have been here for longer than I can remember.", "Thomas Benzie owns the manor but you don't want to mess with him.", "Honestly, he is a criminal and overall thats bad for my business.", "Property values have been plummeting so I wouldn't mind him leaving..." }, new List { "Oh, Thomas? I don't know much about him. The Benzies family runs the town.", "He paid off a lot of people to get where he is today.", "Cops, lawyers, even some folks at Town Hall...", "He's been trying to get me to sell him my agency." }, new List { "His manor is a monument to his ego. He bought it just to show off.", "Don't go near the place. He has people guarding the property.", "You'll get yourself killed poking around.", "He's not someone you want to mess with." } }; public static NPC crankyFrank = null; public static NPC jeremy = null; public static Quest_CarMeetup activeCarMeetupQuest = null; public static Vector3 frankStandPos = new Vector3(-55.29f, -3.64f, 167.14f); public static Vector3 jeremyStandPos = new Vector3(69f, 5.93f, -119.09f); public static bool carMeetupCompleted = false; public static int frankDiagIndex = -1; public static int jeremyDiagIndex = -1; public static bool jeremyDialogueActive = false; public static List> frankDialogOptions = new List> { new List { "I've seen some green clunkers speeding down the street like they're running from something.", "They always pull up behind that obnoxious red building. Hard to miss.", "You should ask Jeremy. He might know who owns the cars." }, new List { "Bunch of damn green cars driving around late at night.", "They always cruise past here then turn down the alley next to that ugly red building.", "You know Jeremy, the Car Shop guy? He should know who they are." }, new List { "The only thing I've seen is some shiny green cars causing trouble after the sun goes down.", "Yeah, those punks always hide behind that red building over there.", "Go bug Jeremy, the car guy. He knows who's in those cars." } }; public static Quest_TrucedRecruits activeTruceIntro = null; public static Quest_AlliedSupplies activeAlliedSupplies = null; public static bool alliedSuppliesActive = false; public static CartelGoon alliedGuard = null; public static NetworkObject alliedVanObject = null; public static int guardChoiceIndex = -1; public static bool PreRequirementsMet() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Invalid comparison between Unknown and I4 //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Invalid comparison between Unknown and I4 //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Invalid comparison between Unknown and I4 if (!InstanceFinder.IsServer) { return false; } if ((int)NetworkSingleton.Instance.Status != 2) { return false; } int num = 0; for (int i = 0; i < Customer.UnlockedCustomers.Count; i++) { if ((int)Customer.UnlockedCustomers[i].NPC.Region == 4) { num++; } } if (num < 1) { return false; } if ((int)NetworkSingleton.Instance.Rank < 4) { return false; } return true; } [IteratorStateMachine(typeof(d__9))] public static IEnumerator GenDialogOption() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__9(0); } [IteratorStateMachine(typeof(d__10))] public static IEnumerator DisposeChoice(DialogueController controller) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__10(0) { controller = controller }; } public static void OnQuestChosen(DialogueController controller) { controller.handler.ContinueSubmitted(); if (NetworkSingleton.Instance.cashBalance >= 5000f) { NetworkSingleton.Instance.ChangeCashBalance(-5000f, true, false); MelonCoroutines.Start(DisposeChoice(controller)); MelonCoroutines.Start(EventInstructions(controller)); MelonCoroutines.Start(GenerateQuestState()); } else { controller.npc.PlayVO((EVOLineType)9, false); } } [IteratorStateMachine(typeof(d__12))] public static IEnumerator GenContactDialog(NPC npc, Action cb) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__12(0) { npc = npc, cb = cb }; } [IteratorStateMachine(typeof(d__13))] public static IEnumerator DisposeContactChoice(DialogueController controller) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__13(0) { controller = controller }; } public static void OnOptionSelected(DialogueController controller, Action cb) { controller.handler.ContinueSubmitted(); MelonCoroutines.Start(DisposeContactChoice(controller)); MelonCoroutines.Start(ContactDialogue(controller, cb)); } [IteratorStateMachine(typeof(d__15))] public static IEnumerator ContactDialogue(DialogueController controller, Action cb) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__15(0) { controller = controller, cb = cb }; } [IteratorStateMachine(typeof(d__17))] public static IEnumerator EventInstructions(DialogueController controller) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__17(0) { controller = controller }; } [IteratorStateMachine(typeof(d__18))] private static IEnumerator GenerateQuestState() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__18(0); } [IteratorStateMachine(typeof(d__19))] public static IEnumerator QuestReward(CartelGoon goon) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__19(0) { goon = goon }; } [IteratorStateMachine(typeof(d__27))] public static IEnumerator GenManorDialogOption() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__27(0); } public static void OnManorQuestChosen(DialogueController controller) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) controller.handler.ContinueSubmitted(); bool flag = NetworkSingleton.Instance.CurrentTime >= 1815 && NetworkSingleton.Instance.CurrentTime <= 1858; bool num = NetworkSingleton.Instance.cashBalance >= 2500f; bool flag2 = Vector3.Distance(ray.CenterPoint, standPos) < 1f; if (num && flag && flag2) { NetworkSingleton.Instance.ChangeCashBalance(-2500f, true, false); MelonCoroutines.Start(DisposeRayChoice(controller)); MelonCoroutines.Start(EventManorInstructions(controller)); MelonCoroutines.Start(GenerateManorQuestState()); } else { controller.handler.WorldspaceRend.ShowText("Talk with me at the courthouse between 18:15 and 19:00.", 7f); controller.npc.PlayVO((EVOLineType)9, false); } } [IteratorStateMachine(typeof(d__29))] public static IEnumerator DisposeRayChoice(DialogueController controller) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__29(0) { controller = controller }; } [IteratorStateMachine(typeof(d__31))] public static IEnumerator EventManorInstructions(DialogueController controller) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__31(0) { controller = controller }; } [IteratorStateMachine(typeof(d__32))] private static IEnumerator GenerateManorQuestState() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__32(0); } [IteratorStateMachine(typeof(d__33))] public static IEnumerator GenRaySecondDialog(Action cb) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__33(0) { cb = cb }; } public static void OnSecondDialogChosen(DialogueController controller, Action cb) { controller.handler.ContinueSubmitted(); MelonCoroutines.Start(DisposeRaySecondChoice(controller)); MelonCoroutines.Start(PlaySecondRayDialog(controller, cb)); } [IteratorStateMachine(typeof(d__35))] public static IEnumerator DisposeRaySecondChoice(DialogueController controller) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__35(0) { controller = controller }; } [IteratorStateMachine(typeof(d__36))] public static IEnumerator ResetRayAFK() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__36(0); } [IteratorStateMachine(typeof(d__37))] public static IEnumerator PlaySecondRayDialog(DialogueController controller, Action cb) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__37(0) { controller = controller, cb = cb }; } [IteratorStateMachine(typeof(d__38))] public static IEnumerator QuestManorReward() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__38(0); } public static bool CarQuestPreRequirementsMet() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Invalid comparison between Unknown and I4 //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Invalid comparison between Unknown and I4 //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Invalid comparison between Unknown and I4 if (!InstanceFinder.IsServer) { return false; } if ((int)NetworkSingleton.Instance.Status != 2) { return false; } int num = 0; for (int i = 0; i < Customer.UnlockedCustomers.Count; i++) { if ((int)Customer.UnlockedCustomers[i].NPC.Region == 4) { num++; } } if (num < 3) { return false; } if ((int)NetworkSingleton.Instance.Rank < 3) { return false; } return true; } [IteratorStateMachine(typeof(d__49))] public static IEnumerator GenFrankOption() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__49(0); } public static void OnCarQuestChosen(DialogueController controller) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) controller.handler.ContinueSubmitted(); bool flag = NetworkSingleton.Instance.CurrentTime >= 1600 && NetworkSingleton.Instance.CurrentTime <= 1800; bool num = NetworkSingleton.Instance.cashBalance >= 3500f; bool flag2 = Vector3.Distance(crankyFrank.CenterPoint, frankStandPos) < 0.7f; if (num && flag && flag2) { NetworkSingleton.Instance.ChangeCashBalance(-3500f, true, false); MelonCoroutines.Start(DisposeFrankChoice(controller)); MelonCoroutines.Start(EventFrankInstructions(controller)); } else { controller.handler.WorldspaceRend.ShowText("Meet me at the north waterfront between 16:00 and 18:00.", 7f); controller.npc.PlayVO((EVOLineType)9, false); } } [IteratorStateMachine(typeof(d__51))] public static IEnumerator DisposeFrankChoice(DialogueController controller) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__51(0) { controller = controller }; } [IteratorStateMachine(typeof(d__53))] public static IEnumerator EventFrankInstructions(DialogueController controller) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__53(0) { controller = controller }; } [IteratorStateMachine(typeof(d__54))] private static IEnumerator GenerateCarQuestState() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__54(0); } [IteratorStateMachine(typeof(d__55))] public static IEnumerator GenJeremyOption(Action cb) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__55(0) { cb = cb }; } public static void OnJeremyOptionSelected(DialogueController controller, Action cb) { //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Invalid comparison between Unknown and I4 //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) controller.handler.ContinueSubmitted(); Transform child = ((Component)controller.npc.Behaviour.ScheduleManager).transform.GetChild(0); if (child != null) { GameObject gameObject = ((Component)child).gameObject; if (gameObject != null) { gameObject.SetActive(false); } } bool flag = NetworkSingleton.Instance.CurrentTime >= 2059 && NetworkSingleton.Instance.CurrentTime <= 2359; bool flag2 = (int)Player.Local.CrimeData.CurrentPursuitLevel > 0; bool num = NetworkSingleton.Instance.cashBalance >= 6000f; bool flag3 = Vector3.Distance(jeremy.CenterPoint, jeremyStandPos) < 10f; if (num && flag && flag3 && !flag2) { NetworkSingleton.Instance.ChangeCashBalance(-6000f, true, false); MelonCoroutines.Start(DisposeJeremyChoice(controller)); MelonCoroutines.Start(JeremyDialogue(controller, cb)); return; } if (flag2) { controller.handler.WorldspaceRend.ShowText("Get out of here! I don't want police at my house!", 8f); controller.npc.PlayVO((EVOLineType)10, false); controller.npc.Avatar.EmotionManager.AddEmotionOverride("Annoyed", "product_rejected", 8f, 1); } else { controller.handler.WorldspaceRend.ShowText("Talk to me after 21:00 at my house.", 8f); controller.npc.PlayVO((EVOLineType)9, false); } Transform child2 = ((Component)controller.npc.Behaviour.ScheduleManager).transform.GetChild(0); if (child2 != null) { GameObject gameObject2 = ((Component)child2).gameObject; if (gameObject2 != null) { gameObject2.SetActive(true); } } } [IteratorStateMachine(typeof(d__57))] public static IEnumerator DisposeJeremyChoice(DialogueController controller) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__57(0) { controller = controller }; } [IteratorStateMachine(typeof(d__58))] public static IEnumerator JeremyDialogue(DialogueController controller, Action cb) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__58(0) { controller = controller, cb = cb }; } [IteratorStateMachine(typeof(d__59))] public static IEnumerator QuestCarMeetupReward() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__59(0); } [IteratorStateMachine(typeof(d__61))] public static IEnumerator SetupTruceIntroQuest() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__61(0); } [IteratorStateMachine(typeof(d__67))] public static IEnumerator SetupTruceSuppliesQuest() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__67(0); } [IteratorStateMachine(typeof(d__68))] public static IEnumerator CleanupTruceSuppliesQuest(SupplyLocation location) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__68(0) { location = location }; } public static void UpdateQuestMapLogo(QuestEntry entry) { CartelEnforcer.coros.Add(MelonCoroutines.Start(WaitQuestUI(entry))); } [IteratorStateMachine(typeof(d__70))] public static IEnumerator WaitQuestUI(QuestEntry entry) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__70(0) { entry = entry }; } public static RectTransform MakeIcon(Transform parent) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("BenziesLogoQuest"); RectTransform result = val.AddComponent(); val.AddComponent().sprite = InterceptEvent.benziesLogo; val.transform.SetParent(parent, false); return result; } public static GameObject MakePOI() { return Quest.Quests[0].PoIPrefab; } } [RegisterTypeInIl2Cpp] public class Quest_InfiltrateManor : Quest { [CompilerGenerated] private sealed class d__21 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public CartelGoon goon; private int 5__2; private int 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__21(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__2 = 2; 5__3 = 0; goto IL_00cc; case 1: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } if (!((NPC)goon).Health.IsDead && !((NPC)goon).Health.IsKnockedOut && !((Object)(object)((NPC)goon).Behaviour.activeBehaviour == (Object)null) && !((Object)(object)((NPC)goon).Behaviour.activeBehaviour != (Object)(object)((NPC)goon).Behaviour.CombatBehaviour)) { 5__3++; goto IL_00cc; } goto IL_00e0; case 2: { <>1__state = -1; ((NPC)goon).Health.MaxHealth = 100f; ((NPC)goon).Health.Health = 100f; ((Component)((NPC)goon).Behaviour.ScheduleManager.ActionList[0]).gameObject.SetActive(true); ((NPC)goon).Behaviour.ScheduleManager.EnableSchedule(); if (((NPC)goon).Health.IsDead) { ((NPC)goon).Health.Revive(); } if (goon.IsGoonSpawned) { goon.Despawn(); } if (((Behaviour)((NPC)goon).Behaviour.CombatBehaviour).Active) { ((Behaviour)((NPC)goon).Behaviour.CombatBehaviour).Disable_Networked((NetworkConnection)null); } ((NPC)goon).Movement.SpeedController.RemoveSpeedControl("combat"); return false; } IL_00e0: <>2__current = CartelEnforcer.Wait30; <>1__state = 2; return true; IL_00cc: if (5__3 < 60 * 5__2) { <>2__current = CartelEnforcer.Wait1; <>1__state = 1; return true; } goto IL_00e0; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private float questDifficultyScalar = 1f; private int manorGoonsAlive = 4; private readonly List forestSearchLocs = new List { new Vector3(164.96f, 3.1f, -32.65f), new Vector3(151.45f, 3.2f, -35.21f), new Vector3(139.41f, 1.96f, -45.71f), new Vector3(135.26f, 2.72f, -66.56f) }; private readonly Dictionary roomsPositions = new Dictionary { { new Vector3(166.58f, 15.61f, -52.99f), false }, { new Vector3(160.65f, 15.61f, -52.97f), false }, { new Vector3(160.65f, 15.61f, -61f), false }, { new Vector3(166.58f, 15.61f, -61f), false } }; public float GiveUpRange; public int GiveUpAfterSuccessfulHits; public float DefaultSearchTime; private bool forestGoonSpawned; private int forestPosSearched; private int roomsVisited; public bool isJukeboxPlaying; public QuestEntry QuestEntry_InvestigateWoods; public QuestEntry QuestEntry_ReturnToRay; public QuestEntry QuestEntry_WaitForNight; public QuestEntry QuestEntry_BreakIn; public QuestEntry QuestEntry_DefeatManorGoons; public QuestEntry QuestEntry_SearchResidence; public QuestEntry QuestEntry_EscapeManor; public Quest_InfiltrateManor(IntPtr ptr) : base(ptr) { }//IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: 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) public Quest_InfiltrateManor() : base(ClassInjector.DerivedConstructorPointer()) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: 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) ClassInjector.DerivedConstructorBody((Il2CppObjectBase)(object)this); } public override void Complete(bool network = true) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 try { if ((int)((Quest)this).State != 2) { if (InstanceFinder.IsServer && !Singleton.Instance.IsLoading) { NetworkSingleton.Instance.AddXP(((Quest)this).CompletionXP); } ((Quest)this).SetQuestState((EQuestState)2, false); NetworkSingleton.Instance.PlayCompleteQuestSound(); ((Quest)this).End(); } } catch (Exception) { throw; } } public override void Fail(bool network = true) { try { ((Quest)this).SetQuestState((EQuestState)3, false); ((Quest)this).End(); } catch (Exception) { throw; } } public override void End() { try { if ((Object)(object)((Quest)this).hudUI != (Object)null) { ((Quest)this).hudUI.Complete(); } TimeManager instance = NetworkSingleton.Instance; if ((Object)(object)instance == (Object)null) { return; } Action action = ((Quest)this).OnMinPass; instance.onHourPass -= Action.op_Implicit((Action)HourPass); instance.onMinutePass.Remove(Action.op_Implicit(action)); } catch (Exception) { throw; } ((Component)this).gameObject.SetActive(false); } public void SetupSelf() { //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Expected O, but got Unknown //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Expected O, but got Unknown //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Expected O, but got Unknown //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Expected O, but got Unknown //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Expected O, but got Unknown //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Expected O, but got Unknown //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Expected O, but got Unknown //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Expected O, but got Unknown //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Expected O, but got Unknown //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Expected O, but got Unknown //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Expected O, but got Unknown //IL_038c: Unknown result type (might be due to invalid IL or missing references) //IL_03da: Unknown result type (might be due to invalid IL or missing references) //IL_0464: Unknown result type (might be due to invalid IL or missing references) //IL_04b2: Unknown result type (might be due to invalid IL or missing references) //IL_0548: Unknown result type (might be due to invalid IL or missing references) //IL_05eb: Unknown result type (might be due to invalid IL or missing references) //IL_0639: Unknown result type (might be due to invalid IL or missing references) //IL_06b7: Unknown result type (might be due to invalid IL or missing references) //IL_0766: Unknown result type (might be due to invalid IL or missing references) //IL_0821: Unknown result type (might be due to invalid IL or missing references) float num = 0f; Enumerator enumerator = NetworkSingleton.Instance.Influence.regionInfluence.GetEnumerator(); while (enumerator.MoveNext()) { RegionInfluenceData current = enumerator.Current; num += current.Influence; } float num2 = num / (float)NetworkSingleton.Instance.Influence.regionInfluence.Count; questDifficultyScalar = 1f + num2; ((Object)this).name = "Quest_InfiltrateManor"; ((Quest)this).Expires = false; ((Quest)this).title = "Infiltrate Manor"; ((Quest)this).CompletionXP = Mathf.RoundToInt(600f * questDifficultyScalar); ((Quest)this).Description = "Find info about Thomas Benzie and break into Manor"; ((Quest)this).TrackOnBegin = true; ((Quest)this).autoInitialize = false; ((Quest)this).AutoCompleteOnAllEntriesComplete = false; ((Quest)this).onActiveState = new UnityEvent(); ((Quest)this).onComplete = new UnityEvent(); ((Quest)this).onInitialComplete = new UnityEvent(); ((Quest)this).onQuestBegin = new UnityEvent(); ((Quest)this).onQuestEnd = new UnityEvent(); ((Quest)this).onTrackChange = new UnityEvent(); ((Quest)this).SetGUID(Guid.NewGuid()); Transform questContainer = NetworkSingleton.Instance.QuestContainer; Transform val = ((questContainer != null) ? questContainer.GetChild(0) : null); if ((Object)(object)val != (Object)null) { ((Component)this).transform.SetParent(val); } ((Quest)this).IconPrefab = EndGameQuest.MakeIcon(((Component)this).transform); ((Quest)this).PoIPrefab = EndGameQuest.MakePOI(); GameObject val2 = new GameObject("QuestEntry_InvestigateWoods"); val2.transform.SetParent(((Component)this).transform); GameObject val3 = new GameObject("QuestEntry_ReturnToRay"); val3.transform.SetParent(((Component)this).transform); GameObject val4 = new GameObject("QuestEntry_WaitForNight"); val4.transform.SetParent(((Component)this).transform); GameObject val5 = new GameObject("QuestEntry_BreakIn"); val5.transform.SetParent(((Component)this).transform); GameObject val6 = new GameObject("QuestEntry_DefeatManorGoons"); val6.transform.SetParent(((Component)this).transform); GameObject val7 = new GameObject("QuestEntry_SearchResidence"); val7.transform.SetParent(((Component)this).transform); GameObject val8 = new GameObject("QuestEntry_EscapeManor"); val8.transform.SetParent(((Component)this).transform); QuestEntry investigate = val2.AddComponent(); QuestEntry returnToRay = val3.AddComponent(); QuestEntry waitForNight = val4.AddComponent(); QuestEntry breakIn = val5.AddComponent(); QuestEntry defeatGoons = val6.AddComponent(); QuestEntry searchResidence = val7.AddComponent(); QuestEntry escapeManor = val8.AddComponent(); QuestEntry_InvestigateWoods = investigate; QuestEntry_ReturnToRay = returnToRay; QuestEntry_WaitForNight = waitForNight; QuestEntry_BreakIn = breakIn; QuestEntry_DefeatManorGoons = defeatGoons; QuestEntry_SearchResidence = searchResidence; QuestEntry_EscapeManor = escapeManor; ((Quest)this).Entries = new List(); ((Quest)this).Entries.Add(investigate); ((Quest)this).Entries.Add(returnToRay); ((Quest)this).Entries.Add(waitForNight); ((Quest)this).Entries.Add(breakIn); ((Quest)this).Entries.Add(defeatGoons); ((Quest)this).Entries.Add(searchResidence); ((Quest)this).Entries.Add(escapeManor); investigate.SetEntryTitle("Investigate the hillside forest near Manor (0/4)"); investigate.ParentQuest = (Quest)(object)this; investigate.CompleteParentQuest = false; investigate.PoILocation = new GameObject("InvestigateEntry_POI").transform; ((Component)investigate.PoILocation).transform.SetParent(((Component)investigate).transform); ((Component)investigate.PoILocation).transform.position = new Vector3(164.96f, 3.1f, -32.65f); investigate.AutoUpdatePoILocation = true; investigate.SetState((EQuestState)1, true); UnityAction investigateCompleteAction = null; investigateCompleteAction = UnityAction.op_Implicit((Action)OnInvestigateComplete); investigate.onComplete.AddListener(investigateCompleteAction); returnToRay.SetEntryTitle("Return to Ray and ask for more information"); returnToRay.ParentQuest = (Quest)(object)this; returnToRay.CompleteParentQuest = false; returnToRay.PoILocation = new GameObject("ReturnToRayEntry_POI").transform; ((Component)returnToRay.PoILocation).transform.SetParent(((Component)returnToRay).transform); ((Component)returnToRay.PoILocation).transform.position = new Vector3(77.3f, 1.46f, -12.85f); returnToRay.AutoUpdatePoILocation = true; returnToRay.SetState((EQuestState)0, false); UnityAction returnToRayAction = null; returnToRayAction = UnityAction.op_Implicit((Action)OnReturnToRayComplete); returnToRay.onComplete.AddListener(returnToRayAction); waitForNight.SetEntryTitle("Wait for night time (22:00)"); waitForNight.ParentQuest = (Quest)(object)this; waitForNight.CompleteParentQuest = false; waitForNight.AutoCreatePoI = false; waitForNight.PoILocation = new GameObject("WaitForNightEntry_POI").transform; ((Component)waitForNight.PoILocation).transform.SetParent(((Component)waitForNight).transform); waitForNight.SetState((EQuestState)0, false); UnityAction waitForNightAction = null; waitForNightAction = UnityAction.op_Implicit((Action)OnWaitForNightComplete); waitForNight.onComplete.AddListener(waitForNightAction); breakIn.SetEntryTitle("Break into Manor through the back door"); breakIn.ParentQuest = (Quest)(object)this; breakIn.CompleteParentQuest = false; breakIn.PoILocation = new GameObject("BreakInEntry_POI").transform; ((Component)breakIn.PoILocation).transform.SetParent(((Component)breakIn).transform); ((Component)breakIn.PoILocation).transform.position = new Vector3(163.37f, 11.86f, -50.12f); breakIn.SetState((EQuestState)0, false); UnityAction breakInAction = null; breakInAction = UnityAction.op_Implicit((Action)OnBreakInComplete); breakIn.onComplete.AddListener(breakInAction); defeatGoons.SetEntryTitle("Defeat the Manor Goons"); defeatGoons.ParentQuest = (Quest)(object)this; defeatGoons.CompleteParentQuest = false; defeatGoons.PoILocation = new GameObject("DefeatGoonsEntry_POI").transform; ((Component)defeatGoons.PoILocation).transform.SetParent(((Component)defeatGoons).transform); defeatGoons.AutoCreatePoI = false; defeatGoons.SetState((EQuestState)0, false); UnityAction defeatGoonsAction = null; defeatGoonsAction = UnityAction.op_Implicit((Action)OnDefeatGoonsComplete); defeatGoons.onComplete.AddListener(defeatGoonsAction); searchResidence.SetEntryTitle("Investigate the upstairs rooms (0/4)"); searchResidence.ParentQuest = (Quest)(object)this; searchResidence.CompleteParentQuest = false; searchResidence.PoILocation = new GameObject("SearchResidenceEntry_POI").transform; ((Component)searchResidence.PoILocation).transform.SetParent(((Component)searchResidence).transform); searchResidence.AutoUpdatePoILocation = true; searchResidence.SetState((EQuestState)0, false); UnityAction searchResidenceAction = null; searchResidenceAction = UnityAction.op_Implicit((Action)OnSearchResidenceComplete); searchResidence.onComplete.AddListener(searchResidenceAction); escapeManor.SetEntryTitle("Escape the Manor before the Police arrive"); escapeManor.ParentQuest = (Quest)(object)this; escapeManor.CompleteParentQuest = false; escapeManor.AutoCreatePoI = false; escapeManor.PoILocation = new GameObject("EscapeManorEntry_POI").transform; ((Component)escapeManor.PoILocation).transform.SetParent(((Component)escapeManor).transform); escapeManor.SetState((EQuestState)0, false); TimeManager instance = NetworkSingleton.Instance; Action action = ((Quest)this).OnMinPass; instance.onHourPass += Action.op_Implicit((Action)HourPass); instance.onMinutePass += Action.op_Implicit(action); StartQuestDetail(); void OnBreakInComplete() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Invalid comparison between Unknown and I4 if ((!((Object)(object)breakIn != (Object)null) || (int)breakIn.State != 3) && !((Object)(object)defeatGoons == (Object)null)) { SpawnManorGoons(); defeatGoons.Begin(); if (defeatGoons.compassElement != null) { defeatGoons.compassElement.Visible = false; } if ((Delegate)(object)breakInAction != (Delegate)null) { breakIn.onComplete.RemoveListener(breakInAction); breakInAction = null; } } } void OnDefeatGoonsComplete() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Invalid comparison between Unknown and I4 //IL_0058: Unknown result type (might be due to invalid IL or missing references) if ((!((Object)(object)defeatGoons != (Object)null) || (int)defeatGoons.State != 3) && !((Object)(object)searchResidence == (Object)null)) { searchResidence.Begin(); EndGameQuest.UpdateQuestMapLogo(searchResidence); searchResidence.SetPoILocation(roomsPositions.Keys.FirstOrDefault()); if ((Delegate)(object)defeatGoonsAction != (Delegate)null) { defeatGoons.onComplete.RemoveListener(defeatGoonsAction); defeatGoonsAction = null; } } } void OnInvestigateComplete() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Invalid comparison between Unknown and I4 //IL_0052: Unknown result type (might be due to invalid IL or missing references) if ((!((Object)(object)investigate != (Object)null) || (int)investigate.State != 3) && !((Object)(object)returnToRay == (Object)null)) { returnToRay.Begin(); EndGameQuest.UpdateQuestMapLogo(returnToRay); returnToRay.SetPoILocation(((Component)EndGameQuest.ray).transform.position); MelonCoroutines.Start(EndGameQuest.GenRaySecondDialog((Action)QuestEntry_ReturnToRay.Complete)); if ((Delegate)(object)investigateCompleteAction != (Delegate)null) { investigate.onComplete.RemoveListener(investigateCompleteAction); investigateCompleteAction = null; } } } void OnReturnToRayComplete() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Invalid comparison between Unknown and I4 if ((!((Object)(object)returnToRay != (Object)null) || (int)returnToRay.State != 3) && !((Object)(object)waitForNight == (Object)null)) { waitForNight.Begin(); if (waitForNight.compassElement != null) { waitForNight.compassElement.Visible = false; } CartelEnforcer.coros.Add(MelonCoroutines.Start(RandomManorGenerator.SetupManor())); if ((Delegate)(object)returnToRayAction != (Delegate)null) { returnToRay.onComplete.RemoveListener(returnToRayAction); returnToRayAction = null; } } } void OnSearchResidenceComplete() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Invalid comparison between Unknown and I4 if (((Object)(object)searchResidence != (Object)null && (int)searchResidence.State == 3) || (Object)(object)escapeManor == (Object)null) { return; } escapeManor.Begin(); if (escapeManor.compassElement != null) { escapeManor.compassElement.Visible = false; } Player.Local.CrimeData.SetPursuitLevel((EPursuitLevel)1); PoliceStation.PoliceStations[0].Dispatch(1, Player.Local, (EDispatchType)0, true); if ((Delegate)(object)searchResidenceAction != (Delegate)null) { searchResidence.onComplete.RemoveListener(searchResidenceAction); searchResidenceAction = null; } try { if (RandomManorGenerator.activeJukebox.IsPlaying) { RandomManorGenerator.OnJukeboxStateChange(); } } catch (Exception) { } } void OnWaitForNightComplete() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Invalid comparison between Unknown and I4 if ((!((Object)(object)waitForNight != (Object)null) || (int)waitForNight.State != 3) && !((Object)(object)breakIn == (Object)null)) { breakIn.Begin(); EndGameQuest.UpdateQuestMapLogo(breakIn); if ((Delegate)(object)waitForNightAction != (Delegate)null) { waitForNight.onComplete.RemoveListener(waitForNightAction); waitForNightAction = null; } } } } private void StartQuestDetail() { ((Quest)this).SetupHUDUI(); if ((Object)(object)((Quest)this).hudUI != (Object)null) { if ((Object)(object)((Quest)this).hudUI.MainLabel != (Object)null) { ((TMP_Text)((Quest)this).hudUI.MainLabel).text = "Infiltrate Manor"; } ((Component)((Quest)this).hudUI).gameObject.SetActive(true); } ((Quest)this).SetIsTracked(true); ((Quest)this).SetQuestState((EQuestState)1, true); EndGameQuest.UpdateQuestMapLogo(QuestEntry_InvestigateWoods); } public void SpawnManorGoons() { //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_03bf: Unknown result type (might be due to invalid IL or missing references) //IL_03c9: Expected O, but got Unknown //IL_03fe: Unknown result type (might be due to invalid IL or missing references) //IL_0403: Unknown result type (might be due to invalid IL or missing references) List list = roomsPositions.Keys.ToList(); if (NetworkSingleton.Instance.GoonPool.unspawnedGoons.Count == 0) { foreach (CartelGoon item in (Il2CppArrayBase)(object)NetworkSingleton.Instance.GoonPool.goons) { if (NetworkSingleton.Instance.GoonPool.unspawnedGoons.Count >= 3) { break; } if (NetworkSingleton.Instance.GoonPool.spawnedGoons.Contains(item) && item.IsGoonSpawned && (((NPC)item).Health.IsDead || ((NPC)item).Health.IsKnockedOut)) { ((NPC)item).Health.Revive(); item.Despawn(); } } } for (int i = 0; i < 3; i++) { CartelGoon goon = NetworkSingleton.Instance.GoonPool.SpawnGoon(list[i]); ((Component)((NPC)goon).Behaviour.ScheduleManager.ActionList[0]).gameObject.SetActive(false); ((NPC)goon).Behaviour.ScheduleManager.DisableSchedule(); goon.IsGoonSpawned = true; if (!((Component)goon).gameObject.activeSelf) { ((Component)goon).gameObject.SetActive(true); } if (!((Behaviour)((NPC)goon).Avatar).enabled || !((Component)((NPC)goon).Avatar).gameObject.activeSelf) { ((Component)((NPC)goon).Avatar).gameObject.SetActive(true); ((Behaviour)((NPC)goon).Avatar).enabled = true; } SetupGoonWeapon(goon); ((NPC)goon).Inventory.AddCash(Mathf.Round(Random.Range(500f * questDifficultyScalar, 1300f * questDifficultyScalar))); ((NPC)goon).Health.MaxHealth = Mathf.Round(Mathf.Lerp(150f, 300f, questDifficultyScalar - 1f)); ((NPC)goon).Health.Health = Mathf.Round(Mathf.Lerp(150f, 300f, questDifficultyScalar - 1f)); UnityAction onGoonDiedAction = null; onGoonDiedAction = UnityAction.op_Implicit((Action)onGoonDie); ((NPC)goon).Health.onDieOrKnockedOut.AddListener(onGoonDiedAction); if (GiveUpRange == 0f) { GiveUpRange = ((NPC)goon).Behaviour.CombatBehaviour.GiveUpRange; GiveUpAfterSuccessfulHits = ((NPC)goon).Behaviour.CombatBehaviour.GiveUpAfterSuccessfulHits; DefaultSearchTime = ((NPC)goon).Behaviour.CombatBehaviour.DefaultSearchTime; } ((NPC)goon).Behaviour.CombatBehaviour.GiveUpRange = 60f; ((NPC)goon).Behaviour.CombatBehaviour.GiveUpAfterSuccessfulHits = 60; ((NPC)goon).Behaviour.CombatBehaviour.DefaultSearchTime = 120f; ((NPC)goon).Behaviour.CombatBehaviour.SetTarget(((Component)Player.Local).GetComponent().NetworkObject); ((Behaviour)((NPC)goon).Behaviour.CombatBehaviour).Enable_Networked(); float num = Mathf.Lerp(Random.Range(0.42f, 0.55f), 0.67f, questDifficultyScalar - 1f); ((NPC)goon).Movement.SpeedController.AddSpeedControl(new SpeedControl("combat", 5, num)); ((NPC)goon).Movement.Agent.avoidancePriority = 30; EndGameQuest.manorGoons.Add(goon); List manorGoonGuids = EndGameQuest.manorGoonGuids; Guid gUID = ((NPC)goon).GUID; manorGoonGuids.Add(((object)(Guid)(ref gUID)).ToString()); void onGoonDie() { manorGoonsAlive--; if ((Delegate)(object)onGoonDiedAction != (Delegate)null) { ((NPC)goon).Health.onDieOrKnockedOut.RemoveListener(onGoonDiedAction); onGoonDiedAction = null; } } } manorGoonsAlive = EndGameQuest.manorGoons.Count(); } private void SetupGoonWeapon(CartelGoon goon) { ((NPC)goon).Behaviour.CombatBehaviour.SetWeapon("Avatar/Equippables/M1911"); if (!((Object)(object)((NPC)goon).Behaviour.CombatBehaviour.currentWeapon != (Object)null)) { return; } AvatarRangedWeapon val = null; try { val = ((Il2CppObjectBase)((NPC)goon).Behaviour.CombatBehaviour.currentWeapon).Cast(); } catch (InvalidCastException ex) { MelonLogger.Warning("Failed to Cast Manor Goon Weapon Instance: " + ex); } if ((Object)(object)val != (Object)null) { float num = 26f; float num2 = 45f; float num3 = Mathf.Clamp01(questDifficultyScalar - 1f); val.CanShootWhileMoving = true; val.AimTime_Max = 0.3f; val.AimTime_Min = 0.1f; val.HitChance_MaxRange = 65f; val.HitChance_MinRange = 85f; val.MaxFireRate = Mathf.Round(Mathf.Lerp(0.7f, 1.2f, num3)); val.MaxMovingShotsBeforeReposition = 3; val.MaxStationaryShotsBeforeReposition = 1; ((AvatarWeapon)val).MaxUseRange = 7f; ((AvatarWeapon)val).MinUseRange = 0.1f; ((AvatarWeapon)val).CooldownDuration = Mathf.Round(Mathf.Lerp(0.7f, 1.2f, num3)); val.Damage = Mathf.Round(Mathf.Lerp(num, num2, num3)); if (CartelEnforcer.currentConfig.debugMode) { val.Damage = 0f; } } if ((Object)(object)((NPC)goon).Behaviour.CombatBehaviour.currentWeapon != (Object)null && (Object)(object)((NPC)goon).Behaviour.CombatBehaviour.DefaultWeapon == (Object)null) { ((NPC)goon).Behaviour.CombatBehaviour.DefaultWeapon = ((NPC)goon).Behaviour.CombatBehaviour.currentWeapon; } } private void SpawnForestGoon() { //IL_0034: 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_0327: Expected O, but got Unknown //IL_034e: Unknown result type (might be due to invalid IL or missing references) if (NetworkSingleton.Instance.GoonPool.unspawnedGoons.Count == 0) { return; } CartelGoon val = NetworkSingleton.Instance.GoonPool.SpawnGoon(forestSearchLocs[forestSearchLocs.Count - 1]); ((Component)((NPC)val).Behaviour.ScheduleManager.ActionList[0]).gameObject.SetActive(false); ((NPC)val).Behaviour.ScheduleManager.DisableSchedule(); if (!((Component)val).gameObject.activeSelf) { ((Component)val).gameObject.SetActive(true); } if (!((Behaviour)((NPC)val).Avatar).enabled || !((Component)((NPC)val).Avatar).gameObject.activeSelf) { ((Component)((NPC)val).Avatar).gameObject.SetActive(true); ((Behaviour)((NPC)val).Avatar).enabled = true; } ((NPC)val).Inventory.AddCash(Mathf.Round(Random.Range(500f * questDifficultyScalar, 1300f * questDifficultyScalar))); ((NPC)val).Health.MaxHealth = Mathf.Round(Mathf.Lerp(35f, 85f, questDifficultyScalar - 1f)); ((NPC)val).Health.Health = Mathf.Round(Mathf.Lerp(35f, 85f, questDifficultyScalar - 1f)); ((NPC)val).Behaviour.CombatBehaviour.SetWeapon("Avatar/Equippables/Knife"); if ((Object)(object)((NPC)val).Behaviour.CombatBehaviour.currentWeapon != (Object)null) { AvatarMeleeWeapon val2 = null; try { val2 = ((Il2CppObjectBase)((NPC)val).Behaviour.CombatBehaviour.currentWeapon).Cast(); } catch (InvalidCastException ex) { MelonLogger.Warning("Failed to Cast Manor Goon Weapon Instance: " + ex); } if ((Object)(object)val2 != (Object)null) { float num = 66f; float num2 = 87f; float num3 = Mathf.Clamp01(questDifficultyScalar - 1f); ((AvatarWeapon)val2).MaxUseRange = 2.7f; ((AvatarWeapon)val2).MinUseRange = 0.2f; val2.AttackRadius = Mathf.Lerp(2.3f, 3.7f, num3); val2.AttackRange = Mathf.Lerp(2.3f, 3.7f, num3); ((AvatarWeapon)val2).CooldownDuration = Mathf.Lerp(0.6f, 1.2f, num3); val2.Damage = Mathf.Round(Mathf.Lerp(num, num2, num3)); if (CartelEnforcer.currentConfig.debugMode) { val2.Damage = 0f; } } if ((Object)(object)((NPC)val).Behaviour.CombatBehaviour.currentWeapon != (Object)null && (Object)(object)((NPC)val).Behaviour.CombatBehaviour.DefaultWeapon == (Object)null) { ((NPC)val).Behaviour.CombatBehaviour.DefaultWeapon = ((NPC)val).Behaviour.CombatBehaviour.currentWeapon; } } ((NPC)val).Behaviour.CombatBehaviour.SetTarget(((Component)Player.Local).GetComponent().NetworkObject); ((Behaviour)((NPC)val).Behaviour.CombatBehaviour).Enable_Networked(); float num4 = Mathf.Lerp(Random.Range(0.55f, 0.76f), 0.86f, questDifficultyScalar - 1f); ((NPC)val).Movement.SpeedController.AddSpeedControl(new SpeedControl("combat", 5, num4)); ((NPC)val).Movement.Agent.avoidancePriority = 30; ((Component)val).transform.localScale = new Vector3(0.81f, 0.81f, 0.81f); CartelEnforcer.coros.Add(MelonCoroutines.Start(DespawnForestGoon(val))); } [IteratorStateMachine(typeof(d__21))] private IEnumerator DespawnForestGoon(CartelGoon goon) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__21(0) { goon = goon }; } public override void OnMinPass() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Invalid comparison between Unknown and I4 //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Invalid comparison between Unknown and I4 //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Invalid comparison between Unknown and I4 //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_037e: Invalid comparison between Unknown and I4 //IL_0509: Unknown result type (might be due to invalid IL or missing references) //IL_050f: Invalid comparison between Unknown and I4 //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_051e: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0590: Unknown result type (might be due to invalid IL or missing references) //IL_0530: Unknown result type (might be due to invalid IL or missing references) //IL_053f: Unknown result type (might be due to invalid IL or missing references) //IL_05a1: Unknown result type (might be due to invalid IL or missing references) //IL_05a7: Invalid comparison between Unknown and I4 //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_03e3: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_03f8: Unknown result type (might be due to invalid IL or missing references) //IL_03fd: Unknown result type (might be due to invalid IL or missing references) //IL_0411: Unknown result type (might be due to invalid IL or missing references) //IL_046a: Unknown result type (might be due to invalid IL or missing references) if (!CartelEnforcer.registered || Singleton.Instance.IsSaving || EndGameQuest.manorCompleted || (int)((Quest)this).State != 1 || !InstanceFinder.IsServer) { return; } if ((Object)(object)QuestEntry_InvestigateWoods != (Object)null && (int)QuestEntry_InvestigateWoods.State == 1) { QuestEntry_InvestigateWoods.SetEntryTitle($"Investigate the hillside forest near Manor ({forestPosSearched}/4)"); if (forestPosSearched > 0 && forestPosSearched < 3 && !forestGoonSpawned && Random.Range(0f, 1f) > 0.9f) { forestGoonSpawned = true; SpawnForestGoon(); } if (forestSearchLocs == null) { return; } if (forestPosSearched == 4) { QuestEntry_InvestigateWoods.SetEntryTitle("Investigate the hillside forest near Manor (4/4)"); QuestEntry_InvestigateWoods.Complete(); return; } if (forestPosSearched < forestSearchLocs.Count && Vector3.Distance(Player.Local.CenterPointTransform.position, forestSearchLocs[forestPosSearched]) < 5f) { forestPosSearched++; QuestEntry_InvestigateWoods.SetEntryTitle($"Investigate the hillside forest near Manor ({forestPosSearched}/4)"); if (forestPosSearched >= forestSearchLocs.Count) { QuestEntry_InvestigateWoods.SetEntryTitle("Investigate the hillside forest near Manor (4/4)"); QuestEntry_InvestigateWoods.Complete(); return; } QuestEntry_InvestigateWoods.SetPoILocation(forestSearchLocs[forestPosSearched]); } if (NetworkSingleton.Instance.CurrentTime >= 2200) { EndGameQuest.manorCompleted = true; QuestEntry_InvestigateWoods.SetState((EQuestState)3, true); CartelEnforcer.coros.Add(MelonCoroutines.Start(EndGameQuest.ResetRayAFK())); ((Quest)this).Fail(true); } } else if ((Object)(object)QuestEntry_ReturnToRay != (Object)null && (int)QuestEntry_ReturnToRay.State == 1) { if (NetworkSingleton.Instance.CurrentTime >= 2200) { EndGameQuest.manorCompleted = true; QuestEntry_ReturnToRay.SetState((EQuestState)3, true); CartelEnforcer.coros.Add(MelonCoroutines.Start(EndGameQuest.ResetRayAFK())); ((Quest)this).Fail(true); } } else if ((Object)(object)QuestEntry_DefeatManorGoons != (Object)null && (int)QuestEntry_DefeatManorGoons.State == 1) { if (EndGameQuest.manorGoons != null && EndGameQuest.manorGoons.Count > 0 && manorGoonsAlive == 0) { QuestEntry_DefeatManorGoons.Complete(); } if (Vector3.Distance(QuestEntry_BreakIn.PoILocation.position, Player.Local.CenterPointTransform.position) > 70f) { EndGameQuest.manorCompleted = true; CartelEnforcer.coros.Add(MelonCoroutines.Start(RandomManorGenerator.CleanupManor())); ((Quest)this).Fail(true); } else if (NetworkSingleton.Instance.CurrentTime < 2200 && NetworkSingleton.Instance.CurrentTime > 359) { EndGameQuest.manorCompleted = true; QuestEntry_DefeatManorGoons.SetState((EQuestState)3, true); CartelEnforcer.coros.Add(MelonCoroutines.Start(RandomManorGenerator.CleanupManor())); ((Quest)this).Fail(true); } } else if ((Object)(object)QuestEntry_SearchResidence != (Object)null && (int)QuestEntry_SearchResidence.State == 1) { QuestEntry_SearchResidence.SetEntryTitle($"Investigate the upstairs rooms ({roomsVisited}/4)"); bool flag = true; foreach (KeyValuePair roomsPosition in roomsPositions) { Vector3 key = roomsPosition.Key; if (!roomsPosition.Value && Vector3.Distance(Player.Local.CenterPointTransform.position, key) < 1.85f) { roomsPositions[key] = true; roomsVisited++; break; } } foreach (KeyValuePair roomsPosition2 in roomsPositions) { if (!roomsPosition2.Value) { QuestEntry_SearchResidence.SetPoILocation(roomsPosition2.Key); flag = false; break; } } if (flag) { QuestEntry_SearchResidence.Complete(); } else if (NetworkSingleton.Instance.CurrentTime < 2200 && NetworkSingleton.Instance.CurrentTime > 359) { EndGameQuest.manorCompleted = true; QuestEntry_SearchResidence.SetState((EQuestState)3, true); CartelEnforcer.coros.Add(MelonCoroutines.Start(RandomManorGenerator.CleanupManor())); ((Quest)this).Fail(true); } } else if ((Object)(object)QuestEntry_EscapeManor != (Object)null && (int)QuestEntry_EscapeManor.State == 1) { if ((int)Player.Local.CrimeData.CurrentPursuitLevel == 0 && Vector3.Distance(QuestEntry_BreakIn.PoILocation.position, Player.Local.CenterPointTransform.position) > 70f) { EndGameQuest.manorCompleted = true; CartelEnforcer.coros.Add(MelonCoroutines.Start(RandomManorGenerator.CleanupManor())); CartelEnforcer.coros.Add(MelonCoroutines.Start(EndGameQuest.QuestManorReward())); ((Quest)this).Complete(true); } else if ((int)Player.Local.CrimeData.CurrentPursuitLevel != 0 && (int)Player.Local.CrimeData.CurrentPursuitLevel != 1) { EndGameQuest.manorCompleted = true; QuestEntry_EscapeManor.SetState((EQuestState)3, true); CartelEnforcer.coros.Add(MelonCoroutines.Start(RandomManorGenerator.CleanupManor())); ((Quest)this).Fail(true); } } } private void HourPass() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Invalid comparison between Unknown and I4 //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Invalid comparison between Unknown and I4 if (CartelEnforcer.registered && !Singleton.Instance.IsSaving && !EndGameQuest.manorCompleted && (int)((Quest)this).State == 1 && InstanceFinder.IsServer && (Object)(object)QuestEntry_WaitForNight != (Object)null && (int)QuestEntry_WaitForNight.State == 1 && NetworkSingleton.Instance.CurrentTime >= 2200 && NetworkSingleton.Instance.CurrentTime <= 2359) { QuestEntry_WaitForNight.Complete(); } } } public static class MiniQuest { public class NpcQuestStatus { public bool HasAskedQuestToday { get; set; } public bool HasActiveQuest { get; set; } } [CompilerGenerated] private sealed class <>c__DisplayClass13_0 { public bool opened; public bool changeInfluence; public DeadDrop entity; public Action onOpenedAction; } [CompilerGenerated] private sealed class d__13 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DeadDrop entity; private <>c__DisplayClass13_0 <>8__1; public List filledItems; public bool useShortTimeout; public List itemsFromPool; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__13(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass13_0(); <>8__1.entity = entity; <>2__current = CartelEnforcer.Wait5; <>1__state = 1; return true; case 1: { <>1__state = -1; if (!CartelEnforcer.registered) { return false; } <>8__1.changeInfluence = InfluenceOverrides.ShouldChangeInfluence(<>8__1.entity.Region); for (int i = 0; i < filledItems.Count; i++) { ((StorageEntity)<>8__1.entity.Storage).InsertItem(filledItems[i], true); } <>8__1.opened = false; <>8__1.onOpenedAction = null; <>8__1.onOpenedAction = Action.op_Implicit((Action)WrapOnOpenCallback); WorldStorageEntity storage2 = <>8__1.entity.Storage; ((StorageEntity)storage2).onOpened = ((StorageEntity)storage2).onOpened + <>8__1.onOpenedAction; <>2__current = CartelEnforcer.Wait60; <>1__state = 2; return true; } case 2: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } if (!useShortTimeout) { <>2__current = CartelEnforcer.Wait60; <>1__state = 3; return true; } goto IL_0176; case 3: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } goto IL_0176; case 4: { <>1__state = -1; return false; } IL_0176: if (!<>8__1.opened) { if (<>8__1.changeInfluence) { NetworkSingleton.Instance.Influence.ChangeInfluence(<>8__1.entity.Region, CartelEnforcer.influenceConfig.deadDropFail); } if (itemsFromPool != null && itemsFromPool.Count > 0) { CartelInventory.CartelStealsItems(itemsFromPool); } ((StorageEntity)<>8__1.entity.Storage).ClearContents(); } if ((Delegate)(object)<>8__1.onOpenedAction != (Delegate)null) { WorldStorageEntity storage = <>8__1.entity.Storage; ((StorageEntity)storage).onOpened = ((StorageEntity)storage).onOpened - <>8__1.onOpenedAction; <>8__1.onOpenedAction = null; } <>2__current = null; <>1__state = 4; return true; } void WrapOnOpenCallback() { //IL_002b: 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: Invalid comparison between Unknown and I4 //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Invalid comparison between Unknown and I4 NetworkSingleton.Instance.AddXP(100); ((<>c__DisplayClass13_0)this).opened = true; if (((<>c__DisplayClass13_0)this).changeInfluence) { NetworkSingleton.Instance.Influence.ChangeInfluence(((<>c__DisplayClass13_0)this).entity.Region, CartelEnforcer.influenceConfig.deadDropSuccess); } if ((Object)(object)EndGameQuest.activeQuest != (Object)null && (int)((Quest)EndGameQuest.activeQuest).State == 1 && (Object)(object)EndGameQuest.activeQuest.QuestEntry_Investigate != (Object)null && (int)EndGameQuest.activeQuest.QuestEntry_Investigate.State == 1 && EndGameQuest.StageDeadDropsObserved <= 1) { EndGameQuest.StageDeadDropsObserved++; } if ((Delegate)(object)((<>c__DisplayClass13_0)this).onOpenedAction != (Delegate)null) { WorldStorageEntity storage3 = ((<>c__DisplayClass13_0)this).entity.Storage; ((StorageEntity)storage3).onOpened = ((StorageEntity)storage3).onOpened - ((<>c__DisplayClass13_0)this).onOpenedAction; ((<>c__DisplayClass13_0)this).onOpenedAction = null; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__12 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DialogueController controller; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__12(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = CartelEnforcer.Wait05; <>1__state = 1; return true; case 1: { <>1__state = -1; if (!CartelEnforcer.registered) { return false; } List choices = controller.Choices; choices.RemoveAt(choices.Count - 1); controller.Choices = choices; <>2__current = null; <>1__state = 2; return true; } case 2: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__8 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private WaitForSeconds 5__2; private bool 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__8(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Invalid comparison between Unknown and I4 switch (<>1__state) { default: return false; case 0: { <>1__state = -1; 5__2 = new WaitForSeconds(240f); 5__3 = false; bool flag = false; bool flag2 = false; break; } case 1: { <>1__state = -1; if (!CartelEnforcer.currentConfig.miniQuestsEnabled) { break; } bool flag = (int)NetworkSingleton.Instance.Status == 2; bool flag2 = ((NetworkSingleton.Instance.CurrentTime >= 659 && NetworkSingleton.Instance.CurrentTime <= 2359) ? true : false); if (flag && flag2) { NPC val = targetNPCsList[Random.Range(0, targetNPCsList.Count)]; if (targetNPCs.ContainsKey(val) && !targetNPCs[val].HasActiveQuest && !targetNPCs[val].HasAskedQuestToday) { float num = 1f; if (!val.RelationData.Unlocked) { num = Random.Range(0f, 1f); } if (num > 0.2f) { targetNPCs[val].HasActiveQuest = true; InitMiniQuestDialogue(val); 5__3 = true; } } } if (5__3) { <>2__current = 5__2; <>1__state = 2; return true; } <>2__current = CartelEnforcer.Wait30; <>1__state = 3; return true; } case 2: <>1__state = -1; goto IL_018c; case 3: { <>1__state = -1; goto IL_018c; } IL_018c: if (!CartelEnforcer.registered) { return false; } 5__3 = false; break; } if (CartelEnforcer.registered) { <>2__current = CartelEnforcer.Wait2; <>1__state = 1; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__11 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DialogueController controller; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__11(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = CartelEnforcer.Wait10; <>1__state = 1; return true; case 1: <>1__state = -1; controller.handler.WorldspaceRend.ShowText("You need to hurry before they grab it!", 5f); <>2__current = null; <>1__state = 2; return true; case 2: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__6 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__6(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: { <>1__state = -1; Anna val = Object.FindObjectOfType(); if ((Object)(object)val != (Object)null) { targetNPCs.Add((NPC)(object)val, new NpcQuestStatus { HasAskedQuestToday = false, HasActiveQuest = false }); } Fiona val2 = Object.FindObjectOfType(); if ((Object)(object)val2 != (Object)null) { targetNPCs.Add((NPC)(object)val2, new NpcQuestStatus { HasAskedQuestToday = false, HasActiveQuest = false }); } Dean val3 = Object.FindObjectOfType(); if ((Object)(object)val3 != (Object)null) { targetNPCs.Add((NPC)(object)val3, new NpcQuestStatus { HasAskedQuestToday = false, HasActiveQuest = false }); } Mick val4 = Object.FindObjectOfType(); if ((Object)(object)val4 != (Object)null) { targetNPCs.Add((NPC)(object)val4, new NpcQuestStatus { HasAskedQuestToday = false, HasActiveQuest = false }); } Jeff val5 = Object.FindObjectOfType(); if ((Object)(object)val5 != (Object)null) { targetNPCs.Add((NPC)(object)val5, new NpcQuestStatus { HasAskedQuestToday = false, HasActiveQuest = false }); } Dan val6 = Object.FindObjectOfType(); if ((Object)(object)val6 != (Object)null) { targetNPCs.Add((NPC)(object)val6, new NpcQuestStatus { HasAskedQuestToday = false, HasActiveQuest = false }); } Marco val7 = Object.FindObjectOfType(); if ((Object)(object)val7 != (Object)null) { targetNPCs.Add((NPC)(object)val7, new NpcQuestStatus { HasAskedQuestToday = false, HasActiveQuest = false }); } Herbert val8 = Object.FindObjectOfType(); if ((Object)(object)val8 != (Object)null) { targetNPCs.Add((NPC)(object)val8, new NpcQuestStatus { HasAskedQuestToday = false, HasActiveQuest = false }); } targetNPCsList = targetNPCs.Keys.ToList(); <>2__current = null; <>1__state = 1; return true; } case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static Dictionary targetNPCs = new Dictionary(); public static List targetNPCsList = new List(); public static List emptyDrops = new List(); public static List rareDrops = new List { "silverwatch", "goldwatch", "silverchain", "goldchain", "oldmanjimmys", "brutdugloop", "sewerkey" }; public static List commonDrops = new List { "cocaine", "meth", "greencrackseed", "ogkushseed" }; [IteratorStateMachine(typeof(d__6))] public static IEnumerator InitMiniQuest() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__6(0); } public static void OnDayPassNewDiag() { if (!CartelEnforcer.currentConfig.miniQuestsEnabled) { return; } foreach (NPC targetNPCs in targetNPCsList) { MiniQuest.targetNPCs[targetNPCs].HasAskedQuestToday = false; } } [IteratorStateMachine(typeof(d__8))] public static IEnumerator EvaluateMiniQuestCreation() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__8(0); } public static void InitMiniQuestDialogue(NPC npc) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown DialogueController controller = ((Component)npc.DialogueHandler).gameObject.GetComponent(); DialogueChoice choice = new DialogueChoice(); string value = ""; float paid = 500f; if (npc.RelationData != null) { paid = Mathf.Lerp(500f, 100f, npc.RelationData.NormalizedRelationDelta); } if (float.IsNaN(paid)) { paid = 500f; } paid = Mathf.Round(paid / 20f) * 20f; switch (Random.Range(0, 3)) { case 0: value = "Have you heard anything new about the Benzies?"; break; case 1: value = "Any rumours about the Cartel you could share?"; break; case 2: value = "What's the word around town? I need info on the Benzies."; break; } choice.ChoiceText = $"{value} (Bribe -${paid})"; choice.Enabled = true; choice.onChoosen.AddListener(UnityAction.op_Implicit((Action)OnMiniQuestChosenWrapped)); controller.AddDialogueChoice(choice, 0); void OnMiniQuestChosenWrapped() { OnMiniQuestChosen(choice, npc, controller, paid); } } public static void OnMiniQuestChosen(DialogueChoice choice, NPC npc, DialogueController controller, float paid) { //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Lerp(0.4f, 0.75f, npc.RelationData.NormalizedRelationDelta); bool flag = NetworkSingleton.Instance.cashBalance >= paid; if (NetworkSingleton.Instance.CurrentTime >= 1200 || NetworkSingleton.Instance.CurrentTime <= 1800) { num = Mathf.Lerp(num, 1f, num); } if (CartelGathering.areGoonsGathering) { num = Mathf.Lerp(num, 0f, 0.5f); } if (Random.Range(0f, 1f) < num && flag) { emptyDrops.Clear(); Enumerator enumerator = DeadDrop.DeadDrops.GetEnumerator(); while (enumerator.MoveNext()) { DeadDrop current = enumerator.Current; if (((StorageEntity)current.Storage).ItemCount == 0) { emptyDrops.Add(current); } } if (emptyDrops.Count == 0) { return; } DeadDrop val = emptyDrops[Random.Range(0, emptyDrops.Count)]; string text = ""; bool flag2 = false; if (Random.Range(0f, 1f) > num) { EMapRegion region = val.Region; text = ((object)(EMapRegion)(ref region)).ToString() + " region"; } else { text = val.DeadDropName; text = text.ToLower(); List list = text.Split(' ').ToList(); if (list.Count > 0 && (list[0] == "under" || list[0] == "behind")) { flag2 = true; } } List list2 = new List(); Func func = Registry.GetItem; if (Random.Range(0f, 1f) > 0.2f) { ItemDefinition obj = func(commonDrops[Random.Range(0, commonDrops.Count)]); int num2 = Random.Range(3, 11); ItemInstance defaultInstance = obj.GetDefaultInstance(num2); list2.Add(defaultInstance); } else { ItemDefinition obj2 = func(rareDrops[Random.Range(0, rareDrops.Count)]); int num2 = 1; ItemInstance defaultInstance = obj2.GetDefaultInstance(num2); list2.Add(defaultInstance); } List list3 = new List(); if (CartelInventory.cartelStolenItems.Count > 0) { list3 = CartelInventory.GetFromPool(2); if (list3.Count > 0) { list2.AddRange(list3); } } CartelEnforcer.coros.Add(MelonCoroutines.Start(CreateDropContent(val, list2, npc, list3, flag2))); controller.handler.ContinueSubmitted(); NetworkSingleton.Instance.ChangeCashBalance(0f - paid, true, false); string text2 = ""; switch (Random.Range(0, 5)) { case 0: text2 = (flag2 ? "" : "around"); controller.handler.WorldspaceRend.ShowText($"I heard them talk about some drop {text2} {text}...", 9f); break; case 1: text2 = (flag2 ? "" : "near"); controller.handler.WorldspaceRend.ShowText($"There are rumours about a suspicious drop {text2} {text}!", 9f); break; case 2: text2 = (flag2 ? "" : "near"); controller.handler.WorldspaceRend.ShowText($"Yes! I heard they stashed something {text2} {text}!", 9f); break; case 3: text2 = (flag2 ? "" : "around"); controller.handler.WorldspaceRend.ShowText($"I saw one of them hide something in a dead drop {text2} {text}.", 9f); break; case 4: text2 = (flag2 ? "" : "at"); controller.handler.WorldspaceRend.ShowText($"They have been stashing items {text2} {text}.", 9f); break; } CartelEnforcer.coros.Add(MelonCoroutines.Start(HurryUpMessage(controller))); } else if (CartelGathering.areGoonsGathering && CartelGathering.currentGatheringLocation != null && flag) { controller.handler.ContinueSubmitted(); NetworkSingleton.Instance.ChangeCashBalance(0f - paid, true, false); switch (Random.Range(0, 3)) { case 0: controller.handler.WorldspaceRend.ShowText("I saw a group of them at the " + CartelGathering.currentGatheringLocation.description, 15f); npc.PlayVO((EVOLineType)19, false); break; case 1: controller.handler.WorldspaceRend.ShowText("There is a group of Benzies at the " + CartelGathering.currentGatheringLocation.description, 15f); npc.PlayVO((EVOLineType)3, false); break; case 2: controller.handler.WorldspaceRend.ShowText("The Benzies are gathering at the " + CartelGathering.currentGatheringLocation.description, 15f); npc.PlayVO((EVOLineType)5, false); break; } } else { controller.handler.ContinueSubmitted(); switch (Random.Range(0, 3)) { case 0: controller.handler.WorldspaceRend.ShowText("I've heard nothing...", 15f); npc.PlayVO((EVOLineType)17, false); break; case 1: controller.handler.WorldspaceRend.ShowText("No! Leave me alone!", 15f); npc.Avatar.EmotionManager.AddEmotionOverride("Annoyed", "product_rejected", 6f, 1); npc.PlayVO((EVOLineType)9, false); break; case 2: controller.handler.WorldspaceRend.ShowText("I'm afraid to talk about it...", 15f); npc.PlayVO((EVOLineType)5, false); break; } } targetNPCs[npc].HasActiveQuest = false; targetNPCs[npc].HasAskedQuestToday = true; CartelEnforcer.coros.Add(MelonCoroutines.Start(DisposeChoice(controller, npc))); } [IteratorStateMachine(typeof(d__11))] public static IEnumerator HurryUpMessage(DialogueController controller) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__11(0) { controller = controller }; } [IteratorStateMachine(typeof(d__12))] public static IEnumerator DisposeChoice(DialogueController controller, NPC npc) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__12(0) { controller = controller }; } [IteratorStateMachine(typeof(d__13))] public static IEnumerator CreateDropContent(DeadDrop entity, List filledItems, NPC npc, List itemsFromPool = null, bool useShortTimeout = true) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__13(0) { entity = entity, filledItems = filledItems, itemsFromPool = itemsFromPool, useShortTimeout = useShortTimeout }; } } public static class RandomManorGenerator { public class SafeSpawnSpot { public Vector3 spawnSpot; public Vector3 eulerAngles; public SafeSpawnSpot(Vector3 pos, Vector3 rot) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) spawnSpot = pos; eulerAngles = rot; } } public abstract class RoomDesignBase { public WaitForSeconds waitInstantiateEach; public Vector3 roomCenter { get; set; } public Vector3 roomRotation { get; set; } public Transform roomTransform { get; set; } public bool canGenerateSafe { get; set; } public abstract IEnumerator SpawnDesign(); public void AfterSpawnComplete() { for (int i = 0; i < roomTransform.childCount; i++) { ((Component)roomTransform.GetChild(i)).gameObject.SetActive(true); } } public void SpawnItemOut(string itemKey, out NetworkObject nob) { nob = null; if (buildablesMap.ContainsKey(itemKey)) { nob = SpawnItem(buildablesMap[itemKey]); } } public void SpawnItemOut(string itemKey, out GameObject go) { go = null; if (itemKey == "Sofa") { go = SpawnItem(sofaObj); } } public void AdjustY(NetworkObject nob) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) Transform val = ((Component)nob).transform.Find("Bounds"); if ((Object)(object)val == (Object)null) { return; } Transform val2 = ((Component)nob).transform.Find("BuildPoint"); if (!((Object)(object)val2 == (Object)null)) { float num = val2.localPosition.y; if (num < 0f) { num = 0f - num; } float y = val.localPosition.y; float num2 = num + y; ((Component)nob).transform.localPosition = new Vector3(((Component)nob).transform.localPosition.x, num2, ((Component)nob).transform.localPosition.z); } } private GameObject SpawnItem(GameObject obj) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) GameObject obj2 = Object.Instantiate(obj, roomTransform); obj2.transform.SetPositionAndRotation(Vector3.zero, Quaternion.identity); return obj2; } private NetworkObject SpawnItem(NetworkObject obj) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) NetworkObject obj2 = Object.Instantiate(obj, roomTransform); ((Component)obj2).transform.SetPositionAndRotation(Vector3.zero, Quaternion.identity); return obj2; } } private class UpstairsLivingRoom : RoomDesignBase { [CompilerGenerated] private sealed class d__8 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public UpstairsLivingRoom <>4__this; private NetworkObject 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__8(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; UpstairsLivingRoom upstairsLivingRoom = <>4__this; switch (num) { default: return false; case 0: { <>1__state = -1; upstairsLivingRoom.roomTransform.position = upstairsLivingRoom.roomCenter; upstairsLivingRoom.SpawnItemOut("CoffeeTable", out NetworkObject nob2); ((Component)nob2).transform.localPosition = upstairsLivingRoom.coffeeTablePos; ((Component)nob2).transform.localRotation = Quaternion.Euler(upstairsLivingRoom.coffeeTableRot); <>2__current = upstairsLivingRoom.waitInstantiateEach; <>1__state = 1; return true; } case 1: { <>1__state = -1; if (!CartelEnforcer.registered) { return false; } upstairsLivingRoom.SpawnItemOut("Sofa", out GameObject go); go.transform.localPosition = upstairsLivingRoom.sofaPos; go.transform.localRotation = Quaternion.Euler(upstairsLivingRoom.sofaRot); <>2__current = upstairsLivingRoom.waitInstantiateEach; <>1__state = 2; return true; } case 2: { <>1__state = -1; if (!CartelEnforcer.registered) { return false; } upstairsLivingRoom.SpawnItemOut("DisplayCabinet", out NetworkObject nob); ((Component)nob).transform.localPosition = upstairsLivingRoom.displayCabinetPos; ((Component)nob).transform.localRotation = Quaternion.Euler(upstairsLivingRoom.displayCabinetRot); <>2__current = upstairsLivingRoom.waitInstantiateEach; <>1__state = 3; return true; } case 3: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } if (upstairsLivingRoom.canGenerateSafe) { upstairsLivingRoom.SpawnItemOut("Small Safe", out 5__2); questSafe = ((Component)5__2).GetComponent(); ((Component)5__2).transform.localPosition = upstairsLivingRoom.safePos; ((Component)5__2).transform.rotation = Quaternion.Euler(upstairsLivingRoom.safeRot.x, upstairsLivingRoom.safeRot.y, 90f); <>2__current = upstairsLivingRoom.waitInstantiateEach; <>1__state = 4; return true; } break; case 4: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } ((Component)5__2).gameObject.SetActive(true); <>2__current = upstairsLivingRoom.waitInstantiateEach; <>1__state = 5; return true; case 5: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } ((Component)5__2).gameObject.SetActive(true); if (onSafeBuilt != null) { onSafeBuilt(); } 5__2 = null; break; } upstairsLivingRoom.AfterSpawnComplete(); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private readonly Vector3 coffeeTablePos = new Vector3(-0.2873f, 0f, 1.2164f); private readonly Vector3 coffeeTableRot = Vector3.zero; private readonly Vector3 sofaPos = Vector3.zero; private readonly Vector3 sofaRot = Vector3.zero; private readonly Vector3 displayCabinetPos = new Vector3(0.9627f, 0.85f, -1.2836f); private readonly Vector3 displayCabinetRot = Vector3.zero; private readonly Vector3 safePos = new Vector3(0.7f, 2.535f, -1.4f); private readonly Vector3 safeRot = new Vector3(0f, 270f, 0f); [IteratorStateMachine(typeof(d__8))] public override IEnumerator SpawnDesign() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__8(0) { <>4__this = this }; } } private class UpstairsBedRoom : RoomDesignBase { [CompilerGenerated] private sealed class d__8 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public UpstairsBedRoom <>4__this; private NetworkObject 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__8(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: 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_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; UpstairsBedRoom upstairsBedRoom = <>4__this; switch (num) { default: return false; case 0: { <>1__state = -1; upstairsBedRoom.roomTransform.position = upstairsBedRoom.roomCenter; upstairsBedRoom.SpawnItemOut("FloorLamp", out NetworkObject nob2); ((Component)nob2).transform.localPosition = upstairsBedRoom.floorLampPos; ((Component)nob2).transform.localRotation = Quaternion.Euler(upstairsBedRoom.floorLampRot); upstairsBedRoom.AdjustY(nob2); <>2__current = upstairsBedRoom.waitInstantiateEach; <>1__state = 1; return true; } case 1: { <>1__state = -1; if (!CartelEnforcer.registered) { return false; } upstairsBedRoom.SpawnItemOut("SingleBed", out NetworkObject nob3); ((Component)nob3).transform.localPosition = upstairsBedRoom.bedPos; ((Component)nob3).transform.localRotation = Quaternion.Euler(upstairsBedRoom.bedRot); upstairsBedRoom.AdjustY(nob3); <>2__current = upstairsBedRoom.waitInstantiateEach; <>1__state = 2; return true; } case 2: { <>1__state = -1; if (!CartelEnforcer.registered) { return false; } upstairsBedRoom.SpawnItemOut("WoodSquareTable", out NetworkObject nob); ((Component)nob).transform.localPosition = upstairsBedRoom.woodTablePos; ((Component)nob).transform.localRotation = Quaternion.Euler(upstairsBedRoom.woodTableRot); upstairsBedRoom.AdjustY(nob); <>2__current = upstairsBedRoom.waitInstantiateEach; <>1__state = 3; return true; } case 3: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } if (upstairsBedRoom.canGenerateSafe) { upstairsBedRoom.SpawnItemOut("Small Safe", out 5__2); questSafe = ((Component)5__2).GetComponent(); ((Component)5__2).transform.localPosition = upstairsBedRoom.safePos; ((Component)5__2).transform.rotation = Quaternion.Euler(upstairsBedRoom.safeRot.x, upstairsBedRoom.safeRot.y, 90f); <>2__current = upstairsBedRoom.waitInstantiateEach; <>1__state = 4; return true; } break; case 4: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } ((Component)5__2).gameObject.SetActive(true); <>2__current = upstairsBedRoom.waitInstantiateEach; <>1__state = 5; return true; case 5: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } ((Component)5__2).gameObject.SetActive(true); if (onSafeBuilt != null) { onSafeBuilt(); } 5__2 = null; break; } upstairsBedRoom.AfterSpawnComplete(); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private readonly Vector3 floorLampPos = new Vector3(-1.0373f, 0f, 1.4664f); private readonly Vector3 floorLampRot = Vector3.zero; private readonly Vector3 bedPos = new Vector3(-0.0373f, 0f, 0.4664f); private readonly Vector3 bedRot = new Vector3(0f, 90f, 0f); private readonly Vector3 woodTablePos = new Vector3(-0.7872f, 0f, -0.7836f); private readonly Vector3 woodTableRot = Vector3.zero; private readonly Vector3 safePos = new Vector3(-0.74f, 0.175f, -0.76f); private readonly Vector3 safeRot = new Vector3(0f, 90f, 0f); [IteratorStateMachine(typeof(d__8))] public override IEnumerator SpawnDesign() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__8(0) { <>4__this = this }; } } private class DownstairsLivingRoom : RoomDesignBase { [CompilerGenerated] private sealed class d__10 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DownstairsLivingRoom <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__10(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; DownstairsLivingRoom downstairsLivingRoom = <>4__this; switch (num) { default: return false; case 0: { <>1__state = -1; downstairsLivingRoom.roomTransform.position = downstairsLivingRoom.roomCenter; downstairsLivingRoom.SpawnItemOut("Sofa", out GameObject go); go.transform.localPosition = downstairsLivingRoom.sofaPos; go.transform.localRotation = Quaternion.Euler(downstairsLivingRoom.sofaRot); <>2__current = downstairsLivingRoom.waitInstantiateEach; <>1__state = 1; return true; } case 1: { <>1__state = -1; if (!CartelEnforcer.registered) { return false; } downstairsLivingRoom.SpawnItemOut("TV_Built", out NetworkObject nob); ((Component)nob).transform.localPosition = downstairsLivingRoom.tvPos; ((Component)nob).transform.localRotation = Quaternion.Euler(downstairsLivingRoom.tvRot); <>2__current = downstairsLivingRoom.waitInstantiateEach; <>1__state = 2; return true; } case 2: { <>1__state = -1; if (!CartelEnforcer.registered) { return false; } downstairsLivingRoom.SpawnItemOut("DisplayCabinet", out NetworkObject nob3); ((Component)nob3).transform.localPosition = downstairsLivingRoom.displayCabinet1Pos; ((Component)nob3).transform.localRotation = Quaternion.Euler(downstairsLivingRoom.displayCabinet1Rot); <>2__current = downstairsLivingRoom.waitInstantiateEach; <>1__state = 3; return true; } case 3: { <>1__state = -1; if (!CartelEnforcer.registered) { return false; } downstairsLivingRoom.SpawnItemOut("DisplayCabinet", out NetworkObject nob4); ((Component)nob4).transform.localPosition = downstairsLivingRoom.displayCabinet2Pos; ((Component)nob4).transform.localRotation = Quaternion.Euler(downstairsLivingRoom.displayCabinet2Rot); <>2__current = downstairsLivingRoom.waitInstantiateEach; <>1__state = 4; return true; } case 4: { <>1__state = -1; if (!CartelEnforcer.registered) { return false; } downstairsLivingRoom.SpawnItemOut("WoodSquareTable", out NetworkObject nob2); ((Component)nob2).transform.localPosition = downstairsLivingRoom.woodTablePos; ((Component)nob2).transform.localRotation = Quaternion.Euler(downstairsLivingRoom.woodTableRot); <>2__current = downstairsLivingRoom.waitInstantiateEach; <>1__state = 5; return true; } case 5: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } downstairsLivingRoom.AfterSpawnComplete(); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private readonly Vector3 sofaPos = new Vector3(0.25f, 0f, 0f); private readonly Vector3 sofaRot = Vector3.zero; private readonly Vector3 tvPos = new Vector3(0.295f, 0f, 2.4532f); private readonly Vector3 tvRot = new Vector3(0f, 180f, 0f); private readonly Vector3 displayCabinet1Pos = new Vector3(2.045f, 0.85f, 2.4532f); private readonly Vector3 displayCabinet1Rot = new Vector3(0f, 180f, 0f); private readonly Vector3 displayCabinet2Pos = new Vector3(-1.455f, 0.85f, 2.4532f); private readonly Vector3 displayCabinet2Rot = new Vector3(0f, 180f, 0f); private readonly Vector3 woodTablePos = new Vector3(-1.205f, 0f, -0.0468f); private readonly Vector3 woodTableRot = Vector3.zero; [IteratorStateMachine(typeof(d__10))] public override IEnumerator SpawnDesign() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__10(0) { <>4__this = this }; } } private class DownstairsKitchenRoom : RoomDesignBase { [CompilerGenerated] private sealed class d__12 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DownstairsKitchenRoom <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__12(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; DownstairsKitchenRoom downstairsKitchenRoom = <>4__this; switch (num) { default: return false; case 0: { <>1__state = -1; downstairsKitchenRoom.roomTransform.position = downstairsKitchenRoom.roomCenter; downstairsKitchenRoom.SpawnItemOut("Jukebox_Built", out NetworkObject nob); ((Component)nob).transform.localPosition = downstairsKitchenRoom.jukeboxPos; ((Component)nob).transform.localRotation = Quaternion.Euler(downstairsKitchenRoom.jukeboxRot); activeJukebox = ((Component)nob).GetComponent(); downstairsKitchenRoom.AdjustY(nob); <>2__current = downstairsKitchenRoom.waitInstantiateEach; <>1__state = 1; return true; } case 1: { <>1__state = -1; if (!CartelEnforcer.registered) { return false; } downstairsKitchenRoom.SpawnItemOut("MixingStation_Built", out NetworkObject nob4); ((Component)nob4).transform.localPosition = downstairsKitchenRoom.mixingStationPos; ((Component)nob4).transform.localRotation = Quaternion.Euler(downstairsKitchenRoom.mixingStationRot); <>2__current = downstairsKitchenRoom.waitInstantiateEach; <>1__state = 2; return true; } case 2: { <>1__state = -1; if (!CartelEnforcer.registered) { return false; } downstairsKitchenRoom.SpawnItemOut("DisplayCabinet", out NetworkObject nob6); ((Component)nob6).transform.localPosition = downstairsKitchenRoom.displayCabinet1Pos; ((Component)nob6).transform.localRotation = Quaternion.Euler(downstairsKitchenRoom.displayCabinet1Rot); <>2__current = downstairsKitchenRoom.waitInstantiateEach; <>1__state = 3; return true; } case 3: { <>1__state = -1; if (!CartelEnforcer.registered) { return false; } downstairsKitchenRoom.SpawnItemOut("DisplayCabinet", out NetworkObject nob2); ((Component)nob2).transform.localPosition = downstairsKitchenRoom.displayCabinet2Pos; ((Component)nob2).transform.localRotation = Quaternion.Euler(downstairsKitchenRoom.displayCabinet2Rot); <>2__current = downstairsKitchenRoom.waitInstantiateEach; <>1__state = 4; return true; } case 4: { <>1__state = -1; if (!CartelEnforcer.registered) { return false; } downstairsKitchenRoom.SpawnItemOut("MetalSquareTable", out NetworkObject nob5); ((Component)nob5).transform.localPosition = downstairsKitchenRoom.metalTable1Pos; ((Component)nob5).transform.localRotation = Quaternion.Euler(downstairsKitchenRoom.metalTable1Rot); downstairsKitchenRoom.AdjustY(nob5); <>2__current = downstairsKitchenRoom.waitInstantiateEach; <>1__state = 5; return true; } case 5: { <>1__state = -1; if (!CartelEnforcer.registered) { return false; } downstairsKitchenRoom.SpawnItemOut("MetalSquareTable", out NetworkObject nob3); ((Component)nob3).transform.localPosition = downstairsKitchenRoom.metalTable2Pos; ((Component)nob3).transform.localRotation = Quaternion.Euler(downstairsKitchenRoom.metalTable2Rot); downstairsKitchenRoom.AdjustY(nob3); <>2__current = downstairsKitchenRoom.waitInstantiateEach; <>1__state = 6; return true; } case 6: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } downstairsKitchenRoom.AfterSpawnComplete(); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private readonly Vector3 jukeboxPos = new Vector3(1.795f, 0f, -1.5468f); private readonly Vector3 jukeboxRot = Vector3.zero; private readonly Vector3 mixingStationPos = new Vector3(0.295f, 0f, 2.4532f); private readonly Vector3 mixingStationRot = new Vector3(0f, 180f, 0f); private readonly Vector3 displayCabinet1Pos = new Vector3(-1.455f, 0.85f, -1.5468f); private readonly Vector3 displayCabinet1Rot = Vector3.zero; private readonly Vector3 displayCabinet2Pos = new Vector3(0.045f, 0.85f, -1.5468f); private readonly Vector3 displayCabinet2Rot = Vector3.zero; private readonly Vector3 metalTable1Pos = new Vector3(-1.205f, 0f, 2.4532f); private readonly Vector3 metalTable1Rot = Vector3.zero; private readonly Vector3 metalTable2Pos = new Vector3(1.795f, 0f, 2.4532f); private readonly Vector3 metalTable2Rot = Vector3.zero; [IteratorStateMachine(typeof(d__12))] public override IEnumerator SpawnDesign() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__12(0) { <>4__this = this }; } } private class ExceedinglyRareGoldenRoomWithThomasTakingAShitOnAGoldenToilet : RoomDesignBase { [CompilerGenerated] private sealed class d__1 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public ExceedinglyRareGoldenRoomWithThomasTakingAShitOnAGoldenToilet <>4__this; private NetworkObject 5__2; private NetworkObject 5__3; private AvatarSeat 5__4; private ParticleSystem 5__5; private NetworkObject 5__6; private Thomas 5__7; private NetworkObject 5__8; private ToggleableItem 5__9; private GameObject 5__10; private int 5__11; private int 5__12; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__1(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; 5__3 = null; 5__4 = null; 5__5 = null; 5__6 = null; 5__7 = null; 5__8 = null; 5__9 = null; 5__10 = null; <>1__state = -2; } private bool MoveNext() { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0087: 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) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Expected O, but got Unknown //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: 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_0857: Unknown result type (might be due to invalid IL or missing references) //IL_099b: Unknown result type (might be due to invalid IL or missing references) //IL_0435: Unknown result type (might be due to invalid IL or missing references) //IL_0450: Unknown result type (might be due to invalid IL or missing references) //IL_0474: Unknown result type (might be due to invalid IL or missing references) //IL_0496: Unknown result type (might be due to invalid IL or missing references) //IL_04aa: Unknown result type (might be due to invalid IL or missing references) //IL_04c6: Unknown result type (might be due to invalid IL or missing references) //IL_04da: Unknown result type (might be due to invalid IL or missing references) //IL_04f6: Unknown result type (might be due to invalid IL or missing references) //IL_050a: Unknown result type (might be due to invalid IL or missing references) //IL_0526: Unknown result type (might be due to invalid IL or missing references) //IL_053a: Unknown result type (might be due to invalid IL or missing references) //IL_0556: Unknown result type (might be due to invalid IL or missing references) //IL_056a: Unknown result type (might be due to invalid IL or missing references) //IL_0586: Unknown result type (might be due to invalid IL or missing references) //IL_059a: Unknown result type (might be due to invalid IL or missing references) //IL_05b6: Unknown result type (might be due to invalid IL or missing references) //IL_05ca: Unknown result type (might be due to invalid IL or missing references) //IL_05e6: Unknown result type (might be due to invalid IL or missing references) //IL_05fa: Unknown result type (might be due to invalid IL or missing references) //IL_0616: Unknown result type (might be due to invalid IL or missing references) //IL_062a: Unknown result type (might be due to invalid IL or missing references) //IL_0647: Unknown result type (might be due to invalid IL or missing references) //IL_065b: Unknown result type (might be due to invalid IL or missing references) //IL_0678: Unknown result type (might be due to invalid IL or missing references) //IL_068c: Unknown result type (might be due to invalid IL or missing references) //IL_06a9: Unknown result type (might be due to invalid IL or missing references) //IL_06bd: Unknown result type (might be due to invalid IL or missing references) //IL_08a1: Unknown result type (might be due to invalid IL or missing references) //IL_09e5: Unknown result type (might be due to invalid IL or missing references) //IL_06ef: Unknown result type (might be due to invalid IL or missing references) //IL_0701: Unknown result type (might be due to invalid IL or missing references) //IL_0760: Unknown result type (might be due to invalid IL or missing references) //IL_0767: Expected O, but got Unknown //IL_07be: Unknown result type (might be due to invalid IL or missing references) //IL_08ce: Unknown result type (might be due to invalid IL or missing references) //IL_08e2: Unknown result type (might be due to invalid IL or missing references) //IL_08e7: Unknown result type (might be due to invalid IL or missing references) //IL_0a12: Unknown result type (might be due to invalid IL or missing references) //IL_0a26: Unknown result type (might be due to invalid IL or missing references) //IL_0a2b: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; ExceedinglyRareGoldenRoomWithThomasTakingAShitOnAGoldenToilet exceedinglyRareGoldenRoomWithThomasTakingAShitOnAGoldenToilet = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; 5__2 = Object.Instantiate(buildablesMap["Metal Bars Sewer Door"], exceedinglyRareGoldenRoomWithThomasTakingAShitOnAGoldenToilet.roomTransform); ((Component)5__2).transform.SetPositionAndRotation(new Vector3(165.8605f, 14.2515f, -61f), Quaternion.Euler(0f, 270f, 0f)); <>2__current = CartelEnforcer.Wait05; <>1__state = 1; return true; case 1: { <>1__state = -1; if (!CartelEnforcer.registered) { return false; } ((Component)5__2).gameObject.SetActive(true); 5__3 = Object.Instantiate(buildablesMap["GoldenToilet"], exceedinglyRareGoldenRoomWithThomasTakingAShitOnAGoldenToilet.roomTransform); ((Component)5__3).transform.position = new Vector3(171.3982f, 14.215f, -60.5732f); GameObject val3 = new GameObject("SittingPoint"); val3.transform.parent = ((Component)5__3).transform; val3.transform.localPosition = new Vector3(0f, 0.6f, 0.2f); 5__4 = ((Component)5__3).gameObject.AddComponent(); 5__4.SittingPoint = val3.transform; Transform val4 = ((Component)5__3).transform.Find("Golden Toilet/Toilet/Particle System"); val4.localPosition = new Vector3(0f, 0.6772f, 0.0364f); val4.rotation = Quaternion.Euler(90f, 0f, 0f); 5__5 = ((Component)val4).gameObject.GetComponent(); 5__5.main.startColor = MinMaxGradient.op_Implicit(new Color(0.4129f, 0.2529f, 0.1529f, 1f)); <>2__current = CartelEnforcer.Wait05; <>1__state = 2; return true; } case 2: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } ((Component)5__3).gameObject.SetActive(true); 5__5.Play(); 5__6 = Object.Instantiate(buildablesMap["Thomas"], exceedinglyRareGoldenRoomWithThomasTakingAShitOnAGoldenToilet.roomTransform); 5__7 = ((Component)5__6).GetComponent(); ((NPC)5__7).Health.Invincible = true; <>2__current = CartelEnforcer.Wait05; <>1__state = 3; return true; case 3: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } ((Component)5__6).gameObject.SetActive(true); nonRoomObjects.Add(((Component)5__6).gameObject); ((NPC)5__7).Movement.SetSeat(5__4); ((NPC)5__7).Avatar.LookController.AutoLookAtPlayer = true; 5__8 = Object.Instantiate(buildablesMap["FloorLamp"], exceedinglyRareGoldenRoomWithThomasTakingAShitOnAGoldenToilet.roomTransform); ((Component)5__8).transform.position = new Vector3(172.3888f, 14.245f, -59.9603f); 5__9 = ((Component)5__8).GetComponent(); <>2__current = CartelEnforcer.Wait05; <>1__state = 4; return true; case 4: { <>1__state = -1; if (!CartelEnforcer.registered) { return false; } ((Component)5__8).gameObject.SetActive(true); 5__9.Toggle(); ItemInstance defaultInstance = new Func(Registry.GetItem)("goldbar").GetDefaultInstance(1); 5__10 = null; StorableItemInstance val5 = ((Il2CppObjectBase)defaultInstance).TryCast(); if (val5 != null && (Object)(object)val5.StoredItem != (Object)null) { GameObject gameObject = ((Component)((Component)val5.StoredItem).transform.Find("Gold bar")).gameObject; if ((Object)(object)gameObject != (Object)null) { 5__10 = Object.Instantiate(gameObject); } } if ((Object)(object)5__10 == (Object)null) { return false; } BoxCollider val6 = 5__10.AddComponent(); val6.size = new Vector3(0.05f, 0.05f, 0.2f); val6.center = new Vector3(0f, 0.025f, 0f); 5__10.transform.localScale = new Vector3(5f, 5f, 5f); var array = new[] { new { pos = new Vector3(168.3982f, 14.41f, -60.3f), rot = Quaternion.Euler(17f, 0f, 8f) }, new { pos = new Vector3(168.3982f, 14.215f, -60.5732f), rot = Quaternion.Euler(0f, 63f, 0f) }, new { pos = new Vector3(169.9482f, 14.215f, -60.5732f), rot = Quaternion.Euler(0f, 4f, 0f) }, new { pos = new Vector3(170.9482f, 14.215f, -61.5732f), rot = Quaternion.Euler(0f, 140f, 0f) }, new { pos = new Vector3(169.7982f, 14.215f, -61.5732f), rot = Quaternion.Euler(0f, 98f, 0f) }, new { pos = new Vector3(170.2982f, 14.455f, -61.4732f), rot = Quaternion.Euler(0f, 70f, 0f) }, new { pos = new Vector3(170.3982f, 14.215f, -60.5732f), rot = Quaternion.Euler(0f, 0f, 0f) }, new { pos = new Vector3(170.1982f, 14.455f, -60.5732f), rot = Quaternion.Euler(0f, 92f, 0f) }, new { pos = new Vector3(170.1982f, 14.455f, -60.1732f), rot = Quaternion.Euler(0f, 85f, 0f) }, new { pos = new Vector3(170.1982f, 14.455f, -60.9732f), rot = Quaternion.Euler(0f, 92f, 0f) }, new { pos = new Vector3(170.3982f, 14.695f, -60.5732f), rot = Quaternion.Euler(0f, 0f, 0f) }, new { pos = new Vector3(170.1282f, 14.885f, -60.5732f), rot = Quaternion.Euler(0f, 0f, 103f) } }; foreach (var anon in array) { GameObject obj = Object.Instantiate(5__10, exceedinglyRareGoldenRoomWithThomasTakingAShitOnAGoldenToilet.roomTransform); obj.transform.position = anon.pos; obj.transform.rotation = anon.rot; obj.SetActive(true); } Rigidbody obj2 = 5__10.AddComponent(); obj2.angularDrag = 0.98f; obj2.drag = 0.2f; obj2.mass = 2.3f; obj2.maxAngularVelocity = 3f; obj2.maxLinearVelocity = 7f; PhysicMaterial val7 = new PhysicMaterial(); val7.bounceCombine = (PhysicMaterialCombine)3; val7.bounciness = 0.03f; val7.dynamicFriction = 0.096f; val7.staticFriction = 0.03f; val7.frictionCombine = (PhysicMaterialCombine)2; ((Collider)val6).material = val7; 5__10.transform.localScale = new Vector3(3.6f, 3.6f, 3.6f); 5__11 = 9; 5__12 = 0; goto IL_0903; } case 5: { <>1__state = -1; if (!CartelEnforcer.registered) { return false; } GameObject val2 = Object.Instantiate(5__10, exceedinglyRareGoldenRoomWithThomasTakingAShitOnAGoldenToilet.roomTransform); val2.transform.position = new Vector3(169.7678f + Random.Range(-0.6f, 0.6f), 15f + 0.1f * (float)5__12, -58.9568f + Random.Range(-0.6f, 0.6f)); val2.transform.rotation = Quaternion.Euler((Random.Range(0, 2) == 0) ? 0f : 30f, Random.Range(0f, 359f), (Random.Range(0, 2) == 0) ? 0f : 120f); val2.SetActive(true); if (Random.Range(0, 2) == 0) { val2.transform.localScale = 5__10.transform.localScale - new Vector3(0.8f, 0.8f, 0.8f); } 5__12++; goto IL_0903; } case 6: { <>1__state = -1; if (!CartelEnforcer.registered) { return false; } GameObject val = Object.Instantiate(5__10, exceedinglyRareGoldenRoomWithThomasTakingAShitOnAGoldenToilet.roomTransform); val.transform.position = new Vector3(172.4147f + Random.Range(-0.6f, 0.6f), 15f + 0.1f * (float)5__12, -58.9158f + Random.Range(-0.6f, 0.6f)); val.transform.rotation = Quaternion.Euler((Random.Range(0, 2) == 0) ? 0f : 30f, Random.Range(0f, 359f), (Random.Range(0, 2) == 0) ? 0f : 120f); val.SetActive(true); if (Random.Range(0, 2) == 0) { val.transform.localScale = 5__10.transform.localScale - new Vector3(0.8f, 0.8f, 0.8f); } 5__12++; break; } IL_0903: if (5__12 < 5__11) { <>2__current = CartelEnforcer.Wait05; <>1__state = 5; return true; } 5__12 = 0; break; } if (5__12 < 5__11) { <>2__current = CartelEnforcer.Wait05; <>1__state = 6; return true; } Object.Destroy((Object)(object)5__10); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public ExceedinglyRareGoldenRoomWithThomasTakingAShitOnAGoldenToilet() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) base.roomCenter = upstairsRoomCenters[1]; } [IteratorStateMachine(typeof(d__1))] public override IEnumerator SpawnDesign() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__1(0) { <>4__this = this }; } } [CompilerGenerated] private sealed class <>c__DisplayClass11_0 { public Transform doorContainer; public AudioClip open; public AudioClip close; public UnityAction doorInteractedAction; public InteractableObject exteriorIntObj; public UnityAction interiorDoorInteractedAction; public InteractableObject interiorIntObj; } [CompilerGenerated] private sealed class <>c__DisplayClass15_0 { public Action onOpenedAction; } [CompilerGenerated] private sealed class d__16 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private List.Enumerator <>7__wrap1; private ToggleableLight[] 5__3; private ToggleableLight[] <>7__wrap3; private int <>7__wrap4; private ToggleableLight 5__6; private List.Enumerator <>7__wrap6; private CartelGoon 5__8; private List.Enumerator <>7__wrap8; private RoomDesignBase 5__10; private List.Enumerator <>7__wrap10; private GameObject 5__12; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__16(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { switch (<>1__state) { case -3: case 2: case 3: try { } finally { <>m__Finally1(); } break; case -4: case 4: try { } finally { <>m__Finally2(); } break; case -5: case 5: try { } finally { <>m__Finally3(); } break; case -6: case 6: try { } finally { <>m__Finally4(); } break; } <>7__wrap1 = default(List.Enumerator); 5__3 = null; <>7__wrap3 = null; 5__6 = null; <>7__wrap6 = default(List.Enumerator); 5__8 = null; <>7__wrap8 = default(List.Enumerator); 5__10 = null; <>7__wrap10 = default(List.Enumerator); 5__12 = null; <>1__state = -2; } private bool MoveNext() { //IL_00d2: Unknown result type (might be due to invalid IL or missing references) bool result; try { switch (<>1__state) { default: result = false; goto end_IL_0000; case 0: <>1__state = -1; <>2__current = CartelEnforcer.Wait60; <>1__state = 1; result = true; goto end_IL_0000; case 1: <>1__state = -1; if (CartelEnforcer.registered) { Manor val = Object.FindObjectOfType(true); Transform val2 = ((Component)val).transform.Find("Doors"); if ((Object)(object)val2 != (Object)null) { ((Component)val2).gameObject.SetActive(true); } Transform val3 = val.OriginalContainer.transform.Find("MansionDoor (1)"); if ((Object)(object)val3 == (Object)null) { Transform val4 = val3.Find("Container"); if (!((Object)(object)val4 == (Object)null)) { ((Component)val4).transform.localRotation = doorOrigRot; } } List list = new List { val.OriginalContainer.transform.GetChild(3), val.OriginalContainer.transform.GetChild(4), val.OriginalContainer.transform.GetChild(5) }; <>7__wrap1 = list.GetEnumerator(); <>1__state = -3; goto IL_023c; } result = false; goto end_IL_0000; case 2: <>1__state = -3; if (!CartelEnforcer.registered) { result = false; goto IL_0254; } <>7__wrap3 = 5__3; <>7__wrap4 = 0; goto IL_021e; case 3: <>1__state = -3; if (!CartelEnforcer.registered) { result = false; goto IL_0254; } 5__6.isOn = false; 5__6 = null; <>7__wrap4++; goto IL_021e; case 4: <>1__state = -4; if (CartelEnforcer.registered) { ((NPC)5__8).Health.MaxHealth = 100f; ((NPC)5__8).Health.Health = 100f; ((NPC)5__8).Behaviour.CombatBehaviour.GiveUpRange = EndGameQuest.activeManorQuest.GiveUpRange; ((NPC)5__8).Behaviour.CombatBehaviour.GiveUpAfterSuccessfulHits = EndGameQuest.activeManorQuest.GiveUpAfterSuccessfulHits; ((NPC)5__8).Behaviour.CombatBehaviour.DefaultSearchTime = EndGameQuest.activeManorQuest.DefaultSearchTime; ((Component)((NPC)5__8).Behaviour.ScheduleManager.ActionList[0]).gameObject.SetActive(true); ((NPC)5__8).Behaviour.ScheduleManager.EnableSchedule(); if (((NPC)5__8).Health.IsDead) { ((NPC)5__8).Health.Revive(); } if (5__8.IsGoonSpawned) { 5__8.Despawn(); } if (((Behaviour)((NPC)5__8).Behaviour.CombatBehaviour).Active) { ((Behaviour)((NPC)5__8).Behaviour.CombatBehaviour).Disable_Networked((NetworkConnection)null); } 5__8 = null; goto IL_03f8; } result = false; <>m__Finally2(); goto end_IL_0000; case 5: <>1__state = -5; if (CartelEnforcer.registered) { Object.Destroy((Object)(object)((Component)5__10.roomTransform).gameObject); 5__10 = null; goto IL_049a; } result = false; <>m__Finally3(); goto end_IL_0000; case 6: { <>1__state = -6; if (CartelEnforcer.registered) { Object.Destroy((Object)(object)5__12); 5__12 = null; break; } result = false; <>m__Finally4(); goto end_IL_0000; } IL_049a: if (!<>7__wrap8.MoveNext()) { <>m__Finally3(); <>7__wrap8 = default(List.Enumerator); <>7__wrap10 = nonRoomObjects.GetEnumerator(); <>1__state = -6; break; } 5__10 = <>7__wrap8.Current; <>2__current = CartelEnforcer.Wait05; <>1__state = 5; result = true; goto end_IL_0000; IL_023c: while (true) { if (!<>7__wrap1.MoveNext()) { <>m__Finally1(); <>7__wrap1 = default(List.Enumerator); <>7__wrap6 = EndGameQuest.manorGoons.GetEnumerator(); <>1__state = -4; break; } Transform current = <>7__wrap1.Current; ((Component)current).gameObject.SetActive(false); 5__3 = Il2CppArrayBase.op_Implicit(((Component)current).GetComponentsInChildren()); if (5__3.Length == 0) { continue; } <>2__current = CartelEnforcer.Wait05; <>1__state = 2; result = true; goto end_IL_0000; } goto IL_03f8; IL_0254: <>m__Finally1(); goto end_IL_0000; IL_021e: if (<>7__wrap4 >= <>7__wrap3.Length) { <>7__wrap3 = null; 5__3 = null; goto IL_023c; } 5__6 = <>7__wrap3[<>7__wrap4]; <>2__current = CartelEnforcer.Wait05; <>1__state = 3; result = true; goto end_IL_0000; IL_03f8: if (!<>7__wrap6.MoveNext()) { <>m__Finally2(); <>7__wrap6 = default(List.Enumerator); <>7__wrap8 = roomsGenerated.GetEnumerator(); <>1__state = -5; goto IL_049a; } 5__8 = <>7__wrap6.Current; <>2__current = CartelEnforcer.Wait05; <>1__state = 4; result = true; goto end_IL_0000; } if (<>7__wrap10.MoveNext()) { 5__12 = <>7__wrap10.Current; <>2__current = CartelEnforcer.Wait05; <>1__state = 6; result = true; } else { <>m__Finally4(); <>7__wrap10 = default(List.Enumerator); ResetManorItemRef(); result = false; } end_IL_0000:; } catch { //try-fault ((IDisposable)this).Dispose(); throw; } return result; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; ((IDisposable)<>7__wrap1).Dispose(); } private void <>m__Finally2() { <>1__state = -1; ((IDisposable)<>7__wrap6).Dispose(); } private void <>m__Finally3() { <>1__state = -1; ((IDisposable)<>7__wrap8).Dispose(); } private void <>m__Finally4() { <>1__state = -1; ((IDisposable)<>7__wrap10).Dispose(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__18 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public bool enterBuilding; private Transform 5__2; private Vector3 5__3; private Quaternion 5__4; private Vector3 5__5; private Quaternion 5__6; private float 5__7; private float 5__8; private Vector3 5__9; private Quaternion 5__10; private Vector3 5__11; private Quaternion 5__12; private Vector3 5__13; private Quaternion 5__14; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__18(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_0236: 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_0366: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_031b: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0176: 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_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_0387: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_0106: 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_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_03aa: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: 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_014f: 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_0154: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; Singleton.Instance.ExitAll(); PlayerSingleton.Instance.SetCanLook(false); PlayerSingleton.Instance.CanMove = false; 5__2 = ((Component)PlayerSingleton.Instance).transform.root; 5__3 = new Vector3(162.7173f, 11.1317f, -48.8222f); 5__4 = Quaternion.Euler(0f, enterBuilding ? 160f : 0f, 0f); 5__5 = new Vector3(163.4521f, 11.465f, -51.942f); 5__6 = Quaternion.Euler(0f, enterBuilding ? 185f : 10f, 0f); 5__7 = 0f; 5__8 = 1f; 5__9 = 5__2.position; 5__10 = 5__2.rotation; 5__11 = (enterBuilding ? 5__3 : 5__5); 5__12 = (enterBuilding ? 5__4 : 5__6); goto IL_01cc; case 1: <>1__state = -1; goto IL_01cc; case 2: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } 5__7 = 0f; 5__8 = 3f; 5__9 = 5__2.position; 5__10 = 5__2.rotation; 5__13 = (enterBuilding ? 5__5 : 5__3); 5__14 = (enterBuilding ? 5__6 : 5__4); goto IL_02eb; case 3: <>1__state = -1; goto IL_02eb; case 4: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } 5__7 = 0f; 5__8 = 0.5f; 5__10 = 5__2.rotation; break; case 5: { <>1__state = -1; break; } IL_01cc: if (5__7 < 5__8 && CartelEnforcer.registered) { float num = 5__7 / 5__8; 5__2.position = Vector3.Lerp(5__9, 5__11, num); 5__2.rotation = Quaternion.Slerp(5__10, 5__12, num); 5__7 += Time.deltaTime; <>2__current = null; <>1__state = 1; return true; } <>2__current = CartelEnforcer.Wait05; <>1__state = 2; return true; IL_02eb: if (5__7 < 5__8 && CartelEnforcer.registered) { float num2 = 5__7 / 5__8; 5__2.position = Vector3.Lerp(5__9, 5__13, num2); 5__2.rotation = Quaternion.Slerp(5__10, 5__14, num2); 5__7 += Time.deltaTime; <>2__current = null; <>1__state = 3; return true; } 5__2.position = 5__13; 5__2.rotation = 5__14; <>2__current = CartelEnforcer.Wait05; <>1__state = 4; return true; } if (5__7 < 5__8 && CartelEnforcer.registered) { float num3 = 5__7 / 5__8; 5__2.rotation = Quaternion.Slerp(5__10, Quaternion.Euler(0f, enterBuilding ? 0f : 165f, 0f), num3); 5__7 += Time.deltaTime; <>2__current = null; <>1__state = 5; return true; } PlayerSingleton.Instance.SetCanLook(true); PlayerSingleton.Instance.CanMove = true; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__14 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private NetworkObject 5__2; private NetworkObject 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__14(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; 5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_0133: 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_0157: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0275: 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_0347: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Unknown result type (might be due to invalid IL or missing references) //IL_039d: Unknown result type (might be due to invalid IL or missing references) //IL_0426: Unknown result type (might be due to invalid IL or missing references) //IL_046c: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: { <>1__state = -1; bool flag = false; bool flag2 = false; if (Random.Range(0f, 1f) < 0.75f) { flag = true; if (Random.Range(0f, 1f) < 0.5f) { flag2 = true; } } DownstairsKitchenRoom item = new DownstairsKitchenRoom { roomCenter = downstairsRoomCenters[0], roomRotation = Vector3.zero, roomTransform = new GameObject("CE_ManorKitchenRoom").transform, canGenerateSafe = false, waitInstantiateEach = CartelEnforcer.Wait05 }; roomsGenerated.Add(item); DownstairsLivingRoom item2 = new DownstairsLivingRoom { roomCenter = downstairsRoomCenters[1], roomRotation = Vector3.zero, roomTransform = new GameObject("CE_ManorLivingRoom").transform, canGenerateSafe = false, waitInstantiateEach = CartelEnforcer.Wait05 }; roomsGenerated.Add(item2); int num = 1; if (Random.Range(0, 1000) == 0 || CartelEnforcer.currentConfig.debugMode) { ExceedinglyRareGoldenRoomWithThomasTakingAShitOnAGoldenToilet item3 = new ExceedinglyRareGoldenRoomWithThomasTakingAShitOnAGoldenToilet { roomTransform = new GameObject("CE_ToiletRoom").transform, roomCenter = upstairsRoomCenters[num], roomRotation = Vector3.zero, canGenerateSafe = false }; roomsGenerated.Add(item3); Quest_InfiltrateManor activeManorQuest = EndGameQuest.activeManorQuest; ((Quest)activeManorQuest).CompletionXP = ((Quest)activeManorQuest).CompletionXP + 1500; } else { num = -1; } UpstairsLivingRoom upstairsLivingRoom = new UpstairsLivingRoom(); int num2 = Random.Range(0, upstairsRoomCenters.Count); if (num2 == num) { num2 = (num2 + 1) % upstairsRoomCenters.Count; } upstairsLivingRoom.roomCenter = upstairsRoomCenters[num2]; upstairsLivingRoom.roomRotation = Vector3.zero; upstairsLivingRoom.roomTransform = new GameObject("CE_ManorUpstairLiving").transform; upstairsLivingRoom.canGenerateSafe = flag2 && flag; upstairsLivingRoom.waitInstantiateEach = CartelEnforcer.Wait05; roomsGenerated.Add(upstairsLivingRoom); UpstairsBedRoom upstairsBedRoom = new UpstairsBedRoom(); int num3 = Random.Range(0, upstairsRoomCenters.Count); while (num3 == num2 || num3 == num) { num3 = (num3 + 1) % upstairsRoomCenters.Count; } upstairsBedRoom.roomCenter = upstairsRoomCenters[num3]; upstairsBedRoom.roomRotation = Vector3.zero; upstairsBedRoom.roomTransform = new GameObject("CE_ManorUpstairBed").transform; upstairsBedRoom.canGenerateSafe = !flag2 && flag; upstairsBedRoom.waitInstantiateEach = CartelEnforcer.Wait05; roomsGenerated.Add(upstairsBedRoom); foreach (RoomDesignBase item4 in roomsGenerated) { CartelEnforcer.coros.Add(MelonCoroutines.Start(item4.SpawnDesign())); } 5__2 = Object.Instantiate(buildablesMap["GrandfatherClock"]); ((Component)5__2).transform.position = new Vector3(161.5f, 10.5f, -56f); ((Component)5__2).transform.rotation = Quaternion.Euler(0f, 90f, 0f); NetworkObject val3 = Object.Instantiate(buildablesMap["Painting_Rapscallion"]); ((Component)val3).transform.position = new Vector3(161.28f, 12.465f, -59f); ((Component)val3).transform.rotation = Quaternion.Euler(0f, 90f, 0f); nonRoomObjects.Add(((Component)5__2).gameObject); nonRoomObjects.Add(((Component)val3).gameObject); if (!flag) { int index = Random.Range(0, lootSafeSpawns.Count); 5__3 = Object.Instantiate(buildablesMap["Small Safe"]); questSafe = ((Component)5__3).GetComponent(); ((Component)5__3).transform.position = lootSafeSpawns[index].spawnSpot; ((Component)5__3).transform.rotation = Quaternion.Euler(lootSafeSpawns[index].eulerAngles.x, lootSafeSpawns[index].eulerAngles.y, 90f); nonRoomObjects.Add(((Component)5__3).gameObject); <>2__current = CartelEnforcer.Wait05; <>1__state = 1; return true; } goto IL_04fb; } case 1: <>1__state = -1; ((Component)5__3).gameObject.SetActive(true); <>2__current = CartelEnforcer.Wait05; <>1__state = 2; return true; case 2: <>1__state = -1; ((Component)5__3).gameObject.SetActive(true); if (onSafeBuilt != null) { onSafeBuilt(); } 5__3 = null; goto IL_04fb; case 3: { <>1__state = -1; foreach (GameObject nonRoomObject in nonRoomObjects) { nonRoomObject.SetActive(true); } Transform val = ((Component)5__2).transform.Find("Grandfather Clock"); Animation val2 = default(Animation); if ((Object)(object)val != (Object)null && ((Component)val).TryGetComponent(ref val2)) { val2.Play(); } return false; } IL_04fb: <>2__current = CartelEnforcer.Wait2; <>1__state = 3; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__12 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private PrefabObjects 5__2; private List 5__3; private bool 5__4; private int 5__5; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__12(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; 5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; if (num != 0) { if (num != 1) { return false; } <>1__state = -1; if (!CartelEnforcer.registered) { return false; } if (5__3.Count == 0) { goto IL_026c; } NetworkObject @object = 5__2.GetObject(true, 5__5); string text = ((@object != null) ? ((Object)((Component)@object).gameObject).name : null); if (!5__4 && text.Contains("RE Office")) { Transform val = ((Component)@object).transform.Find("Interior"); if ((Object)(object)val != (Object)null) { 5__4 = true; sofaObj = ((Component)val.Find("Double Sofa")).gameObject; } } else if (text.Contains("Safe_Built")) { NetworkObject val2 = Object.Instantiate(@object); ((Component)val2).gameObject.SetActive(false); ((Component)val2).transform.localScale = new Vector3(0.5f, 0.5f, 0.5f); ((Component)val2).transform.rotation = Quaternion.Euler(0f, 0f, 90f); if ((Object)(object)buildablesMap["Small Safe"] == (Object)null) { buildablesMap["Small Safe"] = val2; } 5__3.Remove("Small Safe"); } else { string text2 = string.Empty; foreach (string item in 5__3) { if ((Object)(object)buildablesMap[item] == (Object)null && text.Contains(item) && (!(item == "Thomas") || !text.Contains("BoxSUV"))) { buildablesMap[item] = @object; text2 = item; break; } } if (text2 != string.Empty) { 5__3.Remove(text2); } } 5__5++; } else { <>1__state = -1; NetworkManager val3 = Object.FindObjectOfType(true); 5__2 = val3.SpawnablePrefabs; 5__3 = new List(buildablesMap.Keys); 5__4 = false; 5__5 = 0; } if (5__5 < 5__2.GetObjectCount()) { <>2__current = CartelEnforcer.Wait01; <>1__state = 1; return true; } goto IL_026c; IL_026c: foreach (KeyValuePair item2 in buildablesMap) { _ = item2; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__17 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Transform tr; public AudioClip open; public AudioClip close; public Action cb; private AudioSource 5__2; private Quaternion 5__3; private Quaternion 5__4; private float 5__5; private float 5__6; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__17(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: 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_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Expected O, but got Unknown //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__2 = ((Component)tr).gameObject.AddComponent(); 5__2.volume = 0.2f; 5__2.clip = open; 5__3 = Quaternion.Euler(0f, 75f, 0f); 5__4 = tr.localRotation; 5__5 = 1.5f; 5__6 = 0f; 5__2.Play(); goto IL_00ff; case 1: <>1__state = -1; goto IL_00ff; case 2: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } 5__5 = 1f; 5__6 = 0f; break; case 3: { <>1__state = -1; break; } IL_00ff: if (5__6 < 5__5 && CartelEnforcer.registered) { float num = 5__6 / 5__5; tr.localRotation = Quaternion.Lerp(5__4, 5__3, num); 5__6 += Time.deltaTime; <>2__current = null; <>1__state = 1; return true; } tr.localRotation = 5__3; <>2__current = (object)new WaitForSeconds(3.8f); <>1__state = 2; return true; } if (5__6 < 5__5 && CartelEnforcer.registered) { float num2 = 5__6 / 5__5; tr.localRotation = Quaternion.Lerp(5__3, 5__4, num2); 5__6 += Time.deltaTime; <>2__current = null; <>1__state = 3; return true; } 5__2.clip = close; 5__2.Play(); tr.localRotation = 5__4; if (cb != null) { cb(); } Object.Destroy((Object)(object)5__2); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__19 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__19(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: { <>1__state = -1; if (Singleton.Instance.IsAnyTrackPlaying) { Singleton.Instance.StopAndDisableTracks(); } if ((Object)(object)RandomManorGenerator.activeJukebox == (Object)null) { return false; } int num = 0; for (int i = 0; i < ((Il2CppArrayBase)(object)RandomManorGenerator.activeJukebox.TrackList).Length; i++) { if (((Il2CppArrayBase)(object)RandomManorGenerator.activeJukebox.TrackList)[i] != null && ((Il2CppArrayBase)(object)RandomManorGenerator.activeJukebox.TrackList)[i].TrackName.ToLower().Contains("royalty in loyalty")) { num = i; break; } } RandomManorGenerator.activeJukebox.PlayTrack(num); EndGameQuest.activeManorQuest.isJukeboxPlaying = true; <>2__current = CartelEnforcer.Wait2; <>1__state = 1; return true; } case 1: { <>1__state = -1; if (!CartelEnforcer.registered) { return false; } Jukebox activeJukebox = RandomManorGenerator.activeJukebox; activeJukebox.onStateChanged += Action.op_Implicit((Action)OnJukeboxStateChange); return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__15 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__15(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; <>c__DisplayClass15_0 CS$<>8__locals0 = new <>c__DisplayClass15_0(); onSafeBuilt = null; CS$<>8__locals0.onOpenedAction = null; CS$<>8__locals0.onOpenedAction = Action.op_Implicit((Action)SecondaryTrigger); StorageEntity questSafe = RandomManorGenerator.questSafe; questSafe.onOpened += CS$<>8__locals0.onOpenedAction; RandomManorGenerator.questSafe.StorageEntitySubtitle = "Thomas' Safe"; Func func = Registry.GetItem; int num = 5; int num2 = 0; if (Random.Range(0f, 1f) > 0.666f) { ItemInstance defaultInstance = func("m1911").GetDefaultInstance(1); RandomManorGenerator.questSafe.InsertItem(defaultInstance, true); num2++; } if (Random.Range(0f, 1f) > 0.9f) { ItemInstance defaultInstance2 = func("cocaine").GetDefaultInstance(Random.Range(12, 20)); RandomManorGenerator.questSafe.InsertItem(defaultInstance2, true); num2++; } ItemInstance defaultInstance3 = func("m1911mag").GetDefaultInstance(1); RandomManorGenerator.questSafe.InsertItem(defaultInstance3, true); num2++; bool flag = false; if (Random.Range(0f, 1f) > 0.3f && num2 <= num) { int num3 = Random.Range(3, 7); ItemInstance defaultInstance4 = func("goldbar").GetDefaultInstance(num3); RandomManorGenerator.questSafe.InsertItem(defaultInstance4, true); flag = true; num2++; } if (num2 <= num && !flag) { ItemInstance defaultInstance5 = func("cash").GetDefaultInstance(1); CashInstance val = ((Il2CppObjectBase)defaultInstance5).TryCast(); if (val != null) { val.Balance = 1000f; } RandomManorGenerator.questSafe.InsertItem(defaultInstance5, true); num2++; } if (Random.Range(0f, 1f) > 0.4f && num2 <= num) { ItemInstance defaultInstance6 = func("silverwatch").GetDefaultInstance(1); RandomManorGenerator.questSafe.InsertItem(defaultInstance6, true); num2++; } if (Random.Range(0f, 1f) > 0.4f && num2 <= num) { ItemInstance defaultInstance7 = func("silverchain").GetDefaultInstance(1); RandomManorGenerator.questSafe.InsertItem(defaultInstance7, true); num2++; } return false; void SecondaryTrigger() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Invalid comparison between Unknown and I4 if ((int)EndGameQuest.activeManorQuest.QuestEntry_SearchResidence.State == 1) { EndGameQuest.activeManorQuest.QuestEntry_SearchResidence.Complete(); } if ((Delegate)(object)CS$<>8__locals0.onOpenedAction != (Delegate)null) { StorageEntity questSafe2 = RandomManorGenerator.questSafe; questSafe2.onOpened -= CS$<>8__locals0.onOpenedAction; CS$<>8__locals0.onOpenedAction = null; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__11 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private List.Enumerator <>7__wrap1; private ToggleableLight[] 5__3; private ToggleableLight[] <>7__wrap3; private int <>7__wrap4; private ToggleableLight 5__6; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__11(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if (num == -3 || (uint)(num - 1) <= 1u) { try { } finally { <>m__Finally1(); } } <>7__wrap1 = default(List.Enumerator); 5__3 = null; <>7__wrap3 = null; 5__6 = null; <>1__state = -2; } private bool MoveNext() { //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) bool result; try { switch (<>1__state) { default: result = false; goto end_IL_0000; case 0: { <>1__state = -1; <>c__DisplayClass11_0 CS$<>8__locals0 = new <>c__DisplayClass11_0(); Manor val = Object.FindObjectOfType(true); if ((Object)(object)val == (Object)null) { result = false; } else { CS$<>8__locals0.open = null; CS$<>8__locals0.close = null; Transform val2 = ((Component)val).transform.Find("Doors"); if ((Object)(object)val2 != (Object)null) { if (val2.childCount > 0) { Transform child = val2.GetChild(0); for (int i = 0; i < child.childCount; i++) { if (((Object)child.GetChild(i)).name.ToLower().Contains("audio source")) { if (((Object)child.GetChild(i)).name.ToLower().Contains("closet_heavy_open")) { AudioSource component = ((Component)child.GetChild(i)).gameObject.GetComponent(); CS$<>8__locals0.open = ((component != null) ? component.clip : null); } else if (((Object)child.GetChild(i)).name.ToLower().Contains("door_close")) { AudioSource component2 = ((Component)child.GetChild(i)).gameObject.GetComponent(); CS$<>8__locals0.close = ((component2 != null) ? component2.clip : null); } } } } ((Component)val2).gameObject.SetActive(false); Transform val3 = val.OriginalContainer.transform.Find("MansionDoor (1)"); if ((Object)(object)val3 == (Object)null) { result = false; } else { CS$<>8__locals0.doorContainer = val3.Find("Container"); if ((Object)(object)CS$<>8__locals0.doorContainer == (Object)null) { result = false; } else { Transform val4 = val.OriginalContainer.transform.Find("MansionDoor"); if ((Object)(object)val4 == (Object)null) { result = false; } else { Transform val5 = val4.Find("Container"); if (!((Object)(object)val5 == (Object)null)) { ((Behaviour)((Component)val5.GetChild(0)).GetComponent()).enabled = false; ((Behaviour)((Component)val5.GetChild(1)).GetComponent()).enabled = false; doorOrigRot = ((Component)CS$<>8__locals0.doorContainer).transform.localRotation; CS$<>8__locals0.exteriorIntObj = ((Component)CS$<>8__locals0.doorContainer.GetChild(0)).GetComponent(); CS$<>8__locals0.interiorIntObj = ((Component)CS$<>8__locals0.doorContainer.GetChild(1)).GetComponent(); CS$<>8__locals0.doorInteractedAction = null; CS$<>8__locals0.exteriorIntObj.message = "Open Door"; CS$<>8__locals0.doorInteractedAction = UnityAction.op_Implicit((Action)onDoorInteracted); CS$<>8__locals0.exteriorIntObj.onInteractStart.AddListener(CS$<>8__locals0.doorInteractedAction); CS$<>8__locals0.exteriorIntObj.MaxInteractionRange = 2f; CS$<>8__locals0.interiorDoorInteractedAction = null; CS$<>8__locals0.interiorDoorInteractedAction = UnityAction.op_Implicit((Action)onInteriorDoorInteracted); CS$<>8__locals0.interiorIntObj.onInteractStart.AddListener(CS$<>8__locals0.interiorDoorInteractedAction); CS$<>8__locals0.interiorIntObj.MaxInteractionRange = 3f; CS$<>8__locals0.interiorIntObj.message = "Leave Manor"; List list = new List { val.OriginalContainer.transform.GetChild(3), val.OriginalContainer.transform.GetChild(4), val.OriginalContainer.transform.GetChild(5) }; <>7__wrap1 = list.GetEnumerator(); <>1__state = -3; goto IL_046d; } result = false; } } } } else { result = false; } } goto end_IL_0000; } case 1: <>1__state = -3; if (!CartelEnforcer.registered) { result = false; break; } <>7__wrap3 = 5__3; <>7__wrap4 = 0; goto IL_044f; case 2: { <>1__state = -3; if (!CartelEnforcer.registered) { result = false; break; } 5__6.isOn = true; 5__6 = null; <>7__wrap4++; goto IL_044f; } IL_044f: if (<>7__wrap4 >= <>7__wrap3.Length) { <>7__wrap3 = null; 5__3 = null; goto IL_046d; } 5__6 = <>7__wrap3[<>7__wrap4]; <>2__current = CartelEnforcer.Wait05; <>1__state = 2; result = true; goto end_IL_0000; IL_046d: while (true) { if (<>7__wrap1.MoveNext()) { Transform current = <>7__wrap1.Current; ((Component)current).gameObject.SetActive(true); 5__3 = Il2CppArrayBase.op_Implicit(((Component)current).GetComponentsInChildren()); if (5__3.Length != 0) { <>2__current = CartelEnforcer.Wait05; <>1__state = 1; result = true; break; } continue; } <>m__Finally1(); <>7__wrap1 = default(List.Enumerator); onSafeBuilt = delegate { CartelEnforcer.coros.Add(MelonCoroutines.Start(PrepareSafe())); }; CartelEnforcer.coros.Add(MelonCoroutines.Start(GenerateRooms())); result = false; break; } goto end_IL_0000; } <>m__Finally1(); end_IL_0000:; } catch { //try-fault ((IDisposable)this).Dispose(); throw; } return result; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; ((IDisposable)<>7__wrap1).Dispose(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static readonly List upstairsRoomCenters = new List { new Vector3(170.7373f, 14.25f, -53.7164f), new Vector3(170.7373f, 14.25f, -60.0944f), new Vector3(156.7373f, 14.25f, -60.0944f), new Vector3(156.7373f, 14.25f, -53.7164f) }; public static readonly List downstairsRoomCenters = new List { new Vector3(157.1746f, 10.5f, -56.9532f), new Vector3(169.755f, 10.5f, -56.9532f) }; public static readonly List lootSafeSpawns = new List { new SafeSpawnSpot(new Vector3(153.63f, 14.42f, -56.13f), new Vector3(0f, 0f, 0f)), new SafeSpawnSpot(new Vector3(159.43f, 14.42f, -57.73f), new Vector3(0f, 90f, 0f)), new SafeSpawnSpot(new Vector3(173.43f, 14.42f, -57.89f), new Vector3(0f, 180f, 0f)), new SafeSpawnSpot(new Vector3(166.56f, 14.42f, -51.41f), new Vector3(0f, 75f, 0f)) }; public static Dictionary buildablesMap = new Dictionary { { "CoffeeTable", null }, { "DisplayCabinet", null }, { "FloorLamp", null }, { "GrandfatherClock", null }, { "Jukebox_Built", null }, { "MetalSquareTable", null }, { "MixingStation_Built", null }, { "Painting_Rapscallion", null }, { "SingleBed", null }, { "Small Safe", null }, { "TV_Built", null }, { "WoodSquareTable", null }, { "Metal Bars Sewer Door", null }, { "Thomas", null }, { "GoldenToilet", null } }; private static GameObject sofaObj = null; public static StorageEntity questSafe = null; public static Action onSafeBuilt; public static Jukebox activeJukebox = null; public static List roomsGenerated = new List(); public static List nonRoomObjects = new List(); private static Quaternion doorOrigRot; [IteratorStateMachine(typeof(d__11))] public static IEnumerator SetupManor() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__11(0); } [IteratorStateMachine(typeof(d__12))] public static IEnumerator InitManorItemRef() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__12(0); } public static void ResetManorItemRef() { foreach (string item in buildablesMap.Keys.ToList()) { buildablesMap[item] = null; } sofaObj = null; questSafe = null; activeJukebox = null; onSafeBuilt = null; roomsGenerated.Clear(); nonRoomObjects.Clear(); EndGameQuest.manorGoons.Clear(); EndGameQuest.manorGoonGuids.Clear(); } [IteratorStateMachine(typeof(d__14))] public static IEnumerator GenerateRooms() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__14(0); } [IteratorStateMachine(typeof(d__15))] public static IEnumerator PrepareSafe() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__15(0); } [IteratorStateMachine(typeof(d__16))] public static IEnumerator CleanupManor() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__16(0); } [IteratorStateMachine(typeof(d__17))] public static IEnumerator LerpDoorRotation(Transform tr, Action cb, AudioClip open, AudioClip close) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__17(0) { tr = tr, cb = cb, open = open, close = close }; } [IteratorStateMachine(typeof(d__18))] public static IEnumerator DoorEnterAnimation(bool enterBuilding) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__18(0) { enterBuilding = enterBuilding }; } [IteratorStateMachine(typeof(d__19))] public static IEnumerator OnDoorFirstEntered() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__19(0); } public static void OnJukeboxStateChange() { if (EndGameQuest.activeManorQuest.isJukeboxPlaying) { EndGameQuest.activeManorQuest.isJukeboxPlaying = false; if (!((Object)(object)activeJukebox == (Object)null)) { activeJukebox.SetVolume(0, false); } } } } [HarmonyPatch(typeof(Dealer), "TryRobDealer")] public static class DealerRobberyPatch { private static bool IsPlayerNearby(Dealer dealer, float maxDistance = 120f) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) return Vector3.Distance(((Component)dealer).transform.position, ((Component)Player.Local).transform.position) < maxDistance; } private static void Original(Dealer __instance) { //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Expected O, but got Unknown //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Expected O, but got Unknown //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Expected O, but got Unknown float num = 0f; Enumerator enumerator = ((NPC)__instance).Inventory.ItemSlots.GetEnumerator(); while (enumerator.MoveNext()) { ItemSlot current = enumerator.Current; if (current.ItemInstance != null) { StorableItemDefinition val = ((Il2CppObjectBase)current.ItemInstance.Definition).TryCast(); if ((Object)(object)val != (Object)null) { num = Mathf.Max(num, val.CombatUtility); } } } float num2 = Random.Range(0f, 1f); num2 = Mathf.Lerp(num2, 1f, num * 0.5f); if (num2 > 0.67f) { ((NPC)__instance).MSGConversation.SendMessage(new Message(((NPC)__instance).DialogueHandler.Database.GetLine((EDialogueModule)6, "dealer_rob_defended"), (ESenderType)1, false, -1), true, true); return; } if (num2 > 0.25f) { ((NPC)__instance).MSGConversation.SendMessage(new Message(((NPC)__instance).DialogueHandler.Database.GetLine((EDialogueModule)6, "dealer_rob_partially_defended"), (ESenderType)1, false, -1), true, true); List list = new List(); float num3 = 1f - Mathf.InverseLerp(0.25f, 0.67f, num2); for (int i = 0; i < ((NPC)__instance).Inventory.ItemSlots.Count; i++) { if (((NPC)__instance).Inventory.ItemSlots[i].ItemInstance != null) { float num4 = num3 * 0.8f; if (Random.Range(0f, 1f) < num4) { int num5 = Mathf.RoundToInt((float)((BaseItemInstance)((NPC)__instance).Inventory.ItemSlots[i].ItemInstance).Quantity * num3); list.Add(((NPC)__instance).Inventory.ItemSlots[i].ItemInstance.GetCopy(num5)); ((NPC)__instance).Inventory.ItemSlots[i].ChangeQuantity(-num5, false); } } } __instance.TryMoveOverflowItems(); float num6 = __instance.Cash * num3; __instance.ChangeCash(0f - num6); SummarizeLosses(__instance, list, num6); return; } ((NPC)__instance).MSGConversation.SendMessage(new Message(((NPC)__instance).DialogueHandler.Database.GetLine((EDialogueModule)6, "dealer_rob_loss"), (ESenderType)1, false, -1), true, true); List list2 = new List(); enumerator = ((NPC)__instance).Inventory.ItemSlots.GetEnumerator(); while (enumerator.MoveNext()) { ItemSlot current2 = enumerator.Current; if (current2.ItemInstance != null) { list2.Add(current2.ItemInstance.GetCopy(((BaseItemInstance)current2.ItemInstance).Quantity)); } } ((NPC)__instance).Inventory.Clear(); foreach (ItemSlot item in (Il2CppArrayBase)(object)__instance.overflowSlots) { if (item.ItemInstance != null) { list2.Add(item.ItemInstance.GetCopy(((BaseItemInstance)item.ItemInstance).Quantity)); item.ClearStoredInstance(false); } } float cash2 = __instance.Cash; __instance.ChangeCash(0f - cash2); SummarizeLosses(__instance, list2, cash2); static void SummarizeLosses(Dealer __instance, List items, float cash) { //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Expected O, but got Unknown //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) if (items.Count != 0 || !(cash <= 0f)) { CartelEnforcer.coros.Add(MelonCoroutines.Start(CartelInventory.CartelStealsItems(items))); CartelInventory.cartelCashAmount += cash; List list3 = new List(); for (int j = 0; j < items.Count; j++) { string text = ((BaseItemInstance)items[j]).Quantity + "x "; ProductItemInstance val2 = ((Il2CppObjectBase)items[j]).TryCast(); if (val2 != null && (Object)(object)val2.AppliedPackaging != (Object)null) { text = text + ((BaseItemDefinition)val2.AppliedPackaging).Name + " of "; } text += ((BaseItemDefinition)items[j].Definition).Name; QualityItemInstance val3 = ((Il2CppObjectBase)items[j]).TryCast(); if (val3 != null) { string text2 = text; EQuality quality = val3.Quality; text = text2 + " (" + ((object)(EQuality)(ref quality)).ToString() + " quality)"; } list3.Add(text); } if (cash > 0f) { list3.Add(MoneyManager.FormatAmount(cash, false, false) + " cash"); } string text3 = "This is what they got:\n" + string.Join("\n", list3); ((NPC)__instance).MSGConversation.SendMessage(new Message(text3, (ESenderType)1, true, -1), false, true); } } } [HarmonyPrefix] public static bool Prefix(Dealer __instance) { if (((NPC)__instance).RelationData.Unlocked && __instance.IsRecruited && !((NPC)__instance).Health.IsDead && !((NPC)__instance).Health.IsKnockedOut && !((NPC)__instance).isInBuilding) { if (IsPlayerNearby(__instance) && CartelEnforcer.currentConfig.realRobberyEnabled && NetworkSingleton.Instance.GoonPool.unspawnedGoons.Count > 0) { CartelEnforcer.coros.Add(MelonCoroutines.Start(DealerRobbery.RobberyCombatCoroutine(__instance))); } else if (CartelEnforcer.currentConfig.defaultRobberyEnabled) { Original(__instance); } } return false; } } public static class DealerRobbery { [CompilerGenerated] private sealed class d__6 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public CartelGoon goon; private float 5__2; private float 5__3; private int 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__6(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__2 = ((NPC)goon).Movement.WalkSpeed; 5__3 = ((NPC)goon).Movement.RunSpeed; ((NPC)goon).Movement.WalkSpeed = ((NPC)goon).Movement.WalkSpeed * 3.5f; ((NPC)goon).Movement.RunSpeed = ((NPC)goon).Movement.RunSpeed * 2.5f; ((NPC)goon).Movement.MoveSpeedMultiplier = 1.4f; ((NPC)goon).Health.Health = Mathf.Round(Mathf.Lerp(((NPC)goon).Health.Health, ((NPC)goon).Health.MaxHealth, 0.15f)); 5__4 = 0; break; case 1: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } ((NPC)goon).Movement.WalkSpeed = Mathf.Lerp(((NPC)goon).Movement.WalkSpeed, 5__2, 0.025f); ((NPC)goon).Movement.RunSpeed = Mathf.Lerp(((NPC)goon).Movement.RunSpeed, 5__3, 0.025f); ((NPC)goon).Movement.MoveSpeedMultiplier = Mathf.Lerp(((NPC)goon).Movement.MoveSpeedMultiplier, 1f, 0.025f); 5__4++; break; } if (5__4 < 50) { <>2__current = CartelEnforcer.Wait05; <>1__state = 1; return true; } ((NPC)goon).Movement.WalkSpeed = 5__2; ((NPC)goon).Movement.RunSpeed = 5__3; ((NPC)goon).Movement.MoveSpeedMultiplier = 1f; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__3 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public bool instant; public CartelGoon goon; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__3(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (!instant) { <>2__current = CartelEnforcer.Wait60; <>1__state = 1; return true; } goto IL_0045; case 1: <>1__state = -1; goto IL_0045; case 2: { <>1__state = -1; return false; } IL_0045: if (!CartelEnforcer.registered) { return false; } if (goon.IsGoonSpawned) { goon.Despawn(); } ((NPC)goon).Health.MaxHealth = 100f; ((NPC)goon).Health.Health = 100f; ((NPC)goon).Health.Revive(); ((Behaviour)((NPC)goon).Behaviour.CombatBehaviour).Disable_Networked((NetworkConnection)null); ((NPC)goon).Behaviour.ScheduleManager.EnableSchedule(); ((Component)((NPC)goon).Behaviour.ScheduleManager.ActionList[0]).gameObject.SetActive(true); ((NPC)goon).Behaviour.ScheduleManager.ActionList[0].Resume(); <>2__current = null; <>1__state = 2; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__2 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public CartelGoon goon; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__2(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = CartelEnforcer.Wait60; <>1__state = 1; return true; case 1: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } CartelEnforcer.coros.Add(MelonCoroutines.Start(DespawnSoon(goon, instant: true))); <>2__current = null; <>1__state = 2; return true; case 2: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__4 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public CartelGoon goon; public bool changeInfluence; public EMapRegion region; private Vector3 5__2; private bool 5__3; private float 5__4; private float 5__5; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //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_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_031b: 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_01dd: 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) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_042d: 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_00c7: 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_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_047f: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: { <>1__state = -1; if (!CartelEnforcer.registered) { return false; } float num2 = 150f; float num3 = 0f; NPCEnterableBuilding val = null; StaticDoor val2 = null; StaticDoor val3 = null; Vector3 val4 = Vector3.zero; CartelDealer[] allCartelDealers = DealerActivity.allCartelDealers; foreach (CartelDealer val5 in allCartelDealers) { if (!((Object)(object)((Dealer)val5).Home != (Object)null) || ((Dealer)val5).Home.Doors == null || ((Il2CppArrayBase)(object)((Dealer)val5).Home.Doors).Length <= 0) { continue; } val3 = ((Il2CppArrayBase)(object)((Dealer)val5).Home.Doors)[0]; if (!((Object)(object)val3 == (Object)null) && !((Object)(object)val3.AccessPoint == (Object)null)) { num3 = Vector3.Distance(val3.AccessPoint.position, ((NPC)goon).CenterPointTransform.position); if (num3 < num2) { val2 = val3; val = ((Dealer)val5).Home; val4 = val2.AccessPoint.position; num2 = num3; } } } if (!((Object)(object)val2 == (Object)null) && !((Object)(object)val == (Object)null)) { for (int j = 0; j < ((NPC)goon).Behaviour.ScheduleManager.ActionList.Count; j++) { NPCEvent_StayInBuilding val6 = ((Il2CppObjectBase)((NPC)goon).Behaviour.ScheduleManager.ActionList[j]).TryCast(); if ((Object)(object)val6 != (Object)null) { val6.Door = val2; val6.Building = val; } } } ((NPC)goon).Behaviour.ScheduleManager.EnableSchedule(); ((Behaviour)((NPC)goon).Behaviour.CombatBehaviour).Disable_Networked((NetworkConnection)null); ((NPC)goon).Behaviour.GetBehaviour("Follow Schedule").Enable(); ((NPC)goon).Movement.GetClosestReachablePoint(val4, ref 5__2); CartelEnforcer.coros.Add(MelonCoroutines.Start(ApplyAdrenalineRush(goon))); 5__3 = false; if (val4 == Vector3.zero || !((NPC)goon).Movement.CanGetTo(5__2, 1f)) { float num4 = default(float); ((NPC)goon).Behaviour.FleeBehaviour.SetEntityToFlee(((NetworkBehaviour)Player.GetClosestPlayer(((NPC)goon).CenterPointTransform.position, ref num4, (List)null)).NetworkObject); ((Behaviour)((NPC)goon).Behaviour.FleeBehaviour).Enable_Networked(); 5__3 = true; } else { ((NPC)goon).Movement.SetDestination(5__2); } 5__4 = 0f; 5__5 = 100f; float num = 0f; goto IL_034e; } case 1: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } if (!5__3) { float num = Vector3.Distance(5__2, ((NPC)goon).CenterPointTransform.position); if (num < 5__5) { 5__5 = num; } if (Vector3.Distance(5__2, ((NPC)goon).CenterPointTransform.position) < 3f) { goto IL_03a9; } } 5__4 += 0.5f; goto IL_034e; case 2: { <>1__state = -1; return false; } IL_03a9: if (!((NPC)goon).Health.IsDead && !((NPC)goon).Health.IsKnockedOut && 5__5 < 5f) { EscapeEndSuccess(changeInfluence, region, goon); } else if (((NPC)goon).Health.IsDead || ((NPC)goon).Health.IsKnockedOut) { if (changeInfluence) { NetworkSingleton.Instance.Influence.ChangeInfluence(region, CartelEnforcer.influenceConfig.robberyGoonEscapeDead); } CartelEnforcer.coros.Add(MelonCoroutines.Start(DespawnSoon(goon))); } else if (5__4 >= 60f && goon.IsGoonSpawned) { EscapeEndSuccess(changeInfluence, region, goon); } <>2__current = null; <>1__state = 2; return true; IL_034e: if (5__4 < 60f && ((NPC)goon).IsConscious && goon.IsGoonSpawned && !((NPC)goon).Health.IsDead && !((NPC)goon).Health.IsKnockedOut && !((NPC)goon).isInBuilding) { <>2__current = CartelEnforcer.Wait05; <>1__state = 1; return true; } goto IL_03a9; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__0 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Dealer dealer; private EMapRegion 5__2; private int 5__3; private int 5__4; private CartelGoon 5__5; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__0(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__5 = null; <>1__state = -2; } private bool MoveNext() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: 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_0105: 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_010f: 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_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_043b: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Expected O, but got Unknown //IL_037f: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: { <>1__state = -1; 5__2 = (EMapRegion)0; for (int i = 0; i < ((Il2CppArrayBase)(object)Singleton.Instance.Regions).Length; i++) { if (((Il2CppArrayBase)(object)Singleton.Instance.Regions)[i].RegionBounds.IsPointInsidePolygon(((NPC)dealer).CenterPointTransform.position)) { 5__2 = ((Il2CppArrayBase)(object)Singleton.Instance.Regions)[i].Region; } } Vector3 zero = Vector3.zero; 5__3 = 6; 5__4 = 0; goto IL_00a4; } case 1: { <>1__state = -1; if (!CartelEnforcer.registered) { return false; } Vector3 onUnitSphere = Random.onUnitSphere; onUnitSphere.y = 0f; ((Vector3)(ref onUnitSphere)).Normalize(); float num = Random.Range(8f, 16f); Vector3 val = ((Component)dealer).transform.position + onUnitSphere * num; Vector3 zero = default(Vector3); ((NPC)dealer).Movement.GetClosestReachablePoint(val, ref zero); 5__4++; if (!(zero == Vector3.zero) || 5__4 > 5__3) { if (zero == Vector3.zero) { return false; } 5__5 = NetworkSingleton.Instance.GoonPool.SpawnGoon(zero); if ((Object)(object)5__5 == (Object)null) { return false; } string text = ""; text = Random.Range(0, 5) switch { 0 => "HELP BOSS!! Benzies are trying to ROB ME!!", 1 => "BOSS!! I'm getting robbed!", 2 => "I'm being jumped, come back me up!", 3 => "Benzies set me up!! Come help quick!", 4 => "Help, boss! I'm getting ambushed!", _ => "HELP BOSS!! Benzies are trying to ROB ME!!", }; ((NPC)dealer).MSGConversation.SendMessage(new Message(text, (ESenderType)1, false, -1), true, true); ((NPC)5__5).Behaviour.CombatBehaviour.DefaultWeapon = null; if (Random.Range(0f, 1f) > 0.7f) { ((NPC)5__5).Behaviour.CombatBehaviour.SetWeapon("Avatar/Equippables/M1911"); if ((Object)(object)((NPC)5__5).Behaviour.CombatBehaviour.currentWeapon != (Object)null) { AvatarRangedWeapon val2 = ((Il2CppObjectBase)((NPC)5__5).Behaviour.CombatBehaviour.currentWeapon).TryCast(); if ((Object)(object)val2 != (Object)null) { val2.AimTime_Max = 0.33f; val2.AimTime_Min = 0.1f; val2.CanShootWhileMoving = true; ((AvatarWeapon)val2).MinUseRange = 0.1f; } } } else if (AmbushOverrides.MeleeWeapons != null && AmbushOverrides.MeleeWeapons.Length != 0) { ((NPC)5__5).Behaviour.CombatBehaviour.DefaultWeapon = AmbushOverrides.MeleeWeapons[Random.Range(0, AmbushOverrides.MeleeWeapons.Length)]; AvatarMeleeWeapon val3 = ((Il2CppObjectBase)((NPC)5__5).Behaviour.CombatBehaviour.DefaultWeapon).TryCast(); if ((Object)(object)val3 != (Object)null) { val3.AttackRadius = 2.8f; val3.AttackRange = 3.5f; ((AvatarWeapon)val3).MaxUseRange = 3.5f; ((AvatarWeapon)val3).MinUseRange = 0.01f; ((AvatarWeapon)val3).CooldownDuration = 1.2f; val3.Damage = 44f; } } ((NPC)5__5).Movement.Warp(zero); <>2__current = CartelEnforcer.Wait05; <>1__state = 2; return true; } goto IL_00a4; } case 2: { <>1__state = -1; if (!CartelEnforcer.registered) { return false; } ((NPC)dealer).Behaviour.CombatBehaviour.SetTarget(((Component)5__5).GetComponent().NetworkObject); ((Behaviour)((NPC)dealer).Behaviour.CombatBehaviour).Enable_Networked(); ((NPC)5__5).Health.MaxHealth = 160f; ((NPC)5__5).Health.Health = 160f; 5__5.AttackEntity(((Component)((NetworkBehaviour)dealer).NetworkObject).GetComponent(), true); CartelEnforcer.coros.Add(MelonCoroutines.Start(StateRobberyCombat(dealer, 5__5, 5__2))); return false; } IL_00a4: <>2__current = CartelEnforcer.Wait05; <>1__state = 1; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__1 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public EMapRegion region; public Dealer dealer; public CartelGoon goon; private bool 5__2; private int 5__3; private float 5__4; private int 5__5; private int 5__6; private int 5__7; private int 5__8; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__1(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0302: 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_06bc: Unknown result type (might be due to invalid IL or missing references) //IL_0738: Unknown result type (might be due to invalid IL or missing references) //IL_0744: Expected O, but got Unknown //IL_078b: Unknown result type (might be due to invalid IL or missing references) //IL_07ae: Unknown result type (might be due to invalid IL or missing references) //IL_07be: Unknown result type (might be due to invalid IL or missing references) //IL_07fb: Unknown result type (might be due to invalid IL or missing references) //IL_0807: Expected O, but got Unknown //IL_08b3: Unknown result type (might be due to invalid IL or missing references) //IL_08bf: Expected O, but got Unknown //IL_0864: Unknown result type (might be due to invalid IL or missing references) float num4; float num5; switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__2 = InfluenceOverrides.ShouldChangeInfluence(region); 5__3 = 60; 5__4 = 0f; num4 = 159f; goto IL_00b5; case 1: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } num4 = Vector3.Distance(Player.Local.CenterPointTransform.position, ((NPC)dealer).CenterPointTransform.position); 5__4 += 0.5f; goto IL_00b5; case 2: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } if (((NPC)goon).Health.IsDead || !((NPC)goon).IsConscious || ((NPC)goon).Health.IsKnockedOut) { CartelEnforcer.coros.Add(MelonCoroutines.Start(EndBodyLootPrematurely(goon))); return false; } ((NPC)goon).Movement.FacePoint(((NPC)dealer).CenterPointTransform.position, 0.3f); ((NPC)goon).Movement.SetDestination(((NPC)dealer).CenterPoint); num5 = 10f; 5__5 = 0; goto IL_0318; case 3: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } if (((NPC)goon).Health.IsDead || !((NPC)goon).IsConscious || ((NPC)goon).Health.IsKnockedOut) { CartelEnforcer.coros.Add(MelonCoroutines.Start(EndBodyLootPrematurely(goon))); return false; } num5 = Vector3.Distance(((NPC)goon).CenterPoint, ((NPC)dealer).CenterPoint); goto IL_0318; case 4: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } if (((NPC)goon).Health.IsDead || !((NPC)goon).IsConscious || ((NPC)goon).Health.IsKnockedOut) { CartelEnforcer.coros.Add(MelonCoroutines.Start(EndBodyLootPrematurely(goon))); return false; } if (((NPC)dealer).Inventory.ItemSlots[5__8].ItemInstance != null) { int num3 = Mathf.Max(1, Mathf.RoundToInt((float)((BaseItemInstance)((NPC)dealer).Inventory.ItemSlots[5__8].ItemInstance).Quantity * 0.6f)); ItemInstance copy = ((NPC)dealer).Inventory.ItemSlots[5__8].ItemInstance.GetCopy(num3); if (((NPC)goon).Inventory.CanItemFit(copy)) { ((NPC)dealer).Inventory.ItemSlots[5__8].ChangeQuantity(-num3, false); ((NPC)goon).Inventory.InsertItem(copy, true); 5__7++; } } 5__8++; goto IL_0536; case 5: { <>1__state = -1; if (!CartelEnforcer.registered) { return false; } if (((NPC)goon).Health.IsDead || !((NPC)goon).IsConscious || ((NPC)goon).Health.IsKnockedOut) { CartelEnforcer.coros.Add(MelonCoroutines.Start(EndBodyLootPrematurely(goon))); return false; } if (5__7 < 5__6 && dealer.Cash > 1f) { int num = 5__6 - 5__7; float num2 = Mathf.Clamp(Mathf.Round(dealer.Cash * Random.Range(0.6f, 0.95f)), 1f, 1000f * (float)num); dealer.ChangeCash(0f - num2); ((NPC)goon).Inventory.AddCash(num2); ((NPC)goon).SetAnimationTrigger("GrabItem"); } ((NPC)dealer).Inventory.InventoryContentsChanged(); ((NPC)goon).Inventory.InventoryContentsChanged(); ((NPC)goon).Avatar.Animation.SetCrouched(false); CartelEnforcer.coros.Add(MelonCoroutines.Start(NavigateGoonEsacpe(goon, region, 5__2))); break; } IL_00b5: if (!((NPC)dealer).Health.IsDead && !((NPC)dealer).Health.IsKnockedOut && !((NPC)goon).Health.IsDead && !((NPC)goon).Health.IsKnockedOut && num4 <= 160f && 5__4 < (float)5__3) { <>2__current = CartelEnforcer.Wait05; <>1__state = 1; return true; } if (((NPC)dealer).Health.IsDead || !((NPC)dealer).IsConscious || ((NPC)dealer).Health.IsKnockedOut) { ((NPC)goon).Inventory.Clear(); ((NPC)goon).Behaviour.ScheduleManager.DisableSchedule(); ((NPC)goon).Behaviour.ScheduleManager.ActionList[0].End(); ((Component)((NPC)goon).Behaviour.ScheduleManager.ActionList[0]).gameObject.SetActive(false); <>2__current = CartelEnforcer.Wait2; <>1__state = 2; return true; } if (((NPC)goon).Health.IsDead || !((NPC)goon).IsConscious || ((NPC)goon).Health.IsKnockedOut) { ((NPC)dealer).MSGConversation.SendMessage(new Message(((NPC)dealer).DialogueHandler.Database.GetLine((EDialogueModule)6, "dealer_rob_defended"), (ESenderType)1, false, -1), true, true); ((Behaviour)((NPC)dealer).Behaviour.CombatBehaviour).Disable_Networked((NetworkConnection)null); CartelEnforcer.coros.Add(MelonCoroutines.Start(DespawnSoon(goon))); if (5__2) { NetworkSingleton.Instance.Influence.ChangeInfluence(region, CartelEnforcer.influenceConfig.robberyGoonDead); } } else if (Vector3.Distance(Player.Local.CenterPointTransform.position, ((NPC)goon).CenterPointTransform.position) > 160f) { ((NPC)dealer).MSGConversation.SendMessage(new Message(((NPC)dealer).DialogueHandler.Database.GetLine((EDialogueModule)6, "dealer_rob_defended"), (ESenderType)1, false, -1), true, true); ((Behaviour)((NPC)dealer).Behaviour.CombatBehaviour).Disable_Networked((NetworkConnection)null); ((Behaviour)((NPC)goon).Behaviour.CombatBehaviour).Disable_Networked((NetworkConnection)null); CartelEnforcer.coros.Add(MelonCoroutines.Start(DespawnSoon(goon, instant: true))); if (5__2) { NetworkSingleton.Instance.Influence.ChangeInfluence(region, CartelEnforcer.influenceConfig.robberyPlayerEscape); } } else if (5__4 >= 60f) { ((NPC)dealer).MSGConversation.SendMessage(new Message(((NPC)dealer).DialogueHandler.Database.GetLine((EDialogueModule)6, "dealer_rob_defended"), (ESenderType)1, false, -1), true, true); ((Behaviour)((NPC)dealer).Behaviour.CombatBehaviour).Disable_Networked((NetworkConnection)null); ((Behaviour)((NPC)goon).Behaviour.CombatBehaviour).Disable_Networked((NetworkConnection)null); CartelEnforcer.coros.Add(MelonCoroutines.Start(DespawnSoon(goon, instant: true))); } break; IL_0536: if (5__8 < ((NPC)dealer).Inventory.ItemSlots.Count && 5__7 < 5__6) { <>2__current = CartelEnforcer.Wait025; <>1__state = 4; return true; } dealer.TryMoveOverflowItems(); ((NPC)goon).SetAnimationTrigger("GrabItem"); <>2__current = CartelEnforcer.Wait05; <>1__state = 5; return true; IL_0318: if (num5 > 2f && 5__5 < 24) { 5__5++; <>2__current = CartelEnforcer.Wait025; <>1__state = 3; return true; } ((NPC)goon).Avatar.Animation.SetCrouched(true); ((NPC)goon).Movement.Stop(); 5__6 = 0; for (int i = 0; i < ((NPC)goon).Inventory.ItemSlots.Count; i++) { if (((NPC)goon).Inventory.ItemSlots[i].ItemInstance == null) { 5__6++; } } 5__7 = 0; 5__8 = 0; goto IL_0536; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [IteratorStateMachine(typeof(d__0))] public static IEnumerator RobberyCombatCoroutine(Dealer dealer) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__0(0) { dealer = dealer }; } [IteratorStateMachine(typeof(d__1))] public static IEnumerator StateRobberyCombat(Dealer dealer, CartelGoon goon, EMapRegion region) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__1(0) { dealer = dealer, goon = goon, region = region }; } [IteratorStateMachine(typeof(d__2))] public static IEnumerator EndBodyLootPrematurely(CartelGoon goon) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__2(0) { goon = goon }; } [IteratorStateMachine(typeof(d__3))] public static IEnumerator DespawnSoon(CartelGoon goon, bool instant = false) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__3(0) { goon = goon, instant = instant }; } [IteratorStateMachine(typeof(d__4))] public static IEnumerator NavigateGoonEsacpe(CartelGoon goon, EMapRegion region, bool changeInfluence) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__4(0) { goon = goon, region = region, changeInfluence = changeInfluence }; } public static void EscapeEndSuccess(bool changeInfluence, EMapRegion region, CartelGoon goon) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) if (changeInfluence) { NetworkSingleton.Instance.Influence.ChangeInfluence(region, CartelEnforcer.influenceConfig.robberyGoonEscapeSuccess); } List list = new List(); CashInstance val = null; for (int i = 0; i < ((NPC)goon).Inventory.ItemSlots.Count; i++) { if (((NPC)goon).Inventory.ItemSlots[i].ItemInstance != null) { val = ((Il2CppObjectBase)((NPC)goon).Inventory.ItemSlots[i].ItemInstance).TryCast(); if (val != null) { CartelInventory.cartelCashAmount += val.Balance; val = null; continue; } val = null; } if (((NPC)goon).Inventory.ItemSlots[i].ItemInstance != null) { int num = Mathf.Min(((BaseItemInstance)((NPC)goon).Inventory.ItemSlots[i].ItemInstance).Quantity, 20); list.Add(((NPC)goon).Inventory.ItemSlots[i].ItemInstance.GetCopy(num)); } } if (list.Count > 0) { CartelEnforcer.coros.Add(MelonCoroutines.Start(CartelInventory.CartelStealsItems(list, Callback))); } CartelEnforcer.coros.Add(MelonCoroutines.Start(DespawnSoon(goon, instant: true))); void Callback() { if ((Object)(object)goon != (Object)null) { ((NPC)goon).Inventory.Clear(); } } } [IteratorStateMachine(typeof(d__6))] public static IEnumerator ApplyAdrenalineRush(CartelGoon goon) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__6(0) { goon = goon }; } } public static class SabotageEvent { public class SabotageEventLocation { public Business business { get; private set; } public int hoursUntilEnabled { get; set; } public Tuple bombLocation { get; private set; } public Tuple fireLocation { get; private set; } public List sabotagerSpawns { get; private set; } public SabotageEventLocation(Business business, Tuple bombLocation, Tuple fireLocation, List sabotagerSpawns) { this.business = business; this.bombLocation = bombLocation; this.fireLocation = fireLocation; this.sabotagerSpawns = sabotagerSpawns; hoursUntilEnabled = CartelEnforcer.eventCooldowns.SabotageCooldowns.First((KeyValuePair x) => x.Key == ((Property)business).PropertyName).Value; } public void HourPass() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Invalid comparison between Unknown and I4 if (InstanceFinder.IsServer && ((Property)business).IsOwned && (int)NetworkSingleton.Instance.Status == 2) { hoursUntilEnabled = Mathf.Clamp(hoursUntilEnabled - 1, 0, int.MaxValue); } } } [CompilerGenerated] private sealed class d__26 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public SabotageEventLocation location; private int 5__2; private int 5__3; private bool 5__4; private int 5__5; private int 5__6; private bool 5__7; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__26(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: 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) float num = default(float); switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__2 = 120; 5__3 = 0; num = 50f; 5__4 = false; 5__5 = 0; 5__6 = 7; 5__7 = false; goto IL_015b; case 1: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } 5__3 += 2; goto IL_015b; case 2: <>1__state = -1; if (bombDefused) { EventEnded(location, CartelEnforcer.influenceConfig.sabotageBombDefused); sabotageEventActive = false; return false; } CartelEnforcer.coros.Add(MelonCoroutines.Start(ExplosionEvent(location))); <>2__current = null; <>1__state = 3; return true; case 3: { <>1__state = -1; return false; } IL_015b: if (!5__7 && !bombDefused) { Player.GetClosestPlayer(location.bombLocation.Item1, ref num, (List)null); if (!5__4) { 5__4 = num < 6f; 5__7 = 5__3 >= 5__2; } if (5__4) { if (5__5 % 2 == 0) { bombCubeMat.color = Color.grey; bombLight.intensity = 0f; } else { bombCubeMat.color = Color.red; bombLight.intensity = 1.8f; bombLight.color = Color.red; } bombSound.Play(); 5__5++; if (5__5 >= 5__6) { goto IL_016d; } } <>2__current = CartelEnforcer.Wait2; <>1__state = 1; return true; } goto IL_016d; IL_016d: <>2__current = CartelEnforcer.Wait05; <>1__state = 2; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__25 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__25(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_004d: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = CartelEnforcer.Wait10; <>1__state = 1; return true; case 1: <>1__state = -1; intBomb.SetActive(false); bombCubeMat.color = Color.grey; bombLight.intensity = 0f; bombSound.volume = 0.1f; <>2__current = null; <>1__state = 2; return true; case 2: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__30 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public CartelGoon goon; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__30(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = CartelEnforcer.Wait30; <>1__state = 1; return true; case 1: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } ((Component)((NPC)goon).Behaviour.ScheduleManager.ActionList[0]).gameObject.SetActive(true); ((NPC)goon).Behaviour.ScheduleManager.EnableSchedule(); if (((NPC)goon).Health.IsDead || ((NPC)goon).Health.IsKnockedOut) { ((NPC)goon).Health.Revive(); } goon.Despawn(); if (((Behaviour)((NPC)goon).Behaviour.CombatBehaviour).Active) { ((Behaviour)((NPC)goon).Behaviour.CombatBehaviour).Disable_Networked((NetworkConnection)null); } ((NPC)goon).Movement.MoveSpeedMultiplier = 1f; <>2__current = null; <>1__state = 2; return true; case 2: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__22 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private float 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__22(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Invalid comparison between Unknown and I4 //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0160: 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_00fe: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__2 = FrequencyOverrides.GetByID("Sabotage").InfluenceRequirement; goto IL_0037; case 1: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } if (CartelEnforcer.currentConfig.businessSabotage) { if (!InstanceFinder.IsServer) { return false; } if ((int)NetworkSingleton.Instance.Status == 2 && !Singleton.Instance.IsSaving && !CartelEnforcer.isSaving && !sabotageEventActive && NetworkSingleton.Instance.GoonPool.UnspawnedGoonCount != 0) { SabotageEventLocation sabotageEventLocation = null; float num = default(float); foreach (SabotageEventLocation location in locations) { if (location.hoursUntilEnabled != 0) { continue; } if (5__2 >= 0f) { EMapRegion val = Singleton.Instance.GetRegionFromPosition(((Component)location.business).transform.position); if ((int)val == 0) { val = (EMapRegion)2; } if (NetworkSingleton.Instance.Influence.GetRegionData(val).Influence < 5__2) { continue; } } if (location.business.LaunderingOperations.Count != 0 && location.business.currentLaunderTotal > location.business.appliedLaunderLimit * 0.5f) { sabotageEventLocation = location; break; } Player closestPlayer = Player.GetClosestPlayer(location.bombLocation.Item1, ref num, (List)null); if (num < 20f && (Object)(object)closestPlayer.CurrentBusiness != (Object)null && (Object)(object)closestPlayer.CurrentBusiness == (Object)(object)location.business && ((Property)location.business).IsOwned) { sabotageEventLocation = location; break; } } if (sabotageEventLocation != null) { int activityHours = FrequencyOverrides.GetActivityHours("Sabotage"); if (activityHours == 0) { float num2 = 0f; Enumerator enumerator2 = NetworkSingleton.Instance.Influence.regionInfluence.GetEnumerator(); while (enumerator2.MoveNext()) { RegionInfluenceData current2 = enumerator2.Current; num2 += current2.Influence; } float num3 = num2 / (float)NetworkSingleton.Instance.Influence.regionInfluence.Count; int num4 = Mathf.RoundToInt(Mathf.Lerp(16f, 37f, num3)); int num5 = Mathf.RoundToInt(Mathf.Lerp(38f, 64f, num3)); sabotageEventLocation.hoursUntilEnabled = Random.Range(num4, num5); } else { sabotageEventLocation.hoursUntilEnabled = activityHours; } sabotageEventActive = true; CartelEnforcer.coros.Add(MelonCoroutines.Start(GoonPlantBomb(sabotageEventLocation))); } } } goto IL_0037; case 2: { <>1__state = -1; return false; } IL_0037: <>2__current = CartelEnforcer.Wait60; <>1__state = 1; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__27 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public SabotageEventLocation location; private bool 5__2; private Player 5__3; private List 5__4; private float 5__5; private float 5__6; private float 5__7; private float 5__8; private float 5__9; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__27(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__3 = null; 5__4 = null; <>1__state = -2; } private bool MoveNext() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_0426: 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_04d1: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: { <>1__state = -1; intBomb.SetActive(false); bombCubeMat.color = Color.grey; bombLight.intensity = 0f; bombSound.volume = 0.1f; reactiveFire.transform.SetPositionAndRotation(location.fireLocation.Item1, Quaternion.Euler(location.fireLocation.Item2)); reactiveFire.SetActive(true); 5__2 = false; float num = default(float); 5__3 = Player.GetClosestPlayer(location.bombLocation.Item1, ref num, (List)null); IDamageable component = ((Component)5__3).GetComponent(); if (num <= maxExplosionDistance && component != null) { ProcessExplosionImpact(5__3.CenterPointTransform.position, component); } if (num <= maxConcussionDistance) { 5__2 = true; 5__3.Seizure = true; 5__3.Disoriented = true; } 5__4 = new List(); Enumerator enumerator = NPCManager.NPCRegistry.GetEnumerator(); while (enumerator.MoveNext()) { NPC current = enumerator.Current; if (!((NetworkBehaviour)current).IsSpawned || current.isInBuilding || current.IsInVehicle) { continue; } num = Vector3.Distance(intBomb.transform.position, current.CenterPoint); if (num <= maxExplosionDistance) { IDamageable component2 = ((Component)current).GetComponent(); if (component2 == null) { MelonLogger.Warning("Explosion recipient does not have IDamageable interface"); continue; } ProcessExplosionImpact(current.CenterPoint, component2); if (!current.Health.IsDead && !current.Health.IsKnockedOut) { current.Behaviour.FleeBehaviour.FleeMode = (EFleeMode)1; current.Behaviour.FleeBehaviour.SetPointToFlee(intBomb.transform.position); ((Behaviour)current.Behaviour.FleeBehaviour).Enable_Networked(); 5__4.Add(current); } } else if (num <= maxConcussionDistance) { current.SetPanicked_Server(); } } Enumerator enumerator2 = location.business.LaunderingOperations.GetEnumerator(); while (enumerator2.MoveNext()) { LaunderingOperation current2 = enumerator2.Current; current2.amount = 0f; current2.completionTime_Minutes = 1; } <>2__current = CartelEnforcer.Wait5; <>1__state = 1; return true; } case 1: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } if (5__2) { 5__3.Seizure = false; 5__3.Disoriented = false; } EventEnded(location, CartelEnforcer.influenceConfig.sabotageBombExploded); <>2__current = CartelEnforcer.Wait10; <>1__state = 2; return true; case 2: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } foreach (NPC item in 5__4) { if (((Behaviour)item.Behaviour.FleeBehaviour).Active) { ((Behaviour)item.Behaviour.FleeBehaviour).Disable_Networked((NetworkConnection)null); } if (Random.Range(0f, 1f) > 0.33f) { item.SetPanicked_Server(); } } 5__4.Clear(); <>2__current = CartelEnforcer.Wait10; <>1__state = 3; return true; case 3: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } 5__5 = 1f; 5__6 = 0.05f; 5__7 = 0.025f; 5__8 = 14f; 5__9 = 10f; goto IL_049c; case 4: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } 5__5 -= 5__7; reactiveFire.transform.localScale = new Vector3(5__5, 5__5, 5__5); fireLight.maxIntensity = Mathf.Clamp(Mathf.SmoothStep(5__8, -2f, 1f - 5__5), 0f, 5__8); fireLight.minIntensity = Mathf.Clamp(Mathf.SmoothStep(5__9, -2f, 1f - 5__5), 0f, 5__9); goto IL_049c; case 5: { <>1__state = -1; return false; } IL_049c: if (5__5 >= 5__6) { <>2__current = CartelEnforcer.Wait025; <>1__state = 4; return true; } reactiveFire.SetActive(false); reactiveFire.transform.localScale = new Vector3(1f, 1f, 1f); fireLight.maxIntensity = 14f; fireLight.minIntensity = 10f; sabotageEventActive = false; bombDefused = false; <>2__current = null; <>1__state = 5; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__23 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public SabotageEventLocation location; private CartelGoon 5__2; private int 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__23(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) float num; switch (<>1__state) { default: return false; case 0: { <>1__state = -1; Vector3 val = location.sabotagerSpawns[Random.Range(0, location.sabotagerSpawns.Count)]; 5__2 = NetworkSingleton.Instance.GoonPool.SpawnGoon(val); ((NPC)5__2).Movement.WarpToNavMesh(); ((Component)((NPC)5__2).Behaviour.ScheduleManager.ActionList[0]).gameObject.SetActive(false); ((NPC)5__2).Behaviour.ScheduleManager.DisableSchedule(); ((NPC)5__2).Movement.SetDestination(location.bombLocation.Item1); ((NPC)5__2).Movement.MoveSpeedMultiplier = 1.3f; num = 50f; 5__3 = 0; goto IL_01ba; } case 1: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } if (((NPC)5__2).Health.IsDead || !((NPC)5__2).IsConscious || ((NPC)5__2).Health.IsKnockedOut) { EventEnded(location, CartelEnforcer.influenceConfig.sabotageGoonKilled); sabotageEventActive = false; CartelEnforcer.coros.Add(MelonCoroutines.Start(DespawnGoonSoon(5__2))); return false; } num = Vector3.Distance(((NPC)5__2).CenterPoint, location.bombLocation.Item1); goto IL_01ba; case 2: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } if (((NPC)5__2).Health.IsDead || !((NPC)5__2).IsConscious || ((NPC)5__2).Health.IsKnockedOut) { EventEnded(location, CartelEnforcer.influenceConfig.sabotageGoonKilled); sabotageEventActive = false; CartelEnforcer.coros.Add(MelonCoroutines.Start(DespawnGoonSoon(5__2))); return false; } ((NPC)5__2).Avatar.Animation.SetCrouched(true); <>2__current = CartelEnforcer.Wait05; <>1__state = 3; return true; case 3: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } if (((NPC)5__2).Health.IsDead || !((NPC)5__2).IsConscious || ((NPC)5__2).Health.IsKnockedOut) { EventEnded(location, CartelEnforcer.influenceConfig.sabotageGoonKilled); sabotageEventActive = false; CartelEnforcer.coros.Add(MelonCoroutines.Start(DespawnGoonSoon(5__2))); return false; } ((NPC)5__2).SetAnimationTrigger("GrabItem"); SpawnBomb(location); Singleton.Instance.SendNotification(((Property)location.business).PropertyName, "Business Sabotage Alert!", NetworkSingleton.Instance.LaunderingNotificationIcon, 10f, true); <>2__current = CartelEnforcer.Wait05; <>1__state = 4; return true; case 4: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } ((NPC)5__2).Avatar.Animation.SetCrouched(false); ((Component)((NPC)5__2).Behaviour.ScheduleManager.ActionList[0]).gameObject.SetActive(true); ((NPC)5__2).Behaviour.ScheduleManager.EnableSchedule(); ((NPC)5__2).Movement.MoveSpeedMultiplier = 1.6f; CartelEnforcer.coros.Add(MelonCoroutines.Start(DespawnGoonSoon(5__2))); <>2__current = null; <>1__state = 5; return true; case 5: { <>1__state = -1; return false; } IL_01ba: if (num > 2f && 5__3 < 120) { 5__3++; <>2__current = CartelEnforcer.Wait025; <>1__state = 1; return true; } if (5__3 >= 120 && num > 2f) { sabotageEventActive = false; CartelEnforcer.coros.Add(MelonCoroutines.Start(DespawnGoonSoon(5__2))); return false; } ((NPC)5__2).Movement.Stop(); ((NPC)5__2).Movement.FacePoint(location.bombLocation.Item1, 0.4f); <>2__current = CartelEnforcer.Wait05; <>1__state = 2; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__29 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Player player; private int 5__2; private int 5__3; private int 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__29(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (burningPlayers.Contains(player)) { return false; } burningPlayers.Add(player); 5__2 = 0; goto IL_004d; case 1: <>1__state = -1; if (!CartelEnforcer.registered) { return false; } if (player.Health.IsAlive) { float num = Random.Range(minFireTickDamage, maxFireTickDamage); num *= (float)5__2; player.Health.TakeDamage(num, true, true); 5__4++; goto IL_00eb; } goto IL_00fc; case 2: { <>1__state = -1; return false; } IL_004d: 5__2++; 5__3 = fireTicks * 5__2; 5__4 = 0; goto IL_00eb; IL_00eb: if (5__4 < 5__3) { <>2__current = CartelEnforcer.Wait05; <>1__state = 1; return true; } goto IL_00fc; IL_00fc: if (!fireHandler.inCollision.Contains(player)) { if (burningPlayers.Contains(player)) { burningPlayers.Remove(player); } <>2__current = null; <>1__state = 2; return true; } goto IL_004d; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static GameObject intBomb = null; public static InteractableObject bombInteractable = null; public static Light bombLight = null; public static Material bombCubeMat = null; public static AudioSource bombSound = null; public static GameObject reactiveFire = null; public static FlickeringLight fireLight = null; public static FireCollisionHandler fireHandler = null; public static List locations = new List(); public static List burningPlayers = new List(); public static int interactionsUntilDefuse = 6; public static bool bombDefused = false; public static bool sabotageEventActive = false; private static readonly float maxExplosionDistance = 7f; private static readonly float maxConcussionDistance = 12f; private static readonly float maxExplosionDmg = 500f; private static readonly float impactForce = 1450f; private static readonly float maxFireTickDamage = 8f; private static readonly float minFireTickDamage = 2f; private static readonly int fireTicks = 2; public static void PopulateBombLocations() { //IL_0041: 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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0145: 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) //IL_0178: 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_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0230: 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) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) Enumerator enumerator = Business.Businesses.GetEnumerator(); while (enumerator.MoveNext()) { Business current = enumerator.Current; if (((Property)current).PropertyName == "Laundromat") { locations.Add(new SabotageEventLocation(current, new Tuple(new Vector3(-27.75f, 0.59f, 22.8f), new Vector3(0f, 0f, 0f)), new Tuple(new Vector3(-26.9f, -0.4f, 25.09f), new Vector3(0f, 65f, 0f)), new List { new Vector3(-43.82f, 1.46f, 49.71f), new Vector3(-7.46f, 1.36f, 10.72f), new Vector3(-11.14f, 1.46f, 67.1f) })); } else if (((Property)current).PropertyName == "Post Office") { locations.Add(new SabotageEventLocation(current, new Tuple(new Vector3(47.94f, 0.15f, -0.45f), new Vector3(0f, 0f, 0f)), new Tuple(new Vector3(47.8f, 0f, -1.15f), new Vector3(0f, 90f, 0f)), new List { new Vector3(56.62f, 1.36f, -25.8f), new Vector3(7.77f, 1.36f, 19.38f), new Vector3(65.3f, 1.45f, 33.3f) })); } else if (((Property)current).PropertyName == "Taco Ticklers") { locations.Add(new SabotageEventLocation(current, new Tuple(new Vector3(-34f, 0.24f, 78.38f), new Vector3(90f, 270f, 0f)), new Tuple(new Vector3(-34f, -0.3f, 80f), new Vector3(0f, 15f, 0f)), new List { new Vector3(-30.13f, 1.45f, 97.5f), new Vector3(-43.82f, 1.46f, 49.71f), new Vector3(-11.14f, 1.46f, 67.1f) })); } } } public static void PrepareBombFXObjects() { //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Expected O, but got Unknown //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) Transform obj = ((Component)Object.FindObjectOfType()).transform.Find("Destroyed RV/FX"); reactiveFire = Object.Instantiate((obj != null) ? ((Component)obj).gameObject : null); if (reactiveFire.gameObject.activeSelf) { reactiveFire.SetActive(false); } ((Object)reactiveFire).name = "CartelEnforcer_ReactiveFire"; fireLight = reactiveFire.GetComponentInChildren(); BoxCollider obj2 = reactiveFire.AddComponent(); obj2.size = new Vector3(2.7f, 3f, 8.3f); obj2.center = new Vector3(0.4f, 0f, 0f); ((Collider)obj2).isTrigger = true; reactiveFire.AddComponent().isKinematic = true; fireHandler = reactiveFire.AddComponent(); GameObject val = null; StorableItemInstance val2 = ((Il2CppObjectBase)new Func(Registry.GetItem)("bomb").GetDefaultInstance(1)).TryCast(); if (val2 != null && (Object)(object)val2.StoredItem != (Object)null) { val = ((Component)val2.StoredItem).gameObject; } intBomb = Object.Instantiate(val); intBomb.SetActive(false); ((Object)intBomb).name = "CartelEnforcer_InteractableBomb"; ((Component)intBomb.transform.Find("Bomb/bomb")).gameObject.AddComponent(); bombInteractable = intBomb.AddComponent(); bombInteractable.message = "x 6 - Defuse bomb"; bombInteractable.onInteractStart.AddListener(UnityAction.op_Implicit((Action)OnBombInteract)); Transform transform = new GameObject("BombLight").transform; transform.parent = intBomb.transform; transform.localPosition = new Vector3(0f, 0.23f, 0f); bombLight = ((Component)transform).gameObject.AddComponent(); bombLight.color = Color.red; bombLight.intensity = 1.8f; bombLight.range = 0.4f; bombLight.type = (LightType)2; bombCubeMat = new Material(Shader.Find("Unlit/Color")); bombCubeMat.color = Color.grey; GameObject obj3 = GameObject.CreatePrimitive((PrimitiveType)3); obj3.transform.parent = intBomb.transform; ((Renderer)obj3.GetComponent()).material = bombCubeMat; obj3.transform.localScale = new Vector3(0.023f, 0.01f, 0.01f); obj3.transform.position = new Vector3(0f, 0.052f, -0.016f); bombSound = intBomb.AddComponent(); bombSound.maxDistance = 7f; bombSound.minDistance = 1f; bombSound.pitch = 0.8f; bombSound.spatialize = true; bombSound.spatialBlend = 1f; bombSound.spread = 0.7f; bombSound.rolloffMode = (AudioRolloffMode)1; bombSound.velocityUpdateMode = (AudioVelocityUpdateMode)2; bombSound.volume = 0.12f; PoliceChatterVO val3 = Object.FindObjectOfType(true); if (!((Object)(object)val3 == (Object)null)) { bombSound.clip = val3.StartEndBeep._audioSource.clip; } static void OnBombInteract() { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) bombInteractable.message = $"x {interactionsUntilDefuse} - Defuse bomb"; if (interactionsUntilDefuse > 0) { interactionsUntilDefuse--; } else { bombLight.intensity = 1.8f; bombLight.color = Color.green; bombCubeMat.color = Color.green; bombDefused = true; CartelEnforcer.coros.Add(MelonCoroutines.Start(DespawnBombSoon())); } } } [IteratorStateMachine(typeof(d__22))] public static IEnumerator EvaluateBombEvent() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__22(0); } [IteratorStateMachine(typeof(d__23))] public static IEnumerator GoonPlantBomb(SabotageEventLocation location) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__23(0) { location = location }; } public static void SpawnBomb(SabotageEventLocation location) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) bombDefused = false; interactionsUntilDefuse = Random.Range(26, 68); bombCubeMat.color = Color.grey; bombLight.intensity = 0f; intBomb.transform.SetPositionAndRotation(location.bombLocation.Item1, Quaternion.Euler(location.bombLocation.Item2)); intBomb.SetActive(true); bombInteractable.message = $"x {interactionsUntilDefuse} - Defuse bomb"; CartelEnforcer.coros.Add(MelonCoroutines.Start(BombActivated(location))); } [IteratorStateMachine(typeof(d__25))] public static IEnumerator DespawnBombSoon() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__25(0); } [IteratorStateMachine(typeof(d__26))] public static IEnumerator BombActivated(SabotageEventLocation location) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__26(0) { location = location }; } [IteratorStateMachine(typeof(d__27))] public static IEnumerator ExplosionEvent(SabotageEventLocation location) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__27(0) { location = location }; } public static void ProcessExplosionImpact(Vector3 receivePosition, IDamageable recipient) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Expected O, but got Unknown Vector3 val = intBomb.transform.position - receivePosition; float num = 1f / ((Vector3)(ref val)).sqrMagnitude; float num2 = Mathf.Clamp(impactForce * num, 0f, 350f); float num3 = Mathf.Clamp(maxExplosionDmg * num, 0f, 200f); val = receivePosition - intBomb.transform.position; Vector3 normalized = ((Vector3)(ref val)).normalized; Impact val2 = new Impact(receivePosition, normalized, num2, num3, (EImpactType)4, (NetworkObject)null); recipient.SendImpact(val2); } [IteratorStateMachine(typeof(d__29))] public static IEnumerator SetPlayerBurning(Player player, Collider coll) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__29(0) { player = player }; } [IteratorStateMachine(typeof(d__30))] public static IEnumerator DespawnGoonSoon(CartelGoon goon) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__30(0) { goon = goon }; } public static void EventEnded(SabotageEventLocation location, float influenceChange) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) EMapRegion val = Singleton.Instance.GetRegionFromPosition(((Component)location.business).transform.position); if (InstanceFinder.IsServer) { if ((int)val == 0) { val = (EMapRegion)2; } NetworkSingleton.Instance.Influence.ChangeInfluence(val, influenceChange); } } public static void ReduceSabotageHours() { if (locations == null || locations.Count == 0 || Singleton.Instance.IsSaving || CartelEnforcer.isSaving || !CartelEnforcer.currentConfig.businessSabotage) { return; } foreach (SabotageEventLocation location in locations) { location.HourPass(); } } } [RegisterTypeInIl2Cpp] public class FireCollisionHandler : MonoBehaviour { public List inCollision = new List(); public FireCollisionHandler(IntPtr ptr) : base(ptr) { } public FireCollisionHandler() : base(ClassInjector.DerivedConstructorPointer()) { ClassInjector.DerivedConstructorBody((Il2CppObjectBase)(object)this); } private void OnTriggerEnter(Collider other) { if (((Component)other).gameObject.layer != 6) { return; } Player componentInParent = ((Component)other).gameObject.GetComponentInParent(); if (!((Object)(object)componentInParent == (Object)null)) { if (!inCollision.Contains(componentInParent)) { inCollision.Add(componentInParent); } CartelEnforcer.coros.Add(MelonCoroutines.Start(SabotageEvent.SetPlayerBurning(componentInParent, other))); } } private void OnTriggerExit(Collider other) { if (((Component)other).gameObject.layer == 6) { Player componentInParent = ((Component)other).gameObject.GetComponentInParent(); if (!((Object)(object)componentInParent == (Object)null) && inCollision.Contains(componentInParent)) { inCollision.Remove(componentInParent); } } } private void OnDisable() { inCollision.Clear(); } } }