Decompiled source of MonsterDB v0.2.6
MonsterDB.dll
Decompiled a week 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.Concurrent; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.IO; using System.IO.Compression; using System.Linq; using System.Linq.Expressions; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Serialization; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Text.RegularExpressions; using System.Threading; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using JetBrains.Annotations; using Microsoft.CodeAnalysis; using MonsterDB.Misc; using MonsterDB.Solution.Methods; using ServerSync; using TMPro; using UnityEngine; using UnityEngine.Networking; using UnityEngine.Rendering; using YamlDotNet.Core; using YamlDotNet.Core.Events; using YamlDotNet.Core.Tokens; using YamlDotNet.Helpers; using YamlDotNet.Serialization; using YamlDotNet.Serialization.BufferedDeserialization; using YamlDotNet.Serialization.BufferedDeserialization.TypeDiscriminators; using YamlDotNet.Serialization.Converters; using YamlDotNet.Serialization.EventEmitters; using YamlDotNet.Serialization.NamingConventions; using YamlDotNet.Serialization.NodeDeserializers; using YamlDotNet.Serialization.NodeTypeResolvers; using YamlDotNet.Serialization.ObjectFactories; using YamlDotNet.Serialization.ObjectGraphTraversalStrategies; using YamlDotNet.Serialization.ObjectGraphVisitors; using YamlDotNet.Serialization.Schemas; using YamlDotNet.Serialization.TypeInspectors; using YamlDotNet.Serialization.TypeResolvers; using YamlDotNet.Serialization.Utilities; using YamlDotNet.Serialization.ValueDeserializers; [assembly: ComVisible(false)] [assembly: AssemblyTrademark("")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyProduct("MonsterDB")] [assembly: AssemblyCompany("RustyMods")] [assembly: AssemblyFileVersion("0.2.6")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyDescription("")] [assembly: AssemblyTitle("MonsterDB")] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: CompilationRelaxations(8)] [assembly: Guid("4358610B-F3F4-4843-B7AF-98B7BC60DCDE")] [assembly: AssemblyConfiguration("")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.2.6.0")] [module: UnverifiableCode] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [<7861023c-836d-4177-8d6e-776d041e0289>Embedded] internal sealed class <7861023c-836d-4177-8d6e-776d041e0289>EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] [CompilerGenerated] [<7861023c-836d-4177-8d6e-776d041e0289>Embedded] internal sealed class <dcc6a84d-b343-4031-b8de-1578fa5229a7>NullableAttribute : Attribute { public readonly byte[] NullableFlags; public <dcc6a84d-b343-4031-b8de-1578fa5229a7>NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public <dcc6a84d-b343-4031-b8de-1578fa5229a7>NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [<7861023c-836d-4177-8d6e-776d041e0289>Embedded] [CompilerGenerated] internal sealed class <e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContextAttribute : Attribute { public readonly byte Flag; public <e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContextAttribute(byte P_0) { Flag = P_0; } } } namespace MonsterDB { [<dcc6a84d-b343-4031-b8de-1578fa5229a7>Nullable(0)] [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(1)] [PublicAPI] public static class AssetBundleManager { private static readonly Dictionary<string, AssetBundle> CachedBundles = new Dictionary<string, AssetBundle>(); [return: <dcc6a84d-b343-4031-b8de-1578fa5229a7>Nullable(2)] public static T LoadAsset<[<dcc6a84d-b343-4031-b8de-1578fa5229a7>Nullable(0)] T>(string assetBundle, string prefab) where T : Object { AssetBundle assetBundle2 = GetAssetBundle(assetBundle); if (assetBundle2 != null) { return assetBundle2.LoadAsset<T>(prefab); } return default(T); } public static AssetBundle GetAssetBundle(string fileName) { if (CachedBundles.TryGetValue(fileName, out var value)) { return value; } AssetBundle val = AssetBundle.GetAllLoadedAssetBundles().FirstOrDefault((Func<AssetBundle, bool>)([<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(0)] (AssetBundle b) => ((Object)b).name == fileName)); if (val != null) { CachedBundles[fileName] = val; return val; } Assembly executingAssembly = Assembly.GetExecutingAssembly(); string name = executingAssembly.GetManifestResourceNames().Single([<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(0)] (string str) => str.EndsWith(fileName)); using Stream stream = executingAssembly.GetManifestResourceStream(name); AssetBundle val2 = AssetBundle.LoadFromStream(stream); CachedBundles[fileName] = val2; return val2; } } [<dcc6a84d-b343-4031-b8de-1578fa5229a7>Nullable(0)] [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(1)] public class AnimalTameable : MonoBehaviour { [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(0)] [HarmonyPatch(typeof(BaseAI), "IdleMovement")] private static class AnimalAI_IdleMovement_Patch { [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(1)] private static bool Prefix(BaseAI __instance, float dt) { AnimalTameable animalTameable = default(AnimalTameable); if (!((Component)__instance).TryGetComponent<AnimalTameable>(ref animalTameable)) { return true; } AnimalAI val = (AnimalAI)(object)((__instance is AnimalAI) ? __instance : null); if (val == null) { return true; } Tameable tameable = default(Tameable); if (!((Component)__instance).TryGetComponent<Tameable>(ref tameable)) { return true; } return !animalTameable.UpdateConsumeItem(__instance.m_character, val, tameable, dt); } } [HarmonyPatch(typeof(Tameable), "TamingUpdate")] [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(0)] private static class Tameable_TamingUpdate_Patch { [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(1)] private static void Postfix(Tameable __instance) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) if (ShouldPatchTameable(__instance) && !__instance.IsHungry()) { __instance.DecreaseRemainingTime(3f); if ((double)__instance.GetRemainingTime() <= 0.0) { __instance.Tame(); } else { __instance.m_sootheEffect.Create(((Component)__instance).transform.position, ((Component)__instance).transform.rotation, (Transform)null, 1f, -1); } } } } [HarmonyPatch(typeof(Tameable), "Tame")] [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(0)] private static class Tameable_Tame_Patch { [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(1)] private static void Postfix(Tameable __instance) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (ShouldPatchTameable(__instance)) { __instance.m_character.SetTamed(true); __instance.m_tamedEffect.Create(((Component)__instance).transform.position, ((Component)__instance).transform.rotation, (Transform)null, 1f, -1); Player closestPlayer = Player.GetClosestPlayer(((Component)__instance).transform.position, 30f); if (Object.op_Implicit((Object)(object)closestPlayer)) { ((Character)closestPlayer).Message((MessageType)2, __instance.m_character.m_name + " $hud_tamedone", 0, (Sprite)null); } } } } public List<ItemDrop> m_consumeItems = new List<ItemDrop>(); public float m_consumeRange = 2f; public float m_consumeSearchRange = 5f; public float m_consumeSearchInterval = 10f; public EffectList m_consumeItemEffects = new EffectList(); public float m_consumeSearchTimer; [<dcc6a84d-b343-4031-b8de-1578fa5229a7>Nullable(2)] public ItemDrop m_consumeTarget; private static readonly int Consume = Animator.StringToHash("consume"); private static bool ShouldPatchTameable(Tameable __instance) { if (__instance.m_nview.IsValid() && __instance.m_nview.IsOwner() && !__instance.IsTamed() && Object.op_Implicit((Object)(object)__instance.m_character)) { return !Object.op_Implicit((Object)(object)__instance.m_monsterAI); } return false; } public bool UpdateConsumeItem(Character character, AnimalAI animalAI, Tameable tameable, float dt) { //IL_0073: 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_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) if (m_consumeItems.Count == 0) { return false; } m_consumeSearchTimer += dt; if (m_consumeSearchTimer > m_consumeSearchInterval) { m_consumeSearchTimer = 0f; if (!tameable.IsHungry()) { return false; } ItemDrop consumeTarget = FindClosestConsumableItem(animalAI, m_consumeSearchRange); m_consumeTarget = consumeTarget; } if (!Object.op_Implicit((Object)(object)m_consumeTarget)) { return false; } if (((BaseAI)animalAI).MoveTo(dt, ((Component)m_consumeTarget).transform.position, m_consumeRange, false)) { ((BaseAI)animalAI).LookAt(((Component)m_consumeTarget).transform.position); if (((BaseAI)animalAI).IsLookingAt(((Component)m_consumeTarget).transform.position, 20f, false) && m_consumeTarget.RemoveOne()) { tameable.OnConsumedItem(m_consumeTarget); m_consumeItemEffects.Create(((Component)character).transform.position, Quaternion.identity, (Transform)null, 1f, -1); character.m_animator.SetTrigger(Consume); m_consumeTarget = null; } } return true; } [return: <dcc6a84d-b343-4031-b8de-1578fa5229a7>Nullable(2)] public ItemDrop FindClosestConsumableItem(AnimalAI animalAI, float maxRange) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) if (MonsterAI.m_itemMask == 0) { MonsterAI.m_itemMask = LayerMask.GetMask(new string[1] { "item" }); } Collider[] array = (Collider[])(object)new Collider[20]; int num = Physics.OverlapSphereNonAlloc(((Component)animalAI).transform.position, maxRange, array, MonsterAI.m_itemMask); ItemDrop val = null; float num2 = 999999f; for (int i = 0; i < num; i++) { Collider val2 = array[i]; if ((Object)(object)val2 == (Object)null || !Object.op_Implicit((Object)(object)val2.attachedRigidbody)) { continue; } ItemDrop component = ((Component)val2.attachedRigidbody).GetComponent<ItemDrop>(); if (!((Object)(object)component == (Object)null) && ((Component)component).GetComponent<ZNetView>().IsValid() && CanConsume(component.m_itemData)) { float num3 = Vector3.Distance(((Component)component).transform.position, ((Component)animalAI).transform.position); if ((Object)(object)val == (Object)null || num3 < num2) { val = component; num2 = num3; } } } if (!((Object)(object)val != (Object)null) || !((BaseAI)animalAI).HavePath(((Component)val).transform.position)) { return null; } return val; } public bool CanConsume(ItemData item) { if (m_consumeItems.Count == 0) { return false; } foreach (ItemDrop consumeItem in m_consumeItems) { if (consumeItem.m_itemData.m_shared.m_name == item.m_shared.m_name) { return true; } } return false; } } [<dcc6a84d-b343-4031-b8de-1578fa5229a7>Nullable(0)] [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(1)] public static class GrowUpText { private static ConfigEntry<Toggle> addGrowUpText; public static void Setup() { addGrowUpText = ConfigManager.config("Grow Up", "Add Progress Text", Toggle.Off, "If on, will add progress text on character hover"); } public static bool AddGrowUpText() { return addGrowUpText.Value == Toggle.On; } public static string GetGrowthPercentageText(this Growup __instance) { if ((Object)(object)__instance.m_baseAI == (Object)null) { return "$hud_growup_maturing 0%"; } double num = __instance.m_baseAI.GetTimeSinceSpawned().TotalSeconds / (double)__instance.m_growTime * 100.0; return $"$hud_growup_maturing {num:0}%"; } } public static class ProcreateText { [HarmonyPatch(typeof(Tameable), "GetStatusString")] private static class Tameable_GetStatusString { [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(1)] private static void Postfix(Tameable __instance, ref string __result) { Procreation val = default(Procreation); if (AddProgressText() && __instance.IsTamed() && ((Component)__instance).TryGetComponent<Procreation>(ref val)) { if (val.IsPregnant()) { __result += ", $hud_procreate_pregnant"; return; } float num = (float)val.GetLovePoints() / (float)val.m_requiredLovePoints * 100f; __result += $", $hud_procreate_bonding {num}%"; } } } [<dcc6a84d-b343-4031-b8de-1578fa5229a7>Nullable(1)] private static ConfigEntry<Toggle> addProcreateProgressText; public static void Setup() { addProcreateProgressText = ConfigManager.config("Procreation", "Add Progress Text", Toggle.Off, "If on, will add procreation progress info to hover text"); } private static bool AddProgressText() { return addProcreateProgressText.Value == Toggle.On; } } [HarmonyPatch(typeof(Character), "GetHoverText")] public static class Character_GetHoverText_Patch { [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(1)] private static bool Prefix(Character __instance, ref string __result) { if (!__instance.m_nview.IsValid()) { return true; } StringBuilder stringBuilder = new StringBuilder(); Tameable val = default(Tameable); Growup _instance2 = default(Growup); if (((Component)__instance).TryGetComponent<Tameable>(ref val)) { stringBuilder.Append(val.GetName()); if (val.IsTamed()) { stringBuilder.AppendFormat(" ( {0}, {1}", "$hud_tame", val.GetStatusString()); Growup _instance = default(Growup); if (((Component)__instance).TryGetComponent<Growup>(ref _instance) && GrowUpText.AddGrowUpText()) { stringBuilder.Append(", " + _instance.GetGrowthPercentageText()); } stringBuilder.Append(" )"); stringBuilder.Append("\n[<color=yellow><b>$KEY_Use</b></color>] $hud_pet"); bool flag = ZInput.IsNonClassicFunctionality() && ZInput.IsGamepadActive(); stringBuilder.AppendFormat("\n[<color=yellow><b>{0} + $KEY_Use</b></color>] $hud_rename", flag ? "$KEY_AltKeys" : "$KEY_AltPlace"); Saddle saddle = default(Saddle); if (((Component)__instance).TryGetComponent<Saddle>(ref saddle) && (!saddle.HasSaddleItem() || saddle.HaveSaddle())) { saddle.GetHoverText(stringBuilder, flag); } } else { int tameness = val.GetTameness(); stringBuilder.AppendFormat(" ( {0}, {1} )", (tameness <= 0) ? "$hud_wild" : $"$hud_tameness {tameness}%", val.GetStatusString()); } } else if (((Component)__instance).TryGetComponent<Growup>(ref _instance2) && GrowUpText.AddGrowUpText() && __instance.IsTamed()) { stringBuilder.Append(__instance.m_name + " ( " + _instance2.GetGrowthPercentageText() + " )"); } __result = Localization.instance.Localize(stringBuilder.ToString()); return false; } } [HarmonyPatch(typeof(Growup), "GrowUpdate")] public static class GrowUp_ConditioanlGrow_Patch { [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(1)] private static bool Prefix(Growup __instance) { if (!__instance.m_nview.IsValid() || !__instance.m_nview.IsOwner()) { return true; } Character val = default(Character); if (!((Component)__instance).TryGetComponent<Character>(ref val) || val.IsTamed()) { return true; } __instance.m_nview.GetZDO().Set(ZDOVars.s_spawnTime, ZNet.instance.GetTime().Ticks); return false; } } [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(1)] [<dcc6a84d-b343-4031-b8de-1578fa5229a7>Nullable(0)] public class Human : Humanoid { [CompilerGenerated] private sealed class <ReloadRoutine>d__20 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; [<dcc6a84d-b343-4031-b8de-1578fa5229a7>Nullable(0)] private object <>2__current; [<dcc6a84d-b343-4031-b8de-1578fa5229a7>Nullable(0)] public Human <>4__this; [<dcc6a84d-b343-4031-b8de-1578fa5229a7>Nullable(0)] public string reloadAnimation; public float reloadTime; object IEnumerator<object>.Current { [DebuggerHidden] [return: <dcc6a84d-b343-4031-b8de-1578fa5229a7>Nullable(0)] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] [return: <dcc6a84d-b343-4031-b8de-1578fa5229a7>Nullable(0)] get { return <>2__current; } } [DebuggerHidden] public <ReloadRoutine>d__20(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Expected O, but got Unknown int num = <>1__state; Human human = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; human.m_reloading = true; ((Character)human).m_zanim.SetBool(reloadAnimation, true); <>2__current = (object)new WaitForSeconds(reloadTime); <>1__state = 1; return true; case 1: <>1__state = -1; ((Character)human).m_zanim.SetTrigger(reloadAnimation + "_done"); ((Character)human).m_zanim.SetBool(reloadAnimation, false); <>2__current = human.m_weaponLoadedDelay; <>1__state = 2; return true; case 2: <>1__state = -1; human.m_weaponLoaded = true; human.m_reloadCoroutine = null; human.m_reloading = false; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public int m_modelIndex; public Vector3 m_skinColor; public Vector3 m_hairColor; [<dcc6a84d-b343-4031-b8de-1578fa5229a7>Nullable(2)] public int[] m_models; [<dcc6a84d-b343-4031-b8de-1578fa5229a7>Nullable(new byte[] { 2, 1 })] public string[] m_skinColors; [<dcc6a84d-b343-4031-b8de-1578fa5229a7>Nullable(new byte[] { 2, 1 })] public string[] m_hairColors; [<dcc6a84d-b343-4031-b8de-1578fa5229a7>Nullable(new byte[] { 2, 1 })] public string[] m_beards; [<dcc6a84d-b343-4031-b8de-1578fa5229a7>Nullable(new byte[] { 2, 1 })] public string[] m_hairs; public bool m_reloading; public bool m_weaponLoaded; private readonly WaitForSeconds m_weaponLoadedDelay = new WaitForSeconds(1f); [<dcc6a84d-b343-4031-b8de-1578fa5229a7>Nullable(2)] private Coroutine m_reloadCoroutine; public override void Start() { //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: 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_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) ((Humanoid)this).Start(); BaseAI baseAI = ((Character)this).m_baseAI; MonsterAI val = (MonsterAI)(object)((baseAI is MonsterAI) ? baseAI : null); if (val != null) { val.m_onConsumedItem = (Action<ItemDrop>)Delegate.Combine(val.m_onConsumedItem, new Action<ItemDrop>(OnConsumeItem)); } if (((Character)this).m_nview.IsValid() && !((Character)this).m_nview.GetZDO().GetBool(ZDOVars.s_addedDefaultItems, false)) { if (m_models != null && m_models.Length != 0) { m_modelIndex = m_models[Random.Range(0, m_models.Length)]; } if (m_beards != null && m_beards.Length != 0) { base.m_beardItem = m_beards[Random.Range(0, m_beards.Length)]; } if (m_hairs != null && m_hairs.Length != 0) { base.m_hairItem = m_hairs[Random.Range(0, m_hairs.Length)]; } if (m_skinColors != null && m_skinColors.Length != 0) { string hex = m_skinColors[Random.Range(0, m_skinColors.Length)]; m_skinColor = Utils.ColorToVec3(hex.FromHexOrRGBA(Color.white)); } if (m_hairColors != null && m_hairColors.Length != 0) { string hex2 = m_hairColors[Random.Range(0, m_hairColors.Length)]; m_hairColor = Utils.ColorToVec3(hex2.FromHexOrRGBA(Color.black)); } ((Character)this).m_nview.GetZDO().Set(ZDOVars.s_addedDefaultItems, true); ((Humanoid)this).SetupVisEquipment(base.m_visEquipment, false); } } private void OnConsumeItem(ItemDrop item) { string trigger = (item.m_itemData.m_shared.m_isDrink ? "emote_drink" : "eat"); ((Character)this).m_animator.SetTrigger(trigger); } public override void SetupVisEquipment(VisEquipment visEq, bool isRagdoll) { //IL_0171: 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) if (!isRagdoll) { visEq.SetLeftItem((base.m_leftItem != null) ? ((Object)base.m_leftItem.m_dropPrefab).name : "", (base.m_leftItem != null) ? base.m_leftItem.m_variant : 0); visEq.SetRightItem((base.m_rightItem != null) ? ((Object)base.m_rightItem.m_dropPrefab).name : ""); } visEq.SetChestItem((base.m_chestItem != null) ? ((Object)base.m_chestItem.m_dropPrefab).name : ""); visEq.SetLegItem((base.m_legItem != null) ? ((Object)base.m_legItem.m_dropPrefab).name : ""); visEq.SetHelmetItem((base.m_helmetItem != null) ? ((Object)base.m_helmetItem.m_dropPrefab).name : ""); visEq.SetShoulderItem((base.m_shoulderItem != null) ? ((Object)base.m_shoulderItem.m_dropPrefab).name : "", (base.m_shoulderItem != null) ? base.m_shoulderItem.m_variant : 0); visEq.SetUtilityItem((base.m_utilityItem != null) ? ((Object)base.m_utilityItem.m_dropPrefab).name : ""); visEq.SetTrinketItem((base.m_trinketItem != null) ? ((Object)base.m_trinketItem.m_dropPrefab).name : ""); visEq.SetBeardItem(base.m_beardItem); visEq.SetHairItem(base.m_hairItem); visEq.SetSkinColor(m_skinColor); visEq.SetHairColor(m_hairColor); visEq.SetModel(m_modelIndex); } public override float GetMaxEitr() { return 9999f; } public void LateUpdate() { if (base.m_currentAttack != null && base.m_currentAttack.m_loopingAttack && Mathf.CeilToInt(base.m_lastCombatTimer / base.m_currentAttack.m_burstInterval) > 10) { base.m_currentAttack.Stop(); base.m_previousAttack = base.m_currentAttack; base.m_currentAttack = null; } } public override void ResetLoadedWeapon() { m_weaponLoaded = false; StartWeaponReload(); } public override bool IsWeaponLoaded() { if (!m_weaponLoaded) { StartWeaponReload(); } return m_weaponLoaded; } public void StartWeaponReload() { if (m_reloading || m_weaponLoaded) { return; } ItemData currentWeapon = ((Humanoid)this).GetCurrentWeapon(); if (currentWeapon != null && currentWeapon.m_shared.m_attack.m_requiresReload) { if (m_reloadCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(m_reloadCoroutine); m_reloadCoroutine = null; } m_reloadCoroutine = ((MonoBehaviour)this).StartCoroutine(ReloadRoutine(currentWeapon.m_shared.m_attack.m_reloadAnimation, currentWeapon.m_shared.m_attack.m_reloadTime)); } } [IteratorStateMachine(typeof(<ReloadRoutine>d__20))] private IEnumerator ReloadRoutine(string reloadAnimation, float reloadTime) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <ReloadRoutine>d__20(0) { <>4__this = this, reloadAnimation = reloadAnimation, reloadTime = reloadTime }; } } public static class Humanoid_Patches { [HarmonyPatch(typeof(Humanoid), "EquipItem")] private static class Humanoid_EquipItem_Patch { [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(1)] private static void Prefix(Humanoid __instance, ItemData item) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Invalid comparison between Unknown and I4 if (!((Character)__instance).IsPlayer() && (int)item.m_shared.m_itemType == 10 && !((Object)(object)item.m_dropPrefab == (Object)null)) { string prefabName = Utils.GetPrefabName(item.m_dropPrefab); if (Utils.CustomStartsWith(prefabName, "Beard")) { __instance.SetBeard(prefabName); } else if (Utils.CustomStartsWith(prefabName, "Hair")) { __instance.SetHair(prefabName); } } } } } [HarmonyPatch(typeof(Hud), "UpdateMount")] public static class Hud_UpdateMount { [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(1)] private static bool Prefix(Hud __instance, Player player, float dt) { Saddle saddle = player.GetDoodadController() as Saddle; if ((Object)(object)saddle == (Object)null) { return true; } Character character = saddle.GetCharacter(); __instance.m_mountPanel.SetActive(true); __instance.m_mountIcon.overrideSprite = saddle.m_mountIcon; __instance.m_mountHealthBarSlow.SetValue(character.GetHealthPercentage()); __instance.m_mountHealthBarFast.SetValue(character.GetHealthPercentage()); ((TMP_Text)__instance.m_mountHealthText).text = StringExtensionMethods.ToFastString(Mathf.CeilToInt(character.GetHealth())); float stamina = saddle.GetStamina(); float maxStamina = saddle.GetMaxStamina(); __instance.m_mountStaminaBar.SetValue(stamina / maxStamina); ((TMP_Text)__instance.m_mountStaminaText).text = StringExtensionMethods.ToFastString(Mathf.CeilToInt(stamina)); ((TMP_Text)__instance.m_mountNameText).text = character.GetHoverName() + " ( " + Localization.instance.Localize(saddle.GetTameable().GetStatusString()) + " )"; return false; } } [HarmonyPatch(typeof(Player), "IsRiding")] public static class Player_IsRiding { [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(1)] private static void Postfix(Player __instance, ref bool __result) { __result |= __instance.m_doodadController != null && __instance.m_doodadController.IsValid() && __instance.m_doodadController is Saddle; } } [HarmonyPatch(typeof(Player), "SetControls")] public static class Player_SetControls_SaddlePatch { [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(1)] private static bool Prefix(Player __instance, Vector3 movedir, bool attack, bool secondaryAttack, bool block, bool jump, bool run, bool autoRun) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) if (!(__instance.m_doodadController is Saddle saddle) || !saddle.IsValid()) { return true; } saddle.ApplyCustomControls(movedir, ((Character)__instance).m_lookDir, run, autoRun, block, attack, secondaryAttack, jump); return false; } } [<dcc6a84d-b343-4031-b8de-1578fa5229a7>Nullable(0)] [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(1)] public class Saddle : MonoBehaviour, Interactable, Hoverable, IDoodadController { [HarmonyPatch(typeof(Tameable), "UseItem")] [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(0)] public static class Tameable_UseItem { [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(1)] private static bool Prefix(Tameable __instance, Humanoid user, ItemData item, ref bool __result) { Saddle saddle = default(Saddle); if (!((Component)__instance).TryGetComponent<Saddle>(ref saddle)) { return true; } __result = saddle.UseItem(user, item); return false; } } [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(0)] [HarmonyPatch(typeof(BaseAI), "UpdateAI")] public static class BaseAI_UpdateAI { [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(1)] private static bool Prefix(BaseAI __instance, float dt, ref bool __result) { Saddle saddle = default(Saddle); if (!((Component)__instance).TryGetComponent<Saddle>(ref saddle)) { return true; } if (!__instance.m_nview.IsValid() || !__instance.m_nview.IsOwner()) { return true; } if (!__instance.m_character.IsTamed()) { return true; } if (saddle.UpdateRiding(dt)) { __instance.UpdateTakeoffLanding(dt); if ((double)__instance.m_jumpInterval > 0.0) { __instance.m_jumpTimer += dt; } if ((double)__instance.m_randomMoveUpdateTimer > 0.0) { __instance.m_randomMoveUpdateTimer -= dt; } __instance.UpdateRegeneration(dt); __instance.m_timeSinceHurt += dt; __result = false; return false; } return true; } } [HarmonyPatch(typeof(Tameable), "Interact")] [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(0)] public static class Tameable_Interact { [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(1)] private static bool Prefix(Tameable __instance, Humanoid user, bool hold, bool alt, ref bool __result) { Saddle saddle = default(Saddle); if (!((Component)__instance).TryGetComponent<Saddle>(ref saddle)) { return true; } if (saddle.HasSaddleItem() && !saddle.HaveSaddle()) { return true; } if (alt || hold) { return true; } if (ZInput.GetKey((KeyCode)308, true) || ZInput.GetKeyDown((KeyCode)308, true) || ZInput.GetButton("JoyLTrigger")) { __result = saddle.Interact(user, repeat: false, alt: false); return false; } if (ZInput.GetKey((KeyCode)306, true) || ZInput.GetKeyDown((KeyCode)306, true) || ZInput.GetButton("JoyButtonB")) { __result = saddle.Interact(user, repeat: false, alt: true); return false; } return true; } } public string m_hoverText = ""; public float m_maxUseRange = 10f; [<dcc6a84d-b343-4031-b8de-1578fa5229a7>Nullable(2)] public Transform m_attachPoint; public Vector3 m_attachOffset; public GameObject m_attachParent; public Vector3 m_detachOffset = new Vector3(0f, 0.5f, 0f); public string m_attachAnimation = "attach_chair"; public float m_maxStamina = 100f; public float m_runStaminaDrain = 10f; public float m_swimStaminaDrain = 10f; public float m_staminaRegen = 10f; public float m_staminaRegenHungry = 10f; public EffectList m_drownEffects = new EffectList(); [<dcc6a84d-b343-4031-b8de-1578fa5229a7>Nullable(2)] public Sprite m_mountIcon; public Vector3 m_controlDir; public Speed m_speed; public float m_rideSkill; public float m_staminaRegenTimer; public float m_drownDamageTimer; public float m_raiseSkillTimer; public Character m_character; public ZNetView m_nview; public Tameable m_tambable; public BaseAI m_baseAI; public bool m_haveValidUser; public const string rideKey = "JoyLTrigger"; private const string removeKey = "JoyButtonB"; public void Awake() { m_character = ((Component)this).GetComponent<Character>(); m_nview = ((Component)this).GetComponent<ZNetView>(); m_tambable = ((Component)this).GetComponent<Tameable>(); m_baseAI = ((Component)this).GetComponent<BaseAI>(); m_nview.Register<long>("RequestControl", (Action<long, long>)RPC_RequestControl); m_nview.Register<long>("ReleaseControl", (Action<long, long>)RPC_ReleaseControl); m_nview.Register<bool>("RequestRespons", (Action<long, bool>)RPC_RequestRespons); m_nview.Register<Vector3>("RemoveSaddle", (Action<long, Vector3>)RPC_RemoveSaddle); m_nview.Register<Vector3, int, float>("Controls", (Action<long, Vector3, int, float>)RPC_Controls); m_nview.Register("AddSaddle", (Action<long>)RPC_AddSaddle); } public void Start() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("attach"); val.transform.SetParent(((Object)(object)m_attachParent != (Object)null) ? m_attachParent.transform : ((Component)this).transform); val.transform.localPosition = m_attachOffset; val.transform.rotation = Quaternion.identity; m_attachPoint = val.transform; } public void Restart() { //IL_0041: 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) if ((Object)(object)m_attachPoint != (Object)null) { m_attachPoint.SetParent(((Object)(object)m_attachParent != (Object)null) ? m_attachParent.transform : ((Component)this).transform); m_attachPoint.localPosition = m_attachOffset; m_attachPoint.rotation = Quaternion.identity; } } public bool IsValid() { if (Object.op_Implicit((Object)(object)this)) { return (Object)(object)m_attachPoint != (Object)null; } return false; } public bool UseItem(Humanoid user, ItemData item) { if (!m_nview.IsValid() || (Object)(object)m_tambable.m_saddleItem == (Object)null || !m_tambable.IsTamed() || item.m_shared.m_name != m_tambable.m_saddleItem.m_itemData.m_shared.m_name) { return false; } if (HaveSaddle()) { ((Character)user).Message((MessageType)2, m_tambable.GetHoverName() + " $hud_saddle_already", 0, (Sprite)null); } else { m_nview.InvokeRPC("AddSaddle", Array.Empty<object>()); user.GetInventory().RemoveOneItem(item); ((Character)user).Message((MessageType)2, m_tambable.GetHoverName() + " $hud_saddle_ready", 0, (Sprite)null); } return true; } public void FixedUpdate() { if (!m_nview.IsValid()) { return; } CalculateHaveValidUser(); if (m_character.IsTamed()) { if (IsLocalUser()) { UpdateRidingSkill(Time.fixedDeltaTime); } if (m_nview.IsOwner()) { float fixedDeltaTime = Time.fixedDeltaTime; UpdateStamina(fixedDeltaTime); UpdateDrown(fixedDeltaTime); } } } public void LateUpdate() { if (HaveValidUser()) { UpdateAttachRotation(); } } public void UpdateDrown(float dt) { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0082: 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_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0094: 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_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Expected O, but got Unknown //IL_00c1: 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_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) if (m_character.IsSwimming() && !m_character.IsOnGround() && !HaveStamina()) { m_drownDamageTimer += dt; if (!((double)m_drownDamageTimer <= 1.0)) { m_drownDamageTimer = 0f; float damage = Mathf.Ceil(m_character.GetMaxHealth() / 20f); m_character.Damage(new HitData { m_damage = { m_damage = damage }, m_point = m_character.GetCenterPoint(), m_dir = Vector3.down, m_pushForce = 10f, m_hitType = (HitType)4 }); EffectList drownEffects = m_drownEffects; Vector3 position = ((Component)this).transform.position; position.y = m_character.GetLiquidLevel(); drownEffects.Create(position, ((Component)this).transform.rotation, (Transform)null, 1f, -1); } } } public bool UpdateRiding(float dt) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Invalid comparison between Unknown and I4 //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Invalid comparison between Unknown and I4 //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Invalid comparison between Unknown and I4 //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Invalid comparison between Unknown and I4 //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Invalid comparison between Unknown and I4 if (!m_character.IsTamed() || !HaveValidUser() || (int)m_speed == 0 || (double)((Vector3)(ref m_controlDir)).magnitude == 0.0) { return false; } bool flag = HaveStamina(); if (m_character.IsFlying() && !flag && m_character.CanToggleFly()) { m_character.Land(); } if ((int)m_speed == 1 || (int)m_speed == 2) { if ((int)m_speed == 2 && !flag) { m_speed = (Speed)1; } m_baseAI.MoveTowards(m_controlDir, (int)m_speed == 2); float num = Mathf.Lerp(1f, 0.5f, GetRiderSkill()); if (m_character.IsSwimming() || m_character.IsFlying()) { UseStamina(m_swimStaminaDrain * num * dt); } else if ((int)m_speed == 2) { UseStamina(m_runStaminaDrain * num * dt); } } else if ((int)m_speed == 3) { m_baseAI.StopMoving(); m_character.SetRun(false); m_baseAI.LookTowards(m_controlDir); } m_baseAI.ResetRandomMovement(); return true; } public bool HasSaddleItem() { return (Object)(object)m_tambable.m_saddleItem != (Object)null; } public bool HaveSaddle() { if (m_nview.IsValid()) { return m_nview.GetZDO().GetBool(ZDOVars.s_haveSaddleHash, false); } return false; } public void RPC_AddSaddle(long sender) { if (m_nview.IsOwner() && !HaveSaddle()) { m_nview.GetZDO().Set(ZDOVars.s_haveSaddleHash, true); m_nview.InvokeRPC(ZNetView.Everybody, "SetSaddle", new object[1] { true }); } } public bool DropSaddle(Vector3 userPoint) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004c: 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) if (!HaveSaddle()) { return false; } m_nview.GetZDO().Set(ZDOVars.s_haveSaddleHash, false); m_nview.InvokeRPC(ZNetView.Everybody, "SetSaddle", new object[1] { false }); SpawnSaddle(userPoint - ((Component)this).transform.position); return true; } public void SpawnSaddle(Vector3 flyDirection) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0074: 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) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) Rigidbody component = Object.Instantiate<GameObject>(((Component)m_tambable.m_saddleItem).gameObject, ((Component)this).transform.TransformPoint(m_tambable.m_dropSaddleOffset), Quaternion.identity).GetComponent<Rigidbody>(); if (Object.op_Implicit((Object)(object)component)) { Vector3 val = Vector3.up; if ((double)((Vector3)(ref flyDirection)).magnitude > 0.10000000149011612) { flyDirection.y = 0f; ((Vector3)(ref flyDirection)).Normalize(); val += flyDirection; } component.AddForce(val * m_tambable.m_dropItemVel, (ForceMode)2); } } public string GetHoverText() { if (!m_nview.IsValid()) { return ""; } StringBuilder stringBuilder = new StringBuilder(); GetHoverText(stringBuilder, ZInput.IsNonClassicFunctionality() && ZInput.IsGamepadActive()); return Localization.instance.Localize(stringBuilder.ToString()); } public void GetHoverText(StringBuilder sb, bool gamepad) { sb.AppendFormat("\n[<color=yellow><b>{0} + $KEY_Use</b></color>] $hud_ride", gamepad ? ZInput.instance.GetBoundKeyString("JoyLTrigger", false) : "$button_lalt"); if (HasSaddleItem()) { sb.AppendFormat("\n[<color=yellow><b>{0} + $KEY_Use</b></color>] $hud_saddle_remove", gamepad ? ZInput.instance.GetBoundKeyString("JoyButtonB", false) : "$button_lctrl"); } } public string GetHoverName() { return Localization.instance.Localize(m_hoverText); } public bool Interact(Humanoid character, bool repeat, bool alt) { //IL_0084: 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_005e: Unknown result type (might be due to invalid IL or missing references) if (repeat || !m_nview.IsValid() || !InUseDistance(character) || !m_character.IsTamed()) { return false; } Player val = (Player)(object)((character is Player) ? character : null); if ((Object)(object)val == (Object)null) { return false; } if (alt && HasSaddleItem()) { m_nview.InvokeRPC("RemoveSaddle", new object[1] { ((Component)character).transform.position }); return true; } ZNetView nview = m_nview; object[] array = new object[1]; ZDOID zDOID = ((Character)val).GetZDOID(); array[0] = ((ZDOID)(ref zDOID)).UserID; nview.InvokeRPC("RequestControl", array); return false; } public Character GetCharacter() { return m_character; } public Tameable GetTameable() { return m_tambable; } public void ApplyCustomControls(Vector3 moveDir, Vector3 lookDir, bool run, bool autoRun, bool block, bool attack, bool attackSecondary, bool jump) { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Player.m_localPlayer == (Object)null) { return; } if (jump) { if (m_character.GetBaseAI().m_randomFly || m_character.CanToggleFly()) { if (m_character.IsFlying()) { m_character.Land(); } else { m_character.TakeOff(); } } else { m_character.Jump(false); } } ApplyControlls(moveDir, lookDir, run, autoRun, block); BaseAI baseAI = m_character.GetBaseAI(); MonsterAI val = (MonsterAI)(object)((baseAI is MonsterAI) ? baseAI : null); if (val == null) { return; } Character character = m_character; Humanoid val2 = (Humanoid)(object)((character is Humanoid) ? character : null); if (val2 != null && (attack || attackSecondary)) { List<ItemData> availableAttacks = val2.GetAvailableAttacks(); if (availableAttacks.Count > 0) { ItemData val3 = availableAttacks[Random.Range(0, availableAttacks.Count)]; val2.EquipItem(val3, true); } val.DoAttack((Character)null, false); } } public void ApplyControlls(Vector3 moveDir, Vector3 lookDir, bool run, bool autoRun, bool block) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0074: 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_0085: 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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Expected I4, but got Unknown //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Player.m_localPlayer == (Object)null) { return; } float skillFactor = ((Character)Player.m_localPlayer).GetSkills().GetSkillFactor((SkillType)110); Speed val = (Speed)4; Vector3 val2 = Vector3.zero; if (run || block || moveDir.z > 0.5f) { val2 = lookDir; if (!m_character.IsFlying()) { val2.y = 0f; } if (((Vector3)(ref val2)).sqrMagnitude > 0f) { ((Vector3)(ref val2)).Normalize(); } } if (run) { val = (Speed)2; } else if (moveDir.z > 0.5f) { val = (Speed)1; } else if (moveDir.z < -0.5f) { val = (Speed)0; } else if (block) { val = (Speed)3; } m_nview.InvokeRPC("Controls", new object[3] { val2, (int)val, skillFactor }); } public void RPC_Controls(long sender, Vector3 rideDir, int rideSpeed, float skill) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Invalid comparison between Unknown and I4 //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Invalid comparison between Unknown and I4 //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Invalid comparison between Unknown and I4 //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) if (!m_nview.IsOwner()) { return; } m_rideSkill = skill; if (rideDir != Vector3.zero) { m_controlDir = rideDir; } switch (rideSpeed) { case 3: if ((int)m_speed == 1 || (int)m_speed == 2) { return; } break; case 4: if ((int)m_speed == 3) { m_speed = (Speed)0; } return; } m_speed = (Speed)rideSpeed; } public void UpdateRidingSkill(float dt) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Invalid comparison between Unknown and I4 m_raiseSkillTimer += dt; if (!((double)m_raiseSkillTimer <= 1.0)) { m_raiseSkillTimer = 0f; if ((int)m_speed == 2) { ((Character)Player.m_localPlayer).RaiseSkill((SkillType)110, 1f); } } } public void ResetControlls() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) m_controlDir = Vector3.zero; m_speed = (Speed)0; m_rideSkill = 0f; } public Component GetControlledComponent() { return (Component)(object)m_character; } public Vector3 GetPosition() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return ((Component)this).transform.position; } public void RPC_RemoveSaddle(long sender, Vector3 userPoint) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) if (m_nview.IsOwner() && !HaveValidUser()) { DropSaddle(userPoint); } } public void RPC_RequestControl(long sender, long playerID) { if (m_nview.IsOwner()) { CalculateHaveValidUser(); if (GetUser() == playerID || !HaveValidUser()) { UpdateAttachRotation(); m_nview.GetZDO().Set(ZDOVars.s_user, playerID); ResetControlls(); m_nview.InvokeRPC(sender, "RequestRespons", new object[1] { true }); m_nview.GetZDO().SetOwner(sender); } else { m_nview.InvokeRPC(sender, "RequestRespons", new object[1] { false }); } } } public void UpdateAttachRotation() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)m_attachPoint == (Object)null)) { Vector3 forward = ((Component)this).transform.forward; forward.y = 0f; if (!(((Vector3)(ref forward)).sqrMagnitude < 0.0001f)) { ((Vector3)(ref forward)).Normalize(); m_attachPoint.rotation = Quaternion.LookRotation(forward, Vector3.up); } } } public bool HaveValidUser() { return m_haveValidUser; } public void CalculateHaveValidUser() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) m_haveValidUser = false; long user = GetUser(); if (user == 0L) { return; } List<ZDO> allCharacterZDOS = ZNet.instance.GetAllCharacterZDOS(); for (int i = 0; i < allCharacterZDOS.Count; i++) { ZDO val = allCharacterZDOS[i]; if (((ZDOID)(ref val.m_uid)).UserID == user) { m_haveValidUser = Vector3.Distance(val.GetPosition(), ((Component)this).transform.position) < m_maxUseRange; break; } } } public void RPC_ReleaseControl(long sender, long playerID) { if (m_nview.IsOwner() && GetUser() == playerID) { m_nview.GetZDO().Set(ZDOVars.s_user, 0L); ResetControlls(); } } public void RPC_RequestRespons(long sender, bool granted) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)Player.m_localPlayer)) { if (granted && (Object)(object)m_attachPoint != (Object)null) { Player.m_localPlayer.StartDoodadControl((IDoodadController)(object)this); ((Character)Player.m_localPlayer).AttachStart(m_attachPoint, ((Component)this).gameObject, false, false, false, m_attachAnimation, m_detachOffset, (Transform)null); } else { ((Character)Player.m_localPlayer).Message((MessageType)2, "$msg_inuse", 0, (Sprite)null); } } } public void OnUseStop(Player player) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) if (m_nview.IsValid()) { ZNetView nview = m_nview; object[] array = new object[1]; ZDOID zDOID = ((Character)player).GetZDOID(); array[0] = ((ZDOID)(ref zDOID)).UserID; nview.InvokeRPC("ReleaseControl", array); ((Character)player).AttachStop(); } } public bool IsLocalUser() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)Player.m_localPlayer)) { return false; } long user = GetUser(); if (user != 0L) { ZDOID zDOID = ((Character)Player.m_localPlayer).GetZDOID(); return user == ((ZDOID)(ref zDOID)).UserID; } return false; } public long GetUser() { if (!((Object)(object)m_nview == (Object)null) && m_nview.IsValid()) { return m_nview.GetZDO().GetLong(ZDOVars.s_user, 0L); } return 0L; } public bool InUseDistance(Humanoid human) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)m_attachPoint == (Object)null) { return false; } return (double)Vector3.Distance(((Component)human).transform.position, m_attachPoint.position) < (double)m_maxUseRange; } public void UseStamina(float v) { if ((double)v != 0.0 && m_nview.IsValid() && m_nview.IsOwner()) { float num = GetStamina() - v; if ((double)num < 0.0) { num = 0f; } SetStamina(num); m_staminaRegenTimer = 1f; } } public bool HaveStamina(float amount = 0f) { if (m_nview.IsValid()) { return GetStamina() > amount; } return false; } public float GetStamina() { if (!((Object)(object)m_nview == (Object)null) && m_nview.GetZDO() != null) { return m_nview.GetZDO().GetFloat(ZDOVars.s_stamina, GetMaxStamina()); } return 0f; } public void SetStamina(float stamina) { m_nview.GetZDO().Set(ZDOVars.s_stamina, stamina); } public float GetMaxStamina() { return m_maxStamina; } public void UpdateStamina(float dt) { m_staminaRegenTimer -= dt; if (!(m_staminaRegenTimer > 0f) && !m_character.InAttack() && !m_character.IsSwimming()) { float stamina = GetStamina(); float maxStamina = GetMaxStamina(); if (!(stamina >= maxStamina)) { float num = (m_tambable.IsHungry() ? m_staminaRegenHungry : m_staminaRegen); float num2 = 1f - stamina / maxStamina; float num3 = num + num2 * num; float num4 = stamina + num3 * dt; SetStamina(Mathf.Min(num4, maxStamina)); } } } public float GetRiderSkill() { return m_rideSkill; } } [Serializable] [<dcc6a84d-b343-4031-b8de-1578fa5229a7>Nullable(0)] [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(1)] public class CharacterData { public string ClonedFrom = ""; public string PrefabName = ""; public string Name = ""; public string Group = ""; public string Faction = ""; public bool Boss; public bool DoNotHideBossHUD; public string BossEvent = ""; public string DefeatSetGlobalKey = ""; public bool AISkipTarget; public float CrouchSpeed; public float WalkSpeed; public float Speed; public float TurnSpeed; public float RunSpeed; public float RunTurnSpeed; public float FlySlowSpeed; public float FlyFastSpeed; public float FlyTurnSpeed; public float Acceleration; public float JumpForce; public float JumpForceForward; public float JumpForceTiredFactor; public float AirControl; public bool CanSwim; public float SwimDepth; public float SwimSpeed; public float SwimTurnSpeed; public float SwimAcceleration; public string GroundTilt = ""; public float GroundTiltSpeed; public bool Flying; public float JumpStaminaUsage; public bool DisableWhileSleeping; public bool TolerateWater; public bool TolerateFire; public bool TolerateSmoke; public bool TolerateTar; public float Health; public string BluntResistance = "Normal"; public string SlashResistance = "Normal"; public string PierceResistance = "Normal"; public string ChopResistance = "Normal"; public string PickaxeResistance = "Normal"; public string FireResistance = "Normal"; public string FrostResistance = "Normal"; public string LightningResistance = "Normal"; public string PoisonResistance = "Normal"; public string SpiritResistance = "Normal"; public bool StaggerWhenBlocked; public float StaggerDamageFactor; [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(2)] public void Set(ref CharacterRef r) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_0328: Unknown result type (might be due to invalid IL or missing references) //IL_0329: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_0345: Unknown result type (might be due to invalid IL or missing references) //IL_035f: Unknown result type (might be due to invalid IL or missing references) //IL_0361: Unknown result type (might be due to invalid IL or missing references) //IL_037b: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Unknown result type (might be due to invalid IL or missing references) //IL_0399: Unknown result type (might be due to invalid IL or missing references) //IL_03b3: Unknown result type (might be due to invalid IL or missing references) //IL_03b5: Unknown result type (might be due to invalid IL or missing references) //IL_03cf: Unknown result type (might be due to invalid IL or missing references) //IL_03d1: Unknown result type (might be due to invalid IL or missing references) //IL_03eb: Unknown result type (might be due to invalid IL or missing references) //IL_03ed: Unknown result type (might be due to invalid IL or missing references) //IL_03f2: Unknown result type (might be due to invalid IL or missing references) //IL_03fe: Expected O, but got I4 //IL_02f3->IL02f3: Incompatible stack types: O vs I4 //IL_02f2->IL02f3: Incompatible stack types: I4 vs O //IL_02f2->IL02f3: Incompatible stack types: O vs I4 if (r == null) { r = new CharacterRef(); } r.m_name = Name; r.m_group = Group; r.m_faction = FactionManager.GetFaction(Faction); r.m_boss = Boss; r.m_dontHideBossHud = DoNotHideBossHUD; r.m_bossEvent = BossEvent; r.m_defeatSetGlobalKey = DefeatSetGlobalKey; r.m_aiSkipTarget = AISkipTarget; r.m_crouchSpeed = CrouchSpeed; r.m_walkSpeed = WalkSpeed; r.m_speed = Speed; r.m_turnSpeed = TurnSpeed; r.m_runSpeed = RunSpeed; r.m_runTurnSpeed = RunTurnSpeed; r.m_acceleration = Acceleration; r.m_jumpForce = JumpForce; r.m_jumpForceForward = JumpForceForward; r.m_jumpForceTiredFactor = JumpForceTiredFactor; r.m_airControl = AirControl; r.m_jumpStaminaUsage = JumpStaminaUsage; r.m_flying = Flying; r.m_flySlowSpeed = FlySlowSpeed; r.m_flyFastSpeed = FlyFastSpeed; r.m_flyTurnSpeed = FlyTurnSpeed; r.m_canSwim = CanSwim; r.m_swimDepth = SwimDepth; r.m_swimSpeed = SwimSpeed; r.m_swimTurnSpeed = SwimTurnSpeed; r.m_swimAcceleration = SwimAcceleration; if (!string.IsNullOrEmpty(GroundTilt) && Enum.TryParse<GroundTiltType>(GroundTilt, ignoreCase: true, out GroundTiltType result)) { r.m_groundTilt = result; } r.m_groundTiltSpeed = GroundTiltSpeed; r.m_disableWhileSleeping = DisableWhileSleeping; r.m_tolerateWater = TolerateWater; r.m_tolerateFire = TolerateFire; r.m_tolerateSmoke = TolerateSmoke; r.m_tolerateTar = TolerateTar; r.m_health = Health; r.m_staggerWhenBlocked = StaggerWhenBlocked; r.m_staggerDamageFactor = StaggerDamageFactor; object obj = r; DamageModifiers value = default(DamageModifiers); int num; if (Enum.TryParse<DamageModifier>(BluntResistance, ignoreCase: true, out DamageModifier result2)) { obj = result2; num = (int)obj; } else { num = 0; obj = num; num = (int)obj; } value.m_blunt = (DamageModifier)obj; num = (Enum.TryParse<DamageModifier>(PierceResistance, ignoreCase: true, out DamageModifier result3) ? ((int)result3) : 0); value.m_pierce = (DamageModifier)num; num = (Enum.TryParse<DamageModifier>(SlashResistance, ignoreCase: true, out DamageModifier result4) ? ((int)result4) : 0); value.m_slash = (DamageModifier)num; num = (Enum.TryParse<DamageModifier>(PickaxeResistance, ignoreCase: true, out DamageModifier result5) ? ((int)result5) : 0); value.m_pickaxe = (DamageModifier)num; num = (Enum.TryParse<DamageModifier>(ChopResistance, ignoreCase: true, out DamageModifier result6) ? ((int)result6) : 0); value.m_chop = (DamageModifier)num; num = (Enum.TryParse<DamageModifier>(FireResistance, ignoreCase: true, out DamageModifier result7) ? ((int)result7) : 0); value.m_fire = (DamageModifier)num; num = (Enum.TryParse<DamageModifier>(FrostResistance, ignoreCase: true, out DamageModifier result8) ? ((int)result8) : 0); value.m_frost = (DamageModifier)num; num = (Enum.TryParse<DamageModifier>(PoisonResistance, ignoreCase: true, out DamageModifier result9) ? ((int)result9) : 0); value.m_poison = (DamageModifier)num; num = (Enum.TryParse<DamageModifier>(LightningResistance, ignoreCase: true, out DamageModifier result10) ? ((int)result10) : 0); value.m_lightning = (DamageModifier)num; num = (Enum.TryParse<DamageModifier>(SpiritResistance, ignoreCase: true, out DamageModifier result11) ? ((int)result11) : 0); value.m_spirit = (DamageModifier)num; ((CharacterRef)num).m_damageModifiers = value; } [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(2)] public void Set(ref HumanoidRef r) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_0328: Unknown result type (might be due to invalid IL or missing references) //IL_0329: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_0345: Unknown result type (might be due to invalid IL or missing references) //IL_035f: Unknown result type (might be due to invalid IL or missing references) //IL_0361: Unknown result type (might be due to invalid IL or missing references) //IL_037b: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Unknown result type (might be due to invalid IL or missing references) //IL_0399: Unknown result type (might be due to invalid IL or missing references) //IL_03b3: Unknown result type (might be due to invalid IL or missing references) //IL_03b5: Unknown result type (might be due to invalid IL or missing references) //IL_03cf: Unknown result type (might be due to invalid IL or missing references) //IL_03d1: Unknown result type (might be due to invalid IL or missing references) //IL_03eb: Unknown result type (might be due to invalid IL or missing references) //IL_03ed: Unknown result type (might be due to invalid IL or missing references) //IL_03f2: Unknown result type (might be due to invalid IL or missing references) //IL_03fe: Expected O, but got I4 //IL_02f3->IL02f3: Incompatible stack types: O vs I4 //IL_02f2->IL02f3: Incompatible stack types: I4 vs O //IL_02f2->IL02f3: Incompatible stack types: O vs I4 if (r == null) { r = new HumanoidRef(); } r.m_name = Name; r.m_group = Group; r.m_faction = FactionManager.GetFaction(Faction); r.m_boss = Boss; r.m_dontHideBossHud = DoNotHideBossHUD; r.m_bossEvent = BossEvent; r.m_defeatSetGlobalKey = DefeatSetGlobalKey; r.m_aiSkipTarget = AISkipTarget; r.m_crouchSpeed = CrouchSpeed; r.m_walkSpeed = WalkSpeed; r.m_speed = Speed; r.m_turnSpeed = TurnSpeed; r.m_runSpeed = RunSpeed; r.m_runTurnSpeed = RunTurnSpeed; r.m_acceleration = Acceleration; r.m_jumpForce = JumpForce; r.m_jumpForceForward = JumpForceForward; r.m_jumpForceTiredFactor = JumpForceTiredFactor; r.m_airControl = AirControl; r.m_jumpStaminaUsage = JumpStaminaUsage; r.m_flying = Flying; r.m_flySlowSpeed = FlySlowSpeed; r.m_flyFastSpeed = FlyFastSpeed; r.m_flyTurnSpeed = FlyTurnSpeed; r.m_canSwim = CanSwim; r.m_swimDepth = SwimDepth; r.m_swimSpeed = SwimSpeed; r.m_swimTurnSpeed = SwimTurnSpeed; r.m_swimAcceleration = SwimAcceleration; if (!string.IsNullOrEmpty(GroundTilt) && Enum.TryParse<GroundTiltType>(GroundTilt, ignoreCase: true, out GroundTiltType result)) { r.m_groundTilt = result; } r.m_groundTiltSpeed = GroundTiltSpeed; r.m_disableWhileSleeping = DisableWhileSleeping; r.m_tolerateWater = TolerateWater; r.m_tolerateFire = TolerateFire; r.m_tolerateSmoke = TolerateSmoke; r.m_tolerateTar = TolerateTar; r.m_health = Health; r.m_staggerWhenBlocked = StaggerWhenBlocked; r.m_staggerDamageFactor = StaggerDamageFactor; object obj = r; DamageModifiers value = default(DamageModifiers); int num; if (Enum.TryParse<DamageModifier>(BluntResistance, ignoreCase: true, out DamageModifier result2)) { obj = result2; num = (int)obj; } else { num = 0; obj = num; num = (int)obj; } value.m_blunt = (DamageModifier)obj; num = (Enum.TryParse<DamageModifier>(PierceResistance, ignoreCase: true, out DamageModifier result3) ? ((int)result3) : 0); value.m_pierce = (DamageModifier)num; num = (Enum.TryParse<DamageModifier>(SlashResistance, ignoreCase: true, out DamageModifier result4) ? ((int)result4) : 0); value.m_slash = (DamageModifier)num; num = (Enum.TryParse<DamageModifier>(PickaxeResistance, ignoreCase: true, out DamageModifier result5) ? ((int)result5) : 0); value.m_pickaxe = (DamageModifier)num; num = (Enum.TryParse<DamageModifier>(ChopResistance, ignoreCase: true, out DamageModifier result6) ? ((int)result6) : 0); value.m_chop = (DamageModifier)num; num = (Enum.TryParse<DamageModifier>(FireResistance, ignoreCase: true, out DamageModifier result7) ? ((int)result7) : 0); value.m_fire = (DamageModifier)num; num = (Enum.TryParse<DamageModifier>(FrostResistance, ignoreCase: true, out DamageModifier result8) ? ((int)result8) : 0); value.m_frost = (DamageModifier)num; num = (Enum.TryParse<DamageModifier>(PoisonResistance, ignoreCase: true, out DamageModifier result9) ? ((int)result9) : 0); value.m_poison = (DamageModifier)num; num = (Enum.TryParse<DamageModifier>(LightningResistance, ignoreCase: true, out DamageModifier result10) ? ((int)result10) : 0); value.m_lightning = (DamageModifier)num; num = (Enum.TryParse<DamageModifier>(SpiritResistance, ignoreCase: true, out DamageModifier result11) ? ((int)result11) : 0); value.m_spirit = (DamageModifier)num; ((CharacterRef)num).m_damageModifiers = value; } } [Serializable] [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(1)] [<dcc6a84d-b343-4031-b8de-1578fa5229a7>Nullable(0)] public class EffectInfo { public string PrefabName = ""; public bool Enabled; public int Variant = -1; public bool Attach; public bool Follow; public bool InheritParentRotation; public bool InheritParentScale; public bool MultiplyParentVisualScale; public bool RandomRotation; public bool Scale; public string ChildTransform = ""; public EffectListRef.EffectDataRef ToRef() { return new EffectListRef.EffectDataRef { m_prefab = PrefabName, m_variant = Variant, m_attach = Attach, m_follow = Follow, m_inheritParentRotation = InheritParentRotation, m_inheritParentScale = InheritParentScale, m_multiplyParentVisualScale = MultiplyParentVisualScale, m_randomRotation = RandomRotation, m_scale = Scale, m_childTransform = ChildTransform }; } } [Serializable] [<dcc6a84d-b343-4031-b8de-1578fa5229a7>Nullable(0)] [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(1)] public class AttackData { public string OriginalPrefab = ""; public string Name = ""; public string AnimationState = ""; public int ToolTier; public float Damage; public float Blunt; public float Slash; public float Pierce; public float Chop; public float Pickaxe; public float Fire; public float Frost; public float Lightning; public float Poison; public float Spirit; public float AttackForce; public bool Dodgeable; public bool Blockable; public string SpawnOnHit = ""; public string SpawnOnHitTerrain = ""; public string AttackStatusEffect = ""; public float AttackStatusEffectChance; public string AttackType = ""; public string AttackAnimation = ""; public bool HitTerrain; public bool HitFriendly; public float DamageMultiplier; public float DamageMultiplierPerMissingHP; public float DamageMultiplierByTotalHealthMissing; public float ForceMultiplier; public float StaggerMultiplier; public float RecoilPushback; public int SelfDamage; public string AttackOriginJoint = ""; public float AttackRange; public float AttackHeight; public float AttackOffset; public string SpawnOnTrigger = ""; public bool ToggleFlying; public bool Attach; public float AttackAngle; public float AttackRayWidth; public float MaxYAngle; public bool LowerDamagePerHit; public bool HitThroughWalls; public float AttackRangeMinimum; public float AttackInterval; public float AttackMaxAngle; public string Projectile = ""; public string MaterialOverride = ""; public void Set(ref ItemDataSharedRef r) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) r.m_prefab = Name; r.m_toolTier = ToolTier; r.m_damages = new DamageTypes { m_damage = Damage, m_blunt = Blunt, m_slash = Slash, m_pierce = Pierce, m_chop = Chop, m_pickaxe = Pickaxe, m_fire = Fire, m_frost = Frost, m_lightning = Lightning, m_poison = Poison, m_spirit = Spirit }; r.m_attackForce = AttackForce; r.m_dodgeable = Dodgeable; r.m_blockable = Blockable; if (r.m_attack == null) { r.m_attack = new AttackRef(); } r.m_attack.m_attackAnimation = AttackAnimation; r.m_attack.m_spawnOnHit = SpawnOnHit; r.m_attack.m_spawnOnTrigger = SpawnOnTrigger; r.m_attackStatusEffect = AttackStatusEffect; r.m_attackStatusEffectChance = AttackStatusEffectChance; if (Enum.TryParse<AttackType>(AttackType, ignoreCase: true, out AttackType result)) { r.m_attack.m_attackType = result; } r.m_attack.m_hitTerrain = HitTerrain; r.m_attack.m_damageMultiplier = DamageMultiplier; r.m_attack.m_damageMultiplierPerMissingHP = DamageMultiplierPerMissingHP; r.m_attack.m_damageMultiplierByTotalHealthMissing = DamageMultiplierByTotalHealthMissing; r.m_attack.m_forceMultiplier = ForceMultiplier; r.m_attack.m_staggerMultiplier = StaggerMultiplier; r.m_attack.m_recoilPushback = RecoilPushback; r.m_attack.m_selfDamage = SelfDamage; r.m_attack.m_attackOriginJoint = AttackOriginJoint; r.m_attack.m_attackRange = AttackRange; r.m_attack.m_attackHeight = AttackHeight; r.m_attack.m_attackOffset = AttackOffset; r.m_attack.m_toggleFlying = ToggleFlying; r.m_attack.m_attach = Attach; r.m_attack.m_attackAngle = AttackAngle; r.m_attack.m_attackRayWidth = AttackRayWidth; r.m_attack.m_maxYAngle = MaxYAngle; r.m_attack.m_lowerDamagePerHit = LowerDamagePerHit; r.m_attack.m_hitThroughWalls = HitThroughWalls; r.m_aiAttackRangeMin = AttackRangeMinimum; r.m_aiAttackInterval = AttackInterval; r.m_aiAttackMaxAngle = AttackMaxAngle; } } [Serializable] [<dcc6a84d-b343-4031-b8de-1578fa5229a7>Nullable(0)] [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(1)] public class RandomItemData { public string PrefabName = ""; public float Chance; public void Set(ref HumanoidRef.RandomItem r) { r.m_prefab = PrefabName; r.m_chance = Chance; } public HumanoidRef.RandomItem ToRef() { return new HumanoidRef.RandomItem { m_prefab = PrefabName, m_chance = Chance }; } } [Serializable] [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(1)] [<dcc6a84d-b343-4031-b8de-1578fa5229a7>Nullable(0)] public class ProjectileData { public string Name = ""; public float Damage; public float Blunt; public float Slash; public float Pierce; public float Chop; public float Pickaxe; public float Fire; public float Frost; public float Lightning; public float Poison; public float Spirit; public float AOE; public bool Dodgeable; public bool Blockable; public float AttackForce; public float BackstabBonus; public string StatusEffect = ""; public float HealthReturn; public bool CanHitWater; public float Duration; public float Gravity; public float Drag; public float RayRadius; public bool StayAfterHitStatic; public bool StayAfterHitDynamic; public float StayDuration; public bool Bounce; public bool BounceOnWater; public float BouncePower; public float BounceRoughness; public int MaxBounces; public float MinBounceVelocity; public bool RespawnItemOnHit; public bool SpawnOnDuration; public string SpawnOnHit = ""; public float SpawnOnHitChance; public int SpawnCount; public List<string> RandomSpawnOnHit = new List<string>(); public int RandomSpawnOnHitCount; public bool RandomSpawnSkipLava; public bool StaticHitOnly; public bool GroundHitOnly; public bool SpawnRandomRotation; [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(2)] public void Set(ref ProjectileRef r) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) if (r != null) { r.m_damage = new DamageTypes { m_damage = Damage, m_blunt = Blunt, m_slash = Slash, m_pierce = Pierce, m_chop = Chop, m_pickaxe = Pickaxe, m_fire = Fire, m_frost = Frost, m_lightning = Lightning, m_poison = Poison, m_spirit = Spirit }; r.m_aoe = AOE; r.m_dodgeable = Dodgeable; r.m_blockable = Blockable; r.m_attackForce = AttackForce; r.m_backstabBonus = BackstabBonus; r.m_statusEffect = StatusEffect; r.m_healthReturn = HealthReturn; r.m_bounce = Bounce; r.m_bounceOnWater = BounceOnWater; r.m_respawnItemOnHit = RespawnItemOnHit; r.m_spawnOnHit = SpawnOnHit; r.m_spawnOnHitChance = SpawnOnHitChance; r.m_spawnCount = SpawnCount; r.m_randomSpawnOnHit = RandomSpawnOnHit; r.m_randomSpawnOnHitCount = RandomSpawnOnHitCount; r.m_randomSpawnSkipLava = RandomSpawnSkipLava; r.m_staticHitOnly = StaticHitOnly; r.m_groundHitOnly = GroundHitOnly; r.m_spawnRandomRotation = SpawnRandomRotation; } } } [Serializable] [<dcc6a84d-b343-4031-b8de-1578fa5229a7>Nullable(0)] [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(1)] public class MonsterAIData { public float ViewRange; public float ViewAngle; public float HearRange; public bool MistVision; public float IdleSoundInterval; public float IdleSoundChance; public string PathAgentType = ""; public float MoveMinAngle; public bool SmoothMovement; public bool SerpentMovement; public float SerpentTurnRadius; public float JumpInterval; public float RandomCircleInterval; public float RandomMoveInterval; public float RandomMoveRange; public bool RandomFly; public float ChanceToTakeOff; public float ChanceToLand; public float GroundDuration; public float AirDuration; public float MaxLandAltitude; public float TakeoffTime; public float FlyAltitudeMin; public float FlyAltitudeMax; public float FlyAbsMinAltitude; public bool AvoidFire; public bool AfraidOfFire; public bool AvoidWater; public bool AvoidLava; public bool SkipLavaTargets; public bool Aggravatable; public bool PassiveAggressive; public string SpawnMessage = ""; public string DeathMessage = ""; public string AlertedMessage = ""; public float FleeRange; public float FleeAngle; public float FleeInterval; public float AlertRange; public bool FleeIfHurtWhenTargetCannotBeReached; public float FleeUnreachableSinceAttack; public float FleeUnreachableSinceHurt; public bool FleeIfNotAlerted; public float FleeIfLowHealth; public float FleeTimeSinceHurt; public bool FleeInLava; public bool CirculateWhileCharging; public bool CirculateWhileChargingFlying; public bool EnableHuntPlayer; public bool AttackPlayerObjects; public int PrivateAreaTriggerThreshold; public float InterceptTimeMax; public float InterceptTimeMin; public float MaxChaseDistance; public float MinAttackInterval; public float CircleTargetInterval; public float CircleTargetDuration; public float CircleTargetDistance; public bool Sleeping; public float WakeupRange; public bool NoiseWakeup; public float MaxNoiseWakeupRange; public float WakeupDelayMin; public float WakeupDelayMax; public bool AvoidLand; public List<string> ConsumeItems = new List<string>(); public float ConsumeRange; public float ConsumeSearchRange; public float ConsumeSearchInterval; [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(2)] public void Set(ref MonsterAIRef r) { //IL_0089: Unknown result type (might be due to invalid IL or missing references) if (r == null) { r = new MonsterAIRef(); } r.m_viewRange = ViewRange; r.m_viewAngle = ViewAngle; r.m_hearRange = HearRange; r.m_mistVision = MistVision; r.m_idleSoundInterval = IdleSoundInterval; r.m_idleSoundChance = IdleSoundChance; if (Enum.TryParse<AgentType>(PathAgentType, ignoreCase: true, out AgentType result)) { r.m_pathAgentType = result; } r.m_moveMinAngle = MoveMinAngle; r.m_smoothMovement = SmoothMovement; r.m_serpentMovement = SerpentMovement; r.m_serpentTurnRadius = SerpentTurnRadius; r.m_jumpInterval = JumpInterval; r.m_randomCircleInterval = RandomCircleInterval; r.m_randomMoveInterval = RandomMoveInterval; r.m_randomMoveRange = RandomMoveRange; r.m_randomFly = RandomFly; r.m_chanceToTakeoff = ChanceToTakeOff; r.m_chanceToLand = ChanceToLand; r.m_groundDuration = GroundDuration; r.m_airDuration = AirDuration; r.m_maxLandAltitude = MaxLandAltitude; r.m_takeoffTime = TakeoffTime; r.m_flyAltitudeMin = FlyAltitudeMin; r.m_flyAltitudeMax = FlyAltitudeMax; r.m_flyAbsMinAltitude = FlyAbsMinAltitude; r.m_avoidFire = AvoidFire; r.m_afraidOfFire = AfraidOfFire; r.m_avoidWater = AvoidWater; r.m_avoidLava = AvoidLava; r.m_skipLavaTargets = SkipLavaTargets; r.m_aggravatable = Aggravatable; r.m_passiveAggresive = PassiveAggressive; r.m_spawnMessage = SpawnMessage; r.m_deathMessage = DeathMessage; r.m_alertedMessage = AlertedMessage; r.m_fleeRange = FleeRange; r.m_fleeAngle = FleeAngle; r.m_fleeInterval = FleeInterval; r.m_alertRange = AlertRange; r.m_fleeIfHurtWhenTargetCantBeReached = FleeIfHurtWhenTargetCannotBeReached; r.m_fleeUnreachableSinceAttacking = FleeUnreachableSinceAttack; r.m_fleeUnreachableSinceHurt = FleeUnreachableSinceHurt; r.m_fleeIfNotAlerted = FleeIfNotAlerted; r.m_fleeIfLowHealth = FleeIfLowHealth; r.m_fleeTimeSinceHurt = FleeTimeSinceHurt; r.m_fleeInLava = FleeInLava; r.m_circulateWhileCharging = CirculateWhileCharging; r.m_circulateWhileChargingFlying = CirculateWhileChargingFlying; r.m_enableHuntPlayer = EnableHuntPlayer; r.m_attackPlayerObjects = AttackPlayerObjects; r.m_privateAreaTriggerTreshold = PrivateAreaTriggerThreshold; r.m_interceptTimeMax = InterceptTimeMax; r.m_interceptTimeMin = InterceptTimeMin; r.m_maxChaseDistance = MaxChaseDistance; r.m_minAttackInterval = MinAttackInterval; r.m_circleTargetInterval = CircleTargetInterval; r.m_circleTargetDuration = CircleTargetDuration; r.m_circleTargetDistance = CircleTargetDistance; r.m_sleeping = Sleeping; r.m_wakeupRange = WakeupRange; r.m_noiseWakeup = NoiseWakeup; r.m_maxNoiseWakeupRange = MaxNoiseWakeupRange; r.m_wakeUpDelayMin = WakeupDelayMin; r.m_wakeUpDelayMax = WakeupDelayMax; r.m_avoidLand = AvoidLand; r.m_consumeItems = ConsumeItems; r.m_consumeRange = ConsumeRange; r.m_consumeSearchRange = ConsumeSearchRange; r.m_consumeSearchInterval = ConsumeSearchInterval; } } [Serializable] [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(1)] [<dcc6a84d-b343-4031-b8de-1578fa5229a7>Nullable(0)] public class AnimalAIData { public float ViewRange; public float ViewAngle; public float HearRange; public bool MistVision; public float IdleSoundInterval; public float IdleSoundChance; public string PathAgentType = ""; public float MoveMinAngle; public bool SmoothMovement; public bool SerpentMovement; public float SerpentTurnRadius; public float JumpInterval; public float RandomCircleInterval; public float RandomMoveInterval; public float RandomMoveRange; public bool RandomFly; public float ChanceToTakeOff; public float ChanceToLand; public float GroundDuration; public float AirDuration; public float MaxLandAltitude; public float TakeoffTime; public float FlyAltitudeMin; public float FlyAltitudeMax; public float FlyAbsMinAltitude; public bool AvoidFire; public bool AfraidOfFire; public bool AvoidWater; public bool AvoidLava; public bool SkipLavaTargets; public bool Aggravatable; public bool PassiveAggressive; public string SpawnMessage = ""; public string DeathMessage = ""; public string AlertedMessage = ""; public float FleeRange; public float FleeAngle; public float FleeInterval; [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(2)] public void Set(ref AnimalAIRef reference) { //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Expected O, but got I4 //IL_008d->IL008d: Incompatible stack types: O vs I4 //IL_008c->IL008d: Incompatible stack types: I4 vs O //IL_008c->IL008d: Incompatible stack types: O vs I4 if (reference == null) { reference = new AnimalAIRef(); } reference.m_viewRange = ViewRange; reference.m_viewAngle = ViewAngle; reference.m_hearRange = HearRange; reference.m_mistVision = MistVision; reference.m_idleSoundInterval = IdleSoundInterval; reference.m_idleSoundChance = IdleSoundChance; object obj = reference; int num; if (Enum.TryParse<AgentType>(PathAgentType, ignoreCase: true, out AgentType result)) { obj = result; num = (int)obj; } else { num = 1; obj = num; num = (int)obj; } ((BaseAIRef)num).m_pathAgentType = (AgentType)obj; reference.m_moveMinAngle = MoveMinAngle; reference.m_smoothMovement = SmoothMovement; reference.m_serpentMovement = SerpentMovement; reference.m_serpentTurnRadius = SerpentTurnRadius; reference.m_jumpInterval = JumpInterval; reference.m_randomCircleInterval = RandomCircleInterval; reference.m_randomMoveInterval = RandomMoveInterval; reference.m_randomMoveRange = RandomMoveRange; reference.m_randomFly = RandomFly; reference.m_chanceToTakeoff = ChanceToTakeOff; reference.m_chanceToLand = ChanceToLand; reference.m_groundDuration = GroundDuration; reference.m_airDuration = AirDuration; reference.m_maxLandAltitude = MaxLandAltitude; reference.m_takeoffTime = TakeoffTime; reference.m_flyAltitudeMin = FlyAltitudeMin; reference.m_flyAltitudeMax = FlyAltitudeMax; reference.m_flyAbsMinAltitude = FlyAbsMinAltitude; reference.m_avoidFire = AvoidFire; reference.m_afraidOfFire = AfraidOfFire; reference.m_avoidWater = AvoidWater; reference.m_avoidLava = AvoidLava; reference.m_skipLavaTargets = SkipLavaTargets; reference.m_aggravatable = Aggravatable; reference.m_passiveAggresive = PassiveAggressive; reference.m_spawnMessage = SpawnMessage; reference.m_deathMessage = DeathMessage; reference.m_alertedMessage = AlertedMessage; reference.m_fleeRange = FleeRange; reference.m_fleeAngle = FleeAngle; reference.m_fleeInterval = FleeInterval; } } [Serializable] [<dcc6a84d-b343-4031-b8de-1578fa5229a7>Nullable(0)] [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(1)] public class CharacterDropData { public string PrefabName = ""; public int AmountMin; public int AmountMax; public float Chance; public bool OnePerPlayer; public bool LevelMultiplier; public bool DoNotScale; public void Set(ref DropRef r) { r.m_prefab = PrefabName; r.m_amountMin = AmountMin; r.m_amountMax = AmountMax; r.m_chance = Chance; r.m_onePerPlayer = OnePerPlayer; r.m_levelMultiplier = LevelMultiplier; r.m_dontScale = DoNotScale; } public DropRef ToRef() { return new DropRef { m_prefab = PrefabName, m_amountMin = AmountMin, m_amountMax = AmountMax, m_chance = Chance, m_onePerPlayer = OnePerPlayer, m_levelMultiplier = LevelMultiplier, m_dontScale = DoNotScale }; } } [Serializable] [<dcc6a84d-b343-4031-b8de-1578fa5229a7>Nullable(0)] [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(1)] public class TameableData { public float FedDuration; public float TamingTime; public bool StartTamed; public bool Commandable; public float UnsummonDistance; public float UnsummonOnOwnerLogoutSeconds; public string LevelUpOwnerSkill = ""; public float LevelUpFactor; public bool DropSaddleOnDeath; public List<string> RandomStartingName = new List<string>(); [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(2)] public void Set(ref TameableRef r) { //IL_00a2: Unknown result type (might be due to invalid IL or missing references) if (TamingTime != 0f) { if (r == null) { r = new TameableRef(); } r.m_fedDuration = FedDuration; r.m_tamingTime = TamingTime; r.m_startsTamed = StartTamed; r.m_commandable = Commandable; r.m_unsummonDistance = UnsummonDistance; r.m_unsummonOnOwnerLogoutSeconds = UnsummonOnOwnerLogoutSeconds; r.m_levelUpOwnerSkill = (Enum.TryParse<SkillType>(LevelUpOwnerSkill, ignoreCase: true, out SkillType result) ? new SkillType?(result) : null); r.m_levelUpFactor = LevelUpFactor; r.m_dropSaddleOnDeath = DropSaddleOnDeath; r.m_randomStartingName = RandomStartingName; } } } [Serializable] public class ProcreationData { public float UpdateInterval; public float TotalCheckRange; public int MaxCreatures; public float PartnerCheckRange; public float PregnancyChance; public float PregnancyDuration; public int RequiredLovePoints; [<dcc6a84d-b343-4031-b8de-1578fa5229a7>Nullable(1)] public string Offspring = ""; public int MinOffspringLevel; public float SpawnOffset; [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(2)] public void Set(ref ProcreationRef r) { if (r != null) { r.m_updateInterval = UpdateInterval; r.m_totalCheckRange = TotalCheckRange; r.m_maxCreatures = MaxCreatures; r.m_partnerCheckRange = PartnerCheckRange; r.m_pregnancyChance = PregnancyChance; r.m_pregnancyDuration = PregnancyDuration; r.m_requiredLovePoints = RequiredLovePoints; r.m_offspring = Offspring; r.m_spawnOffset = SpawnOffset; r.m_minOffspringLevel = MinOffspringLevel; } } } [Serializable] [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(1)] [<dcc6a84d-b343-4031-b8de-1578fa5229a7>Nullable(0)] public class NPCTalkData { public string Name = ""; public float MaxRange; public float GreetRange; public float ByeRange; public float Offset; public float MinTalkInterval; public float HideDialogueDelay; public float RandomTalkInterval; public float RandomTalkChance; public List<string> RandomTalk = new List<string>(); public List<string> RandomTalkInFactionBase = new List<string>(); public List<string> RandomGreets = new List<string>(); public List<string> RandomGoodbye = new List<string>(); public List<string> PrivateAreaAlarm = new List<string>(); public List<string> Aggravated = new List<string>(); [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(2)] public void Set(ref NPCTalkRef r) { if (r != null) { r.m_name = Name; r.m_maxRange = MaxRange; r.m_greetRange = GreetRange; r.m_byeRange = ByeRange; r.m_offset = Offset; r.m_minTalkInterval = MinTalkInterval; r.m_hideDialogDelay = HideDialogueDelay; r.m_randomTalkInterval = RandomTalkInterval; r.m_randomTalkChance = RandomTalkChance; r.m_randomTalk = RandomTalk; r.m_randomTalkInFactionBase = RandomTalkInFactionBase; r.m_randomGreets = RandomGreets; r.m_randomGoodbye = RandomGoodbye; r.m_privateAreaAlarm = PrivateAreaAlarm; r.m_aggravated = Aggravated; } } } [Serializable] [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(1)] [<dcc6a84d-b343-4031-b8de-1578fa5229a7>Nullable(0)] public class GrowUpData { public float GrowTime; public bool InheritTame; public string GrownPrefab = ""; public List<AltGrownData> AltGrownPrefabs = new List<AltGrownData>(); [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(2)] public void Set(ref GrowUpRef r) { if (r == null) { return; } r.m_growTime = GrowTime; r.m_inheritTame = InheritTame; r.m_grownPrefab = GrownPrefab; if (AltGrownPrefabs.Count != 0) { r.m_altGrownPrefabs = AltGrownPrefabs.Select([<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(0)] (AltGrownData x) => x.ToRef()).ToList(); } } } [Serializable] [<dcc6a84d-b343-4031-b8de-1578fa5229a7>Nullable(0)] [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(1)] public class AltGrownData { public string GrownPrefab = ""; public float Weight; public GrowUpRef.GrownEntry ToRef() { return new GrowUpRef.GrownEntry { m_prefab = GrownPrefab, m_weight = Weight }; } } [Serializable] [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(1)] [<dcc6a84d-b343-4031-b8de-1578fa5229a7>Nullable(0)] public class LevelEffectData { public float Scale; public float Hue; public float Saturation; public float Value; public bool SetEmissiveColor; public VisualMethods.ColorData EmissiveColor = new VisualMethods.ColorData(); public string EnableObject = ""; public LevelSetupRef ToRef() { return new LevelSetupRef { m_scale = Scale, m_hue = Hue, m_saturation = Saturation, m_value = Value, m_setEmissiveColor = SetEmissiveColor, m_enableObject = EnableObject, m_emissiveColor = EmissiveColor.ToHex() }; } } [Serializable] [<dcc6a84d-b343-4031-b8de-1578fa5229a7>Nullable(0)] [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(1)] public class CreatureData { public VisualMethods.ScaleData m_scale = new VisualMethods.ScaleData(); public VisualMethods.ScaleData m_ragdollScale = new VisualMethods.ScaleData(); public Dictionary<string, VisualMethods.MaterialData> m_materials = new Dictionary<string, VisualMethods.MaterialData>(); public CharacterData m_characterData = new CharacterData(); public CharacterEffects m_effects = new CharacterEffects(); public List<ItemAttackData> m_defaultItems = new List<ItemAttackData>(); public List<ItemAttackData> m_randomWeapons = new List<ItemAttackData>(); public List<ItemAttackData> m_randomArmors = new List<ItemAttackData>(); public List<ItemAttackData> m_randomShields = new List<ItemAttackData>(); public List<RandomItemData> m_randomItems = new List<RandomItemData>(); public List<RandomItemSetsData> m_randomSets = new List<RandomItemSetsData>(); public MonsterAIData m_monsterAIData = new MonsterAIData(); public AnimalAIData m_animalAIData = new AnimalAIData(); public List<CharacterDropData> m_characterDrops = new List<CharacterDropData>(); public TameableData m_tameable = new TameableData(); public ProcreationData m_procreation = new ProcreationData(); public NPCTalkData m_npcTalk = new NPCTalkData(); public GrowUpData m_growUp = new GrowUpData(); public List<LevelEffectData> m_levelEffects = new List<LevelEffectData>(); public Dictionary<string, bool> m_particles = new Dictionary<string, bool>(); public VisualMethods.HumanData m_humanData = new VisualMethods.HumanData(); public List<ItemAttackData> GetAllItems() { List<ItemAttackData> list = new List<ItemAttackData>(); list.AddRange(m_defaultItems); list.AddRange(m_randomWeapons); list.AddRange(m_randomArmors); list.AddRange(m_randomShields); list.Add(m_randomSets.SelectMany([<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(0)] (RandomItemSetsData x) => x.m_items).ToArray()); return list; } } [Serializable] [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(1)] [<dcc6a84d-b343-4031-b8de-1578fa5229a7>Nullable(0)] public class ItemAttackData { public AttackData m_attackData = new AttackData(); public ItemEffects m_effects = new ItemEffects(); public void Set(ItemDataSharedRef r) { m_attackData.Set(ref r); m_effects.Set(ref r); } } [Serializable] [<dcc6a84d-b343-4031-b8de-1578fa5229a7>Nullable(0)] [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(1)] public class RandomItemSetsData { public string m_name = ""; public List<ItemAttackData> m_items = new List<ItemAttackData>(); public HumanoidRef.ItemSet ToRef() { return new HumanoidRef.ItemSet { m_name = m_name, m_items = m_items.Select([<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(0)] (ItemAttackData x) => x.m_attackData.Name).ToArray() }; } } [Serializable] [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(1)] [<dcc6a84d-b343-4031-b8de-1578fa5229a7>Nullable(0)] public class CharacterEffects { public List<EffectInfo> m_hitEffects = new List<EffectInfo>(); public List<EffectInfo> m_critHitEffects = new List<EffectInfo>(); public List<EffectInfo> m_backstabHitEffects = new List<EffectInfo>(); public List<EffectInfo> m_deathEffects = new List<EffectInfo>(); public List<EffectInfo> m_waterEffects = new List<EffectInfo>(); public List<EffectInfo> m_tarEffects = new List<EffectInfo>(); public List<EffectInfo> m_slideEffects = new List<EffectInfo>(); public List<EffectInfo> m_jumpEffects = new List<EffectInfo>(); public List<EffectInfo> m_flyingContinuousEffects = new List<EffectInfo>(); public List<EffectInfo> m_pickupEffects = new List<EffectInfo>(); public List<EffectInfo> m_dropEffects = new List<EffectInfo>(); public List<EffectInfo> m_consumeItemEffects = new List<EffectInfo>(); public List<EffectInfo> m_equipEffects = new List<EffectInfo>(); public List<EffectInfo> m_perfectBlockEffects = new List<EffectInfo>(); public List<EffectInfo> m_alertedEffects = new List<EffectInfo>(); public List<EffectInfo> m_idleSounds = new List<EffectInfo>(); public List<EffectInfo> m_wakeupEffects = new List<EffectInfo>(); public List<EffectInfo> m_birthEffects = new List<EffectInfo>(); public List<EffectInfo> m_loveEffects = new List<EffectInfo>(); public List<EffectInfo> m_tamedEffects = new List<EffectInfo>(); public List<EffectInfo> m_soothEffects = new List<EffectInfo>(); public List<EffectInfo> m_petEffects = new List<EffectInfo>(); public List<EffectInfo> m_unSummonEffects = new List<EffectInfo>(); public List<EffectInfo> m_randomTalkFX = new List<EffectInfo>(); public List<EffectInfo> m_randomGreetFX = new List<EffectInfo>(); public List<EffectInfo> m_randomGoodbyeFX = new List<EffectInfo>(); [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(2)] public void Set(ref TameableRef r) { if (r != null) { r.m_tamedEffect = ToEffectListRef(m_tamedEffects); r.m_sootheEffect = ToEffectListRef(m_soothEffects); r.m_petEffect = ToEffectListRef(m_petEffects); r.m_unSummonEffect = ToEffectListRef(m_unSummonEffects); } } [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(2)] public void Set(ref ProcreationRef r) { if (r != null) { r.m_birthEffects = ToEffectListRef(m_birthEffects); r.m_loveEffects = ToEffectListRef(m_loveEffects); } } [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(2)] public void Set(ref NPCTalkRef r) { if (r != null) { r.m_randomGreetFX = ToEffectListRef(m_randomGreetFX); r.m_randomGoodbyeFX = ToEffectListRef(m_randomGoodbyeFX); r.m_randomTalkFX = ToEffectListRef(m_randomTalkFX); } } [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(2)] public void Set(ref CharacterRef reference) { if (reference == null) { reference = new CharacterRef(); } reference.m_hitEffects = ToEffectListRef(m_hitEffects); reference.m_critHitEffects = ToEffectListRef(m_critHitEffects); reference.m_backstabHitEffects = ToEffectListRef(m_backstabHitEffects); reference.m_deathEffects = ToEffectListRef(m_deathEffects); reference.m_waterEffects = ToEffectListRef(m_waterEffects); reference.m_tarEffects = ToEffectListRef(m_tarEffects); reference.m_slideEffects = ToEffectListRef(m_slideEffects); reference.m_jumpEffects = ToEffectListRef(m_jumpEffects); reference.m_flyingContinuousEffect = ToEffectListRef(m_flyingContinuousEffects); } [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(2)] public void Set(ref MonsterAIRef reference) { if (reference == null) { reference = new MonsterAIRef(); } reference.m_wakeupEffects = ToEffectListRef(m_wakeupEffects); } [<e31c499b-b0db-4cc5-a9a7-154e4eb8164c>NullableContext(2)] public void Set(ref HumanoidRef reference) { if (reference == null) { reference = new HumanoidRef(); } reference.m_consu