Decompiled source of RenegadeVikings v1.3.1
RenegadeVikings.dll
Decompiled 3 weeks 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 System.Threading.Tasks; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using JetBrains.Annotations; using LocalizationManager; using Microsoft.CodeAnalysis; using RenegadeVikings.Functions; using RenegadeVikings.Utilities; using RenegadeVikings.VikingsData; using RenegadeVikings.VikingsData.Neutral; using RenegadeVikings.VikingsData.Overlord; using RenegadeVikings.VikingsData.Renegade; using ServerSync; using TMPro; using UnityEngine; using UnityEngine.SceneManagement; 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: AssemblyFileVersion("1.3.1")] [assembly: Guid("6DEB4E9C-1075-4C09-89F4-459880552C76")] [assembly: ComVisible(false)] [assembly: AssemblyTrademark("")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyProduct("RenegadeVikings")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyDescription("https://valheim.thunderstore.io/package/blacks7ar/RenegadeVikings/")] [assembly: AssemblyTitle("RenegadeVikings")] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: CompilationRelaxations(8)] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyCompany("blacks7ar")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.3.1.0")] [module: <6e392c9c-9dc3-450d-b437-6f5598215df8>RefSafetyRules(11)] [module: UnverifiableCode] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [<5c55a252-941f-43c9-97dd-1ccfc4f9116b>Embedded] internal sealed class <5c55a252-941f-43c9-97dd-1ccfc4f9116b>EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] [<5c55a252-941f-43c9-97dd-1ccfc4f9116b>Embedded] internal sealed class <44799ddf-2883-45d1-bc6a-9c1df3e61b0c>NullableAttribute : Attribute { public readonly byte[] NullableFlags; public <44799ddf-2883-45d1-bc6a-9c1df3e61b0c>NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public <44799ddf-2883-45d1-bc6a-9c1df3e61b0c>NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [<5c55a252-941f-43c9-97dd-1ccfc4f9116b>Embedded] [CompilerGenerated] internal sealed class <f8d8dc8d-6734-4d8a-acf5-7ed41529e109>NullableContextAttribute : Attribute { public readonly byte Flag; public <f8d8dc8d-6734-4d8a-acf5-7ed41529e109>NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [<5c55a252-941f-43c9-97dd-1ccfc4f9116b>Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class <6e392c9c-9dc3-450d-b437-6f5598215df8>RefSafetyRulesAttribute : Attribute { public readonly int Version; public <6e392c9c-9dc3-450d-b437-6f5598215df8>RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace LocalizationManager { [PublicAPI] public class Localizer { private static readonly Dictionary<string, Dictionary<string, Func<string>>> PlaceholderProcessors; private static readonly Dictionary<string, Dictionary<string, string>> loadedTexts; private static readonly ConditionalWeakTable<Localization, string> localizationLanguage; private static readonly List<WeakReference<Localization>> localizationObjects; [<44799ddf-2883-45d1-bc6a-9c1df3e61b0c>Nullable(2)] private static BaseUnityPlugin _plugin; private static readonly List<string> fileExtensions; private static BaseUnityPlugin plugin { get { //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Expected O, but got Unknown if (_plugin == null) { IEnumerable<TypeInfo> source; try { source = Assembly.GetExecutingAssembly().DefinedTypes.ToList(); } catch (ReflectionTypeLoadException ex) { source = from t in ex.Types where t != null select t.GetTypeInfo(); } _plugin = (BaseUnityPlugin)Chainloader.ManagerObject.GetComponent((Type)source.First((TypeInfo t) => t.IsClass && typeof(BaseUnityPlugin).IsAssignableFrom(t))); } return _plugin; } } private static void UpdatePlaceholderText(Localization localization, string key) { localizationLanguage.TryGetValue(localization, out var value); string text = loadedTexts[value][key]; if (PlaceholderProcessors.TryGetValue(key, out var value2)) { text = value2.Aggregate(text, (string current, KeyValuePair<string, Func<string>> kv) => current.Replace("{" + kv.Key + "}", kv.Value())); } localization.AddWord(key, text); } public static void AddPlaceholder<[<44799ddf-2883-45d1-bc6a-9c1df3e61b0c>Nullable(1)] T>(string key, string placeholder, ConfigEntry<T> config, [<44799ddf-2883-45d1-bc6a-9c1df3e61b0c>Nullable(new byte[] { 2, 0, 0 })] Func<T, string> convertConfigValue = null) { if (convertConfigValue == null) { convertConfigValue = (T val) => val.ToString(); } if (!PlaceholderProcessors.ContainsKey(key)) { PlaceholderProcessors[key] = new Dictionary<string, Func<string>>(); } config.SettingChanged += delegate { UpdatePlaceholder(); }; if (loadedTexts.ContainsKey(Localization.instance.GetSelectedLanguage())) { UpdatePlaceholder(); } void UpdatePlaceholder() { PlaceholderProcessors[key][placeholder] = () => convertConfigValue(config.Value); UpdatePlaceholderText(Localization.instance, key); } } public static void AddText(string key, string text) { List<WeakReference<Localization>> list = new List<WeakReference<Localization>>(); foreach (WeakReference<Localization> localizationObject in localizationObjects) { if (localizationObject.TryGetTarget(out var target)) { Dictionary<string, string> dictionary = loadedTexts[localizationLanguage.GetOrCreateValue(target)]; if (!target.m_translations.ContainsKey(key)) { dictionary[key] = text; target.AddWord(key, text); } } else { list.Add(localizationObject); } } foreach (WeakReference<Localization> item in list) { localizationObjects.Remove(item); } } public static void Load() { LoadLocalization(Localization.instance, Localization.instance.GetSelectedLanguage()); } private static void LoadLocalization(Localization __instance, string language) { if (!localizationLanguage.Remove(__instance)) { localizationObjects.Add(new WeakReference<Localization>(__instance)); } localizationLanguage.Add(__instance, language); Dictionary<string, string> dictionary = new Dictionary<string, string>(); foreach (string item in from f in Directory.GetFiles(Path.GetDirectoryName(Paths.PluginPath), plugin.Info.Metadata.Name + ".*", SearchOption.AllDirectories) where fileExtensions.IndexOf(Path.GetExtension(f)) >= 0 select f) { string text = Path.GetFileNameWithoutExtension(item).Split(new char[1] { '.' })[1]; if (dictionary.ContainsKey(text)) { Debug.LogWarning((object)("Duplicate key " + text + " found for " + plugin.Info.Metadata.Name + ". The duplicate file found at " + item + " will be skipped.")); } else { dictionary[text] = item; } } byte[] array = LoadTranslationFromAssembly("English"); if (array == null) { throw new Exception("Found no English localizations in mod " + plugin.Info.Metadata.Name + ". Expected an embedded resource translations/English.json or translations/English.yml."); } Dictionary<string, string> dictionary2 = new DeserializerBuilder().IgnoreFields().Build().Deserialize<Dictionary<string, string>>(Encoding.UTF8.GetString(array)); if (dictionary2 == null) { throw new Exception("Localization for mod " + plugin.Info.Metadata.Name + " failed: Localization file was empty."); } string text2 = null; if (language != "English") { if (dictionary.ContainsKey(language)) { text2 = File.ReadAllText(dictionary[language]); } else { byte[] array2 = LoadTranslationFromAssembly(language); if (array2 != null) { text2 = Encoding.UTF8.GetString(array2); } } } if (text2 == null && dictionary.ContainsKey("English")) { text2 = File.ReadAllText(dictionary["English"]); } if (text2 != null) { foreach (KeyValuePair<string, string> item2 in new DeserializerBuilder().IgnoreFields().Build().Deserialize<Dictionary<string, string>>(text2) ?? new Dictionary<string, string>()) { dictionary2[item2.Key] = item2.Value; } } loadedTexts[language] = dictionary2; foreach (KeyValuePair<string, string> item3 in dictionary2) { UpdatePlaceholderText(__instance, item3.Key); } } static Localizer() { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown PlaceholderProcessors = new Dictionary<string, Dictionary<string, Func<string>>>(); loadedTexts = new Dictionary<string, Dictionary<string, string>>(); localizationLanguage = new ConditionalWeakTable<Localization, string>(); localizationObjects = new List<WeakReference<Localization>>(); fileExtensions = new List<string> { ".json", ".yml" }; new Harmony("org.bepinex.helpers.LocalizationManager").Patch((MethodBase)AccessTools.DeclaredMethod(typeof(Localization), "LoadCSV", (Type[])null, (Type[])null), (HarmonyMethod)null, new HarmonyMethod(AccessTools.DeclaredMethod(typeof(Localizer), "LoadLocalization", (Type[])null, (Type[])null)), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } [return: <44799ddf-2883-45d1-bc6a-9c1df3e61b0c>Nullable(2)] private static byte[] LoadTranslationFromAssembly(string language) { foreach (string fileExtension in fileExtensions) { byte[] array = ReadEmbeddedFileBytes("translations." + language + fileExtension); if (array != null) { return array; } } return null; } [<f8d8dc8d-6734-4d8a-acf5-7ed41529e109>NullableContext(2)] public static byte[] ReadEmbeddedFileBytes([<44799ddf-2883-45d1-bc6a-9c1df3e61b0c>Nullable(0)] string resourceFileName, Assembly containingAssembly = null) { using MemoryStream memoryStream = new MemoryStream(); if ((object)containingAssembly == null) { containingAssembly = Assembly.GetCallingAssembly(); } string text = containingAssembly.GetManifestResourceNames().FirstOrDefault((string str) => str.EndsWith(resourceFileName, StringComparison.Ordinal)); if (text != null) { containingAssembly.GetManifestResourceStream(text)?.CopyTo(memoryStream); } return (memoryStream.Length == 0L) ? null : memoryStream.ToArray(); } } } namespace RenegadeVikings { [BepInPlugin("blacks7ar.RenegadeVikings", "RenegadeVikings", "1.3.1")] public class Plugin : BaseUnityPlugin { private const string modGUID = "blacks7ar.RenegadeVikings"; public const string modName = "RenegadeVikings"; public const string modAuthor = "blacks7ar"; public const string modVersion = "1.3.1"; public const string modLink = "https://valheim.thunderstore.io/package/blacks7ar/RenegadeVikings/"; private static string traderYml = "blacks7ar.RenegadeVikings.yml"; private static readonly string configPath = Paths.ConfigPath; private static string ymlFullPath; public static readonly ManualLogSource RVLogger; private static readonly Harmony _harmony; private static readonly ConfigSync _configSync; private static ConfigEntry<Toggle> _serverConfigLocked; public static readonly CustomSyncedValue<List<TraderYaml>> _TraderYml; private static ConfigEntry<string> _vikingsFood; public static GameObject _PrefabContainer; public static readonly List<Character> _companionList; public static AssetBundle _renegadeBundle; public static GameObject _warHorn; public static GameObject _healingPill; public static GameObject _summonBatsSpawn; public static GameObject _summonSkeletonSpawn; public static GameObject _attackSummonSkeleton; public static GameObject _attackSummonBats; public static GameObject _summonedSkeleton; public static GameObject _summonedBats; public static GameObject _attackClusterBomb; public static Plugin _instance; public static HashSet<string> VikingsFood; public static List<TraderYaml> _traderItem { get; private set; } public ConfigEntry<T> config<T>(string group, string name, T value, ConfigDescription description, bool synchronizedConfig = true) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown ConfigDescription val = new ConfigDescription(description.Description + (synchronizedConfig ? " [Synced with Server]" : " [Not Synced with Server]"), description.AcceptableValues, description.Tags); ConfigEntry<T> val2 = ((BaseUnityPlugin)this).Config.Bind<T>(group, name, value, val); _configSync.AddConfigEntry<T>(val2).SynchronizedConfig = synchronizedConfig; return val2; } public ConfigEntry<T> config2<T>(string group, string name, T value, string desc, bool synchronizedConfig = true) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown RenegadeVikings.Utilities.ConfigurationManagerAttributes configurationManagerAttributes = new RenegadeVikings.Utilities.ConfigurationManagerAttributes { CustomDrawer = TextBox }; return config(group, name, value, new ConfigDescription(desc, (AcceptableValueBase)null, new object[1] { configurationManagerAttributes }), synchronizedConfig); } private void ConfigWatcher() { FileSystemWatcher fileSystemWatcher = new FileSystemWatcher(configPath, traderYml); fileSystemWatcher.Changed += ReadTraderYaml; fileSystemWatcher.Created += ReadTraderYaml; fileSystemWatcher.Renamed += ReadTraderYaml; fileSystemWatcher.IncludeSubdirectories = true; fileSystemWatcher.SynchronizingObject = ThreadingHelper.SynchronizingObject; fileSystemWatcher.EnableRaisingEvents = true; } private void ReadTraderYaml(object sender, FileSystemEventArgs e) { try { StreamReader streamReader = File.OpenText(ymlFullPath); _traderItem = Helper.ReadSerializedYml(streamReader.ReadToEnd()); streamReader.Close(); _TraderYml.AssignLocalValue(_traderItem); } catch { Logging.LogError("There was an issue loading you " + traderYml); Logging.LogError("Please check your entries for spelling and format!"); } } public void Awake() { //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Expected O, but got Unknown //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Expected O, but got Unknown //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Expected O, but got Unknown //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Expected O, but got Unknown //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Expected O, but got Unknown //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Expected O, but got Unknown //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Expected O, but got Unknown //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Expected O, but got Unknown //IL_02ee: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Expected O, but got Unknown //IL_0327: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Expected O, but got Unknown //IL_0360: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Expected O, but got Unknown //IL_0399: Unknown result type (might be due to invalid IL or missing references) //IL_03a4: Expected O, but got Unknown //IL_03d2: Unknown result type (might be due to invalid IL or missing references) //IL_03dd: Expected O, but got Unknown //IL_0415: Unknown result type (might be due to invalid IL or missing references) //IL_0420: Expected O, but got Unknown //IL_0458: Unknown result type (might be due to invalid IL or missing references) //IL_0463: Expected O, but got Unknown //IL_0491: Unknown result type (might be due to invalid IL or missing references) //IL_049c: Expected O, but got Unknown //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04d5: Expected O, but got Unknown //IL_0503: Unknown result type (might be due to invalid IL or missing references) //IL_050e: Expected O, but got Unknown //IL_0551: Unknown result type (might be due to invalid IL or missing references) //IL_055c: Expected O, but got Unknown //IL_058a: Unknown result type (might be due to invalid IL or missing references) //IL_0595: Expected O, but got Unknown //IL_05c3: Unknown result type (might be due to invalid IL or missing references) //IL_05ce: Expected O, but got Unknown //IL_05fc: Unknown result type (might be due to invalid IL or missing references) //IL_0607: Expected O, but got Unknown //IL_063f: Unknown result type (might be due to invalid IL or missing references) //IL_064a: Expected O, but got Unknown //IL_0682: Unknown result type (might be due to invalid IL or missing references) //IL_068d: Expected O, but got Unknown Localizer.Load(); ((BaseUnityPlugin)this).Config.SaveOnConfigSet = false; _instance = this; _renegadeBundle = GetAssetBundleFromResources("renegadebundle"); _warHorn = _renegadeBundle.LoadAsset<GameObject>("BRV_WarHorn"); SE_SummonCompanion sE_SummonCompanion = ScriptableObject.CreateInstance<SE_SummonCompanion>(); ((StatusEffect)sE_SummonCompanion).m_ttl = 0.25f; _warHorn.GetComponent<ItemDrop>().m_itemData.m_shared.m_consumeStatusEffect = (StatusEffect)(object)sE_SummonCompanion; _healingPill = _renegadeBundle.LoadAsset<GameObject>("BRV_HealingPill"); _summonBatsSpawn = _renegadeBundle.LoadAsset<GameObject>("brv_summon_bats_spawn"); _summonSkeletonSpawn = _renegadeBundle.LoadAsset<GameObject>("brv_summon_skeleton_spawn"); _serverConfigLocked = config("1- ServerSync", "Lock Configuration", Toggle.On, new ConfigDescription("If On, the configuration is locked and can be changed by server admins only.", (AcceptableValueBase)null, Array.Empty<object>())); _configSync.AddLockingConfigEntry<Toggle>(_serverConfigLocked); ConfigData._neutralHealth = config("2- Neutral Vikings", "Health", 300f, new ConfigDescription("Base health points.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 500f), Array.Empty<object>())); ConfigData._neutralDmgLevel = config("2- Neutral Vikings", "Damage Level", 4, new ConfigDescription("Determines weapons quality level.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 10), new object[1] { new RenegadeVikings.Utilities.ConfigurationManagerAttributes { ShowRangeAsPercent = false } })); ConfigData._neutralArmorLevel = config("2- Neutral Vikings", "Armor Level", 10, new ConfigDescription("Determines armor quality level.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 10), new object[1] { new RenegadeVikings.Utilities.ConfigurationManagerAttributes { ShowRangeAsPercent = false } })); _vikingsFood = config2("2- Neutral Vikings", "Taming Food", "CarrotSoup,DeerStew,FishWraps,HoneyGlazedChicken,MeatPlatter,MushroomOmelette,OnionSoup,SerpentStew,TurnipStew", "Neutral Vikings food and taming item.\nNeeds a Logout."); _vikingsFood.SettingChanged += delegate { GenerateVikingsFood(); }; ConfigData._renegadeTier1Health = config("3- Renegade Vikings", "RenegadeViking Tier1 Health", 100f, new ConfigDescription("Base health points.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 500f), Array.Empty<object>())); ConfigData._renegadeTier2Health = config("3- Renegade Vikings", "RenegadeViking Tier2 Health", 150f, new ConfigDescription("Base health points.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 500f), Array.Empty<object>())); ConfigData._renegadeTier3Health = config("3- Renegade Vikings", "RenegadeViking Tier3 Health", 200f, new ConfigDescription("Base health points.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 500f), Array.Empty<object>())); ConfigData._renegadeTier4Health = config("3- Renegade Vikings", "RenegadeViking Tier4 Health", 250f, new ConfigDescription("Base health points.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 500f), Array.Empty<object>())); ConfigData._renegadeTier5Health = config("3- Renegade Vikings", "RenegadeViking Tier5 Health", 300f, new ConfigDescription("Base health points.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 500f), Array.Empty<object>())); ConfigData._renegadeTier6MagicHealth = config("3- Renegade Vikings", "RenegadeViking Tier6Magic Health", 350f, new ConfigDescription("Base health points.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 500f), Array.Empty<object>())); ConfigData._renegadeTier6MeleeHealth = config("3- Renegade Vikings", "RenegadeViking Tier6Melee Health", 350f, new ConfigDescription("Base health points.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 500f), Array.Empty<object>())); ConfigData._renegadeTier7MeleeHealth = config("3- Renegade Vikings", "RenegadeViking Tier7Melee Health", 400f, new ConfigDescription("Base health points.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 1000f), Array.Empty<object>())); ConfigData._renegadeTier7MagicHealth = config("3- Renegade Vikings", "RenegadeViking Tier7Magic Health", 400f, new ConfigDescription("Base health points.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 1000f), Array.Empty<object>())); ConfigData._renegadeArmorLevel = config("3- Renegade Vikings", "Armor Level", 2, new ConfigDescription("Determines armor quality level.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 10), new object[1] { new RenegadeVikings.Utilities.ConfigurationManagerAttributes { ShowRangeAsPercent = false } })); ConfigData._renegadeDmgLevel = config("3- Renegade Vikings", "Damage Level", 3, new ConfigDescription("Determines weapon quality level.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 10), new object[1] { new RenegadeVikings.Utilities.ConfigurationManagerAttributes { ShowRangeAsPercent = false } })); ConfigData._overlordT1Health = config("4- Overlord Vikings", "OverlordViking Tier1 Health", 500f, new ConfigDescription("Base health points.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 1500f), Array.Empty<object>())); ConfigData._overlordT2Health = config("4- Overlord Vikings", "OverlordViking Tier2 Health", 2500f, new ConfigDescription("Base health points.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 5000f), Array.Empty<object>())); ConfigData._overlordT3Health = config("4- Overlord Vikings", "OverlordViking Tier3 Health", 5000f, new ConfigDescription("Base health points.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 7500f), Array.Empty<object>())); ConfigData._overlordT4Health = config("4- Overlord Vikings", "OverlordViking Tier4 Health", 7500f, new ConfigDescription("Base health points.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 10000f), new object[1] { new RenegadeVikings.Utilities.ConfigurationManagerAttributes { ShowRangeAsPercent = false } })); ConfigData._overlordT5Health = config("4- Overlord Vikings", "OverlordViking Tier5 Health", 10000f, new ConfigDescription("Base health points.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 12500f), Array.Empty<object>())); ConfigData._overlordT6Health = config("4- Overlord Vikings", "OverlordViking Tier6 Health", 12500f, new ConfigDescription("Base health points.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 15000f), Array.Empty<object>())); ConfigData._overlordT6SHealth = config("4- Overlord Vikings", "OverlordViking Tier6Summoner Health", 12500f, new ConfigDescription("Base health points.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 15000f), Array.Empty<object>())); ConfigData._overlordArmorLevel = config("4- Overlord Vikings", "Armor Level", 3, new ConfigDescription("Determines armor quality level.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 10), new object[1] { new RenegadeVikings.Utilities.ConfigurationManagerAttributes { ShowRangeAsPercent = false } })); ConfigData._overlordDmgLevel = config("4- Overlord Vikings", "Damage Level", 4, new ConfigDescription("Determines weapon quality level.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 10), new object[1] { new RenegadeVikings.Utilities.ConfigurationManagerAttributes { ShowRangeAsPercent = false } })); ConfigSetup.Init(); ((BaseUnityPlugin)this).Config.SaveOnConfigSet = true; ((BaseUnityPlugin)this).Config.Save(); Assembly executingAssembly = Assembly.GetExecutingAssembly(); _harmony.PatchAll(executingAssembly); PrefabContainerInit(); if (!File.Exists(ymlFullPath)) { CreateTraderYml(); Logging.LogWarning("File not found - " + traderYml + "!"); Logging.LogWarning("Creating a new one.."); } ReadTraderYaml(null, null); _TraderYml.ValueChanged += TraderYmlOnValueChanged; ConfigWatcher(); GenerateVikingsFood(); } public static void TraderYmlOnValueChanged() { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0081: 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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Expected O, but got Unknown GameObject[] array = Resources.FindObjectsOfTypeAll<GameObject>(); foreach (GameObject val in array) { if (!((Object)val).name.StartsWith("BLV_Trader")) { continue; } Trader component = val.GetComponent<Trader>(); if (!Object.op_Implicit((Object)(object)component)) { continue; } component.m_items.Clear(); foreach (TraderYaml item in _traderItem) { component.m_items.Add(new TradeItem { m_prefab = ObjectDB.instance.GetItemPrefab(item.m_prefab).GetComponent<ItemDrop>(), m_stack = item.m_stack, m_price = item.m_price, m_requiredGlobalKey = item.m_requiredGlobalKey }); } } Logging.LogDebug(traderYml + " changed.."); } private void OnDestroy() { ((BaseUnityPlugin)this).Config.Save(); } public static void PrefabContainerInit() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Expected O, but got Unknown _PrefabContainer = new GameObject("NpcPrefabs"); _PrefabContainer.SetActive(false); Object.DontDestroyOnLoad((Object)(object)_PrefabContainer); } private static void CreateTraderYml() { List<TraderYaml> graph = new List<TraderYaml> { new TraderYaml { m_prefab = "MeadHealthMinor", m_stack = 1, m_price = 80, m_requiredGlobalKey = "" }, new TraderYaml { m_prefab = "FishingRod", m_stack = 1, m_price = 450, m_requiredGlobalKey = "" }, new TraderYaml { m_prefab = "BeltStrength", m_stack = 1, m_price = 1150, m_requiredGlobalKey = "" }, new TraderYaml { m_prefab = "HelmetDverger", m_stack = 1, m_price = 700, m_requiredGlobalKey = "" }, new TraderYaml { m_prefab = "FishingBait", m_stack = 20, m_price = 25, m_requiredGlobalKey = "" }, new TraderYaml { m_prefab = "ChickenEgg", m_stack = 1, m_price = 2500, m_requiredGlobalKey = "defeated_eikthyr" } }; using StreamWriter writer = new StreamWriter(ymlFullPath); new SerializerBuilder().WithNamingConvention(CamelCaseNamingConvention.Instance).Build().Serialize(writer, graph); } private static AssetBundle GetAssetBundleFromResources(string filename) { Assembly executingAssembly = Assembly.GetExecutingAssembly(); string name = executingAssembly.GetManifestResourceNames().Single((string x) => x.EndsWith(filename)); using Stream stream = executingAssembly.GetManifestResourceStream(name); return AssetBundle.LoadFromStream(stream); } private static void GenerateVikingsFood() { VikingsFood = new HashSet<string>(_vikingsFood.Value.Split(new char[1] { ',' }, StringSplitOptions.RemoveEmptyEntries)); } private static void TextBox(ConfigEntryBase entryBase) { entryBase.BoxedValue = GUILayout.TextArea((string)entryBase.BoxedValue, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true) }); } static Plugin() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Expected O, but got Unknown string text = Paths.ConfigPath; char directorySeparatorChar = Path.DirectorySeparatorChar; ymlFullPath = text + directorySeparatorChar + traderYml; RVLogger = Logger.CreateLogSource("RenegadeVikings"); _harmony = new Harmony("blacks7ar.RenegadeVikings"); _configSync = new ConfigSync("blacks7ar.RenegadeVikings") { DisplayName = "RenegadeVikings", CurrentVersion = "1.3.1", MinimumRequiredVersion = "1.3.1" }; _TraderYml = new CustomSyncedValue<List<TraderYaml>>(_configSync, "Trader Items", new List<TraderYaml>()); _companionList = new List<Character>(); } } } namespace RenegadeVikings.VikingsData { public static class NeutralVikings { public static void Init(ZNetScene zNetScene) { //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: 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_0125: 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_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Expected O, but got Unknown GameObject val = zNetScene.GetPrefab("Player").Clone("BLV_NeutralVikings"); val.transform.SetParent(Plugin._PrefabContainer.transform, false); val.RemoveComponent(typeof(PlayerController)); val.RemoveComponent(typeof(Player)); val.RemoveComponent(typeof(Talker)); val.RemoveComponent(typeof(Skills)); Humanoid val2 = val.AddComponent<Humanoid>(); SetHumanoid(val2, zNetScene); SetMonsterAI(val.AddComponent<MonsterAI>(), zNetScene); ZNetView component = val.GetComponent<ZNetView>(); component.m_persistent = true; component.m_distant = false; component.m_type = (ObjectType)0; component.m_syncInitialScale = false; ZSyncTransform component2 = val.GetComponent<ZSyncTransform>(); component2.m_syncPosition = true; component2.m_syncRotation = true; component2.m_syncScale = false; component2.m_syncBodyVelocity = false; component2.m_characterParentSync = false; val.GetComponent<ZSyncAnimation>().m_smoothCharacterSpeeds = true; val.AddComponent<RenegadeSetup>(); SetupTameable(val.AddComponent<Tameable>(), zNetScene); SetupNpcTalk(val.AddComponent<NpcTalk>(), (Character)(object)val2); val.AddComponent<TamedFix>(); val.AddComponent<RandomAnimation>().m_values = new List<RandomValue>(1) { new RandomValue { m_name = "idle", m_values = 5, m_interval = 3f, m_floatValue = false, m_floatTransition = 1f } }; val.AddComponent<EquipmentAdjustment>(); zNetScene.AddClonedObject(val); } private static void SetHumanoid(Humanoid humanoid, ZNetScene zNetScene) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Expected O, but got Unknown //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Expected O, but got Unknown //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Expected O, but got Unknown //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Expected O, but got Unknown //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Expected O, but got Unknown //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Expected O, but got Unknown //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_0327: 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_035c: 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_0372: Unknown result type (might be due to invalid IL or missing references) //IL_0379: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Expected O, but got Unknown ((Character)humanoid).m_group = "NeutralVikings"; ((Character)humanoid).m_faction = (Faction)10; ((Character)humanoid).m_crouchSpeed = 2f; ((Character)humanoid).m_walkSpeed = 1.6f; ((Character)humanoid).m_speed = 4f; ((Character)humanoid).m_turnSpeed = 300f; ((Character)humanoid).m_runSpeed = 7f; ((Character)humanoid).m_runTurnSpeed = 300f; ((Character)humanoid).m_acceleration = 0.8f; ((Character)humanoid).m_jumpForce = 8f; ((Character)humanoid).m_jumpForceForward = 2f; ((Character)humanoid).m_jumpForceTiredFactor = 0.6f; ((Character)humanoid).m_canSwim = true; ((Character)humanoid).m_swimDepth = 1.5f; ((Character)humanoid).m_swimSpeed = 2f; ((Character)humanoid).m_swimTurnSpeed = 100f; ((Character)humanoid).m_swimAcceleration = 0.05f; ((Character)humanoid).m_groundTilt = (GroundTiltType)0; ((Character)humanoid).m_groundTiltSpeed = 50f; ((Character)humanoid).m_eye = Utils.FindChild(((Component)humanoid).gameObject.transform, "EyePos", (IterativeSearchType)0); ((Character)humanoid).m_hitEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[2] { new EffectData { m_prefab = zNetScene.GetPrefab("vfx_player_hit"), m_enabled = true, m_variant = -1 }, new EffectData { m_prefab = zNetScene.GetPrefab("sfx_hit"), m_enabled = true, m_variant = -1 } }; ((Character)humanoid).m_critHitEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = zNetScene.GetPrefab("fx_crit"), m_enabled = true, m_variant = -1 } }; ((Character)humanoid).m_backstabHitEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = zNetScene.GetPrefab("fx_backstab"), m_enabled = true, m_variant = -1 } }; ((Character)humanoid).m_deathEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[2] { new EffectData { m_prefab = zNetScene.GetPrefab("vfx_player_death"), m_enabled = true, m_variant = -1 }, new EffectData { m_prefab = zNetScene.GetPrefab("BLV_VikingRagdoll"), m_enabled = true, m_variant = -1 } }; ((Character)humanoid).m_tolerateWater = true; ConfigData._neutralHealth.SettingChanged += delegate { ((Character)humanoid).m_health = ConfigData._neutralHealth.Value; }; ((Character)humanoid).m_health = ConfigData._neutralHealth.Value; ((Character)humanoid).m_damageModifiers = new DamageModifiers { m_blunt = (DamageModifier)0, m_slash = (DamageModifier)0, m_pierce = (DamageModifier)0, m_chop = (DamageModifier)3, m_pickaxe = (DamageModifier)3, m_fire = (DamageModifier)0, m_frost = (DamageModifier)0, m_lightning = (DamageModifier)0, m_spirit = (DamageModifier)3 }; ((Character)humanoid).m_staggerWhenBlocked = true; ((Character)humanoid).m_staggerDamageFactor = 0.4f; humanoid.m_consumeItemEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = zNetScene.GetPrefab("sfx_creature_consume"), m_enabled = true, m_variant = -1 } }; } private static void SetMonsterAI(MonsterAI monsterAI, ZNetScene zNetScene) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Expected O, but got Unknown //IL_00b0: Unknown result type (might be due to invalid IL or missing references) ((BaseAI)monsterAI).m_viewRange = 40f; ((BaseAI)monsterAI).m_viewAngle = 90f; ((BaseAI)monsterAI).m_hearRange = 9999f; ((BaseAI)monsterAI).m_mistVision = false; ((BaseAI)monsterAI).m_alertedEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = zNetScene.GetPrefab("sfx_dverger_vo_alerted"), m_enabled = true, m_variant = -1 } }; ((BaseAI)monsterAI).m_idleSound.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = zNetScene.GetPrefab("sfx_dverger_vo_idle"), m_enabled = true, m_variant = 0 } }; ((BaseAI)monsterAI).m_idleSoundInterval = 10f; ((BaseAI)monsterAI).m_idleSoundChance = 0.5f; ((BaseAI)monsterAI).m_pathAgentType = (AgentType)1; ((BaseAI)monsterAI).m_moveMinAngle = 90f; ((BaseAI)monsterAI).m_smoothMovement = true; ((BaseAI)monsterAI).m_serpentMovement = false; ((BaseAI)monsterAI).m_jumpInterval = 0f; ((BaseAI)monsterAI).m_randomCircleInterval = 2f; ((BaseAI)monsterAI).m_randomMoveInterval = 10f; ((BaseAI)monsterAI).m_randomMoveRange = 10f; ((BaseAI)monsterAI).m_avoidFire = false; ((BaseAI)monsterAI).m_afraidOfFire = false; ((BaseAI)monsterAI).m_avoidWater = true; ((BaseAI)monsterAI).m_aggravatable = false; monsterAI.m_alertRange = 20f; monsterAI.m_fleeIfHurtWhenTargetCantBeReached = true; monsterAI.m_fleeIfNotAlerted = false; monsterAI.m_fleeIfLowHealth = 0f; monsterAI.m_circulateWhileCharging = false; monsterAI.m_circulateWhileChargingFlying = false; monsterAI.m_enableHuntPlayer = false; monsterAI.m_attackPlayerObjects = false; monsterAI.m_privateAreaTriggerTreshold = 5; monsterAI.m_interceptTimeMax = 2f; monsterAI.m_interceptTimeMin = 0f; monsterAI.m_maxChaseDistance = 0f; monsterAI.m_minAttackInterval = 0f; monsterAI.m_circleTargetInterval = 5f; monsterAI.m_circleTargetDuration = 2f; monsterAI.m_circleTargetDistance = 5f; if (Plugin.VikingsFood.Count != 0) { monsterAI.m_consumeItems = new List<ItemDrop>(); foreach (ItemDrop item in from name in Plugin.VikingsFood where (Object)(object)ObjectDB.instance.GetItemPrefab(name) != (Object)null select ObjectDB.instance.GetItemPrefab(name).GetComponent<ItemDrop>()) { monsterAI.m_consumeItems.Add(item); } } monsterAI.m_consumeRange = 1.4f; monsterAI.m_consumeSearchRange = 20f; monsterAI.m_consumeSearchInterval = 10f; } private static void SetupTameable(Tameable tameable, ZNetScene zNetScene) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_0049: Expected O, but got Unknown //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Expected O, but got Unknown //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_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Expected O, but got Unknown tameable.m_fedDuration = 600f; tameable.m_tamingTime = 1800f; tameable.m_tamedEffect.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = zNetScene.GetPrefab("fx_creature_tamed"), m_enabled = true, m_variant = -1 } }; tameable.m_sootheEffect.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = zNetScene.GetPrefab("vfx_creature_soothed"), m_enabled = true, m_variant = -1 } }; tameable.m_petEffect.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = zNetScene.GetPrefab("fx_skeleton_pet"), m_enabled = true, m_variant = 0 } }; tameable.m_commandable = true; } private static void SetupNpcTalk(NpcTalk npcTalk, Character character) { List<string> randomTalk = new List<string> { "$blv_neutralrandomtalk1", "$blv_neutralrandomtalk2", "$blv_neutralrandomtalk3", "$blv_neutralrandomtalk4", "$blv_neutralrandomtalk5", "$blv_neutralrandomtalk6", "$blv_neutralrandomtalk7", "$blv_neutralrandomtalk8", "$blv_neutralrandomtalk9", "$blv_neutralrandomtalk10" }; npcTalk.m_name = character.m_name; npcTalk.m_maxRange = 20f; npcTalk.m_greetRange = 0f; npcTalk.m_byeRange = 0f; npcTalk.m_offset = 2.2f; npcTalk.m_minTalkInterval = 3f; npcTalk.m_hideDialogDelay = 9f; npcTalk.m_randomTalkInterval = 30f; npcTalk.m_randomTalkChance = 0.75f; npcTalk.m_randomTalk = randomTalk; } } public static class TraderViking { public static void Init(ZNetScene zNetScene) { //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Expected O, but got Unknown GameObject val = zNetScene.GetPrefab("Player").Clone("BLV_TraderViking"); val.transform.SetParent(Plugin._PrefabContainer.transform, false); val.RemoveComponent(typeof(PlayerController)); val.RemoveComponent(typeof(Player)); val.RemoveComponent(typeof(Talker)); val.RemoveComponent(typeof(Skills)); SetHumanoid(val.AddComponent<Humanoid>(), zNetScene); SetMonsterAI(val.AddComponent<MonsterAI>(), zNetScene); ZNetView component = val.GetComponent<ZNetView>(); component.m_persistent = true; component.m_distant = false; component.m_type = (ObjectType)0; component.m_syncInitialScale = false; ZSyncTransform component2 = val.GetComponent<ZSyncTransform>(); component2.m_syncPosition = true; component2.m_syncRotation = true; component2.m_syncScale = false; component2.m_syncBodyVelocity = false; component2.m_characterParentSync = false; val.GetComponent<ZSyncAnimation>().m_smoothCharacterSpeeds = true; val.AddComponent<RenegadeSetup>(); SetupTrader(val.AddComponent<Trader>()); val.AddComponent<RandomAnimation>().m_values = new List<RandomValue>(1) { new RandomValue { m_name = "idle", m_values = 5, m_interval = 3f, m_floatValue = false, m_floatTransition = 1f } }; val.AddComponent<EquipmentAdjustment>(); LookAt obj = ((Component)Utils.FindChild(val.transform, "Visual", (IterativeSearchType)0)).gameObject.AddComponent<LookAt>(); obj.m_bodyWeight = 0.5f; obj.m_headWeight = 1f; obj.m_eyesWeight = 0f; obj.m_smoothTime = 1f; Plugin._TraderYml.ValueChanged += Plugin.TraderYmlOnValueChanged; zNetScene.AddClonedObject(val); } private static void SetHumanoid(Humanoid humanoid, ZNetScene zNetScene) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Expected O, but got Unknown //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Expected O, but got Unknown //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Expected O, but got Unknown //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Expected O, but got Unknown //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Expected O, but got Unknown //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Expected O, but got Unknown //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) ((Character)humanoid).m_name = "$blv_tradername"; ((Character)humanoid).m_group = "TraderVikings"; ((Character)humanoid).m_faction = (Faction)10; ((Character)humanoid).m_crouchSpeed = 2f; ((Character)humanoid).m_walkSpeed = 1f; ((Character)humanoid).m_speed = 2f; ((Character)humanoid).m_turnSpeed = 300f; ((Character)humanoid).m_runSpeed = 3f; ((Character)humanoid).m_runTurnSpeed = 300f; ((Character)humanoid).m_acceleration = 0.8f; ((Character)humanoid).m_jumpForce = 8f; ((Character)humanoid).m_jumpForceForward = 2f; ((Character)humanoid).m_jumpForceTiredFactor = 0.6f; ((Character)humanoid).m_canSwim = true; ((Character)humanoid).m_swimDepth = 1.5f; ((Character)humanoid).m_swimSpeed = 2f; ((Character)humanoid).m_swimTurnSpeed = 100f; ((Character)humanoid).m_swimAcceleration = 0.05f; ((Character)humanoid).m_groundTilt = (GroundTiltType)0; ((Character)humanoid).m_groundTiltSpeed = 50f; ((Character)humanoid).m_eye = Utils.FindChild(((Component)humanoid).gameObject.transform, "EyePos", (IterativeSearchType)0); ((Character)humanoid).m_hitEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[2] { new EffectData { m_prefab = zNetScene.GetPrefab("vfx_player_hit"), m_enabled = true, m_variant = -1 }, new EffectData { m_prefab = zNetScene.GetPrefab("sfx_hit"), m_enabled = true, m_variant = -1 } }; ((Character)humanoid).m_critHitEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = zNetScene.GetPrefab("fx_crit"), m_enabled = true, m_variant = -1 } }; ((Character)humanoid).m_backstabHitEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = zNetScene.GetPrefab("fx_backstab"), m_enabled = true, m_variant = -1 } }; ((Character)humanoid).m_deathEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[2] { new EffectData { m_prefab = zNetScene.GetPrefab("vfx_player_death"), m_enabled = true, m_variant = -1 }, new EffectData { m_prefab = zNetScene.GetPrefab("BLV_VikingRagdoll"), m_enabled = true, m_variant = -1 } }; ((Character)humanoid).m_tolerateWater = true; ((Character)humanoid).m_health = 100f; ((Character)humanoid).m_damageModifiers = new DamageModifiers { m_blunt = (DamageModifier)3, m_slash = (DamageModifier)3, m_pierce = (DamageModifier)3, m_chop = (DamageModifier)3, m_pickaxe = (DamageModifier)3, m_fire = (DamageModifier)3, m_frost = (DamageModifier)3, m_lightning = (DamageModifier)3, m_spirit = (DamageModifier)3 }; ((Character)humanoid).m_staggerWhenBlocked = false; ((Character)humanoid).m_staggerDamageFactor = 0f; } private static void SetMonsterAI(MonsterAI monsterAI, ZNetScene zNetScene) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Expected O, but got Unknown //IL_00b0: Unknown result type (might be due to invalid IL or missing references) ((BaseAI)monsterAI).m_viewRange = 40f; ((BaseAI)monsterAI).m_viewAngle = 90f; ((BaseAI)monsterAI).m_hearRange = 0f; ((BaseAI)monsterAI).m_mistVision = false; ((BaseAI)monsterAI).m_alertedEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = zNetScene.GetPrefab("sfx_dverger_vo_alerted"), m_enabled = true, m_variant = -1 } }; ((BaseAI)monsterAI).m_idleSound.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = zNetScene.GetPrefab("sfx_dverger_vo_idle"), m_enabled = true, m_variant = 0 } }; ((BaseAI)monsterAI).m_idleSoundInterval = 10f; ((BaseAI)monsterAI).m_idleSoundChance = 0.5f; ((BaseAI)monsterAI).m_pathAgentType = (AgentType)1; ((BaseAI)monsterAI).m_moveMinAngle = 90f; ((BaseAI)monsterAI).m_smoothMovement = true; ((BaseAI)monsterAI).m_serpentMovement = false; ((BaseAI)monsterAI).m_jumpInterval = 0f; ((BaseAI)monsterAI).m_randomCircleInterval = 25f; ((BaseAI)monsterAI).m_randomMoveInterval = 25f; ((BaseAI)monsterAI).m_randomMoveRange = 2f; ((BaseAI)monsterAI).m_avoidFire = false; ((BaseAI)monsterAI).m_afraidOfFire = false; ((BaseAI)monsterAI).m_avoidWater = true; ((BaseAI)monsterAI).m_aggravatable = false; monsterAI.m_alertRange = 0f; monsterAI.m_fleeIfHurtWhenTargetCantBeReached = false; monsterAI.m_fleeIfNotAlerted = false; monsterAI.m_fleeIfLowHealth = 0f; monsterAI.m_circulateWhileCharging = false; monsterAI.m_circulateWhileChargingFlying = false; monsterAI.m_enableHuntPlayer = false; monsterAI.m_attackPlayerObjects = false; monsterAI.m_privateAreaTriggerTreshold = 0; monsterAI.m_interceptTimeMax = 2f; monsterAI.m_interceptTimeMin = 0f; monsterAI.m_maxChaseDistance = 0f; monsterAI.m_minAttackInterval = 0f; monsterAI.m_circleTargetInterval = 5f; monsterAI.m_circleTargetDuration = 2f; monsterAI.m_circleTargetDistance = 5f; } private static void SetupTrader(Trader trader) { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0073: 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_008d: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Expected O, but got Unknown //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Expected O, but got Unknown //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Expected O, but got Unknown //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Expected O, but got Unknown //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: Expected O, but got Unknown trader.m_name = "$blv_tradername"; trader.m_standRange = 16f; trader.m_greetRange = 10f; trader.m_byeRange = 15f; trader.m_items.Clear(); foreach (TraderYaml item in Plugin._traderItem) { trader.m_items.Add(new TradeItem { m_prefab = ObjectDB.instance.GetItemPrefab(item.m_prefab).GetComponent<ItemDrop>(), m_stack = item.m_stack, m_price = item.m_price, m_requiredGlobalKey = item.m_requiredGlobalKey }); } trader.m_hideDialogDelay = 5f; trader.m_randomTalkInterval = 30f; trader.m_randomTalk = new List<string>(3) { "$blv_tradertalk1", "$blv_tradertalk2", "$blv_tradertalk3" }; trader.m_randomGreets = new List<string>(2) { "$blv_tradergreet1", "$blv_tradergreet2" }; trader.m_randomGoodbye = new List<string>(2) { "$blv_traderbye1", "$blv_traderbye2" }; trader.m_randomStartTrade = new List<string>(5) { "$npc_haldor_random_starttrade1", "$npc_haldor_random_starttrade2", "$npc_haldor_random_starttrade3", "$npc_haldor_random_starttrade4", "$npc_haldor_random_starttrade5" }; trader.m_randomBuy = new List<string>(5) { "$npc_haldor_random_buy1", "$npc_haldor_random_buy2", "$npc_haldor_random_buy3", "$npc_haldor_random_buy4", "$npc_haldor_random_buy5" }; trader.m_randomSell = new List<string>(4) { "$npc_haldor_random_sell1", "$npc_haldor_random_sell2", "$npc_haldor_random_sell3", "$npc_haldor_random_sell4" }; trader.m_randomGreetFX.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = ZNetScene.instance.GetPrefab("sfx_haldor_greet"), m_enabled = true, m_variant = -1 } }; trader.m_randomStartTradeFX.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = ZNetScene.instance.GetPrefab("sfx_haldor_laugh"), m_enabled = true, m_variant = -1 } }; trader.m_randomBuyFX.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = ZNetScene.instance.GetPrefab("sfx_haldor_yea"), m_enabled = true, m_variant = -1 } }; trader.m_randomSellFX.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = ZNetScene.instance.GetPrefab("sfx_haldor_yea"), m_enabled = true, m_variant = -1 } }; } } } namespace RenegadeVikings.VikingsData.Renegade { public static class RenegadeVikingT1 { public static void Init(ZNetScene zNetScene) { //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Expected O, but got Unknown GameObject val = zNetScene.GetPrefab("Player").Clone("BLV_RenegadeVikingT1"); val.transform.SetParent(Plugin._PrefabContainer.transform, false); val.RemoveComponent(typeof(PlayerController)); val.RemoveComponent(typeof(Player)); val.RemoveComponent(typeof(Talker)); val.RemoveComponent(typeof(Skills)); SetHumanoid(val.AddComponent<Humanoid>(), zNetScene); SetMonsterAI(val.AddComponent<MonsterAI>(), zNetScene); ZNetView component = val.GetComponent<ZNetView>(); component.m_persistent = true; component.m_distant = false; component.m_type = (ObjectType)0; component.m_syncInitialScale = false; ZSyncTransform component2 = val.GetComponent<ZSyncTransform>(); component2.m_syncPosition = true; component2.m_syncRotation = true; component2.m_syncScale = false; component2.m_syncBodyVelocity = false; component2.m_characterParentSync = false; val.GetComponent<ZSyncAnimation>().m_smoothCharacterSpeeds = true; val.AddComponent<RenegadeSetup>(); SetDropList(val.AddComponent<CharacterDrop>(), zNetScene); val.AddComponent<RandomAnimation>().m_values = new List<RandomValue>(1) { new RandomValue { m_name = "idle", m_values = 5, m_interval = 3f, m_floatValue = false, m_floatTransition = 1f } }; val.AddComponent<EquipmentAdjustment>(); zNetScene.AddClonedObject(val); } private static void SetHumanoid(Humanoid humanoid, ZNetScene zNetScene) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Expected O, but got Unknown //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Expected O, but got Unknown //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Expected O, but got Unknown //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Expected O, but got Unknown //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Expected O, but got Unknown //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Expected O, but got Unknown //IL_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Unknown result type (might be due to invalid IL or missing references) //IL_0321: 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_0331: Unknown result type (might be due to invalid IL or missing references) //IL_0336: Unknown result type (might be due to invalid IL or missing references) //IL_0337: Unknown result type (might be due to invalid IL or missing references) //IL_0366: Unknown result type (might be due to invalid IL or missing references) //IL_036c: Expected O, but got Unknown ((Character)humanoid).m_name = "$blv_renegademeadows"; ((Character)humanoid).m_group = "T1Vikings"; ((Character)humanoid).m_faction = (Faction)4; ((Character)humanoid).m_crouchSpeed = 2f; ((Character)humanoid).m_walkSpeed = 1.6f; ((Character)humanoid).m_speed = 4f; ((Character)humanoid).m_turnSpeed = 300f; ((Character)humanoid).m_runSpeed = 7f; ((Character)humanoid).m_runTurnSpeed = 300f; ((Character)humanoid).m_acceleration = 0.8f; ((Character)humanoid).m_jumpForce = 8f; ((Character)humanoid).m_jumpForceForward = 2f; ((Character)humanoid).m_jumpForceTiredFactor = 0.6f; ((Character)humanoid).m_canSwim = true; ((Character)humanoid).m_swimDepth = 1.5f; ((Character)humanoid).m_swimSpeed = 2f; ((Character)humanoid).m_swimTurnSpeed = 100f; ((Character)humanoid).m_swimAcceleration = 0.05f; ((Character)humanoid).m_groundTilt = (GroundTiltType)0; ((Character)humanoid).m_groundTiltSpeed = 50f; ((Character)humanoid).m_eye = Utils.FindChild(((Component)humanoid).gameObject.transform, "EyePos", (IterativeSearchType)0); ((Character)humanoid).m_hitEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[2] { new EffectData { m_prefab = zNetScene.GetPrefab("vfx_player_hit"), m_enabled = true, m_variant = -1 }, new EffectData { m_prefab = zNetScene.GetPrefab("sfx_hit"), m_enabled = true, m_variant = -1 } }; ((Character)humanoid).m_critHitEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = zNetScene.GetPrefab("fx_crit"), m_enabled = true, m_variant = -1 } }; ((Character)humanoid).m_backstabHitEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = zNetScene.GetPrefab("fx_backstab"), m_enabled = true, m_variant = -1 } }; ((Character)humanoid).m_deathEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[2] { new EffectData { m_prefab = zNetScene.GetPrefab("vfx_ghost_death"), m_enabled = true, m_variant = -1 }, new EffectData { m_prefab = zNetScene.GetPrefab("sfx_ghost_death"), m_enabled = true, m_variant = -1 } }; ((Character)humanoid).m_tolerateWater = true; ConfigData._renegadeTier1Health.SettingChanged += delegate { ((Character)humanoid).m_health = ConfigData._renegadeTier1Health.Value; }; ((Character)humanoid).m_health = ConfigData._renegadeTier1Health.Value; ((Character)humanoid).m_damageModifiers = new DamageModifiers { m_blunt = (DamageModifier)0, m_slash = (DamageModifier)0, m_pierce = (DamageModifier)0, m_chop = (DamageModifier)3, m_pickaxe = (DamageModifier)3, m_fire = (DamageModifier)0, m_frost = (DamageModifier)0, m_lightning = (DamageModifier)0, m_spirit = (DamageModifier)3 }; ((Character)humanoid).m_staggerWhenBlocked = true; ((Character)humanoid).m_staggerDamageFactor = 0.4f; Humanoid obj = humanoid; ItemSet[] array = new ItemSet[1]; ItemSet val = new ItemSet(); val.m_items = (GameObject[])(object)new GameObject[4] { ObjectDB.instance.GetItemPrefab("HelmetLeather"), ObjectDB.instance.GetItemPrefab("ArmorLeatherChest"), ObjectDB.instance.GetItemPrefab("ArmorLeatherLegs"), ObjectDB.instance.GetItemPrefab("CapeDeerHide") }; array[0] = val; obj.m_randomSets = (ItemSet[])(object)array; } private static void SetMonsterAI(MonsterAI monsterAI, ZNetScene zNetScene) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Expected O, but got Unknown //IL_00b0: Unknown result type (might be due to invalid IL or missing references) ((BaseAI)monsterAI).m_viewRange = 40f; ((BaseAI)monsterAI).m_viewAngle = 90f; ((BaseAI)monsterAI).m_hearRange = 9999f; ((BaseAI)monsterAI).m_mistVision = false; ((BaseAI)monsterAI).m_alertedEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = zNetScene.GetPrefab("sfx_dverger_vo_alerted"), m_enabled = true, m_variant = -1 } }; ((BaseAI)monsterAI).m_idleSound.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = zNetScene.GetPrefab("sfx_dverger_vo_idle"), m_enabled = true, m_variant = 0 } }; ((BaseAI)monsterAI).m_idleSoundInterval = 10f; ((BaseAI)monsterAI).m_idleSoundChance = 0.5f; ((BaseAI)monsterAI).m_pathAgentType = (AgentType)1; ((BaseAI)monsterAI).m_moveMinAngle = 90f; ((BaseAI)monsterAI).m_smoothMovement = true; ((BaseAI)monsterAI).m_serpentMovement = false; ((BaseAI)monsterAI).m_jumpInterval = 0f; ((BaseAI)monsterAI).m_randomCircleInterval = 2f; ((BaseAI)monsterAI).m_randomMoveInterval = 10f; ((BaseAI)monsterAI).m_randomMoveRange = 10f; ((BaseAI)monsterAI).m_avoidFire = false; ((BaseAI)monsterAI).m_afraidOfFire = false; ((BaseAI)monsterAI).m_avoidWater = true; ((BaseAI)monsterAI).m_aggravatable = true; monsterAI.m_alertRange = 20f; monsterAI.m_fleeIfHurtWhenTargetCantBeReached = true; monsterAI.m_fleeIfNotAlerted = false; monsterAI.m_fleeIfLowHealth = 0f; monsterAI.m_circulateWhileCharging = false; monsterAI.m_circulateWhileChargingFlying = false; monsterAI.m_enableHuntPlayer = false; monsterAI.m_attackPlayerObjects = true; monsterAI.m_privateAreaTriggerTreshold = 5; monsterAI.m_interceptTimeMax = 2f; monsterAI.m_interceptTimeMin = 0f; monsterAI.m_maxChaseDistance = 0f; monsterAI.m_minAttackInterval = 0f; monsterAI.m_circleTargetInterval = 5f; monsterAI.m_circleTargetDuration = 2f; monsterAI.m_circleTargetDistance = 5f; } private static void SetDropList(CharacterDrop characterDrop, ZNetScene zNetScene) { //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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Expected O, but got Unknown //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Expected O, but got Unknown //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Expected O, but got Unknown //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Expected O, but got Unknown string[] array = ConfigData._renegadeT1CDrop1.Value?.Split(new char[1] { ':' }); string[] array2 = ConfigData._renegadeT1CDrop2.Value?.Split(new char[1] { ':' }); string[] array3 = ConfigData._renegadeT1CDrop3.Value?.Split(new char[1] { ':' }); string[] array4 = ConfigData._renegadeT1CDrop4.Value?.Split(new char[1] { ':' }); List<Drop> drops = new List<Drop> { new Drop { m_prefab = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode(array[0])), m_amountMin = int.Parse(array[1]), m_amountMax = int.Parse(array[2]), m_chance = float.Parse(array[3]), m_onePerPlayer = bool.Parse(array[4]), m_levelMultiplier = bool.Parse(array[5]), m_dontScale = bool.Parse(array[6]) }, new Drop { m_prefab = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode(array2[0])), m_amountMin = int.Parse(array2[1]), m_amountMax = int.Parse(array2[2]), m_chance = float.Parse(array2[3]), m_onePerPlayer = bool.Parse(array2[4]), m_levelMultiplier = bool.Parse(array2[5]), m_dontScale = bool.Parse(array2[6]) }, new Drop { m_prefab = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode(array3[0])), m_amountMin = int.Parse(array3[1]), m_amountMax = int.Parse(array3[2]), m_chance = float.Parse(array3[3]), m_onePerPlayer = bool.Parse(array3[4]), m_levelMultiplier = bool.Parse(array3[5]), m_dontScale = bool.Parse(array3[6]) }, new Drop { m_prefab = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode(array4[0])), m_amountMin = int.Parse(array4[1]), m_amountMax = int.Parse(array4[2]), m_chance = float.Parse(array4[3]), m_onePerPlayer = bool.Parse(array4[4]), m_levelMultiplier = bool.Parse(array4[5]), m_dontScale = bool.Parse(array4[6]) } }; characterDrop.m_drops = drops; } } public static class RenegadeVikingT2 { public static void Init(ZNetScene zNetScene) { //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Expected O, but got Unknown GameObject val = zNetScene.GetPrefab("Player").Clone("BLV_RenegadeVikingT2"); val.transform.SetParent(Plugin._PrefabContainer.transform, false); val.RemoveComponent(typeof(PlayerController)); val.RemoveComponent(typeof(Player)); val.RemoveComponent(typeof(Talker)); val.RemoveComponent(typeof(Skills)); SetHumanoid(val.AddComponent<Humanoid>(), zNetScene); SetMonsterAI(val.AddComponent<MonsterAI>(), zNetScene); ZNetView component = val.GetComponent<ZNetView>(); component.m_persistent = true; component.m_distant = false; component.m_type = (ObjectType)0; component.m_syncInitialScale = false; ZSyncTransform component2 = val.GetComponent<ZSyncTransform>(); component2.m_syncPosition = true; component2.m_syncRotation = true; component2.m_syncScale = false; component2.m_syncBodyVelocity = false; component2.m_characterParentSync = false; val.GetComponent<ZSyncAnimation>().m_smoothCharacterSpeeds = true; val.AddComponent<RenegadeSetup>(); SetDropList(val.AddComponent<CharacterDrop>(), zNetScene); val.AddComponent<RandomAnimation>().m_values = new List<RandomValue>(1) { new RandomValue { m_name = "idle", m_values = 5, m_interval = 3f, m_floatValue = false, m_floatTransition = 1f } }; val.AddComponent<EquipmentAdjustment>(); zNetScene.AddClonedObject(val); } private static void SetHumanoid(Humanoid humanoid, ZNetScene zNetScene) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Expected O, but got Unknown //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Expected O, but got Unknown //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Expected O, but got Unknown //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Expected O, but got Unknown //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Expected O, but got Unknown //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Expected O, but got Unknown //IL_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Unknown result type (might be due to invalid IL or missing references) //IL_0321: 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_0331: Unknown result type (might be due to invalid IL or missing references) //IL_0336: Unknown result type (might be due to invalid IL or missing references) //IL_0337: Unknown result type (might be due to invalid IL or missing references) //IL_0366: Unknown result type (might be due to invalid IL or missing references) //IL_036c: Expected O, but got Unknown //IL_03c4: Unknown result type (might be due to invalid IL or missing references) //IL_03ca: Expected O, but got Unknown ((Character)humanoid).m_name = "$blv_renegadeblackforest"; ((Character)humanoid).m_group = "T2Vikings"; ((Character)humanoid).m_faction = (Faction)4; ((Character)humanoid).m_crouchSpeed = 2f; ((Character)humanoid).m_walkSpeed = 1.6f; ((Character)humanoid).m_speed = 4f; ((Character)humanoid).m_turnSpeed = 300f; ((Character)humanoid).m_runSpeed = 7f; ((Character)humanoid).m_runTurnSpeed = 300f; ((Character)humanoid).m_acceleration = 0.8f; ((Character)humanoid).m_jumpForce = 8f; ((Character)humanoid).m_jumpForceForward = 2f; ((Character)humanoid).m_jumpForceTiredFactor = 0.6f; ((Character)humanoid).m_canSwim = true; ((Character)humanoid).m_swimDepth = 1.5f; ((Character)humanoid).m_swimSpeed = 2f; ((Character)humanoid).m_swimTurnSpeed = 100f; ((Character)humanoid).m_swimAcceleration = 0.05f; ((Character)humanoid).m_groundTilt = (GroundTiltType)0; ((Character)humanoid).m_groundTiltSpeed = 50f; ((Character)humanoid).m_eye = Utils.FindChild(((Component)humanoid).gameObject.transform, "EyePos", (IterativeSearchType)0); ((Character)humanoid).m_hitEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[2] { new EffectData { m_prefab = zNetScene.GetPrefab("vfx_player_hit"), m_enabled = true, m_variant = -1 }, new EffectData { m_prefab = zNetScene.GetPrefab("sfx_hit"), m_enabled = true, m_variant = -1 } }; ((Character)humanoid).m_critHitEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = zNetScene.GetPrefab("fx_crit"), m_enabled = true, m_variant = -1 } }; ((Character)humanoid).m_backstabHitEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = zNetScene.GetPrefab("fx_backstab"), m_enabled = true, m_variant = -1 } }; ((Character)humanoid).m_deathEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[2] { new EffectData { m_prefab = zNetScene.GetPrefab("vfx_ghost_death"), m_enabled = true, m_variant = -1 }, new EffectData { m_prefab = zNetScene.GetPrefab("sfx_ghost_death"), m_enabled = true, m_variant = -1 } }; ((Character)humanoid).m_tolerateWater = true; ConfigData._renegadeTier2Health.SettingChanged += delegate { ((Character)humanoid).m_health = ConfigData._renegadeTier2Health.Value; }; ((Character)humanoid).m_health = ConfigData._renegadeTier2Health.Value; ((Character)humanoid).m_damageModifiers = new DamageModifiers { m_blunt = (DamageModifier)0, m_slash = (DamageModifier)0, m_pierce = (DamageModifier)0, m_chop = (DamageModifier)3, m_pickaxe = (DamageModifier)3, m_fire = (DamageModifier)0, m_frost = (DamageModifier)0, m_lightning = (DamageModifier)0, m_spirit = (DamageModifier)3 }; ((Character)humanoid).m_staggerWhenBlocked = true; ((Character)humanoid).m_staggerDamageFactor = 0.4f; Humanoid obj = humanoid; ItemSet[] array = new ItemSet[2]; ItemSet val = new ItemSet(); val.m_items = (GameObject[])(object)new GameObject[4] { ObjectDB.instance.GetItemPrefab("HelmetBronze"), ObjectDB.instance.GetItemPrefab("ArmorBronzeChest"), ObjectDB.instance.GetItemPrefab("ArmorBronzeLegs"), ObjectDB.instance.GetItemPrefab("CapeDeerHide") }; array[0] = val; val = new ItemSet(); val.m_items = (GameObject[])(object)new GameObject[4] { ObjectDB.instance.GetItemPrefab("HelmetTrollLeather"), ObjectDB.instance.GetItemPrefab("ArmorTrollLeatherChest"), ObjectDB.instance.GetItemPrefab("ArmorTrollLeatherLegs"), ObjectDB.instance.GetItemPrefab("CapeTrollHide") }; array[1] = val; obj.m_randomSets = (ItemSet[])(object)array; } private static void SetMonsterAI(MonsterAI monsterAI, ZNetScene zNetScene) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Expected O, but got Unknown //IL_00b0: Unknown result type (might be due to invalid IL or missing references) ((BaseAI)monsterAI).m_viewRange = 40f; ((BaseAI)monsterAI).m_viewAngle = 90f; ((BaseAI)monsterAI).m_hearRange = 9999f; ((BaseAI)monsterAI).m_mistVision = false; ((BaseAI)monsterAI).m_alertedEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = zNetScene.GetPrefab("sfx_dverger_vo_alerted"), m_enabled = true, m_variant = -1 } }; ((BaseAI)monsterAI).m_idleSound.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = zNetScene.GetPrefab("sfx_dverger_vo_idle"), m_enabled = true, m_variant = 0 } }; ((BaseAI)monsterAI).m_idleSoundInterval = 10f; ((BaseAI)monsterAI).m_idleSoundChance = 0.5f; ((BaseAI)monsterAI).m_pathAgentType = (AgentType)1; ((BaseAI)monsterAI).m_moveMinAngle = 90f; ((BaseAI)monsterAI).m_smoothMovement = true; ((BaseAI)monsterAI).m_serpentMovement = false; ((BaseAI)monsterAI).m_jumpInterval = 0f; ((BaseAI)monsterAI).m_randomCircleInterval = 2f; ((BaseAI)monsterAI).m_randomMoveInterval = 10f; ((BaseAI)monsterAI).m_randomMoveRange = 10f; ((BaseAI)monsterAI).m_avoidFire = false; ((BaseAI)monsterAI).m_afraidOfFire = false; ((BaseAI)monsterAI).m_avoidWater = true; ((BaseAI)monsterAI).m_aggravatable = false; monsterAI.m_alertRange = 20f; monsterAI.m_fleeIfHurtWhenTargetCantBeReached = true; monsterAI.m_fleeIfNotAlerted = false; monsterAI.m_fleeIfLowHealth = 0f; monsterAI.m_circulateWhileCharging = false; monsterAI.m_enableHuntPlayer = false; monsterAI.m_attackPlayerObjects = true; monsterAI.m_privateAreaTriggerTreshold = 5; monsterAI.m_interceptTimeMax = 2f; monsterAI.m_interceptTimeMin = 0f; monsterAI.m_maxChaseDistance = 0f; monsterAI.m_minAttackInterval = 0f; monsterAI.m_circleTargetInterval = 5f; monsterAI.m_circleTargetDuration = 2f; monsterAI.m_circleTargetDistance = 5f; } private static void SetDropList(CharacterDrop characterDrop, ZNetScene zNetScene) { //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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Expected O, but got Unknown //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Expected O, but got Unknown //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Expected O, but got Unknown //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Expected O, but got Unknown string[] array = ConfigData._renegadeT2CDrop1.Value?.Split(new char[1] { ':' }); string[] array2 = ConfigData._renegadeT2CDrop2.Value?.Split(new char[1] { ':' }); string[] array3 = ConfigData._renegadeT2CDrop3.Value?.Split(new char[1] { ':' }); string[] array4 = ConfigData._renegadeT2CDrop4.Value?.Split(new char[1] { ':' }); List<Drop> drops = new List<Drop> { new Drop { m_prefab = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode(array[0])), m_amountMin = int.Parse(array[1]), m_amountMax = int.Parse(array[2]), m_chance = float.Parse(array[3]), m_onePerPlayer = bool.Parse(array[4]), m_levelMultiplier = bool.Parse(array[5]), m_dontScale = bool.Parse(array[6]) }, new Drop { m_prefab = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode(array2[0])), m_amountMin = int.Parse(array2[1]), m_amountMax = int.Parse(array2[2]), m_chance = float.Parse(array2[3]), m_onePerPlayer = bool.Parse(array2[4]), m_levelMultiplier = bool.Parse(array2[5]), m_dontScale = bool.Parse(array2[6]) }, new Drop { m_prefab = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode(array3[0])), m_amountMin = int.Parse(array3[1]), m_amountMax = int.Parse(array3[2]), m_chance = float.Parse(array3[3]), m_onePerPlayer = bool.Parse(array3[4]), m_levelMultiplier = bool.Parse(array3[5]), m_dontScale = bool.Parse(array3[6]) }, new Drop { m_prefab = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode(array4[0])), m_amountMin = int.Parse(array4[1]), m_amountMax = int.Parse(array4[2]), m_chance = float.Parse(array4[3]), m_onePerPlayer = bool.Parse(array4[4]), m_levelMultiplier = bool.Parse(array4[5]), m_dontScale = bool.Parse(array4[6]) } }; characterDrop.m_drops = drops; } } public static class RenegadeVikingT3 { public static void Init(ZNetScene zNetScene) { //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Expected O, but got Unknown GameObject val = zNetScene.GetPrefab("Player").Clone("BLV_RenegadeVikingT3"); val.transform.SetParent(Plugin._PrefabContainer.transform, false); val.RemoveComponent(typeof(PlayerController)); val.RemoveComponent(typeof(Player)); val.RemoveComponent(typeof(Talker)); val.RemoveComponent(typeof(Skills)); SetHumanoid(val.AddComponent<Humanoid>(), zNetScene); SetMonsterAI(val.AddComponent<MonsterAI>(), zNetScene); ZNetView component = val.GetComponent<ZNetView>(); component.m_persistent = true; component.m_distant = false; component.m_type = (ObjectType)0; component.m_syncInitialScale = false; ZSyncTransform component2 = val.GetComponent<ZSyncTransform>(); component2.m_syncPosition = true; component2.m_syncRotation = true; component2.m_syncScale = false; component2.m_syncBodyVelocity = false; component2.m_characterParentSync = false; val.GetComponent<ZSyncAnimation>().m_smoothCharacterSpeeds = true; val.AddComponent<RenegadeSetup>(); SetDropList(val.AddComponent<CharacterDrop>(), zNetScene); val.AddComponent<RandomAnimation>().m_values = new List<RandomValue>(1) { new RandomValue { m_name = "idle", m_values = 5, m_interval = 3f, m_floatValue = false, m_floatTransition = 1f } }; val.AddComponent<EquipmentAdjustment>(); zNetScene.AddClonedObject(val); } private static void SetHumanoid(Humanoid humanoid, ZNetScene zNetScene) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Expected O, but got Unknown //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Expected O, but got Unknown //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missin