Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of sunnfjordheimexp v1.0.6
sunnfjordheimexp.dll
Decompiled 2 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.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Serialization; using System.Runtime.Versioning; using System.Security; using System.Security.Cryptography; using System.Security.Permissions; using System.Text; using System.Text.RegularExpressions; using System.Threading; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using ItemManager; using JetBrains.Annotations; using LocalizationManager; using MagicaCloth2; using Microsoft.CodeAnalysis; using PieceManager; using ServerSync; using TMPro; using UnityEngine; 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: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("sunnfjordheimexp")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Zzyzxrd")] [assembly: AssemblyProduct("sunnfjordheimexp")] [assembly: AssemblyCopyright("Copyright © 2021")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("4358610B-F3F4-4843-B7AF-98B7BC60DCDE")] [assembly: AssemblyFileVersion("1.0.6")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.6.0")] [module: UnverifiableCode] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } } namespace sunnfjordheimexp { [BepInPlugin("Zzyzxrd.sunnfjordheimexp", "sunnfjordheimexp", "1.0.6")] public class sunnfjordheimexpPlugin : BaseUnityPlugin { public enum Toggle { On = 1, Off = 0 } private class ConfigurationManagerAttributes { [UsedImplicitly] public int? Order; [UsedImplicitly] public bool? Browsable; [UsedImplicitly] public string? Category; [UsedImplicitly] public Action<ConfigEntryBase>? CustomDrawer; } internal const string ModName = "sunnfjordheimexp"; internal const string ModVersion = "1.0.6"; internal const string Author = "Zzyzxrd"; private const string ModGUID = "Zzyzxrd.sunnfjordheimexp"; private static string ConfigFileName = "Zzyzxrd.sunnfjordheimexp.cfg"; private static string ConfigFileFullPath; internal static string ConnectionError; private readonly Harmony _harmony = new Harmony("Zzyzxrd.sunnfjordheimexp"); public static readonly ManualLogSource sunnfjordheimexpLogger; private static readonly ConfigSync ConfigSync; private static ConfigEntry<Toggle> _serverConfigLocked; private static ConfigEntry<Toggle> _recipeIsActiveConfig; public void Awake() { Localizer.Load(); _serverConfigLocked = config("1 - General", "Lock Configuration", Toggle.On, "If on, the configuration is locked and can be changed by server admins only."); ConfigSync.AddLockingConfigEntry<Toggle>(_serverConfigLocked); Item item = new Item("sunnfjordheimexp", "Sun_Garrasgogo"); item.Name.English("Gogo Claws"); item.Name.Spanish("Garras Gogo"); item.Description.English("Forged from silver drawn from the veins of the mountains and the remains of the Children of Fenring These claws do not merely cut flesh; they claim the primal spirit of the one who wields them."); item.Description.Spanish("Forjadas con la plata de las venas de la montaña y los restos de los Hijos de Fenring Estas garras no solo cortan la carne; reclaman el espíritu salvaje de aquel que las empuña."); item.Crafting.Add(CraftingTable.Forge, 2); item.RequiredItems.Add("Silver", 18); item.RequiredItems.Add("WolfClaw", 6); item.RequiredItems.Add("BoneFragments", 4); item.RequiredUpgradeItems.Add("Silver", 6); item.CraftAmount = 1; ConfigEntry<Toggle> recipeIsActive = config("Sun_Garrasgogo", "IsRecipeEnabled", Toggle.On, "Enable recipe for Garras Gogo"); item.RecipeIsActive = (ConfigEntryBase?)(object)recipeIsActive; Item item2 = new Item("sunnfjordheimexp", "SUN_CAPAMANDOCABALLERO"); item2.Name.English("Mandalorian Knight Cloak"); item2.Description.English("A heavy ceremonial cloak worn by Mandalorian knight-warriors."); item2.Name.Spanish("Capa de Caballero Mandaloriano"); item2.Description.Spanish("Una capa ceremonial pesada usada por los caballeros mandalorianos."); item2.CraftAmount = 1; _recipeIsActiveConfig = config("SUN_CAPAMANDOCABALLERO", "IsRecipeEnabled", Toggle.On, "Determines if the recipe is enabled for this prefab"); item2.RecipeIsActive = (ConfigEntryBase?)(object)_recipeIsActiveConfig; Item item3 = new Item("sunnfjordheimexp", "SUN_MANDOCABALLEROCHEST"); item3.Name.English("Golden Chestplate of the Mandalorian Knight"); item3.Description.English("A ceremonial golden chestplate worn by noble Mandalorian knights, symbol of rank and honor."); item3.Name.Spanish("Peto Dorado del Caballero Mandaloriano"); item3.Description.Spanish("Un peto dorado ceremonial usado por nobles caballeros mandalorianos, símbolo de rango y honor."); item3.CraftAmount = 1; _recipeIsActiveConfig = config("SUN_MANDOCABALLEROCHEST", "IsRecipeEnabled", Toggle.On, "Determines if the recipe is enabled for this prefab"); item3.RecipeIsActive = (ConfigEntryBase?)(object)_recipeIsActiveConfig; Item item4 = new Item("sunnfjordheimexp", "SUN_MANDOCABALLEROCHESTA"); item4.Name.English("Crystal Chestplate of the Mandalorian Knight"); item4.Description.English("A chestplate forged from reinforced crystal, shimmering with elegant clarity."); item4.Name.Spanish("Peto de Cristal del Caballero Mandaloriano"); item4.Description.Spanish("Un peto forjado en cristal reforzado, brillante y elegante."); item4.CraftAmount = 1; _recipeIsActiveConfig = config("SUN_MANDOCABALLEROCHESTA", "IsRecipeEnabled", Toggle.On, "Determines if the recipe is enabled for this prefab"); item4.RecipeIsActive = (ConfigEntryBase?)(object)_recipeIsActiveConfig; Item item5 = new Item("sunnfjordheimexp", "SUN_MANDOCABALLEROCHESTC"); item5.Name.English("Copper Chestplate of the Mandalorian Knight"); item5.Description.English("A chestplate reinforced with tempered copper, durable and reliable in battle."); item5.Name.Spanish("Peto de Cobre del Caballero Mandaloriano"); item5.Description.Spanish("Un peto reforzado con cobre templado, resistente y confiable en combate."); item5.CraftAmount = 1; _recipeIsActiveConfig = config("SUN_MANDOCABALLEROCHESTC", "IsRecipeEnabled", Toggle.On, "Determines if the recipe is enabled for this prefab"); item5.RecipeIsActive = (ConfigEntryBase?)(object)_recipeIsActiveConfig; Item item6 = new Item("sunnfjordheimexp", "SUN_MANDOCABALLEROCHESTP"); item6.Name.English("Silver Chestplate of the Mandalorian Knight"); item6.Description.English("A polished silver chestplate worn by ceremonial honor guards."); item6.Name.Spanish("Peto de Plata del Caballero Mandaloriano"); item6.Description.Spanish("Un peto de plata pulida usado por guardias ceremoniales mandalorianos."); item6.CraftAmount = 1; _recipeIsActiveConfig = config("SUN_MANDOCABALLEROCHESTP", "IsRecipeEnabled", Toggle.On, "Determines if the recipe is enabled for this prefab"); item6.RecipeIsActive = (ConfigEntryBase?)(object)_recipeIsActiveConfig; Item item7 = new Item("sunnfjordheimexp", "SUN_MANDOCABALLEROCHESTV"); item7.Name.English("Black Metal Chestplate of the Mandalorian Knight"); item7.Description.English("A brutal black metal chestplate favored by seasoned warriors."); item7.Name.Spanish("Peto de Metal Negro del Caballero Mandaloriano"); item7.Description.Spanish("Un peto de metal negro, brutal y usado por guerreros experimentados."); item7.CraftAmount = 1; _recipeIsActiveConfig = config("SUN_MANDOCABALLEROCHESTV", "IsRecipeEnabled", Toggle.On, "Determines if the recipe is enabled for this prefab"); item7.RecipeIsActive = (ConfigEntryBase?)(object)_recipeIsActiveConfig; Item item8 = new Item("sunnfjordheimexp", "SUN_MANDOCABALLEROHELMET"); item8.Name.English("Golden Helmet of the Mandalorian Knight"); item8.Description.English("A ceremonial golden helmet symbolizing rank, honor, and Mandalorian tradition."); item8.Name.Spanish("Casco Dorado del Caballero Mandaloriano"); item8.Description.Spanish("Un casco dorado ceremonial que simboliza rango, honor y la tradición mandaloriana."); item8.CraftAmount = 1; _recipeIsActiveConfig = config("SUN_MANDOCABALLEROHELMET", "IsRecipeEnabled", Toggle.On, "Determines if the recipe is enabled for this prefab"); item8.RecipeIsActive = (ConfigEntryBase?)(object)_recipeIsActiveConfig; Item item9 = new Item("sunnfjordheimexp", "SUN_MANDOCABALLEROHELMETA"); item9.Name.English("Crystal Helmet of the Mandalorian Knight"); item9.Description.English("A shining helmet crafted from reinforced crystal."); item9.Name.Spanish("Casco de Cristal del Caballero Mandaloriano"); item9.Description.Spanish("Un casco brillante hecho de cristal reforzado."); item9.CraftAmount = 1; _recipeIsActiveConfig = config("SUN_MANDOCABALLEROHELMETA", "IsRecipeEnabled", Toggle.On, "Determines if the recipe is enabled for this prefab"); item9.RecipeIsActive = (ConfigEntryBase?)(object)_recipeIsActiveConfig; Item item10 = new Item("sunnfjordheimexp", "SUN_MANDOCABALLEROHELMETC"); item10.Name.English("Copper Helmet of the Mandalorian Knight"); item10.Description.English("A durable helmet reinforced with tempered copper."); item10.Name.Spanish("Casco de Cobre del Caballero Mandaloriano"); item10.Description.Spanish("Un casco resistente reforzado con cobre templado."); item10.CraftAmount = 1; _recipeIsActiveConfig = config("SUN_MANDOCABALLEROHELMETC", "IsRecipeEnabled", Toggle.On, "Determines if the recipe is enabled for this prefab"); item10.RecipeIsActive = (ConfigEntryBase?)(object)_recipeIsActiveConfig; Item item11 = new Item("sunnfjordheimexp", "SUN_MANDOCABALLEROHELMETP"); item11.Name.English("Silver Helmet of the Mandalorian Knight"); item11.Description.English("A polished silver helmet worn by ceremonial guards."); item11.Name.Spanish("Casco de Plata del Caballero Mandaloriano"); item11.Description.Spanish("Un casco de plata pulida usado por guardias ceremoniales."); item11.CraftAmount = 1; _recipeIsActiveConfig = config("SUN_MANDOCABALLEROHELMETP", "IsRecipeEnabled", Toggle.On, "Determines if the recipe is enabled for this prefab"); item11.RecipeIsActive = (ConfigEntryBase?)(object)_recipeIsActiveConfig; Item item12 = new Item("sunnfjordheimexp", "SUN_MANDOCABALLEROHELMETSHERK"); item12.Name.English("Black Metal Helmet of the Mandalorian Sherk"); item12.Description.English("A brutal black metal helmet worn by the Sherk warriors of the Mandalorian order."); item12.Name.Spanish("Casco de Metal Negro del Mandaloriano Sherk"); item12.Description.Spanish("Un casco brutal de metal negro usado por los guerreros Sherk de la orden Mandaloriana."); item12.CraftAmount = 1; _recipeIsActiveConfig = config("SUN_MANDOCABALLEROHELMETSHERK", "IsRecipeEnabled", Toggle.On, "Determines if the recipe is enabled for this prefab"); item12.RecipeIsActive = (ConfigEntryBase?)(object)_recipeIsActiveConfig; Item item13 = new Item("sunnfjordheimexp", "SUN_MANDOCABALLEROHELMETV"); item13.Name.English("Black Metal Helmet of the Mandalorian Knight"); item13.Description.English("A menacing helmet forged from hardened black metal."); item13.Name.Spanish("Casco de Metal Negro del Caballero Mandaloriano"); item13.Description.Spanish("Un casco imponente forjado en metal negro endurecido."); item13.CraftAmount = 1; _recipeIsActiveConfig = config("SUN_MANDOCABALLEROHELMETV", "IsRecipeEnabled", Toggle.On, "Determines if the recipe is enabled for this prefab"); item13.RecipeIsActive = (ConfigEntryBase?)(object)_recipeIsActiveConfig; Item item14 = new Item("sunnfjordheimexp", "SUN_MANDOCABALLEROLEGS"); item14.Name.English("Golden Greaves of the Mandalorian Knight"); item14.Description.English("Ceremonial golden greaves worn by noble Mandalorian knights."); item14.Name.Spanish("Grebas Doradas del Caballero Mandaloriano"); item14.Description.Spanish("Grebas doradas ceremoniales usadas por los nobles caballeros mandalorianos."); item14.CraftAmount = 1; _recipeIsActiveConfig = config("SUN_MANDOCABALLEROLEGS", "IsRecipeEnabled", Toggle.On, "Determines if the recipe is enabled for this prefab"); item14.RecipeIsActive = (ConfigEntryBase?)(object)_recipeIsActiveConfig; Item item15 = new Item("sunnfjordheimexp", "SUN_MANDOCABALLEROLEGSA"); item15.Name.English("Crystal Greaves of the Mandalorian Knight"); item15.Description.English("Greaves forged from reinforced crystal, shimmering with refined elegance."); item15.Name.Spanish("Grebas de Cristal del Caballero Mandaloriano"); item15.Description.Spanish("Grebas forjadas en cristal reforzado, brillando con una elegancia refinada."); item15.CraftAmount = 1; _recipeIsActiveConfig = config("SUN_MANDOCABALLEROLEGSA", "IsRecipeEnabled", Toggle.On, "Determines if the recipe is enabled for this prefab"); item15.RecipeIsActive = (ConfigEntryBase?)(object)_recipeIsActiveConfig; Item item16 = new Item("sunnfjordheimexp", "SUN_MANDOCABALLEROLEGSP"); item16.Name.English("Silver Greaves of the Mandalorian Knight"); item16.Description.English("Polished silver greaves worn by ceremonial Mandalorian honor guards."); item16.Name.Spanish("Grebas de Plata del Caballero Mandaloriano"); item16.Description.Spanish("Grebas de plata pulida usadas por los guardias ceremoniales mandalorianos."); item16.CraftAmount = 1; _recipeIsActiveConfig = config("SUN_MANDOCABALLEROLEGSP", "IsRecipeEnabled", Toggle.On, "Determines if the recipe is enabled for this prefab"); item16.RecipeIsActive = (ConfigEntryBase?)(object)_recipeIsActiveConfig; Item item17 = new Item("sunnfjordheimexp", "SUN_MANDOCABALLEROLEGSV"); item17.Name.English("Black Metal Greaves of the Mandalorian Knight"); item17.Description.English("Greaves forged from hardened black metal, built for harsh battle conditions."); item17.Name.Spanish("Grebas de Metal Negro del Caballero Mandaloriano"); item17.Description.Spanish("Grebas forjadas en metal negro endurecido, hechas para las condiciones más duras del combate."); item17.CraftAmount = 1; _recipeIsActiveConfig = config("SUN_MANDOCABALLEROLEGSV", "IsRecipeEnabled", Toggle.On, "Determines if the recipe is enabled for this prefab"); item17.RecipeIsActive = (ConfigEntryBase?)(object)_recipeIsActiveConfig; Item item18 = new Item("sunnfjordheimexp", "SUN_MANDOCABALLEROLEGSC"); item18.Name.English("Copper Greaves of the Mandalorian Knight"); item18.Description.English("Greaves reinforced with tempered copper, balanced between protection and mobility."); item18.Name.Spanish("Grebas de Cobre del Caballero Mandaloriano"); item18.Description.Spanish("Grebas reforzadas con cobre templado, equilibradas entre protección y movilidad."); item18.CraftAmount = 1; _recipeIsActiveConfig = config("SUN_MANDOCABALLEROLEGSC", "IsRecipeEnabled", Toggle.On, "Determines if the recipe is enabled for this prefab"); item18.RecipeIsActive = (ConfigEntryBase?)(object)_recipeIsActiveConfig; Item item19 = new Item("sunnfjordheimexp", "TRI_SkullShamanLegs"); item19.Name.English("Bonebound Greaves of the Skull Shaman"); item19.Description.English("Greaves wrapped in bones, fetishes, and dark hides, allowing the Skull Shaman to stride through ritual battlefields."); item19.Name.Spanish("Grebas de Huesos del Chamán Calavera"); item19.Description.Spanish("Grebas envueltas en huesos, fetiches y pieles oscuras, que permiten al Chamán Calavera avanzar por campos de batalla rituales."); item19.CraftAmount = 1; _recipeIsActiveConfig = config("TRI_SkullShamanLegs", "IsRecipeEnabled", Toggle.On, "Enables crafting for this item."); item19.RecipeIsActive = (ConfigEntryBase?)(object)_recipeIsActiveConfig; MaterialReplacer.RegisterGameObjectForShaderSwap(item19.Prefab, MaterialReplacer.ShaderType.UseUnityShader); Item item20 = new Item("sunnfjordheimexp", "TRI_SkullShamanChest"); item20.Name.English("Boneweaver Chest of the Skull Shaman"); item20.Description.English("A ritual chestpiece woven with bones, channeling ancient shamanic power."); item20.Name.Spanish("Peto Tejedor de Huesos del Chamán Calavera"); item20.Description.Spanish("Un peto ritual tejido con huesos, canalizando antiguo poder chamánico."); item20.CraftAmount = 1; _recipeIsActiveConfig = config("TRI_SkullShamanChest", "IsRecipeEnabled", Toggle.On, "Enables crafting for this item."); item20.RecipeIsActive = (ConfigEntryBase?)(object)_recipeIsActiveConfig; MaterialReplacer.RegisterGameObjectForShaderSwap(item20.Prefab, MaterialReplacer.ShaderType.UseUnityShader); Item item21 = new Item("sunnfjordheimexp", "TRI_SkullShamanHelm"); item21.Name.English("Skullmask Helm of the Shaman"); item21.Description.English("A terrifying skull helm worn by those who commune with spirits and the dead."); item21.Name.Spanish("Yelmo de Máscara Ósea del Chamán"); item21.Description.Spanish("Un yelmo de calavera aterrador usado por quienes se comunican con espíritus y los muertos."); item21.CraftAmount = 1; _recipeIsActiveConfig = config("TRI_SkullShamanHelm", "IsRecipeEnabled", Toggle.On, "Enables crafting for this item."); item21.RecipeIsActive = (ConfigEntryBase?)(object)_recipeIsActiveConfig; MaterialReplacer.RegisterGameObjectForShaderSwap(item21.Prefab, MaterialReplacer.ShaderType.UseUnityShader); Item item22 = new Item("sunnfjordheimexp", "TRI_Rexchest"); item22.Name.English("Direbeast Chest of the Rex"); item22.Description.English("A savage chestpiece fashioned from the hide and fangs of the Direbeast. Its presence alone asserts dominance over the wilds."); item22.Name.Spanish("Peto de Bestia Aullante del Rex"); item22.Description.Spanish("Un peto salvaje hecho de piel y colmillos de la Bestia Aullante. Su sola presencia impone dominio sobre las tierras salvajes."); item22.CraftAmount = 1; _recipeIsActiveConfig = config("TRI_Rexchest", "IsRecipeEnabled", Toggle.On, "Enables crafting for this item."); item22.RecipeIsActive = (ConfigEntryBase?)(object)_recipeIsActiveConfig; Item item23 = new Item("sunnfjordheimexp", "TRI_Rexhelmet"); item23.Name.English("Direbeast Helm of the Rex"); item23.Description.English("A terrifying helm shaped like the snarling head of the Direbeast, worn only by apex hunters of the Rex tribe."); item23.Name.Spanish("Yelmo de Bestia Aullante del Rex"); item23.Description.Spanish("Un yelmo aterrador con la forma de la cabeza enfurecida de la Bestia Aullante, usado solo por los cazadores supremos del clan Rex."); item23.CraftAmount = 1; _recipeIsActiveConfig = config("TRI_Rexhelmet", "IsRecipeEnabled", Toggle.On, "Enables crafting for this item."); item23.RecipeIsActive = (ConfigEntryBase?)(object)_recipeIsActiveConfig; Item item24 = new Item("sunnfjordheimexp", "TRI_Rexlegs"); item24.Name.English("Direbeast Greaves of the Rex"); item24.Description.English("Greaves reinforced with bone plates and dark fur, crafted to enhance the brutal agility of Rex warriors."); item24.Name.Spanish("Grebas de Bestia Aullante del Rex"); item24.Description.Spanish("Grebas reforzadas con placas óseas y pelaje oscuro, hechas para potenciar la agilidad brutal de los guerreros Rex."); item24.CraftAmount = 1; _recipeIsActiveConfig = config("TRI_Rexlegs", "IsRecipeEnabled", Toggle.On, "Enables crafting for this item."); item24.RecipeIsActive = (ConfigEntryBase?)(object)_recipeIsActiveConfig; Item item25 = new Item("sunnfjordheimexp", "TRI_DruidatribalCape"); item25.Name.English("Feathered Cloak of the Tribal Druid"); item25.Description.English("A cloak adorned with ritual feathers and wild furs, worn by druids who walk in harmony with the untamed world."); item25.Name.Spanish("Capa Plumeada del Druida Tribal"); item25.Description.Spanish("Una capa adornada con plumas rituales y pieles salvajes, usada por druidas que caminan en armonía con el mundo indómito."); item25.CraftAmount = 1; _recipeIsActiveConfig = config("TRI_DruidatribalCape", "IsRecipeEnabled", Toggle.On, "Enables crafting for this item."); item25.RecipeIsActive = (ConfigEntryBase?)(object)_recipeIsActiveConfig; Item item26 = new Item("sunnfjordheimexp", "TRI_DruidatribalChest"); item26.Name.English("Wildheart Chest of the Tribal Druid"); item26.Description.English("A chestpiece crafted from layered leather, bones, and ceremonial feathers, channeling the strength of the living forest."); item26.Name.Spanish("Peto del Corazón Salvaje del Druida Tribal"); item26.Description.Spanish("Un peto hecho de cuero trenzado, huesos y plumas ceremoniales, que canaliza la fuerza del bosque viviente."); item26.CraftAmount = 1; _recipeIsActiveConfig = config("TRI_DruidatribalChest", "IsRecipeEnabled", Toggle.On, "Enables crafting for this item."); item26.RecipeIsActive = (ConfigEntryBase?)(object)_recipeIsActiveConfig; Item item27 = new Item("sunnfjordheimexp", "TRI_Druidatribalhelmet"); item27.Name.English("Antler Crown of the Tribal Druid"); item27.Description.English("A ceremonial helm crowned with carved antlers, symbolizing unity between druid and spirit-beast."); item27.Name.Spanish("Corona de Astas del Druida Tribal"); item27.Description.Spanish("Un yelmo ceremonial coronado con astas talladas, símbolo de la unión entre el druida y el espíritu bestial."); item27.CraftAmount = 1; _recipeIsActiveConfig = config("TRI_Druidatribalhelmet", "IsRecipeEnabled", Toggle.On, "Enables crafting for this item."); item27.RecipeIsActive = (ConfigEntryBase?)(object)_recipeIsActiveConfig; Item item28 = new Item("sunnfjordheimexp", "TRI_Druidatriballegs"); item28.Name.English("Wildstride Greaves of the Tribal Druid"); item28.Description.English("Light, flexible greaves made for silent travel through dense forests and sacred groves."); item28.Name.Spanish("Grebas de Zancada Salvaje del Druida Tribal"); item28.Description.Spanish("Grebas ligeras y flexibles hechas para desplazarse en silencio por bosques densos y arboledas sagradas."); item28.CraftAmount = 1; _recipeIsActiveConfig = config("TRI_Druidatriballegs", "IsRecipeEnabled", Toggle.On, "Enables crafting for this item."); item28.RecipeIsActive = (ConfigEntryBase?)(object)_recipeIsActiveConfig; Item item29 = new Item("sunnfjordheimexp", "SUN_BeskarDagger"); item29.Name.English("Beskar Dagger"); item29.Description.English("A dagger forged from pure Beskar, light yet indestructible."); item29.Name.Spanish("Daga de Beskar"); item29.Description.Spanish("Una daga forjada en puro Beskar, liviana pero indestructible."); item29.Crafting.Add(CraftingTable.Forge, 4); item29.RequiredItems.Add("BlackMetal", 10); item29.RequiredItems.Add("LinenThread", 5); item29.RequiredItems.Add("FineWood", 2); item29.RequiredUpgradeItems.Add("BlackMetal", 5); item29.RequiredUpgradeItems.Add("LinenThread", 3); item29.CraftAmount = 1; item29.Snapshot(); _recipeIsActiveConfig = config("SUN_BeskarDagger", "IsRecipeEnabled", Toggle.On, "Enables crafting for this item."); item29.RecipeIsActive = (ConfigEntryBase?)(object)_recipeIsActiveConfig; Item item30 = new Item("sunnfjordheimexp", "SUN_BeskarDagger2H"); item30.Name.English("Beskar Great Dagger"); item30.Description.English("A massive Beskar blade, wielded with both hands. Nearly unbreakable."); item30.Name.Spanish("Gran Daga de Beskar"); item30.Description.Spanish("Una enorme hoja de Beskar, empuñada con ambas manos. Prácticamente irrompible."); item30.Crafting.Add(CraftingTable.Forge, 4); item30.RequiredItems.Add("BlackMetal", 20); item30.RequiredItems.Add("LinenThread", 8); item30.RequiredItems.Add("FineWood", 5); item30.RequiredUpgradeItems.Add("BlackMetal", 10); item30.RequiredUpgradeItems.Add("LinenThread", 5); item30.CraftAmount = 1; _recipeIsActiveConfig = config("SUN_BeskarDagger2H", "IsRecipeEnabled", Toggle.On, "Enables crafting for this item."); item30.RecipeIsActive = (ConfigEntryBase?)(object)_recipeIsActiveConfig; Item item31 = new Item("sunnfjordheimexp", "SUN_beskarSWORD"); item31.Name.English("Beskar Sword"); item31.Description.English("A sword forged from pure Beskar alloy, empowered with Mistlands eitr."); item31.Name.Spanish("Espada de Beskar"); item31.Description.Spanish("Una espada forjada en aleación de Beskar, potenciada con eitr de las Tierras Neblinosas."); item31.Crafting.Add(CraftingTable.BlackForge, 1); item31.RequiredItems.Add("BlackMetal", 10); item31.RequiredItems.Add("Eitr", 5); item31.RequiredItems.Add("Mandible", 3); item31.RequiredUpgradeItems.Add("Mandible", 5); item31.RequiredUpgradeItems.Add("Eitr", 2); item31.CraftAmount = 1; item31.Snapshot(); _recipeIsActiveConfig = config("SUN_beskarSWORD", "IsRecipeEnabled", Toggle.On, "Enables crafting for this item."); item31.RecipeIsActive = (ConfigEntryBase?)(object)_recipeIsActiveConfig; Item item32 = new Item("sunnfjordheimexp", "SUN_beskarSWORD1"); item32.Name.English("Beskar Eitrblade"); item32.Description.English("An enhanced Beskar blade infused with concentrated eitr, humming with arcane power."); item32.Name.Spanish("Hoja de Beskar Eitr"); item32.Description.Spanish("Una hoja de Beskar mejorada, infundida con eitr concentrado y cargada de poder arcano."); item32.Crafting.Add(CraftingTable.BlackForge, 1); item32.RequiredItems.Add("BlackMetal", 10); item32.RequiredItems.Add("Eitr", 5); item32.RequiredItems.Add("Mandible", 3); item32.RequiredUpgradeItems.Add("Mandible", 5); item32.RequiredUpgradeItems.Add("Eitr", 2); item32.CraftAmount = 1; _recipeIsActiveConfig = config("SUN_beskarSWORD1", "IsRecipeEnabled", Toggle.On, "Enables crafting for this item."); item32.RecipeIsActive = (ConfigEntryBase?)(object)_recipeIsActiveConfig; item32.Snapshot(); Item item33 = new Item("sunnfjordheimexp", "Sun_Daedrifist"); item33.Name.English("Daedri Fist"); item33.Description.English("A brutal Ashlands weapon forged in daedric fire, radiating raw destructive force."); item33.Name.Spanish("Puño Daedri"); item33.Description.Spanish("Un arma brutal de Ashlands forjada en fuego daédrico, que irradia una fuerza destructiva pura."); item33.Crafting.Add(CraftingTable.BlackForge, 1); item33.RequiredItems.Add("FlametalNew", 12); item33.RequiredItems.Add("Eitr", 8); item33.RequiredItems.Add("CharredBone", 5); item33.RequiredUpgradeItems.Add("FlametalNew", 6); item33.RequiredUpgradeItems.Add("Eitr", 4); item33.RequiredUpgradeItems.Add("CharredBone", 3); item33.CraftAmount = 1; _recipeIsActiveConfig = config("Sun_Daedrifist", "IsRecipeEnabled", Toggle.On, "Enables crafting for this item."); item33.RecipeIsActive = (ConfigEntryBase?)(object)_recipeIsActiveConfig; Item item34 = new Item("sunnfjordheimexp", "TRI_AtgeirAshlandsSoulreaver"); item34.Name.English("Soulreaver Atgeir"); item34.Description.English("Forged from the shattered remains of a soul-devouring blade, this atgeir was reforged in Ashlands. It whispers of fallen kings, broken oaths, and the countless souls it once claimed."); item34.Name.Spanish("Atgeir Devora almas"); item34.Description.Spanish("Forjado a partir de los restos destrozados de una hoja devoradora de almas, este atgeir fue reforjado en Ashlands. Susurra sobre reyes caídos, juramentos rotos y las innumerables almas que reclamó."); item34.Crafting.Add(CraftingTable.BlackForge, 1); item34.RequiredItems.Add("FlametalNew", 16); item34.RequiredItems.Add("Eitr", 10); item34.RequiredItems.Add("CharredBone", 8); item34.RequiredUpgradeItems.Add("FlametalNew", 8); item34.RequiredUpgradeItems.Add("Eitr", 5); item34.RequiredUpgradeItems.Add("CharredBone", 5); item34.CraftAmount = 1; item34.Snapshot(); _recipeIsActiveConfig = config("TRI_AtgeirAshlandsSoulreaver", "IsRecipeEnabled", Toggle.On, "Enables crafting for this item."); item34.RecipeIsActive = (ConfigEntryBase?)(object)_recipeIsActiveConfig; Item item35 = new Item("medievaleras", "VKE_Vikingmontainchest"); item35.Name.English("Mountain Viking Chest"); item35.Name.Spanish("Pechera Vikinga de Montaña"); item35.Description.English("A heavy chestpiece forged to withstand the frozen winds of the mountains."); item35.Description.Spanish("Una pechera pesada forjada para resistir los vientos helados de la montaña."); item35.Crafting.Add(CraftingTable.Forge, 2); item35.RequiredItems.Add("Silver", 26); item35.RequiredItems.Add("WolfPelt", 6); item35.RequiredUpgradeItems.Add("Silver", 8); item35.CraftAmount = 1; SharedData shared = item35.Prefab.GetComponent<ItemDrop>().m_itemData.m_shared; shared.m_armor = 20f; shared.m_armorPerLevel = 4f; shared.m_weight = 6f; shared.m_maxQuality = 4; shared.m_maxDurability = 1400f; shared.m_durabilityPerLevel = 260f; ConfigEntry<Toggle> recipeIsActive2 = config("VKE_Vikingmontainchest", "IsRecipeEnabled", Toggle.On, "Enable recipe for Mountain Viking Chest"); item35.RecipeIsActive = (ConfigEntryBase?)(object)recipeIsActive2; MaterialReplacer.RegisterGameObjectForShaderSwap(item35.Prefab, MaterialReplacer.ShaderType.UseUnityShader); Item item36 = new Item("medievaleras", "VKE_Vikingmontainhelmet"); item36.Name.English("Mountain Viking Helmet"); item36.Name.Spanish("Casco Vikingo de Montaña"); item36.Description.English("A sturdy helmet crafted for warriors of the frozen peaks."); item36.Description.Spanish("Un casco resistente forjado para los guerreros de las cumbres heladas."); item36.Crafting.Add(CraftingTable.Forge, 2); item36.RequiredItems.Add("Silver", 18); item36.RequiredItems.Add("WolfPelt", 4); item36.RequiredUpgradeItems.Add("Silver", 6); item36.CraftAmount = 1; SharedData shared2 = item36.Prefab.GetComponent<ItemDrop>().m_itemData.m_shared; shared2.m_armor = 14f; shared2.m_armorPerLevel = 3f; shared2.m_weight = 3f; shared2.m_maxQuality = 4; shared2.m_maxDurability = 1100f; shared2.m_durabilityPerLevel = 200f; ConfigEntry<Toggle> recipeIsActive3 = config("VKE_Vikingmontainhelmet", "IsRecipeEnabled", Toggle.On, "Enable recipe for Mountain Viking Helmet"); item36.RecipeIsActive = (ConfigEntryBase?)(object)recipeIsActive3; MaterialReplacer.RegisterGameObjectForShaderSwap(item36.Prefab, MaterialReplacer.ShaderType.UseUnityShader); Item item37 = new Item("medievaleras", "VKE_Vikingmontainlegs"); item37.Name.English("Mountain Viking Legs"); item37.Name.Spanish("Grebas Vikingas de Montaña"); item37.Description.English("Heavy leggings designed for harsh mountain climates."); item37.Description.Spanish("Grebas pesadas diseñadas para los climas montañosos más hostiles."); item37.Crafting.Add(CraftingTable.Forge, 2); item37.RequiredItems.Add("Silver", 22); item37.RequiredItems.Add("WolfPelt", 5); item37.RequiredUpgradeItems.Add("Silver", 7); item37.CraftAmount = 1; SharedData shared3 = item37.Prefab.GetComponent<ItemDrop>().m_itemData.m_shared; shared3.m_armor = 16f; shared3.m_armorPerLevel = 3f; shared3.m_weight = 5f; shared3.m_maxQuality = 4; shared3.m_maxDurability = 1300f; shared3.m_durabilityPerLevel = 230f; ConfigEntry<Toggle> recipeIsActive4 = config("VKE_Vikingmontainlegs", "IsRecipeEnabled", Toggle.On, "Enable recipe for Mountain Viking Legs"); item37.RecipeIsActive = (ConfigEntryBase?)(object)recipeIsActive4; MaterialReplacer.RegisterGameObjectForShaderSwap(item37.Prefab, MaterialReplacer.ShaderType.UseUnityShader); Item item38 = new Item("medievaleras", "VKE_Vikignmontaincape"); item38.Name.English("Mountain Viking Cape"); item38.Name.Spanish("Capa Vikinga de Montaña"); item38.Description.English("A thick fur-lined cape offering protection against icy winds."); item38.Description.Spanish("Una capa gruesa forrada en piel que protege de los vientos helados."); item38.Crafting.Add(CraftingTable.Workbench, 2); item38.RequiredItems.Add("WolfPelt", 10); item38.RequiredItems.Add("Silver", 8); item38.RequiredUpgradeItems.Add("WolfPelt", 5); item38.CraftAmount = 1; SharedData shared4 = item38.Prefab.GetComponent<ItemDrop>().m_itemData.m_shared; shared4.m_armor = 2f; shared4.m_armorPerLevel = 1f; shared4.m_weight = 2f; shared4.m_maxQuality = 4; shared4.m_maxDurability = 900f; shared4.m_durabilityPerLevel = 180f; ConfigEntry<Toggle> recipeIsActive5 = config("VKE_Vikignmontaincape", "IsRecipeEnabled", Toggle.On, "Enable recipe for Mountain Viking Cape"); item38.RecipeIsActive = (ConfigEntryBase?)(object)recipeIsActive5; MaterialReplacer.RegisterGameObjectForShaderSwap(item38.Prefab, MaterialReplacer.ShaderType.UseUnityShader); Item item39 = new Item("medievaleras", "VKE_Vikingbearchest"); item39.Name.English("Bear Viking Chest"); item39.Name.Spanish("Pechera Vikinga del Oso"); item39.Description.English("A heavy chestpiece made from bear hide, favored by the fiercest mountain warriors."); item39.Description.Spanish("Una pechera pesada hecha con piel de oso, usada por los guerreros más feroces de la montaña."); item39.Crafting.Add(CraftingTable.Forge, 2); item39.RequiredItems.Add("Silver", 28); item39.RequiredItems.Add("WolfPelt", 4); item39.RequiredItems.Add("LeatherScraps", 6); item39.RequiredUpgradeItems.Add("Silver", 9); item39.CraftAmount = 1; SharedData shared5 = item39.Prefab.GetComponent<ItemDrop>().m_itemData.m_shared; shared5.m_armor = 22f; shared5.m_armorPerLevel = 4f; shared5.m_weight = 7f; shared5.m_maxQuality = 4; shared5.m_maxDurability = 1500f; shared5.m_durabilityPerLevel = 280f; ConfigEntry<Toggle> recipeIsActive6 = config("VKE_Vikingbearchest", "IsRecipeEnabled", Toggle.On, "Enable recipe for Bear Viking Chest"); item39.RecipeIsActive = (ConfigEntryBase?)(object)recipeIsActive6; MaterialReplacer.RegisterGameObjectForShaderSwap(item39.Prefab, MaterialReplacer.ShaderType.UseUnityShader); Item item40 = new Item("medievaleras", "VKE_Vikingbearhelmet"); item40.Name.English("Bear Viking Helmet"); item40.Name.Spanish("Casco Vikingo del Oso"); item40.Description.English("A fearsome helmet adorned with bear motifs, symbol of raw strength."); item40.Description.Spanish("Un casco temible adornado con motivos de oso, símbolo de fuerza bruta."); item40.Crafting.Add(CraftingTable.Forge, 2); item40.RequiredItems.Add("Silver", 20); item40.RequiredItems.Add("LeatherScraps", 8); item40.RequiredUpgradeItems.Add("Silver", 7); item40.CraftAmount = 1; SharedData shared6 = item40.Prefab.GetComponent<ItemDrop>().m_itemData.m_shared; shared6.m_armor = 15f; shared6.m_armorPerLevel = 3f; shared6.m_weight = 3.5f; shared6.m_maxQuality = 4; shared6.m_maxDurability = 1150f; shared6.m_durabilityPerLevel = 210f; ConfigEntry<Toggle> recipeIsActive7 = config("VKE_Vikingbearhelmet", "IsRecipeEnabled", Toggle.On, "Enable recipe for Bear Viking Helmet"); item40.RecipeIsActive = (ConfigEntryBase?)(object)recipeIsActive7; MaterialReplacer.RegisterGameObjectForShaderSwap(item40.Prefab, MaterialReplacer.ShaderType.UseUnityShader); Item item41 = new Item("medievaleras", "VKE_Vikingbearlegs"); item41.Name.English("Bear Viking Legs"); item41.Name.Spanish("Grebas Vikingas del Oso"); item41.Description.English("Sturdy leg armor reinforced with thick bear hide."); item41.Description.Spanish("Grebas robustas reforzadas con gruesa piel de oso."); item41.Crafting.Add(CraftingTable.Forge, 2); item41.RequiredItems.Add("Silver", 24); item41.RequiredItems.Add("LeatherScraps", 10); item41.RequiredUpgradeItems.Add("Silver", 8); item41.CraftAmount = 1; SharedData shared7 = item41.Prefab.GetComponent<ItemDrop>().m_itemData.m_shared; shared7.m_armor = 17f; shared7.m_armorPerLevel = 3f; shared7.m_weight = 5.5f; shared7.m_maxQuality = 4; shared7.m_maxDurability = 1350f; shared7.m_durabilityPerLevel = 240f; ConfigEntry<Toggle> recipeIsActive8 = config("VKE_Vikingbearlegs", "IsRecipeEnabled", Toggle.On, "Enable recipe for Bear Viking Legs"); item41.RecipeIsActive = (ConfigEntryBase?)(object)recipeIsActive8; MaterialReplacer.RegisterGameObjectForShaderSwap(item41.Prefab, MaterialReplacer.ShaderType.UseUnityShader); Item item42 = new Item("medievaleras", "VKE_Vikignbearcape"); item42.Name.English("Bear Viking Cape"); item42.Name.Spanish("Capa Vikinga del Oso"); item42.Description.English("A massive bear-fur cape that radiates primal strength."); item42.Description.Spanish("Una enorme capa de piel de oso que irradia fuerza primitiva."); item42.Crafting.Add(CraftingTable.Workbench, 2); item42.RequiredItems.Add("WolfPelt", 6); item42.RequiredItems.Add("LeatherScraps", 12); item42.RequiredUpgradeItems.Add("WolfPelt", 4); item42.CraftAmount = 1; SharedData shared8 = item42.Prefab.GetComponent<ItemDrop>().m_itemData.m_shared; shared8.m_armor = 3f; shared8.m_armorPerLevel = 1f; shared8.m_weight = 2.5f; shared8.m_maxQuality = 4; shared8.m_maxDurability = 950f; shared8.m_durabilityPerLevel = 190f; ConfigEntry<Toggle> recipeIsActive9 = config("VKE_Vikignbearcape", "IsRecipeEnabled", Toggle.On, "Enable recipe for Bear Viking Cape"); item42.RecipeIsActive = (ConfigEntryBase?)(object)recipeIsActive9; MaterialReplacer.RegisterGameObjectForShaderSwap(item42.Prefab, MaterialReplacer.ShaderType.UseUnityShader); Item item43 = new Item("medievaleras", "VKE_Villagechest"); item43.Name.English("Village Chest"); item43.Name.Spanish("Pechera Aldeana"); item43.Description.English("A simple chestpiece worn by villagers and common folk."); item43.Description.Spanish("Una pechera sencilla usada por aldeanos y gente común."); item43.Crafting.Add(CraftingTable.Workbench, 2); item43.RequiredItems.Add("LeatherScraps", 10); item43.RequiredItems.Add("DeerHide", 6); item43.RequiredUpgradeItems.Add("LeatherScraps", 5); item43.CraftAmount = 1; SharedData shared9 = item43.Prefab.GetComponent<ItemDrop>().m_itemData.m_shared; shared9.m_armor = 8f; shared9.m_armorPerLevel = 2f; shared9.m_weight = 3.5f; shared9.m_maxQuality = 4; shared9.m_maxDurability = 900f; shared9.m_durabilityPerLevel = 180f; ConfigEntry<Toggle> recipeIsActive10 = config("VKE_Villagechest", "IsRecipeEnabled", Toggle.On, "Enable recipe for Village Chest"); item43.RecipeIsActive = (ConfigEntryBase?)(object)recipeIsActive10; MaterialReplacer.RegisterGameObjectForShaderSwap(item43.Prefab, MaterialReplacer.ShaderType.UseUnityShader); Item item44 = new Item("medievaleras", "VKE_Villagelegs"); item44.Name.English("Village Legs"); item44.Name.Spanish("Pantalones Aldeanos"); item44.Description.English("Simple legwear made for daily work in the village."); item44.Description.Spanish("Ropa sencilla para las piernas, hecha para el trabajo diario en la aldea."); item44.Crafting.Add(CraftingTable.Workbench, 2); item44.RequiredItems.Add("LeatherScraps", 8); item44.RequiredItems.Add("DeerHide", 4); item44.RequiredUpgradeItems.Add("LeatherScraps", 4); item44.CraftAmount = 1; SharedData shared10 = item44.Prefab.GetComponent<ItemDrop>().m_itemData.m_shared; shared10.m_armor = 6f; shared10.m_armorPerLevel = 2f; shared10.m_weight = 3f; shared10.m_maxQuality = 4; shared10.m_maxDurability = 850f; shared10.m_durabilityPerLevel = 160f; ConfigEntry<Toggle> recipeIsActive11 = config("VKE_Villagelegs", "IsRecipeEnabled", Toggle.On, "Enable recipe for Village Legs"); item44.RecipeIsActive = (ConfigEntryBase?)(object)recipeIsActive11; MaterialReplacer.RegisterGameObjectForShaderSwap(item44.Prefab, MaterialReplacer.ShaderType.UseUnityShader); Item item45 = new Item("medievaleras", "VKE_Vikingclanchest"); item45.Name.English("Viking Clan Chest"); item45.Name.Spanish("Pechera del Clan Vikingo"); item45.Description.English("A chestpiece bearing the marks and colors of a proud viking clan."); item45.Description.Spanish("Una pechera que porta las marcas y colores de un orgulloso clan vikingo."); item45.Crafting.Add(CraftingTable.Forge, 2); item45.RequiredItems.Add("Silver", 24); item45.RequiredItems.Add("WolfPelt", 5); item45.RequiredItems.Add("LeatherScraps", 6); item45.RequiredUpgradeItems.Add("Silver", 8); item45.CraftAmount = 1; SharedData shared11 = item45.Prefab.GetComponent<ItemDrop>().m_itemData.m_shared; shared11.m_armor = 18f; shared11.m_armorPerLevel = 3f; shared11.m_weight = 6f; shared11.m_maxQuality = 4; shared11.m_maxDurability = 1350f; shared11.m_durabilityPerLevel = 240f; ConfigEntry<Toggle> recipeIsActive12 = config("VKE_Vikingclanchest", "IsRecipeEnabled", Toggle.On, "Enable recipe for Viking Clan Chest"); item45.RecipeIsActive = (ConfigEntryBase?)(object)recipeIsActive12; MaterialReplacer.RegisterGameObjectForShaderSwap(item45.Prefab, MaterialReplacer.ShaderType.UseUnityShader); Item item46 = new Item("medievaleras", "VKE_Vikingclanhelmet"); item46.Name.English("Viking Clan Helmet"); item46.Name.Spanish("Casco del Clan Vikingo"); item46.Description.English("A helmet worn by seasoned warriors of the viking clans."); item46.Description.Spanish("Un casco usado por los guerreros experimentados de los clanes vikingos."); item46.Crafting.Add(CraftingTable.Forge, 2); item46.RequiredItems.Add("Silver", 18); item46.RequiredItems.Add("LeatherScraps", 8); item46.RequiredUpgradeItems.Add("Silver", 6); item46.CraftAmount = 1; SharedData shared12 = item46.Prefab.GetComponent<ItemDrop>().m_itemData.m_shared; shared12.m_armor = 14f; shared12.m_armorPerLevel = 3f; shared12.m_weight = 3.5f; shared12.m_maxQuality = 4; shared12.m_maxDurability = 1100f; shared12.m_durabilityPerLevel = 200f; ConfigEntry<Toggle> recipeIsActive13 = config("VKE_Vikingclanhelmet", "IsRecipeEnabled", Toggle.On, "Enable recipe for Viking Clan Helmet"); item46.RecipeIsActive = (ConfigEntryBase?)(object)recipeIsActive13; MaterialReplacer.RegisterGameObjectForShaderSwap(item46.Prefab, MaterialReplacer.ShaderType.UseUnityShader); Item item47 = new Item("medievaleras", "VKE_Vikingclanlegs"); item47.Name.English("Viking Clan Legs"); item47.Name.Spanish("Grebas del Clan Vikingo"); item47.Description.English("Leg armor crafted for long marches and clan warfare."); item47.Description.Spanish("Armadura para las piernas forjada para largas marchas y guerras de clan."); item47.Crafting.Add(CraftingTable.Forge, 2); item47.RequiredItems.Add("Silver", 22); item47.RequiredItems.Add("LeatherScraps", 10); item47.RequiredUpgradeItems.Add("Silver", 7); item47.CraftAmount = 1; SharedData shared13 = item47.Prefab.GetComponent<ItemDrop>().m_itemData.m_shared; shared13.m_armor = 16f; shared13.m_armorPerLevel = 3f; shared13.m_weight = 5.5f; shared13.m_maxQuality = 4; shared13.m_maxDurability = 1300f; shared13.m_durabilityPerLevel = 230f; ConfigEntry<Toggle> recipeIsActive14 = config("VKE_Vikingclanlegs", "IsRecipeEnabled", Toggle.On, "Enable recipe for Viking Clan Legs"); item47.RecipeIsActive = (ConfigEntryBase?)(object)recipeIsActive14; MaterialReplacer.RegisterGameObjectForShaderSwap(item47.Prefab, MaterialReplacer.ShaderType.UseUnityShader); Item item48 = new Item("medievaleras", "VKE_Vikignclancape"); item48.Name.English("Viking Clan Cape"); item48.Name.Spanish("Capa del Clan Vikingo"); item48.Description.English("A ceremonial cape representing loyalty to a viking clan."); item48.Description.Spanish("Una capa ceremonial que representa la lealtad a un clan vikingo."); item48.Crafting.Add(CraftingTable.Workbench, 2); item48.RequiredItems.Add("WolfPelt", 6); item48.RequiredItems.Add("LeatherScraps", 10); item48.RequiredUpgradeItems.Add("WolfPelt", 4); item48.CraftAmount = 1; SharedData shared14 = item48.Prefab.GetComponent<ItemDrop>().m_itemData.m_shared; shared14.m_armor = 3f; shared14.m_armorPerLevel = 1f; shared14.m_weight = 2.5f; shared14.m_maxQuality = 4; shared14.m_maxDurability = 950f; shared14.m_durabilityPerLevel = 190f; ConfigEntry<Toggle> recipeIsActive15 = config("VKE_Vikignclancape", "IsRecipeEnabled", Toggle.On, "Enable recipe for Viking Clan Cape"); item48.RecipeIsActive = (ConfigEntryBase?)(object)recipeIsActive15; MaterialReplacer.RegisterGameObjectForShaderSwap(item48.Prefab, MaterialReplacer.ShaderType.UseUnityShader); Item item49 = new Item("medievaleras", "VKE_VikingWolfHelmet"); item49.Name.English("Viking Wolf Helmet"); item49.Name.Spanish("Casco Vikingo del Lobo"); item49.Description.English("A fierce helmet crafted from wolf hide, worn by hunters of the frozen lands."); item49.Description.Spanish("Un casco feroz hecho con piel de lobo, usado por cazadores de las tierras heladas."); item49.Crafting.Add(CraftingTable.Forge, 2); item49.RequiredItems.Add("Silver", 20); item49.RequiredItems.Add("WolfPelt", 6); item49.RequiredUpgradeItems.Add("Silver", 6); item49.CraftAmount = 1; SharedData shared15 = item49.Prefab.GetComponent<ItemDrop>().m_itemData.m_shared; shared15.m_armor = 15f; shared15.m_armorPerLevel = 3f; shared15.m_weight = 3.5f; shared15.m_maxQuality = 4; shared15.m_maxDurability = 1150f; shared15.m_durabilityPerLevel = 210f; ConfigEntry<Toggle> recipeIsActive16 = config("VKE_VikingWolfHelmet", "IsRecipeEnabled", Toggle.On, "Enable recipe for Viking Wolf Helmet"); item49.RecipeIsActive = (ConfigEntryBase?)(object)recipeIsActive16; MaterialReplacer.RegisterGameObjectForShaderSwap(item49.Prefab, MaterialReplacer.ShaderType.UseUnityShader); Item item50 = new Item("medievaleras", "VKE_VikingWolfHelmetWhite"); item50.Name.English("White Viking Wolf Helmet"); item50.Name.Spanish("Casco Vikingo del Lobo Blanco"); item50.Description.English("A rare white wolf helmet symbolizing dominance and honor."); item50.Description.Spanish("Un raro casco de lobo blanco que simboliza dominio y honor."); item50.Crafting.Add(CraftingTable.Forge, 2); item50.RequiredItems.Add("Silver", 22); item50.RequiredItems.Add("WolfPelt", 6); item50.RequiredUpgradeItems.Add("Silver", 7); item50.CraftAmount = 1; SharedData shared16 = item50.Prefab.GetComponent<ItemDrop>().m_itemData.m_shared; shared16.m_armor = 16f; shared16.m_armorPerLevel = 3f; shared16.m_weight = 3.6f; shared16.m_maxQuality = 4; shared16.m_maxDurability = 1200f; shared16.m_durabilityPerLevel = 220f; ConfigEntry<Toggle> recipeIsActive17 = config("VKE_VikingWolfHelmetWhite", "IsRecipeEnabled", Toggle.On, "Enable recipe for White Viking Wolf Helmet"); item50.RecipeIsActive = (ConfigEntryBase?)(object)recipeIsActive17; MaterialReplacer.RegisterGameObjectForShaderSwap(item50.Prefab, MaterialReplacer.ShaderType.UseUnityShader); Item item51 = new Item("medievaleras", "VKE_VikingWolfChest"); item51.Name.English("Viking Lamellar Chest"); item51.Name.Spanish("Pechera Lamelar Vikinga"); item51.Description.English("Heavy lamellar armor forged from steel, leather, and silver."); item51.Description.Spanish("Armadura lamelar pesada forjada con acero, cuero y plata."); item51.Crafting.Add(CraftingTable.Forge, 2); item51.RequiredItems.Add("Silver", 20); item51.RequiredItems.Add("Iron", 10); item51.RequiredItems.Add("LinenThread", 10); item51.RequiredItems.Add("LeatherScraps", 6); item51.RequiredUpgradeItems.Add("Silver", 6); item51.CraftAmount = 1; SharedData shared17 = item51.Prefab.GetComponent<ItemDrop>().m_itemData.m_shared; shared17.m_armor = 22f; shared17.m_armorPerLevel = 3f; shared17.m_weight = 8f; shared17.m_maxQuality = 4; shared17.m_maxDurability = 1400f; shared17.m_durabilityPerLevel = 260f; shared17.m_movementModifier = -0.03f; MaterialReplacer.RegisterGameObjectForShaderSwap(item51.Prefab, MaterialReplacer.ShaderType.UseUnityShader); Item item52 = new Item("medievaleras", "VKE_VikignWolfcape"); item52.Name.English("Northern Fur Cape"); item52.Name.Spanish("Capa de Piel del Norte"); item52.Description.English("A heavy fur cape that protects its wearer from the northern cold."); item52.Description.Spanish("Una pesada capa de piel que protege a su portador del frío del norte."); item52.Crafting.Add(CraftingTable.Workbench, 4); item52.RequiredItems.Add("LeatherScraps", 10); item52.RequiredItems.Add("LoxPelt", 4); item52.RequiredItems.Add("LinenThread", 6); item52.RequiredItems.Add("Iron", 2); item52.RequiredUpgradeItems.Add("LeatherScraps", 4); item52.CraftAmount = 1; _recipeIsActiveConfig = config("VKE_VikignWolfcape", "IsRecipeEnabled", Toggle.On, "Determines if the recipe is enabled for this prefab"); item52.RecipeIsActive = (ConfigEntryBase?)(object)_recipeIsActiveConfig; SharedData shared18 = item52.Prefab.GetComponent<ItemDrop>().m_itemData.m_shared; shared18.m_armor = 1f; shared18.m_armorPerLevel = 0f; shared18.m_weight = 2.5f; shared18.m_maxQuality = 4; shared18.m_maxDurability = 1000f; shared18.m_durabilityPerLevel = 200f; MaterialReplacer.RegisterGameObjectForShaderSwap(item52.Prefab, MaterialReplacer.ShaderType.UseUnityShader); Item item53 = new Item("medievaleras", "VKE_VikingWolflegs"); item53.Name.English("Viking Lamellar Legs"); item53.Name.Spanish("Grebas Lamelar Vikingas"); item53.Description.English("Reinforced lamellar leggings designed for disciplined warriors."); item53.Description.Spanish("Grebas lamelares reforzadas diseñadas para guerreros disciplinados."); item53.Crafting.Add(CraftingTable.Forge, 2); item53.RequiredItems.Add("Iron", 10); item53.RequiredItems.Add("LinenThread", 10); item53.RequiredItems.Add("LeatherScraps", 6); item53.RequiredItems.Add("Silver", 6); item53.RequiredUpgradeItems.Add("Iron", 4); item53.CraftAmount = 1; _recipeIsActiveConfig = config("VKE_VikingWolflegs", "IsRecipeEnabled", Toggle.On, "Determines if the recipe is enabled for this prefab"); item53.RecipeIsActive = (ConfigEntryBase?)(object)_recipeIsActiveConfig; SharedData shared19 = item53.Prefab.GetComponent<ItemDrop>().m_itemData.m_shared; shared19.m_armor = 16f; shared19.m_armorPerLevel = 3f; shared19.m_weight = 5f; shared19.m_maxQuality = 4; shared19.m_maxDurability = 1200f; shared19.m_durabilityPerLevel = 220f; shared19.m_movementModifier = -0.01f; MaterialReplacer.RegisterGameObjectForShaderSwap(item53.Prefab, MaterialReplacer.ShaderType.UseUnityShader); Item item54 = new Item("medievaleras", "VKE_VikingShamanLegs"); item54.Name.English("Viking Shaman Legs"); item54.Name.Spanish("Grebas Chamán Vikingas"); item54.Description.English("Mystic leggings worn by Viking shamans, reinforced for harsh rituals."); item54.Description.Spanish("Grebas místicas usadas por chamanes vikingos, reforzadas para rituales duros."); item54.Crafting.Add(CraftingTable.Forge, 2); item54.RequiredItems.Add("Iron", 8); item54.RequiredItems.Add("LinenThread", 12); item54.RequiredItems.Add("LeatherScraps", 6); item54.RequiredItems.Add("Silver", 4); item54.RequiredUpgradeItems.Add("Iron", 3); item54.CraftAmount = 1; _recipeIsActiveConfig = config("VKE_VikingShamanLegs", "IsRecipeEnabled", Toggle.On, "Determines if the recipe is enabled for this prefab"); item54.RecipeIsActive = (ConfigEntryBase?)(object)_recipeIsActiveConfig; SharedData shared20 = item54.Prefab.GetComponent<ItemDrop>().m_itemData.m_shared; shared20.m_armor = 14f; shared20.m_armorPerLevel = 3f; shared20.m_weight = 4.5f; shared20.m_maxQuality = 4; shared20.m_maxDurability = 1100f; shared20.m_durabilityPerLevel = 200f; shared20.m_movementModifier = -0.01f; MaterialReplacer.RegisterGameObjectForShaderSwap(item54.Prefab, MaterialReplacer.ShaderType.UseUnityShader); Item item55 = new Item("medievaleras", "VKE_VikingShamanHelmet"); item55.Name.English("Viking Shaman Helmet"); item55.Name.Spanish("Casco Chamán Vikingo"); item55.Description.English("A ritual helm adorned for shamanic rites, offering sturdy protection."); item55.Description.Spanish("Yelmo ritual adornado para ritos chamánicos, ofrece protección resistente."); item55.Crafting.Add(CraftingTable.Forge, 2); item55.RequiredItems.Add("Iron", 10); item55.RequiredItems.Add("LinenThread", 8); item55.RequiredItems.Add("LeatherScraps", 4); item55.RequiredItems.Add("Silver", 6); item55.RequiredUpgradeItems.Add("Iron", 4); item55.CraftAmount = 1; _recipeIsActiveConfig = config("VKE_VikingShamanHelmet", "IsRecipeEnabled", Toggle.On, "Determines if the recipe is enabled for this prefab"); item55.RecipeIsActive = (ConfigEntryBase?)(object)_recipeIsActiveConfig; SharedData shared21 = item55.Prefab.GetComponent<ItemDrop>().m_itemData.m_shared; shared21.m_armor = 16f; shared21.m_armorPerLevel = 3f; shared21.m_weight = 3f; shared21.m_maxQuality = 4; shared21.m_maxDurability = 1200f; shared21.m_durabilityPerLevel = 220f; MaterialReplacer.RegisterGameObjectForShaderSwap(item55.Prefab, MaterialReplacer.ShaderType.UseUnityShader); Item item56 = new Item("medievaleras", "VKE_VikingShamanChest"); item56.Name.English("Viking Shaman Chest"); item56.Name.Spanish("Pechera Chamán Vikinga"); item56.Description.English("A ritual chestpiece worn by Viking shamans, infused with ancient protection."); item56.Description.Spanish("Pechera ritual usada por chamanes vikingos, imbuida con protección ancestral."); item56.Crafting.Add(CraftingTable.Forge, 2); item56.RequiredItems.Add("Iron", 12); item56.RequiredItems.Add("LinenThread", 14); item56.RequiredItems.Add("LeatherScraps", 8); item56.RequiredItems.Add("Silver", 6); item56.RequiredUpgradeItems.Add("Iron", 4); item56.CraftAmount = 1; _recipeIsActiveConfig = config("VKE_VikingShamanChest", "IsRecipeEnabled", Toggle.On, "Determines if the recipe is enabled for this prefab"); item56.RecipeIsActive = (ConfigEntryBase?)(object)_recipeIsActiveConfig; SharedData shared22 = item56.Prefab.GetComponent<ItemDrop>().m_itemData.m_shared; shared22.m_armor = 18f; shared22.m_armorPerLevel = 3f; shared22.m_weight = 6f; shared22.m_maxQuality = 4; shared22.m_maxDurability = 1300f; shared22.m_durabilityPerLevel = 240f; shared22.m_movementModifier = -0.02f; MaterialReplacer.RegisterGameObjectForShaderSwap(item56.Prefab, MaterialReplacer.ShaderType.UseUnityShader); Item item57 = new Item("medievaleras", "VKE_VikignshamanCape"); item57.Name.English("Viking Shaman Cape"); item57.Name.Spanish("Capa Chamán Vikinga"); item57.Description.English("A weathered ritual cape used by Viking shamans to endure the wilds."); item57.Description.Spanish("Capa ritual desgastada usada por chamanes vikingos para resistir la naturaleza."); item57.Crafting.Add(CraftingTable.Workbench, 2); item57.RequiredItems.Add("LinenThread", 10); item57.RequiredItems.Add("LeatherScraps", 6); item57.RequiredItems.Add("Silver", 2); item57.RequiredUpgradeItems.Add("LinenThread", 4); item57.CraftAmount = 1; _recipeIsActiveConfig = config("VKE_VikingShamanCape", "IsRecipeEnabled", Toggle.On, "Determines if the recipe is enabled for this prefab"); item57.RecipeIsActive = (ConfigEntryBase?)(object)_recipeIsActiveConfig; SharedData shared23 = item57.Prefab.GetComponent<ItemDrop>().m_itemData.m_shared; shared23.m_armor = 1f; shared23.m_armorPerLevel = 1f; shared23.m_weight = 1.5f; shared23.m_maxQuality = 4; shared23.m_maxDurability = 800f; shared23.m_durabilityPerLevel = 150f; shared23.m_movementModifier = 0f; MaterialReplacer.RegisterGameObjectForShaderSwap(item57.Prefab, MaterialReplacer.ShaderType.UseUnityShader); PrefabManager.RegisterPrefab(PrefabManager.RegisterAssetBundle("sunnfjordheimexp"), "fx_shield_startV1"); PrefabManager.RegisterPrefab(PrefabManager.RegisterAssetBundle("sunnfjordheimexp"), "fx_StaffShield_Break1"); PrefabManager.RegisterPrefab(PrefabManager.RegisterAssetBundle("sunnfjordheimexp"), "fx_StaffShield_Hit1"); Item item58 = new Item("sunnfjordheimexp", "SNFX_Amenhzor"); item58.Name.English("Amenhzor"); item58.Description.English("A legendary weapon of dark origins."); item58.Name.Spanish("Amenhzor"); item58.Description.Spanish("Un arma legendaria de orígenes oscuros."); item58.Crafting.Add(CraftingTable.Forge, 4); item58.RequiredItems.Add("BlackMetal", 10); item58.RequiredItems.Add("LinenThread", 5); item58.RequiredItems.Add("FineWood", 2); item58.RequiredUpgradeItems.Add("BlackMetal", 5); item58.RequiredUpgradeItems.Add("LinenThread", 3); item58.CraftAmount = 1; item58.Snapshot(); ConfigEntry<Toggle> recipeIsActive18 = config("SNFX_Amenhzor", "IsRecipeEnabled", Toggle.On, "Enables crafting for this item."); item58.RecipeIsActive = (ConfigEntryBase?)(object)recipeIsActive18; Item item59 = new Item("sunnfjordheimexp", "SNFX_Amenhzor1"); item59.Name.English("Amenhzor Awakened"); item59.Description.English("The true, unleashed form of Amenhzor."); item59.Name.Spanish("Amenhzor Despertada"); item59.Description.Spanish("La verdadera forma desatada de Amenhzor."); item59.Crafting.Add(CraftingTable.Forge, 4); item59.RequiredItems.Add("BlackMetal", 15); item59.RequiredItems.Add("LinenThread", 5); item59.RequiredItems.Add("FineWood", 2); item59.RequiredUpgradeItems.Add("BlackMetal", 5); item59.RequiredUpgradeItems.Add("LinenThread", 3); item59.CraftAmount = 1; item59.Snapshot(); ConfigEntry<Toggle> recipeIsActive19 = config("SNFX_Amenhzor1", "IsRecipeEnabled", Toggle.On, "Enables crafting for this item."); item59.RecipeIsActive = (ConfigEntryBase?)(object)recipeIsActive19; Item item60 = new Item("sunnfjordheimexp", "SNFX_Caossword"); item60.Name.English("Sword of Chaos"); item60.Description.English("A blade forged in absolute turmoil."); item60.Name.Spanish("Espada del Caos"); item60.Description.Spanish("Una hoja forjada en absoluto caos."); item60.Crafting.Add(CraftingTable.Forge, 4); item60.RequiredItems.Add("BlackMetal", 10); item60.RequiredItems.Add("LinenThread", 5); item60.RequiredItems.Add("FineWood", 2); item60.RequiredUpgradeItems.Add("BlackMetal", 5); item60.RequiredUpgradeItems.Add("LinenThread", 3); item60.CraftAmount = 1; ConfigEntry<Toggle> recipeIsActive20 = config("SNFX_Caossword", "IsRecipeEnabled", Toggle.On, "Enables crafting for this item."); item60.RecipeIsActive = (ConfigEntryBase?)(object)recipeIsActive20; Item item61 = new Item("sunnfjordheimexp", "SNFX_Nemeaguantelete"); item61.Name.English("Nemean Gauntlet"); item61.Description.English("Crush your enemies with the strength of a beast."); item61.Name.Spanish("Guantelete de Nemea"); item61.Description.Spanish("Aplasta a tus enemigos con la fuerza de una bestia."); item61.Crafting.Add(CraftingTable.Forge, 4); item61.RequiredItems.Add("BlackMetal", 12); item61.RequiredItems.Add("LinenThread", 5); item61.RequiredItems.Add("FineWood", 2); item61.RequiredUpgradeItems.Add("BlackMetal", 5); item61.RequiredUpgradeItems.Add("LinenThread", 3); item61.CraftAmount = 1; ConfigEntry<Toggle> recipeIsActive21 = config("SNFX_Nemeaguantelete", "IsRecipeEnabled", Toggle.On, "Enables crafting for this item."); item61.RecipeIsActive = (ConfigEntryBase?)(object)recipeIsActive21; Item item62 = new Item("sunnfjordheimexp", "SNFX_Soulsuckersword"); item62.Name.English("Soul Sucker Sword"); item62.Description.English("It feeds on the life of those it strikes."); item62.Name.Spanish("Espada Devoraalmas"); item62.Description.Spanish("Se alimenta de la vida de aquellos a los que golpea."); item62.Crafting.Add(CraftingTable.Forge, 4); item62.RequiredItems.Add("BlackMetal", 10); item62.RequiredItems.Add("LinenThread", 5); item62.RequiredItems.Add("FineWood", 2); item62.RequiredUpgradeItems.Add("BlackMetal", 5); item62.RequiredUpgradeItems.Add("LinenThread", 3); item62.CraftAmount = 1; item62.Snapshot(); ConfigEntry<Toggle> recipeIsActive22 = config("SNFX_Soulsuckersword", "IsRecipeEnabled", Toggle.On, "Enables crafting for this item."); item62.RecipeIsActive = (ConfigEntryBase?)(object)recipeIsActive22; Item item63 = new Item("sunnfjordheimexp", "SNFX_SwordElfica"); item63.Name.English("Elven Sword"); item63.Description.English("An elegant and deadly weapon from the deep woods."); item63.Name.Spanish("Espada Élfica"); item63.Description.Spanish("Un arma elegante y mortal de los bosques profundos."); item63.Crafting.Add(CraftingTable.Forge, 4); item63.RequiredItems.Add("BlackMetal", 8); item63.RequiredItems.Add("LinenThread", 5); item63.RequiredItems.Add("FineWood", 5); item63.RequiredUpgradeItems.Add("BlackMetal", 4); item63.RequiredUpgradeItems.Add("LinenThread", 3); item63.CraftAmount = 1; item63.Snapshot(); ConfigEntry<Toggle> recipeIsActive23 = config("SNFX_SwordElfica", "IsRecipeEnabled", Toggle.On, "Enables crafting for this item."); item63.RecipeIsActive = (ConfigEntryBase?)(object)recipeIsActive23; SunnfjordCapeClothAdapter.Initialize(((BaseUnityPlugin)this).Config, Item.RegisteredPrefabs); Assembly executingAssembly = Assembly.GetExecutingAssembly(); _harmony.PatchAll(executingAssembly); SetupWatcher(); } private void OnDestroy() { ((BaseUnityPlugin)this).Config.Save(); } private void SetupWatcher() { FileSystemWatcher fileSystemWatcher = new FileSystemWatcher(Paths.ConfigPath, ConfigFileName); fileSystemWatcher.Changed += ReadConfigValues; fileSystemWatcher.Created += ReadConfigValues; fileSystemWatcher.Renamed += ReadConfigValues; fileSystemWatcher.IncludeSubdirectories = true; fileSystemWatcher.SynchronizingObject = ThreadingHelper.SynchronizingObject; fileSystemWatcher.EnableRaisingEvents = true; } private void ReadConfigValues(object sender, FileSystemEventArgs e) { if (!File.Exists(ConfigFileFullPath)) { return; } try { sunnfjordheimexpLogger.LogDebug((object)"ReadConfigValues called"); ((BaseUnityPlugin)this).Config.Reload(); } catch { sunnfjordheimexpLogger.LogError((object)("There was an issue loading your " + ConfigFileName)); sunnfjordheimexpLogger.LogError((object)"Please check your config entries for spelling and format!"); } } private ConfigEntry<T> config<T>(string group, string name, T value, ConfigDescription description, bool synchronizedSetting = true) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown ConfigDescription val = new ConfigDescription(description.Description + (synchronizedSetting ? " [Synced with Server]" : " [Not Synced with Server]"), description.AcceptableValues, description.Tags); ConfigEntry<T> val2 = ((BaseUnityPlugin)this).Config.Bind<T>(group, name, value, val); SyncedConfigEntry<T> syncedConfigEntry = ConfigSync.AddConfigEntry<T>(val2); syncedConfigEntry.SynchronizedConfig = synchronizedSetting; return val2; } private ConfigEntry<T> config<T>(string group, string name, T value, string description, bool synchronizedSetting = true) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown return config(group, name, value, new ConfigDescription(description, (AcceptableValueBase)null, Array.Empty<object>()), synchronizedSetting); } static sunnfjordheimexpPlugin() { string configPath = Paths.ConfigPath; char directorySeparatorChar = Path.DirectorySeparatorChar; ConfigFileFullPath = configPath + directorySeparatorChar + ConfigFileName; ConnectionError = ""; sunnfjordheimexpLogger = Logger.CreateLogSource("sunnfjordheimexp"); ConfigSync = new ConfigSync("Zzyzxrd.sunnfjordheimexp") { DisplayName = "sunnfjordheimexp", CurrentVersion = "1.0.6", MinimumRequiredVersion = "1.0.6" }; _serverConfigLocked = null; _recipeIsActiveConfig = null; } } public static class KeyboardExtensions { public static bool IsKeyDown(this KeyboardShortcut shortcut) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) return (int)((KeyboardShortcut)(ref shortcut)).MainKey != 0 && Input.GetKeyDown(((KeyboardShortcut)(ref shortcut)).MainKey) && ((KeyboardShortcut)(ref shortcut)).Modifiers.All((Func<KeyCode, bool>)Input.GetKey); } public static bool IsKeyHeld(this KeyboardShortcut shortcut) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) return (int)((KeyboardShortcut)(ref shortcut)).MainKey != 0 && Input.GetKey(((KeyboardShortcut)(ref shortcut)).MainKey) && ((KeyboardShortcut)(ref shortcut)).Modifiers.All((Func<KeyCode, bool>)Input.GetKey); } } [HarmonyPatch(typeof(ZNet), "OnNewConnection")] public static class RegisterAndCheckVersion { private static void Prefix(ZNetPeer peer, ref ZNet __instance) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown sunnfjordheimexpPlugin.sunnfjordheimexpLogger.LogDebug((object)"Registering version RPC handler"); peer.m_rpc.Register<ZPackage>("sunnfjordheimexp_VersionCheck", (Action<ZRpc, ZPackage>)RpcHandlers.RPC_sunnfjordheimexp_Version); sunnfjordheimexpPlugin.sunnfjordheimexpLogger.LogInfo((object)"Invoking version check"); ZPackage val = new ZPackage(); val.Write("1.0.6"); peer.m_rpc.Invoke("sunnfjordheimexp_VersionCheck", new object[1] { val }); } } [HarmonyPatch(typeof(ZNet), "RPC_PeerInfo")] public static class VerifyClient { private static bool Prefix(ZRpc rpc, ZPackage pkg, ref ZNet __instance) { if (!__instance.IsServer() || RpcHandlers.ValidatedPeers.Contains(rpc)) { return true; } sunnfjordheimexpPlugin.sunnfjordheimexpLogger.LogWarning((object)("Peer (" + rpc.m_socket.GetHostName() + ") never sent version or couldn't due to previous disconnect, disconnecting")); rpc.Invoke("Error", new object[1] { 3 }); return false; } private static void Postfix(ZNet __instance) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown ZRoutedRpc.instance.InvokeRoutedRPC(ZRoutedRpc.instance.GetServerPeerID(), "sunnfjordheimexpRequestAdminSync", new object[1] { (object)new ZPackage() }); } } [HarmonyPatch(typeof(FejdStartup), "ShowConnectError")] public class ShowConnectionError { private static void Postfix(FejdStartup __instance) { if (__instance.m_connectionFailedPanel.activeSelf) { __instance.m_connectionFailedError.fontSizeMax = 25f; __instance.m_connectionFailedError.fontSizeMin = 15f; TMP_Text connectionFailedError = __instance.m_connectionFailedError; connectionFailedError.text = connectionFailedError.text + "\n" + sunnfjordheimexpPlugin.ConnectionError; } } } [HarmonyPatch(typeof(ZNet), "Disconnect")] public static class RemoveDisconnectedPeerFromVerified { private static void Prefix(ZNetPeer peer, ref ZNet __instance) { if (__instance.IsServer()) { sunnfjordheimexpPlugin.sunnfjordheimexpLogger.LogInfo((object)("Peer (" + peer.m_rpc.m_socket.GetHostName() + ") disconnected, removing from validated list")); RpcHandlers.ValidatedPeers.Remove(peer.m_rpc); } } } public static class RpcHandlers { public static readonly List<ZRpc> ValidatedPeers = new List<ZRpc>(); public static void RPC_sunnfjordheimexp_Version(ZRpc rpc, ZPackage pkg) { string text = pkg.ReadString(); sunnfjordheimexpPlugin.sunnfjordheimexpLogger.LogInfo((object)("Version check, local: 1.0.6, remote: " + text)); if (text != "1.0.6") { sunnfjordheimexpPlugin.ConnectionError = "sunnfjordheimexp Installed: 1.0.6\n Needed: " + text; if (ZNet.instance.IsServer()) { sunnfjordheimexpPlugin.sunnfjordheimexpLogger.LogWarning((object)("Peer (" + rpc.m_socket.GetHostName() + ") has incompatible version, disconnecting...")); rpc.Invoke("Error", new object[1] { 3 }); } } else if (!ZNet.instance.IsServer()) { sunnfjordheimexpPlugin.sunnfjordheimexpLogger.LogInfo((object)"Received same version from server!"); } else { sunnfjordheimexpPlugin.sunnfjordheimexpLogger.LogInfo((object)("Adding peer (" + rpc.m_socket.GetHostName() + ") to validated list")); ValidatedPeers.Add(rpc); } } public static string ComputeHashForMod() { using SHA256 sHA = SHA256.Create(); byte[] array = sHA.ComputeHash(File.ReadAllBytes(Assembly.GetExecutingAssembly().Location)); StringBuilder stringBuilder = new StringBuilder(); byte[] array2 = array; foreach (byte b in array2) { stringBuilder.Append(b.ToString("X2")); } return stringBuilder.ToString(); } } internal static class SunnfjordCapeClothAdapter { internal sealed class AttachState { internal string Name = ""; internal List<ColliderComponent> Colliders = new List<ColliderComponent>(); } [HarmonyPatch(typeof(VisEquipment), "AttachArmor")] private static class AttachCapePatch { private static void Prefix(VisEquipment __instance, int itemHash, out AttachState? __state) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Invalid comparison between Unknown and I4 __state = null; if (!Enabled.Value || !__instance.m_isPlayer || (Object)(object)ObjectDB.instance == (Object)null || (int)SystemInfo.graphicsDeviceType == 4) { return; } GameObject itemPrefab = ObjectDB.instance.GetItemPrefab(itemHash); if ((Object)(object)itemPrefab == (Object)null || !ClothPrefabs.Contains(((Object)itemPrefab).name)) { return; } try { __state = new AttachState { Name = ((Object)itemPrefab).name, Colliders = SunnfjordPlayerClothColliders.GetCapeColliders(__instance) }; } catch (Exception ex) { sunnfjordheimexpPlugin.sunnfjordheimexpLogger.LogWarning((object)("[Cape Cloth] " + ((Object)itemPrefab).name + ": own body colliders unavailable; kept Unity Cloth. " + ex.Message)); } } private static void Postfix(VisEquipment __instance, List<GameObject> __result, AttachState? __state) { if (__state == null || __result == null) { return; } foreach (GameObject item in __result) { if ((Object)(object)item == (Object)null) { continue; } Cloth[] componentsInChildren = item.GetComponentsInChildren<Cloth>(true); foreach (Cloth val in componentsInChildren) { if (!val.enabled || (Object)(object)((Component)val).GetComponent<SunnfjordCapeClothInstance>() != (Object)null) { continue; } SkinnedMeshRenderer renderer = ((Component)val).GetComponent<SkinnedMeshRenderer>(); if (!((Object)(object)renderer == (Object)null) && !item.GetComponentsInChildren<MagicaCloth>(true).Any((MagicaCloth c) => c.SerializeData.sourceRenderers.Contains((Renderer)(object)renderer))) { try { SunnfjordCapeClothInstance sunnfjordCapeClothInstance = ((Component)val).gameObject.AddComponent<SunnfjordCapeClothInstance>(); sunnfjordCapeClothInstance.Begin(val, renderer, __state.Name, __state.Colliders, ((Component)__instance).GetComponent<Player>()); } catch (Exception ex) { sunnfjordheimexpPlugin.sunnfjordheimexpLogger.LogWarning((object)("[Cape Cloth] " + __state.Name + ": " + ex.Message)); } } } } } } private static readonly HashSet<string> ClothPrefabs = new HashSet<string>(StringComparer.Ordinal); private static readonly HashSet<string> ChestPrefabs = new HashSet<string>(StringComparer.Ordinal); internal static ConfigEntry<bool> Enabled = null; internal static ConfigEntry<float> Damping = null; internal static ConfigEntry<float> Wind = null; internal static ConfigEntry<float> CollisionPadding = null; internal static ConfigEntry<bool> EdgeCollisions = null; internal static bool IsChestCloth(string prefab) { return ChestPrefabs.Contains(prefab); } internal static void Initialize(ConfigFile config, IEnumerable<GameObject> prefabs) { //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Expected O, but got Unknown //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Expected O, but got Unknown //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Expected O, but got Unknown //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Invalid comparison between Unknown and I4 ClothPrefabs.Clear(); ChestPrefabs.Clear(); foreach (GameObject prefab in prefabs) { if (!((Object)(object)prefab == (Object)null) && prefab.GetComponentsInChildren<Cloth>(true).Length != 0) { ClothPrefabs.Add(((Object)prefab).name); ItemDrop component = prefab.GetComponent<ItemDrop>(); if ((Object)(object)component != (Object)null && (int)component.m_itemData.m_shared.m_itemType == 7) { ChestPrefabs.Add(((Object)prefab).name); } } } Enabled = config.Bind<bool>("2 - Cape Cloth", "Use MagicaCloth", true, "Convert this mod's equipped clothing from Unity Cloth to MagicaCloth. Re-equip after changing. Visual setting, local to each client."); Damping = config.Bind<float>("2 - Cape Cloth", "Damping", 0.15f, new ConfigDescription("Damping for converted capes. Higher values reduce oscillation. Re-equip to apply.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>())); Wind = config.Bind<float>("2 - Cape Cloth", "Wind Influence", 0.25f, new ConfigDescription("Wind influence for converted capes. Re-equip to apply.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 2f), Array.Empty<object>())); CollisionPadding = config.Bind<float>("2 - Cape Cloth", "Body Collision Padding", 0.025f, new ConfigDescription("Extra body collider radius in world metres. Increase slightly if a cape clips through armour. Applies live.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 0.08f), Array.Empty<object>())); EdgeCollisions = config.Bind<bool>("2 - Cape Cloth", "Use Edge Collisions", true, "True checks cloth edges for better collision coverage. False uses cheaper point collisions, which can allow more clipping. Re-equip to apply."); } internal static int[] MatchParticles(Vector3[] vertices, Vector3[] particles, ClothSkinningCoefficient[] coefficients) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007e: 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_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) if (vertices.Length == 0 || particles.Length == 0 || particles.Length != coefficients.Length) { throw new InvalidOperationException("Missing or inconsistent Unity Cloth particle data."); } Bounds val = default(Bounds); ((Bounds)(ref val))..ctor(particles[0], Vector3.zero); Vector3[] array = particles; foreach (Vector3 val2 in array) { ((Bounds)(ref val)).Encapsulate(val2); } Vector3 val3 = ((Bounds)(ref val)).size; float num = Mathf.Max(1E-05f, ((Vector3)(ref val3)).magnitude * 1E-05f); float limit = num * num; int[] array2 = new int[vertices.Length]; bool[] used = new bool[particles.Length]; for (int j = 0; j < vertices.Length; j++) { float num2 = limit; int num3 = -1; for (int k = 0; k < particles.Length; k++) { val3 = vertices[j] - particles[k]; float sqrMagnitude = ((Vector3)(ref val3)).sqrMagnitude; if (!(sqrMagnitude > limit) && !float.IsNaN(sqrMagnitude)) { if (num3 >= 0 && coefficients[num3].maxDistance <= 0f != coefficients[k].maxDistance <= 0f) { throw new InvalidOperationException("Coincident cloth particles have conflicting fixed/moving painting."); } if (sqrMagnitude <= num2) { num2 = sqrMagnitude; num3 = k; } } } if (num3 < 0) { throw new InvalidOperationException($"Cannot map mesh vertex {j} to a cloth particle safely."); } array2[j] = num3; used[num3] = true; } int i2 = 0; while (i2 < particles.Length) { if (!used[i2] && !Enumerable.Range(0, particles.Length).Any(delegate(int num5) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) int result; if (used[num5]) { Vector3 val4 = particles[i2] - particles[num5]; if (((Vector3)(ref val4)).sqrMagnitude <= limit) { result = ((coefficients[i2].maxDistance <= 0f == coefficients[num5].maxDistance <= 0f) ? 1 : 0); goto IL_009d; } } result = 0; goto IL_009d; IL_009d: return (byte)result != 0; })) { throw new InvalidOperationException("Some cloth particles do not match the renderer."); } int num4 = i2 + 1; i2 = num4; } return array2; } } internal sealed class SunnfjordCapeClothInstance : MonoBehaviour { private Cloth? legacy; private SkinnedMeshRenderer? source; private Mesh? originalMesh; private MagicaCloth? converted; private Player? player; private SunnfjordBodyColliderRig? bodyRig; private float baseWind; private float nextShelterCheck; private string itemName = ""; private volatile bool buildCompleted; private volatile bool buildSucceeded; private bool restored; internal void Begin(Cloth cloth, SkinnedMeshRenderer renderer, string prefab, List<ColliderComponent> colliders, Player player) { //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Expected O, but got Unknown //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: 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_0183: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_031b: Unknown result type (might be due to invalid IL or missing references) //IL_0332: 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_033b: Unknown result type (might be due to invalid IL or missing references) legacy = cloth; source = renderer; originalMesh = renderer.sharedMesh; itemName = prefab; try { if ((Object)(object)originalMesh == (Object)null || !originalMesh.isReadable) { throw new InvalidOperationException("Cape mesh must have Read/Write enabled."); } if ((Object)(object)((Component)this).GetComponent<MagicaCloth>() != (Object)null) { throw new InvalidOperationException("A MagicaCloth component already owns this object."); } ClothSkinningCoefficient[] coefficients = cloth.coefficients; Vector3[] vertices = cloth.vertices; int[] array; try { array = SunnfjordCapeClothAdapter.MatchParticles(originalMesh.vertices, vertices, coefficients); } catch (InvalidOperationException) { Mesh val = new Mesh(); try { renderer.BakeMesh(val); array = SunnfjordCapeClothAdapter.MatchParticles(val.vertices, vertices, coefficients); } finally { Object.Destroy((Object)(object)val); } } VertexAttribute[] array2 = (VertexAttribute[])(object)new VertexAttribute[array.Length]; int num = 0; for (int i = 0; i < array.Length; i++) { bool flag = coefficients[array[i]].maxDistance <= 0f; array2[i] = (flag ? VertexAttribute.Fixed : VertexAttribute.Move); if (flag) { num++; } } if (num == 0 || num == array2.Length) { throw new InvalidOperationException("Cape needs both fixed and movable vertices."); } cloth.enabled = false; converted = ((Component)this).gameObject.AddComponent<MagicaCloth>(); converted.DisableAutoBuild(); ClothSerializeData serializeData = converted.SerializeData; serializeData.clothType = (ClothType)0; serializeData.updateMode = (ClothUpdateMode)0; serializeData.sourceRenderers.Add((Renderer)(object)renderer); serializeData.cullingSettings.cameraCullingMode = (CameraCullingMode)10; serializeData.cullingSettings.cameraCullingMethod = (CameraCullingMethod)10; serializeData.cullingSettings.cameraCullingRenderers.Add((Renderer)(object)renderer); serializeData.cullingSettings.distanceCullingLength.SetValue(true, 35f); serializeData.paintMode = (PaintMode)0; bool flag2 = SunnfjordCapeClothAdapter.IsChestCloth(prefab); serializeData.gravity = 5f; serializeData.damping.SetValue(flag2 ? Mathf.Max(0.25f, SunnfjordCapeClothAdapter.Damping.Value) : SunnfjordCapeClothAdapter.Damping.Value); serializeData.radius.SetValue(0.015f); serializeData.wind.influence = SunnfjordCapeClothAdapter.Wind.Value * (flag2 ? 0.4f : 1f); serializeData.wind.turbulence = 0.3f; serializeData.inertiaConstraint.worldInertia = 0.35f; serializeData.inertiaConstraint.localInertia = 0.35f; serializeData.inertiaConstraint.particleSpeedLimit.SetValue(true, 3f); serializeData.inertiaConstraint.teleportMode = (TeleportMode)1; serializeData.inertiaConstraint.teleportDistance = 2f; serializeData.inertiaConstraint.teleportRotation = 120f; serializeData.stablizationTimeAfterReset = 0.2f; serializeData.colliderCollisionConstraint.colliderList = new List<ColliderComponent>(colliders); serializeData.colliderCollisionConstraint.mode = (Mode)((!SunnfjordCapeClothAdapter.EdgeCollisions.Value) ? 1 : 2); serializeData.colliderCollisionConstraint.friction = 0.15f; Bounds bounds = ((Renderer)renderer).bounds; float y = ((Bounds)(ref bounds)).size.y; serializeData.motionConstraint.useMaxDistance = true; serializeData.motionConstraint.maxDistance.SetValue(flag2 ? Mathf.Clamp(y * 0.25f, 0.06f, 0.2f) : Mathf.Clamp(y * 0.4f, 0.12f, 0.6f)); converted.GetSerializeData2().vertexAttributeList.Add(array2); MagicaCloth? obj = converted; obj.OnBuildComplete = (Action<MagicaCloth, bool>)Delegate.Combine(obj.OnBuildComplete, new Action<MagicaCloth, bool>(OnBuildComplete)); converted.Initialize(); this.player = player; baseWind = serializeData.wind.influence; bodyRig = ((colliders.Count > 0) ? ((Component)colliders[0]).GetComponentInParent<SunnfjordBodyColliderRig>() : null); bodyRig?.Register((Renderer)(object)renderer); if (!converted.BuildAndRun()) { throw new InvalidOperationException("MagicaCloth could not start its runtime build. " + BuildDiagnostic()); } ((MonoBehaviour)this).StartCoroutine(WaitForBuild(num, array2.Length, colliders.Count)); } catch (Exception ex2) { RestoreLegacy(ex2.Message); } } private void OnBuildComplete(MagicaCloth cloth, bool success) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) if (!buildCompleted) { ResultCode result = cloth.Process.Result; if (success || ((ResultCode)(ref result)).IsError() || ((ResultCode)(ref result)).IsCancel()) { buildSucceeded = success; buildCompleted = true; } } } private string BuildDiagnostic() { //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_0075: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)converted == (Object)null) { return "MagicaCloth component unavailable."; } ResultCode result = converted.Process.Result; return "Result=" + ((ResultCode)(ref result)).GetResultString() + "; " + ((ResultCode)(ref result)).GetResultInformation() + " " + $"Warning={((ResultCode)(ref result)).GetWarningString()}; scale={((Component)converted).transform.lossyScale}."; } private IEnumerator WaitForBuild(int fixedCount, int vertexCount, int colliderCount) { float deadline = Time.realtimeSinceStartup + 15f; while (!buildCompleted && Time.realtimeSinceStartup < deadline) { yield return null; } if (!buildCompleted || !buildSucceeded) { RestoreLegacy((buildCompleted ? "MagicaCloth build failed. " : "MagicaCloth build timed out. ") + BuildDiagnostic()); yield break; } sunnfjordheimexpPlugin.sunnfjordheimexpLogger.LogInfo((object)$"[Cape Cloth] {itemName}: MagicaCloth ready ({fixedCount}/{vertexCount} fixed vertices, {colliderCount} colliders)."); } private void RestoreLegacy(string reason) { if (!restored) { restored = true; if ((Object)(object)converted != (Object)null) { MagicaCloth? obj = converted; obj.OnBuildComplete = (Action<MagicaCloth, bool>)Delegate.Remove(obj.OnBuildComplete, new Action<MagicaCloth, bool>(OnBuildComplete)); ((Behaviour)converted).enabled = false; converted.Process.Dispose(); Object.Destroy((Object)(object)converted); } if ((Object)(object)bodyRig != (Object)null && (Object)(object)source != (Object)null) { bodyRig.Unregister((Renderer)(object)source); } if ((Object)(object)source != (Object)null && (Object)(object)originalMesh != (Object)null) { source.sharedMesh = originalMesh; } if ((Object)(object)legacy != (Object)null) { legacy.enabled = true; } sunnfjordheimexpPlugin.sunnfjordheimexpLogger.LogWarning((object)("[Cape Cloth] " + itemName + ": kept Unity Cloth. " + reason)); } } private void OnDestroy() { if ((Object)(object)converted != (Object)null) { MagicaCloth? obj = converted; obj.OnBuildComplete = (Action<MagicaCloth, bool>)Delegate.Remove(obj.OnBuildComplete, new Action<MagicaCloth, bool>(OnBuildComplete)); } if ((Object)(object)bodyRig != (Object)null && (Object)(object)source != (Object)null) { bodyRig.Unregister((Renderer)(object)source); } } private void Update() { if (!restored && buildCompleted && buildSucceeded && !((Object)(object)player == (Object)null) && !((Object)(object)converted == (Object)null) && !(Time.unscaledTime < nextShelterCheck)) { nextShelterCheck = Time.unscaledTime + 0.25f; float num = (player.InShelter() ? 0f : baseWind); if (!Mathf.Approximately(converted.SerializeData.wind.influence, num)) { converted.SerializeData.wind.influence = num; converted.SetParameterChange(); } } } } internal static class SunnfjordPlayerClothColliders { internal static List<ColliderComponent> GetCapeColliders(VisEquipment equipment) { SunnfjordBodyColliderRig sunnfjordBodyColliderRig = ((Component)equipment).GetComponent<SunnfjordBodyColliderRig>(); if ((Object)(object)sunnfjordBodyColliderRig == (Object)null) { sunnfjordBodyColliderRig = ((Component)equipment).gameObject.AddComponent<SunnfjordBodyColliderRig>(); } sunnfjordBodyColliderRig.EnsureInitialized(equipment); sunnfjordBodyColliderRig.Refresh(); return new List<ColliderComponent>(sunnfjordBodyColliderRig.Colliders); } } [DefaultExecutionOrder(10000)] internal sealed class SunnfjordBodyColliderRig : MonoBehaviour { private sealed class Segment { internal Transform Start = null; internal Transform End = null; internal float RadiusRatio; internal float UpOffsetRatio; internal MagicaCapsuleCollider Collider = null; internal Transform Target = null; internal Vector3 LastSize; } private readonly List<Segment> segments = new List<Segment>(); internal readonly List<ColliderComponent> Colliders = new List<ColliderComponent>(); private Transform? container; private Transform? hips; private Transform? head; private Transform? thigh; private Transform? knee; private Transform? ankle; private bool initialized; private readonly List<Renderer> consumers = new List<Renderer>(); private float nextGeometryUpdate; private float cachedHeight; private float lastPadding = -1f; private Vector3 lastParentScale; internal void Register(Renderer renderer) { if (!consumers.Contains(renderer)) { consumers.Add(renderer); } Refresh(); } internal void Unregister(Renderer renderer) { consumers.Remove(renderer); } internal void EnsureInitialized(VisEquipment equipment) { //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Expected O, but got Unknown if (initialized) { return; } if ((Object)(object)equipment.m_bodyModel == (Object)null) { throw new InvalidOperationException("Player body renderer is unavailable."); } Dictionary<string, Transform> bones = (from b in equipment.m_bodyModel.bones where (Object)(object)b != (Object)null group b by ((Object)b).name).ToDictionary((IGrouping<string, Transform> g) => g.Key, (IGrouping<string, Transform> g) => g.First()); string[] array = new string[15] { "Hips", "Spine2", "Head", "LeftArm", "LeftForeArm", "LeftHand", "RightArm", "RightForeArm", "RightHand", "LeftUpLeg", "LeftLeg", "LeftFoot", "RightUpLeg", "RightLeg", "RightFoot" }; string[] array2 = array; foreach (string name in array2) { Bone(name); } hips = Bone("Hips"); head = Bone("Head"); thigh = Bone("LeftUpLeg"); knee = Bone("LeftLeg"); ankle = Bone("LeftFoot"); try { GameObject val = new GameObject("Sunnfjord_CapeBodyColliders"); val.transform.SetParent(((Component)equipment).transform, false); container = val.transform; Add("Torso", hips, Bone("Spine2"), 0.115f); Add("Pelvis", Bone("LeftUpLeg"), Bone("RightUpLeg"), 0.095f, 0.025f); Add("Shoulders", Bone("LeftArm"), Bone("RightArm"), 0.078f); Add("Head", head, head, 0.085f, 0.035f); string[] array3 = new string[2] { "Left", "Right" }; foreach (string text in array3) { Add(text + "UpperArm", Bone(text + "Arm"), Bone(text + "ForeArm"), 0.055f); Add(text + "Forearm", Bone(text + "ForeArm"), Bone(text + "Hand"), 0.043f); Add(text + "Thigh", Bone(text + "UpLeg"), Bone(text + "Leg"), 0.07f); Add(text + "Shin", Bone(text + "Leg"), Bone(text + "Foot"), 0.052f); } initialized = true; Refresh(); sunnfjordheimexpPlugin.sunnfjordheimexpLogger.LogInfo((object)$"[Cape Cloth] Own body collision rig ready: {Colliders.Count} capsules on {((Object)equipment).name}."); } catch { foreach (Segment segment in segments) { if ((Object)(object)segment.Collider != (Object)null) { ((Behaviour)segment.Collider).enabled = false; } } segments.Clear(); Colliders.Clear(); if ((Object)(object)container != (Object)null) { Object.Destroy((Object)(object)((Component)container).gameObject); } container = null; initialized = false; throw; } Transform Bone(string text2) { if (!bones.TryGetValue(text2, out var value)) { throw new InvalidOperationException("Player skeleton is missing " + text2 + "."); } return value; } } private void Add(string label, Transform start, Transform end, float radiusRatio, float upOffsetRatio = 0f) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_002e: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Sunnfjord_" + label); val.transform.SetParent(container, false); MagicaCapsuleCollider val2 = val.AddComponent<MagicaCapsuleCollider>(); val2.direction = (Direction)1; val2.alignedOnCenter = true; val2.reverseDirection = false; segments.Add(new Segment { Start = start, End = end, RadiusRatio = radiusRatio, UpOffsetRatio = upOffsetRatio, Collider = val2, Target = val.transform }); Colliders.Add((ColliderComponent)(object)val2); } internal void Refresh() { //IL_007a: 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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: 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_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_03fb: Unknown result type (might be due to invalid IL or missing references) //IL_03fc: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_022c: 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_0233: 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_0241: 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_0248: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_0267: 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_0273: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: 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_0306: 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_0339: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_037e: Unknown result type (might be due to invalid IL or missing references) //IL_0382: Unknown result type (might be due to invalid IL or missing references) //IL_0387: Unknown result type (might be due to invalid IL or missing references) //IL_038c: Unknown result type (might be due to invalid IL