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.1.0
MelanieMeliciousNPCAPI.dll
Decompiled 4 days ago
The result has been truncated due to the large size, download it to view full contents!
using 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 GameNetcodeStuff; 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] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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 { private static bool loaded; [HarmonyPostfix] [HarmonyPatch(typeof(StartOfRound), "Start")] private static void PostStart() { //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((NPCChatSaveNode a, NPCChatSaveNode 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 (NPCChatSaveNode savedResponse in NPCManager.savedResponses) { savedResponse.LoadData(); } if (!loaded) { foreach (NPCChatRewardNode item in NPCManager.chatReward) { item.LoadData(); } } foreach (NPCQuestNode quest in NPCManager.quests) { quest.LoadData(); } } else { for (int num = 0; num < NPCManager.saveNPCs.Count; num++) { NPCManager.Instance.NPCServerRpc(num); } for (int num2 = 0; num2 < NPCManager.savedResponses.Count; num2++) { NPCManager.Instance.ChatServerRpc(num2); } for (int num3 = 0; num3 < NPCManager.quests.Count; num3++) { NPCManager.Instance.QuestServerRpc(num3); } } if (!loaded) { NPCManager.chatReward.Clear(); } } [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 (NPCChatSaveNode 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 (NPCChatSaveNode 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2814911222u, val2, (RpcDelivery)0); bool flag = indexes != null; ((FastBufferWriter)(ref val)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe<int>(indexes, default(ForPrimitives)); } ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2814911222u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(225046312u, val2, (RpcDelivery)0); bool flag = indexes != null; ((FastBufferWriter)(ref val)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe<int>(indexes, default(ForPrimitives)); } ((NetworkBehaviour)this).__endSendClientRpc(ref val, 225046312u, val2, (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 { [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]); } private IEnumerator TalkDelay() { messageBox.maxVisibleCharacters = 0; int length = messageBox.text.Length; for (int i = 0; i <= length; i++) { messageBox.maxVisibleCharacters = i; yield return (object)new WaitForSeconds(0.05f); } } 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>(); public List<NPCChatNode> allResponses = new List<NPCChatNode>(); public NPCShopNode shop; public List<NPCQuestNode> quests; internal virtual void OnEnable() { if (allResponses.Count != 0) { responses = allResponses; } } } [CreateAssetMenu(menuName = "ScriptableObjects/MelMelNPC/NPCChatRewardNode")] public class NPCChatRewardNode : NPCChatNode { public Item itemReward; public string itemByName; internal string loaded; public void SpawnItem() { //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_002b: 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_0037: Unknown result type (might be due to invalid IL or missing references) Vector3 spawnScrapPos = NPCShop.Instance.spawnScrapPos; NPCManager.Instance.SpawnItemServerRpc(StartOfRound.Instance.allItemsList.itemsList.IndexOf(itemReward), spawnScrapPos.x, spawnScrapPos.y, spawnScrapPos.z); } public void GiveItem() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) if (GameNetworkManager.Instance.localPlayerController.FirstEmptyItemSlot((GrabbableObject)null) != -1) { NPCManager.Instance.GrabServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)GameNetworkManager.Instance.localPlayerController).NetworkObject), StartOfRound.Instance.allItemsList.itemsList.IndexOf(itemReward)); } else { SpawnItem(); } } internal void LoadData() { if (!(itemByName != string.Empty)) { return; } foreach (Item items in StartOfRound.Instance.allItemsList.itemsList) { if (items.itemName == itemByName) { itemReward = items; break; } } } internal override void OnEnable() { if (allResponses.Count != 0) { responses = allResponses; } NPCManager.chatReward.Add(this); } } [CreateAssetMenu(menuName = "ScriptableObjects/MelMelNPC/NPCChatSaveNode")] public class NPCChatSaveNode : NPCChatNode { public List<int> lockedResponsesIndex = new List<int>(); internal List<int> lockedResponses = new List<int>(); internal 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()); } internal override void OnEnable() { NPCManager.savedResponses.Add(this); } internal void LoadData() { if (loaded == GameNetworkManager.Instance.currentSaveFileName || !GameNetworkManager.Instance.isHostingGame) { 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<NPCChatSaveNode> savedResponses = new List<NPCChatSaveNode>(); public static List<NPCChatRewardNode> chatReward = new List<NPCChatRewardNode>(); 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(791563436u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, value); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 791563436u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3675997218u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, value); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3675997218u, val2, (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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(4014728227u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, value); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 4014728227u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2551684416u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, value); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2551684416u, val2, (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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2989129686u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, itemList); ((FastBufferWriter)(ref val)).WriteValueSafe<float>(ref posX, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe<float>(ref posY, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe<float>(ref posZ, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2989129686u, val2, (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); } } } [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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(473036251u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe<NetworkObjectReference>(ref netObjRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val, value); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 473036251u, val2, (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); } } } [ServerRpc(RequireOwnership = false)] internal void GrabServerRpc(NetworkObjectReference netPlayerRef, int itemList) { //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) //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_014c: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(932425325u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe<NetworkObjectReference>(ref netPlayerRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val, itemList); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 932425325u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject component = Object.Instantiate<GameObject>(StartOfRound.Instance.allItemsList.itemsList[itemList].spawnPrefab, Vector3.zero, Quaternion.identity, RoundManager.Instance.spawnedScrapContainer).GetComponent<NetworkObject>(); component.Spawn(false); NetworkObject val3 = default(NetworkObject); if (((NetworkObjectReference)(ref netPlayerRef)).TryGet(ref val3, (NetworkManager)null)) { PlayerControllerB component2 = ((Component)val3).GetComponent<PlayerControllerB>(); component2.GrabObjectClientRpc(true, NetworkObjectReference.op_Implicit(component)); GrabbableObject val4 = default(GrabbableObject); if (((Component)component).TryGetComponent<GrabbableObject>(ref val4)) { val4.ChangeOwnershipOfPropServerRpc(component2.actualClientId); GrabClientRpc(NetworkObjectReference.op_Implicit(component), Random.Range(val4.itemProperties.minValue, val4.itemProperties.maxValue), component2.actualClientId); } else { GrabClientRpc(NetworkObjectReference.op_Implicit(((Component)component).GetComponent<NetworkObject>()), 0, component2.actualClientId); } } } [ClientRpc] internal void GrabClientRpc(NetworkObjectReference netObjRef, int val, ulong id) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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_0099: 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_00f6: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val3 = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1826097618u, val3, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref netObjRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, val); BytePacker.WriteValueBitPacked(val2, id); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1826097618u, val3, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val4 = default(NetworkObject); ((NetworkObjectReference)(ref netObjRef)).TryGet(ref val4, (NetworkManager)null); ((Component)val4).GetComponent<GrabbableObject>().SetScrapValue(val); ((Component)val4).transform.localScale = Vector3.one; if (GameNetworkManager.Instance.localPlayerController.actualClientId == id) { GrabbableObject component = ((Component)val4).GetComponent<GrabbableObject>(); PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; localPlayerController.carryWeight += Mathf.Clamp(component.itemProperties.weight - 1f, 0f, 10f); component.heldByPlayerOnServer = true; component.parentObject = localPlayerController.localItemHolder; component.GrabItemOnClient(); } } } [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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2359530806u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, index); bool flag = syncObject != null; ((FastBufferWriter)(ref val)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe<int>(syncObject, default(ForPrimitives)); } ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2359530806u, val2, (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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2031944468u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, index); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2031944468u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1255338146u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, index); bool flag = syncObject != null; ((FastBufferWriter)(ref val)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe<int>(syncObject, default(ForPrimitives)); } ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1255338146u, val2, (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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3039930900u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, index0); BytePacker.WriteValueBitPacked(val, index1); BytePacker.WriteValueBitPacked(val, progress); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3039930900u, val2, (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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3934955173u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, index); ((FastBufferWriter)(ref val)).WriteValueSafe<bool>(ref claim, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3934955173u, val2, (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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3003663075u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, index); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3003663075u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2613414402u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, index0); BytePacker.WriteValueBitPacked(val, index1); BytePacker.WriteValueBitPacked(val, progress); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2613414402u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(4294733108u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, index); ((FastBufferWriter)(ref val)).WriteValueSafe<bool>(ref claim, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 4294733108u, val2, (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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3281280143u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, index); bool flag = syncLockDialogue != null; ((FastBufferWriter)(ref val)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe<int>(syncLockDialogue, default(ForPrimitives)); } ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3281280143u, val2, (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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2269701451u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, index); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2269701451u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2216386288u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, index); bool flag = syncLockDialogue != null; ((FastBufferWriter)(ref val)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe<int>(syncLockDialogue, default(ForPrimitives)); } ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2216386288u, val2, (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]); } } 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 //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Expected O, but got Unknown //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0214: 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(473036251u, new RpcReceiveHandler(__rpc_handler_473036251), "SpawnItemClientRpc"); ((NetworkBehaviour)this).__registerRpc(932425325u, new RpcReceiveHandler(__rpc_handler_932425325), "GrabServerRpc"); ((NetworkBehaviour)this).__registerRpc(1826097618u, new RpcReceiveHandler(__rpc_handler_1826097618), "GrabClientRpc"); ((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).__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_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; } } private static void __rpc_handler_932425325(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 netPlayerRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref netPlayerRef, default(ForNetworkSerializable)); int itemList = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref itemList); target.__rpc_exec_stage = (__RpcExecStage)1; ((NPCManager)(object)target).GrabServerRpc(netPlayerRef, itemList); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1826097618(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_004b: 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_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0080: 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 val = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref val); ulong id = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref id); target.__rpc_exec_stage = (__RpcExecStage)1; ((NPCManager)(object)target).GrabClientRpc(netObjRef, val, id); 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; } } 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