Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of NPC API MelanieMelicious v1.0.3
MelanieMeliciousNPCAPI.dll
Decompiled 2 weeks agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using HarmonyLib; using MelanieMeliciousNPCAPI.NetcodePatcher; using Microsoft.CodeAnalysis; using TMPro; using Unity.Netcode; using UnityEngine; using UnityEngine.Events; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("MelanieMeliciousNPCAPI")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("MelanieMelicious")] [assembly: AssemblyProduct("Melanie NPC API")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] 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 MelMelNPC { public class HarmonyPatches { [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "Start")] private static void PreStart() { //IL_011b: 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) Object.Instantiate<GameObject>(Plugin.bundle.LoadAsset<GameObject>("Assets/MelanieNPC/Prefab/UI/NPCChat.prefab"), HUDManager.Instance.HUDContainer.transform); Object.Instantiate<GameObject>(Plugin.bundle.LoadAsset<GameObject>("Assets/MelanieNPC/Prefab/UI/NPCShop.prefab"), HUDManager.Instance.HUDContainer.transform); if (NPCManager.saveNPCs.Count != 0) { NPCManager.saveNPCs.Sort((NPCNode a, NPCNode b) => ((Object)a).name.CompareTo(((Object)b).name)); } if (NPCManager.savedResponses.Count != 0) { NPCManager.savedResponses.Sort((NPCChatNode a, NPCChatNode b) => ((Object)a).name.CompareTo(((Object)b).name)); } if (NPCManager.quests.Count != 0) { NPCManager.quests.Sort((NPCQuestNode a, NPCQuestNode b) => ((Object)a).name.CompareTo(((Object)b).name)); } if (GameNetworkManager.Instance.isHostingGame) { GameObject val = Object.Instantiate<GameObject>(Plugin.bundle.LoadAsset<GameObject>("Assets/MelanieNPC/Prefab/MMNPCSpawn.prefab"), Vector3.zero, Quaternion.identity); val.GetComponent<NetworkObject>().Spawn(false); foreach (NPCNode saveNPC in NPCManager.saveNPCs) { saveNPC.LoadData(); } foreach (NPCChatNode savedResponse in NPCManager.savedResponses) { savedResponse.LoadData(); } { foreach (NPCQuestNode quest in NPCManager.quests) { quest.LoadData(); } return; } } for (int i = 0; i < NPCManager.saveNPCs.Count; i++) { NPCManager.Instance.NPCServerRpc(i); } for (int j = 0; j < NPCManager.savedResponses.Count; j++) { NPCManager.Instance.ChatServerRpc(j); } for (int k = 0; k < NPCManager.quests.Count; k++) { NPCManager.Instance.QuestServerRpc(k); } } [HarmonyPostfix] [HarmonyPatch(typeof(HUDManager), "Start")] private static void PostHUD(HUDManager __instance) { //IL_009a: 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) Object.Instantiate<GameObject>(Plugin.bundle.LoadAsset<GameObject>("Assets/MelanieNPC/Prefab/UI/NPCChat.prefab"), __instance.HUDContainer.transform); Object.Instantiate<GameObject>(Plugin.bundle.LoadAsset<GameObject>("Assets/MelanieNPC/Prefab/UI/NPCShop.prefab"), __instance.HUDContainer.transform); foreach (NPCQuestNode quest in NPCManager.quests) { quest.LoadData(); } if (!GameNetworkManager.Instance.isHostingGame) { return; } GameObject val = Object.Instantiate<GameObject>(Plugin.bundle.LoadAsset<GameObject>("Assets/MelanieNPC/Prefab/MMNPCSpawn.prefab"), Vector3.zero, Quaternion.identity); val.GetComponent<NetworkObject>().Spawn(false); foreach (NPCChatNode savedResponse in NPCManager.savedResponses) { savedResponse.LoadData(); } } [HarmonyPostfix] [HarmonyPatch(typeof(HUDManager), "CloseSpecialMenus")] private static void PostCloseMenu(HUDManager __instance) { ((Component)NPCChat.Instance).gameObject.SetActive(false); ((Component)NPCShop.Instance).gameObject.SetActive(false); } [HarmonyPrefix] [HarmonyPatch(typeof(GameNetworkManager), "SaveGameValues")] private static void SaveNPCNodes() { if (!((NetworkBehaviour)StartOfRound.Instance).IsServer) { return; } try { foreach (NPCChatNode savedResponse in NPCManager.savedResponses) { savedResponse.SaveData(); } foreach (NPCQuestNode quest in NPCManager.quests) { quest.SaveData(); } } catch { Plugin.mls.LogError((object)"Issue in NPC save patch. Aborting to prevent save break."); } } [HarmonyPostfix] [HarmonyPatch(typeof(GameNetworkManager), "Start")] private static void NetworkPatch(ref GameNetworkManager __instance) { ((Component)__instance).GetComponent<NetworkManager>().AddNetworkPrefab(Plugin.bundle.LoadAsset<GameObject>("Assets/MelanieNPC/Prefab/MMNPCSpawn.prefab")); } } public class NPC : NetworkBehaviour { [SerializeField] private string nameBox; [SerializeField] internal NPCChatNode welcome; [SerializeField] private Transform spawnScrapPos; [SerializeField] private Animator animator; [SerializeField] private NPCNode npcNode; public List<GameObject> unlockableObjects; public void Welcome() { //IL_0080: 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_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) HUDManager.Instance.CloseSpecialMenus(); ((Component)NPCChat.Instance).gameObject.SetActive(true); NPCChat.Instance.nameBox.text = nameBox; Transform parent = NPCChat.Instance.nameBox.transform.parent; RectTransform val = (RectTransform)(object)((parent is RectTransform) ? parent : null); val.SetSizeWithCurrentAnchors((Axis)0, (float)(nameBox.Length * 10 + 5)); val.anchoredPosition = new Vector2((float)(nameBox.Length * 5 - 305), 120f); if ((Object)(object)spawnScrapPos != (Object)null) { NPCShop.Instance.spawnScrapPos = spawnScrapPos.position; } else { NPCShop.Instance.spawnScrapPos = ((Component)this).transform.position; } if ((Object)(object)animator != (Object)null) { NPCChat.Instance.animator = animator; NPCChat.Instance.animator.Play(NPCChat.Instance.animTalk); } NPCChat.Instance.Talk(welcome); } public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); if ((Object)(object)npcNode != (Object)null) { npcNode.npc = this; if (((NetworkBehaviour)this).IsHost) { ObjectClientRpc(npcNode.unlockedObjects.ToArray()); } } } [ServerRpc(RequireOwnership = false)] internal void ObjectServerRpc(int[] indexes) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Invalid comparison between Unknown and I4 //IL_005f: 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_006d: 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_008e: 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_00c7: 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_00b2: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2814911222u, val, (RpcDelivery)0); bool flag = indexes != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe<int>(indexes, default(ForPrimitives)); } ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2814911222u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ObjectClientRpc(indexes); } } [ClientRpc] private void ObjectClientRpc(int[] indexes) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Invalid comparison between Unknown and I4 //IL_005f: 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_006d: 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_008e: 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_00c7: 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_00b2: 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_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(225046312u, val, (RpcDelivery)0); bool flag = indexes != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe<int>(indexes, default(ForPrimitives)); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 225046312u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; npcNode.unlockedObjects = indexes.ToList(); for (int i = 0; i < indexes.Length && npcNode.unlockedObjects[i] < unlockableObjects.Count && (Object)(object)unlockableObjects[npcNode.unlockedObjects[i]] != (Object)null; i++) { Scene scene = unlockableObjects[npcNode.unlockedObjects[i]].scene; if (((Scene)(ref scene)).IsValid()) { unlockableObjects[npcNode.unlockedObjects[i]].SetActive(true); } else { Object.Instantiate<GameObject>(unlockableObjects[npcNode.unlockedObjects[i]], ((Component)this).transform.position, ((Component)this).transform.rotation, ((Component)this).transform); } } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2814911222u, new RpcReceiveHandler(__rpc_handler_2814911222), "ObjectServerRpc"); ((NetworkBehaviour)this).__registerRpc(225046312u, new RpcReceiveHandler(__rpc_handler_225046312), "ObjectClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_2814911222(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_0088: 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: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); int[] indexes = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe<int>(ref indexes, default(ForPrimitives)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((NPC)(object)target).ObjectServerRpc(indexes); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_225046312(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_0088: 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: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); int[] indexes = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe<int>(ref indexes, default(ForPrimitives)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((NPC)(object)target).ObjectClientRpc(indexes); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "NPC"; } } public class NPCChat : MonoBehaviour { [CompilerGenerated] private sealed class <TalkDelay>d__13 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public NPCChat <>4__this; private int <length>5__1; private int <i>5__2; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <TalkDelay>d__13(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.messageBox.maxVisibleCharacters = 0; <length>5__1 = <>4__this.messageBox.text.Length; <i>5__2 = 0; break; case 1: <>1__state = -1; <i>5__2++; break; } if (<i>5__2 <= <length>5__1) { <>4__this.messageBox.maxVisibleCharacters = <i>5__2; <>2__current = (object)new WaitForSeconds(0.05f); <>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(); } } [SerializeField] internal TMP_Text nameBox; [SerializeField] private TMP_Text messageBox; public TMP_Text[] responseSelect; private List<NPCChatNode> responses = new List<NPCChatNode>(); internal Animator animator; internal int animTalk = Animator.StringToHash("Talk"); private int animIdle = Animator.StringToHash("Idle"); public static NPCChat Instance { get; private set; } public void Talk(NPCChatNode message) { if (message.selectEvent != null) { message.selectEvent.Invoke(); } if ((Object)(object)message.shop != (Object)null) { message.shop.GetItems(); ((Component)NPCShop.Instance).gameObject.SetActive(true); NPCShop.Instance.OpenShop(message.shop); ((Component)this).gameObject.SetActive(false); } else if (message.responses.Count != 0) { responses.Clear(); responses.AddRange(message.responses); if (message.quests.Count != 0) { foreach (NPCQuestNode quest in message.quests) { if (quest.IsComplete()) { if (!quest.claimed) { quest.completeEvent.Invoke(); responses.Insert(0, quest.questComplete); } continue; } responses.Insert(0, quest.questDefault); if (!GameNetworkManager.Instance.localPlayerController.isHoldingObject) { continue; } foreach (NPCQuestCondition condition in quest.conditions) { if ((Object)(object)condition.item != (Object)null && (Object)(object)GameNetworkManager.Instance.localPlayerController.currentlyHeldObjectServer.itemProperties == (Object)(object)condition.item) { responses.Insert(0, quest.questProgress); break; } } } } messageBox.SetText(message.displayText, true); ((MonoBehaviour)this).StartCoroutine(TalkDelay()); for (int i = 0; i < responseSelect.Length; i++) { if (i >= responses.Count) { ((Component)responseSelect[i].transform.parent).gameObject.SetActive(false); continue; } responseSelect[i].text = responses[i].selectText; ((Component)responseSelect[i].transform.parent).gameObject.SetActive(true); } GameNetworkManager.Instance.localPlayerController.inSpecialMenu = true; Cursor.lockState = (CursorLockMode)0; ((Behaviour)GameNetworkManager.Instance.localPlayerController.cursorIcon).enabled = false; ((TMP_Text)GameNetworkManager.Instance.localPlayerController.cursorTip).text = ""; if ((Object)(object)GameNetworkManager.Instance.localPlayerController.hoveringOverTrigger != (Object)null) { GameNetworkManager.Instance.localPlayerController.previousHoveringOverTrigger = GameNetworkManager.Instance.localPlayerController.hoveringOverTrigger; } GameNetworkManager.Instance.localPlayerController.hoveringOverTrigger = null; } else { ((Component)this).gameObject.SetActive(false); if (GameNetworkManager.Instance.localPlayerController.inSpecialMenu) { GameNetworkManager.Instance.localPlayerController.SetInSpecialMenu(false, (SpecialHUDMenu)0); } } } public void Respond(int response) { TMP_Text[] array = responseSelect; foreach (TMP_Text val in array) { ((Component)val.transform.parent).gameObject.SetActive(false); } Talk(responses[response]); } [IteratorStateMachine(typeof(<TalkDelay>d__13))] private IEnumerator TalkDelay() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <TalkDelay>d__13(0) { <>4__this = this }; } private void OnDisable() { if ((Object)(object)animator != (Object)null) { animator.Play(animIdle); } } private void Awake() { if ((Object)(object)Instance != (Object)null) { Object.Destroy((Object)(object)((Component)Instance).gameObject); } Instance = this; ((Component)this).gameObject.SetActive(false); } } [CreateAssetMenu(menuName = "ScriptableObjects/MelMelNPC/NPCChatNode")] public class NPCChatNode : ScriptableObject { [TextArea(2, 4)] public string displayText; public string selectText; public UnityEvent selectEvent; [HideInInspector] public List<NPCChatNode> responses = new List<NPCChatNode>(); [SerializeField] private bool saveUnlockedDialogue; public List<NPCChatNode> allResponses = new List<NPCChatNode>(); public List<int> lockedResponsesIndex = new List<int>(); internal List<int> lockedResponses = new List<int>(); public NPCShopNode shop; public List<NPCQuestNode> quests; private string loaded; public void UnlockDialogue(int index) { lockedResponses.Remove(index); NPCManager.Instance.ChatServerRpc(NPCManager.savedResponses.IndexOf(this), lockedResponses.ToArray()); } public void LockDialogue(int index) { lockedResponses.Add(index); NPCManager.Instance.ChatServerRpc(NPCManager.savedResponses.IndexOf(this), lockedResponses.ToArray()); } private void OnEnable() { if (!saveUnlockedDialogue) { lockedResponses.Clear(); lockedResponses.AddRange(lockedResponsesIndex); responses.Clear(); responses.AddRange(allResponses); { foreach (int lockedResponse in lockedResponses) { responses.Remove(allResponses[lockedResponse]); } return; } } NPCManager.savedResponses.Add(this); } internal void LoadData() { if (!GameNetworkManager.Instance.isHostingGame || loaded == GameNetworkManager.Instance.currentSaveFileName) { return; } try { if (ES3.KeyExists(((Object)this).name, GameNetworkManager.Instance.currentSaveFileName)) { lockedResponses = ES3.Load<List<int>>(((Object)this).name, GameNetworkManager.Instance.currentSaveFileName); NPCManager.Instance.ChatClientRpc(NPCManager.savedResponses.IndexOf(this), lockedResponses.ToArray()); } else { lockedResponses.Clear(); lockedResponses.AddRange(lockedResponsesIndex); NPCManager.Instance.ChatClientRpc(NPCManager.savedResponses.IndexOf(this), lockedResponses.ToArray()); } } catch { Plugin.mls.LogError((object)("Error while loading NPC chat node data for " + ((Object)this).name + ". Aborting to prevent save break.")); } loaded = GameNetworkManager.Instance.currentSaveFileName; } internal void SaveData() { if (!GameNetworkManager.Instance.isHostingGame) { return; } try { ES3.Save<List<int>>(((Object)this).name, lockedResponses, GameNetworkManager.Instance.currentSaveFileName); } catch { Plugin.mls.LogError((object)("Error while saving NPC chat node data for " + ((Object)this).name + ". Aborting to prevent save break.")); } } } public class NPCManager : NetworkBehaviour { public static List<NPCNode> saveNPCs = new List<NPCNode>(); public static List<NPCChatNode> savedResponses = new List<NPCChatNode>(); public static List<NPCQuestNode> quests = new List<NPCQuestNode>(); internal Terminal terminal; public static NPCManager Instance { get; private set; } public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); if ((Object)(object)Instance != (Object)null) { Object.Destroy((Object)(object)((Component)Instance).gameObject); } Instance = this; terminal = Object.FindObjectOfType<Terminal>(); } [ServerRpc(RequireOwnership = false)] public void CreditsServerRpc(int value) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: 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_006d: 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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(791563436u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, value); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 791563436u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; CreditsClientRpc(value); } } } [ClientRpc] public void CreditsClientRpc(int value) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: 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_006d: 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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3675997218u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, value); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3675997218u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; Terminal obj = terminal; obj.groupCredits += value; } } } [ServerRpc(RequireOwnership = false)] public void QuotaServerRpc(int value) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: 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_006d: 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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(4014728227u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, value); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 4014728227u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; QuotaClientRpc(value); } } } [ClientRpc] public void QuotaClientRpc(int value) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: 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_006d: 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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2551684416u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, value); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2551684416u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; TimeOfDay instance = TimeOfDay.Instance; instance.quotaFulfilled += value; } } } [ServerRpc(RequireOwnership = false)] public void SpawnItemServerRpc(int itemList, float posX, float posY, float posZ) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Invalid comparison between Unknown and I4 //IL_005f: 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_006d: 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_008a: 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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_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_00da: 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_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: 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_017d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2989129686u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, itemList); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref posX, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref posY, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref posZ, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2989129686u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; GameObject val3 = Object.Instantiate<GameObject>(StartOfRound.Instance.allItemsList.itemsList[itemList].spawnPrefab, new Vector3(posX, posY, posZ), Quaternion.identity, RoundManager.Instance.spawnedScrapContainer); val3.GetComponent<NetworkObject>().Spawn(false); GrabbableObject val4 = default(GrabbableObject); if (val3.TryGetComponent<GrabbableObject>(ref val4)) { SpawnItemClientRpc(NetworkObjectReference.op_Implicit(val3.GetComponent<NetworkObject>()), Random.Range(val4.itemProperties.minValue, val4.itemProperties.maxValue)); } else { SpawnItemClientRpc(NetworkObjectReference.op_Implicit(val3.GetComponent<NetworkObject>()), 0); } } } [ServerRpc(RequireOwnership = false)] internal void NPCServerRpc(int index, int[] syncObject) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Invalid comparison between Unknown and I4 //IL_005f: 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_006d: 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_0095: 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_0119: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2359530806u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, index); bool flag = syncObject != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe<int>(syncObject, default(ForPrimitives)); } ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2359530806u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; NPCClientRpc(index, syncObject); } } [ServerRpc(RequireOwnership = false)] internal void NPCServerRpc(int index) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: 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_006d: 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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2031944468u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, index); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2031944468u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; NPCClientRpc(index, saveNPCs[index].unlockedObjects.ToArray()); } } } [ClientRpc] internal void NPCClientRpc(int index, int[] syncObject) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Invalid comparison between Unknown and I4 //IL_005f: 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_006d: 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_0095: 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_0119: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1255338146u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, index); bool flag = syncObject != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe<int>(syncObject, default(ForPrimitives)); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1255338146u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; saveNPCs[index].unlockedObjects = syncObject.ToList(); } } [ServerRpc(RequireOwnership = false)] internal void QuestServerRpc(int index0, int index1, int progress) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Invalid comparison between Unknown and I4 //IL_005f: 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_006d: 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_007e: 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_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3039930900u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, index0); BytePacker.WriteValueBitPacked(val2, index1); BytePacker.WriteValueBitPacked(val2, progress); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3039930900u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; QuestClientRpc(index0, index1, progress); } } } [ServerRpc(RequireOwnership = false)] internal void QuestServerRpc(int index, bool claim) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: 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_006d: 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_008a: 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_00a4: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3934955173u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, index); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref claim, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3934955173u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; QuestClientRpc(index, claim); } } } [ServerRpc(RequireOwnership = false)] internal void QuestServerRpc(int index) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: 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_006d: 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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3003663075u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, index); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3003663075u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; QuestClientRpc(index, quests[index].claimed); for (int i = 0; i < quests[index].conditions.Count; i++) { QuestClientRpc(index, i, quests[index].conditions[i].progress); } } } [ClientRpc] internal void QuestClientRpc(int index0, int index1, int progress) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Invalid comparison between Unknown and I4 //IL_005f: 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_006d: 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_007e: 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_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2613414402u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, index0); BytePacker.WriteValueBitPacked(val2, index1); BytePacker.WriteValueBitPacked(val2, progress); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2613414402u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; quests[index0].conditions[index1].progress = (short)progress; } } } [ClientRpc] internal void QuestClientRpc(int index, bool claim) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: 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_006d: 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_008a: 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_00a4: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4294733108u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, index); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref claim, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4294733108u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; quests[index].claimed = claim; } } } [ServerRpc(RequireOwnership = false)] internal void ChatServerRpc(int index, int[] syncLockDialogue) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Invalid comparison between Unknown and I4 //IL_005f: 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_006d: 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_0095: 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_0119: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3281280143u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, index); bool flag = syncLockDialogue != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe<int>(syncLockDialogue, default(ForPrimitives)); } ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3281280143u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ChatClientRpc(index, syncLockDialogue); } } [ServerRpc(RequireOwnership = false)] internal void ChatServerRpc(int index) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: 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_006d: 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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2269701451u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, index); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2269701451u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ChatClientRpc(index, savedResponses[index].lockedResponses.ToArray()); } } } [ClientRpc] internal void ChatClientRpc(int index, int[] syncLockDialogue) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Invalid comparison between Unknown and I4 //IL_005f: 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_006d: 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_0095: 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_0119: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2216386288u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, index); bool flag = syncLockDialogue != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe<int>(syncLockDialogue, default(ForPrimitives)); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2216386288u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; savedResponses[index].lockedResponses = syncLockDialogue.ToList(); savedResponses[index].responses.Clear(); savedResponses[index].responses.AddRange(savedResponses[index].allResponses); foreach (int lockedResponse in savedResponses[index].lockedResponses) { savedResponses[index].responses.Remove(savedResponses[index].allResponses[lockedResponse]); } } [ClientRpc] private void SpawnItemClientRpc(NetworkObjectReference netObjRef, int value) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: 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_006d: 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_0083: 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_00a4: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(473036251u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref netObjRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, value); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 473036251u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); if (((NetworkObjectReference)(ref netObjRef)).TryGet(ref val3, (NetworkManager)null)) { ((Component)val3).GetComponent<GrabbableObject>().SetScrapValue(value); } } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Expected O, but got Unknown //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Expected O, but got Unknown //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Expected O, but got Unknown //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Expected O, but got Unknown //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(791563436u, new RpcReceiveHandler(__rpc_handler_791563436), "CreditsServerRpc"); ((NetworkBehaviour)this).__registerRpc(3675997218u, new RpcReceiveHandler(__rpc_handler_3675997218), "CreditsClientRpc"); ((NetworkBehaviour)this).__registerRpc(4014728227u, new RpcReceiveHandler(__rpc_handler_4014728227), "QuotaServerRpc"); ((NetworkBehaviour)this).__registerRpc(2551684416u, new RpcReceiveHandler(__rpc_handler_2551684416), "QuotaClientRpc"); ((NetworkBehaviour)this).__registerRpc(2989129686u, new RpcReceiveHandler(__rpc_handler_2989129686), "SpawnItemServerRpc"); ((NetworkBehaviour)this).__registerRpc(2359530806u, new RpcReceiveHandler(__rpc_handler_2359530806), "NPCServerRpc"); ((NetworkBehaviour)this).__registerRpc(2031944468u, new RpcReceiveHandler(__rpc_handler_2031944468), "NPCServerRpc"); ((NetworkBehaviour)this).__registerRpc(1255338146u, new RpcReceiveHandler(__rpc_handler_1255338146), "NPCClientRpc"); ((NetworkBehaviour)this).__registerRpc(3039930900u, new RpcReceiveHandler(__rpc_handler_3039930900), "QuestServerRpc"); ((NetworkBehaviour)this).__registerRpc(3934955173u, new RpcReceiveHandler(__rpc_handler_3934955173), "QuestServerRpc"); ((NetworkBehaviour)this).__registerRpc(3003663075u, new RpcReceiveHandler(__rpc_handler_3003663075), "QuestServerRpc"); ((NetworkBehaviour)this).__registerRpc(2613414402u, new RpcReceiveHandler(__rpc_handler_2613414402), "QuestClientRpc"); ((NetworkBehaviour)this).__registerRpc(4294733108u, new RpcReceiveHandler(__rpc_handler_4294733108), "QuestClientRpc"); ((NetworkBehaviour)this).__registerRpc(3281280143u, new RpcReceiveHandler(__rpc_handler_3281280143), "ChatServerRpc"); ((NetworkBehaviour)this).__registerRpc(2269701451u, new RpcReceiveHandler(__rpc_handler_2269701451), "ChatServerRpc"); ((NetworkBehaviour)this).__registerRpc(2216386288u, new RpcReceiveHandler(__rpc_handler_2216386288), "ChatClientRpc"); ((NetworkBehaviour)this).__registerRpc(473036251u, new RpcReceiveHandler(__rpc_handler_473036251), "SpawnItemClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_791563436(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int value = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref value); target.__rpc_exec_stage = (__RpcExecStage)1; ((NPCManager)(object)target).CreditsServerRpc(value); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3675997218(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int value = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref value); target.__rpc_exec_stage = (__RpcExecStage)1; ((NPCManager)(object)target).CreditsClientRpc(value); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4014728227(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int value = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref value); target.__rpc_exec_stage = (__RpcExecStage)1; ((NPCManager)(object)target).QuotaServerRpc(value); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2551684416(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int value = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref value); target.__rpc_exec_stage = (__RpcExecStage)1; ((NPCManager)(object)target).QuotaClientRpc(value); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2989129686(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: 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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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: 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_00ad: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int itemList = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref itemList); float posX = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref posX, default(ForPrimitives)); float posY = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref posY, default(ForPrimitives)); float posZ = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref posZ, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((NPCManager)(object)target).SpawnItemServerRpc(itemList, posX, posY, posZ); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2359530806(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: 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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_0065: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); int[] syncObject = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe<int>(ref syncObject, default(ForPrimitives)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((NPCManager)(object)target).NPCServerRpc(index, syncObject); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2031944468(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((NPCManager)(object)target).NPCServerRpc(index); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1255338146(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: 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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_0065: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); int[] syncObject = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe<int>(ref syncObject, default(ForPrimitives)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((NPCManager)(object)target).NPCClientRpc(index, syncObject); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3039930900(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); int index2 = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index2); int progress = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref progress); target.__rpc_exec_stage = (__RpcExecStage)1; ((NPCManager)(object)target).QuestServerRpc(index, index2, progress); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3934955173(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: 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_0051: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); bool claim = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref claim, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((NPCManager)(object)target).QuestServerRpc(index, claim); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3003663075(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((NPCManager)(object)target).QuestServerRpc(index); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2613414402(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); int index2 = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index2); int progress = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref progress); target.__rpc_exec_stage = (__RpcExecStage)1; ((NPCManager)(object)target).QuestClientRpc(index, index2, progress); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4294733108(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: 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_0051: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); bool claim = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref claim, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((NPCManager)(object)target).QuestClientRpc(index, claim); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3281280143(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: 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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_0065: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); int[] syncLockDialogue = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe<int>(ref syncLockDialogue, default(ForPrimitives)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((NPCManager)(object)target).ChatServerRpc(index, syncLockDialogue); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2269701451(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((NPCManager)(object)target).ChatServerRpc(index); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2216386288(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: 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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_0065: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); int[] syncLockDialogue = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe<int>(ref syncLockDialogue, default(ForPrimitives)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((NPCManager)(object)target).ChatClientRpc(index, syncLockDialogue); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_473036251(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_0051: 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_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference netObjRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref netObjRef, default(ForNetworkSerializable)); int value = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref value); target.__rpc_exec_stage = (__RpcExecStage)1; ((NPCManager)(object)target).SpawnItemClientRpc(netObjRef, value); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "NPCManager"; } } [CreateAssetMenu(menuName = "ScriptableObjects/MelMelNPC/NPCNode")] public class NPCNode : ScriptableObject { internal NPC npc; internal List<int> unlockedObjects = new List<int>(); private string loaded; [SerializeField] private bool saveableData; public void UnlockObject(int index) { if (saveableData) { if (!unlockedObjects.Contains(index)) { unlockedObjects.Add(index); } NPCManager.Instance.NPCServerRpc(NPCManager.saveNPCs.IndexOf(this), unlockedObjects.ToArray()); if ((Object)(object)npc != (Object)null) { npc.ObjectServerRpc(unlockedObjects.ToArray()); } } } internal void LoadData() { if (!saveableData || !GameNetworkManager.Instance.isHostingGame || loaded == GameNetworkManager.Instance.currentSaveFileName) { return; } try { if (ES3.KeyExists(((Object)this).name, GameNetworkManager.Instance.currentSaveFileName)) { unlockedObjects = ES3.Load<List<int>>(((Object)this).name, GameNetworkManager.Instance.currentSaveFileName); NPCManager.Instance.NPCClientRpc(NPCManager.saveNPCs.IndexOf(this), unlockedObjects.ToArray()); } else { unlockedObjects.Clear(); NPCManager.Instance.NPCClientRpc(NPCManager.saveNPCs.IndexOf(this), unlockedObjects.ToArray()); } } catch { Plugin.mls.LogError((object)("Error while loading NPC node data for " + ((Object)this).name + ". Aborting to prevent save break.")); } loaded = GameNetworkManager.Instance.currentSaveFileName; } internal void SaveData() { if (!saveableData || !GameNetworkManager.Instance.isHostingGame) { return; } try { ES3.Save<List<int>>(((Object)this).name, unlockedObjects, GameNetworkManager.Instance.currentSaveFileName); } catch { Plugin.mls.LogError((object)("Error while saving NPC node data for " + ((Object)this).name + ". Aborting to prevent save break.")); } } private void OnEnable() { if (saveableData) { NPCManager.saveNPCs.Add(this); } } } [Serializable] public class NPCQuestCondition { public string requirement = "(Example) 'Pull lever in [example location]' or 'Give 3 Shovels'"; public Item item; public string itemByName; public short progress = 0; public short progressMax = 0; } [CreateAssetMenu(menuName = "ScriptableObjects/MelMelNPC/NPCQuestNode")] public class NPCQuestNode : ScriptableObject { [ES3NonSerializable] public List<NPCQuestCondition> conditions = new List<NPCQuestCondition>(); [ES3NonSerializable] public UnityEvent completeEvent; [ES3NonSerializable] public NPCChatNode questDefault; [ES3NonSerializable] public NPCChatNode questProgress; [ES3NonSerializable] public NPCChatNode questComplete; public bool claimed = false; private bool loadedItems = false; private string loaded; public void Progress(int index) { if (conditions[index].progress <= conditions[index].progressMax) { conditions[index].progress++; NPCManager.Instance.QuestServerRpc(NPCManager.quests.IndexOf(this), index, conditions[index].progress); } } public void DespawnHeld() { GameNetworkManager.Instance.localPlayerController.DespawnHeldObject(); } public void ClaimQuest(bool claim) { NPCManager.Instance.QuestServerRpc(NPCManager.quests.IndexOf(this), claim); } internal bool IsComplete() { foreach (NPCQuestCondition condition in conditions) { if (condition.progress < condition.progressMax) { return false; } } return true; } internal void LoadData() { if (!loadedItems) { foreach (NPCQuestCondition condition in conditions) { if (condition.itemByName == null) { continue; } foreach (Item items in StartOfRound.Instance.allItemsList.itemsList) { if (items.itemName == condition.itemByName) { condition.item = items; break; } } } loadedItems = true; } if (!GameNetworkManager.Instance.isHostingGame || loaded == GameNetworkManager.Instance.currentSaveFileName) { return; } try { if (ES3.KeyExists(((Object)this).name, GameNetworkManager.Instance.currentSaveFileName)) { claimed = ES3.Load<bool>(((Object)this).name, GameNetworkManager.Instance.currentSaveFileName); NPCManager.Instance.QuestClientRpc(NPCManager.quests.IndexOf(this), claimed); for (int i = 0; i < conditions.Count; i++) { if (ES3.KeyExists($"{((Object)this).name}.Condition{i}", GameNetworkManager.Instance.currentSaveFileName)) { conditions[i].progress = ES3.Load<short>($"{((Object)this).name}.Condition{i}", GameNetworkManager.Instance.currentSaveFileName); } NPCManager.Instance.QuestClientRpc(NPCManager.quests.IndexOf(this), i, conditions[i].progress); } } else { claimed = false; for (int j = 0; j < conditions.Count; j++) { conditions[j].progress = 0; NPCManager.Instance.QuestClientRpc(NPCManager.quests.IndexOf(this), j, conditions[j].progress); } } } catch { Plugin.mls.LogError((object)("Error while loading NPC quest node data for " + ((Object)this).name + ". Aborting to prevent save break.")); } loaded = GameNetworkManager.Instance.currentSaveFileName; } internal void SaveData() { if (!GameNetworkManager.Instance.isHostingGame) { return; } try { ES3.Save<bool>(((Object)this).name, claimed, GameNetworkManager.Instance.currentSaveFileName); for (int i = 0; i < conditions.Count; i++) { ES3.Save<short>($"{((Object)this).name}.Condition{i}", conditions[i].progress, GameNetworkManager.Instance.currentSaveFileName); } } catch { Plugin.mls.LogError((object)("Error while saving NPC quest node for " + ((Object)this).name + ". Aborting to prevent save break.")); } } private void OnEnable() { NPCManager.quests.Add(this); } } public class NPCShop : MonoBehaviour { public NPCShopBuy[] buy; public TMP_Text[] buySelect; public NPCShopSell[] sell; public TMP_Text[] sellSelect; private bool sellAddQuota; [SerializeField] private TMP_Text sellAddQuotaText; public NPCShopTrade[] trade; public TMP_Text[] tradeSelect; private bool tradeAddQuota; [SerializeField] private TMP_Text tradeAddQuotaText; internal Vector3 spawnScrapPos; private AudioClip purchase; private const string noQuota = "Does NOT Progress Quota!"; private const string yesQuota = "Progresses Quota!"; public static NPCShop Instance { get; private set; } public void Buy(int index) { if (NPCManager.Instance.terminal.groupCredits >= buy[index].buyCost) { NPCManager.Instance.SpawnItemServerRpc(StartOfRound.Instance.allItemsList.itemsList.IndexOf(buy[index].buy), spawnScrapPos.x, spawnScrapPos.y, spawnScrapPos.z); NPCManager.Instance.CreditsServerRpc(-buy[index].buyCost); HUDManager.Instance.UIAudio.PlayOneShot(purchase); } else { HUDManager.Instance.DisplayTip("Error:", "Not enough credits!", true, false, "LC_Tip1"); } } public void Sell(int index) { if (GameNetworkManager.Instance.localPlayerController.isHoldingObject && (Object)(object)GameNetworkManager.Instance.localPlayerController.currentlyHeldObjectServer.itemProperties == (Object)(object)sell[index].sell) { if (sellAddQuota) { NPCManager.Instance.QuotaServerRpc((int)((float)GameNetworkManager.Instance.localPlayerController.currentlyHeldObjectServer.scrapValue * sell[index].sellMulti)); } NPCManager.Instance.CreditsServerRpc((int)((float)GameNetworkManager.Instance.localPlayerController.currentlyHeldObjectServer.scrapValue * sell[index].sellMulti)); HUDManager.Instance.UIAudio.PlayOneShot(purchase); GameNetworkManager.Instance.localPlayerController.DespawnHeldObject(); } else { HUDManager.Instance.DisplayTip("Error:", "Not holding sell item!", true, false, "LC_Tip1"); } } public void Trade(int index) { if (GameNetworkManager.Instance.localPlayerController.isHoldingObject && (Object)(object)GameNetworkManager.Instance.localPlayerController.currentlyHeldObjectServer.itemProperties == (Object)(object)trade[index].tradeWant) { if (tradeAddQuota) { NPCManager.Instance.QuotaServerRpc(GameNetworkManager.Instance.localPlayerController.currentlyHeldObjectServer.scrapValue); } NPCManager.Instance.SpawnItemServerRpc(StartOfRound.Instance.allItemsList.itemsList.IndexOf(trade[index].tradeGive), spawnScrapPos.x, spawnScrapPos.y, spawnScrapPos.z); HUDManager.Instance.UIAudio.PlayOneShot(purchase); GameNetworkManager.Instance.localPlayerController.DespawnHeldObject(); } else { HUDManager.Instance.DisplayTip("Error:", "Not holding trade item!", true, false, "LC_Tip1"); } } public void OpenShop(NPCShopNode shop) { buy = shop.buyList.ToArray(); sell = shop.sellList.ToArray(); sellAddQuota = shop.sellAddQuota; trade = shop.tradeList.ToArray(); tradeAddQuota = shop.tradeAddQuota; for (int i = 0; i < buySelect.Length; i++) { if (i >= buy.Length) { ((Component)buySelect[i].transform.parent).gameObject.SetActive(false); continue; } buySelect[i].text = $"[ {buy[i].buyCost} Credits -> {buy[i].buy.itemName} ]"; ((Component)buySelect[i].transform.parent).gameObject.SetActive(true); } if (sellAddQuota) { sellAddQuotaText.text = "Progresses Quota!"; } else { sellAddQuotaText.text = "Does NOT Progress Quota!"; } for (int j = 0; j < sellSelect.Length; j++) { if (j >= sell.Length) { ((Component)sellSelect[j].transform.parent).gameObject.SetActive(false); continue; } sellSelect[j].text = $"[ {sell[j].sell.itemName} -> {sell[j].sellMulti * 100f}% Value ]"; ((Component)sellSelect[j].transform.parent).gameObject.SetActive(true); } if (tradeAddQuota) { tradeAddQuotaText.text = "Progresses Quota!"; } else { tradeAddQuotaText.text = "Does NOT Progress Quota!"; } for (int k = 0; k < tradeSelect.Length; k++) { if (k >= trade.Length) { ((Component)tradeSelect[k].transform.parent).gameObject.SetActive(false); continue; } tradeSelect[k].text = "[ " + trade[k].tradeWant.itemName + " -> " + trade[k].tradeGive.itemName + " ]"; ((Component)tradeSelect[k].transform.parent).gameObject.SetActive(true); } } private void Awake() { if ((Object)(object)Instance != (Object)null) { Object.Destroy((Object)(object)((Component)Instance).gameObject); } Instance = this; purchase = Plugin.bundle.LoadAsset<AudioClip>("Assets/MelanieNPC/Audio/PurchaseSFX.ogg"); ((Component)this).gameObject.SetActive(false); } } [Serializable] public class NPCShopBuy { public Item buy; public string buyByName; public int buyCost; } [CreateAssetMenu(menuName = "ScriptableObjects/MelMelNPC/NPCShopNode")] public class NPCShopNode : ScriptableObject { public List<NPCShopBuy> buyList = new List<NPCShopBuy>(); public List<NPCShopSell> sellList = new List<NPCShopSell>(); public bool sellAddQuota = false; public List<NPCShopTrade> tradeList = new List<NPCShopTrade>(); public bool tradeAddQuota = false; private bool foundItems = false; internal void GetItems() { if (foundItems) { return; } foreach (NPCShopBuy buy in buyList) { foreach (Item items in StartOfRound.Instance.allItemsList.itemsList) { if (items.itemName == buy.buyByName) { buy.buy = items; break; } } } foreach (NPCShopSell sell in sellList) { foreach (Item items2 in StartOfRound.Instance.allItemsList.itemsList) { if (items2.itemName == sell.sellByName) { sell.sell = items2; break; } } } foreach (NPCShopTrade trade in tradeList) { foreach (Item items3 in StartOfRound.Instance.allItemsList.itemsList) { if (items3.itemName == trade.tradeWantByName) { trade.tradeWant = items3; } else if (items3.itemName == trade.tradeGiveByName) { trade.tradeGive = items3; } if ((Object)(object)trade.tradeWant != (Object)null && (Object)(object)trade.tradeGive != (Object)null) { break; } } } foundItems = true; } } [Serializable] public class NPCShopSell { public Item sell; public string sellByName; public float sellMulti = 1f; } [Serializable] public class NPCShopTrade { public Item tradeWant; public string tradeWantByName; public Item tradeGive; public string tradeGiveByName; } [BepInPlugin("MelanieMelicious.NPCAPI", "MelanieMelicious - NPC API", "1.0.3")] public class Plugin : BaseUnityPlugin { private const string GUID = "MelanieMelicious.NPCAPI"; private const string NAME = "MelanieMelicious - NPC API"; private const string VERSION = "1.0.3"; public const string NAMESPACE = "melanienpcapi"; private readonly Harmony harmony = new Harmony("MelanieMelicious.NPCAPI"); internal static ManualLogSource mls; public static AssetBundle bundle; public static Plugin instance; private void Awake() { Type[] types = Assembly.GetExecutingAssembly().GetTypes(); Type[] array = types; foreach (Type type in array) { MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); MethodInfo[] array2 = methods; foreach (MethodInfo methodInfo in array2) { object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); if (customAttributes.Length != 0) { methodInfo.Invoke(null, null); } } } instance = this; mls = Logger.CreateLogSource("MelanieMelicious - NPC API"); mls = ((BaseUnityPlugin)this).Logger; string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "melanienpcapi"); bundle = AssetBundle.LoadFromFile(text); harmony.PatchAll(typeof(HarmonyPatches)); } } } namespace __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { } } } namespace MelanieMeliciousNPCAPI.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }