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 ArrowsJvL v1.0.0
plugins/Digitalroot.ArrowsJvL.dll
Decompiled 7 hours ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Threading; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using Digitalroot.Valheim.Common; using Digitalroot.Valheim.Common.Json; using Digitalroot.Valheim.Common.Names.Vanilla; using JetBrains.Annotations; using Jotunn.Configs; using Jotunn.Entities; using Jotunn.Managers; using Jotunn.Utils; using SimpleJson; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyCompany("Digitalroot Technologies")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyCopyright("Copyright © Digitalroot Technologies 2021 - 2026")] [assembly: AssemblyDescription("Combines BoneArrowsJvL, LightningArrowsJvL and AtosArrowsJVL")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+9050b34a1b59085bb4d87a29287873e55626af76")] [assembly: AssemblyProduct("Digitalroot ArrowsJvL")] [assembly: AssemblyTitle("Digitalroot.ArrowsJvL")] [assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/Digitalroot/Digitalroot.Valheim.ArrowsJvL")] [assembly: NeutralResourcesLanguage("en-US")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace Digitalroot.ArrowsJvL { [BepInPlugin("digitalroot.mods.arrows.jvl", "Digitalroot ArrowsJvL", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] [BepInIncompatibility("com.bepinex.plugins.atosarrows")] [BepInIncompatibility("digitalroot.valheim.mods.atosarrows.jvl")] [BepInIncompatibility("digitalroot.mods.lightningarrows.jvl")] [BepInIncompatibility("digitalroot.mods.bonearrows.jvl")] public class Main : BaseUnityPlugin, ITraceableLogging { public static Main Instance; private AssetBundle _assetBundle; public static ConfigEntry<int> NexusId; public static ConfigEntry<bool> EnableFireBomb; public static ConfigEntry<bool> EnableIceBomb; public static ConfigEntry<bool> EnableBoneArrow; public static ConfigEntry<bool> EnableHeavyBoneArrow; public static ConfigEntry<bool> EnableBluntedArrow; public static ConfigEntry<bool> EnableHeavyBluntedArrow; public static ConfigEntry<bool> EnableObsidianFireArrow; public static ConfigEntry<bool> EnableHeavyFireArrow; public static ConfigEntry<bool> EnableExplodingFireArrow; public static ConfigEntry<bool> EnableHeavyFlintArrow; public static ConfigEntry<bool> EnableHeavyIceArrow; public static ConfigEntry<bool> EnableExplodingIceArrow; public static ConfigEntry<bool> EnableHeavyNeedleArrow; public static ConfigEntry<bool> EnableHeavyObsidianArrow; public static ConfigEntry<bool> EnableHeavyPoisonArrow; public static ConfigEntry<bool> EnableExplodingPoisonArrow; public static ConfigEntry<bool> EnableStoneArrow; public static ConfigEntry<bool> EnableXBow; public static ConfigEntry<bool> EnableSimpleBoneArrow; public static ConfigEntry<bool> EnableLightningArrow; public const string Version = "1.0.0"; private const string Name = "Digitalroot ArrowsJvL"; public const string Guid = "digitalroot.mods.arrows.jvl"; public const string Namespace = "Digitalroot.ArrowsJvL"; public string Source => "Digitalroot.ArrowsJvL"; public bool EnableTrace { get; } public Main() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown try { EnableTrace = false; Instance = this; NexusId = ((BaseUnityPlugin)this).Config.Bind<int>("General", "NexusId", 3620, new ConfigDescription("Nexus mod ID for updates", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes { Browsable = false, ReadOnly = true } })); InitConfig(); Log.RegisterSource(Instance); Log.Trace(Instance, ((object)this).GetType().Namespace + "." + ((object)this).GetType().Name + "." + MethodBase.GetCurrentMethod()?.Name + "()"); } catch (Exception ex) { ZLog.LogError((object)ex); } } [UsedImplicitly] public void Awake() { Log.Trace(Instance, ((object)this).GetType().Namespace + "." + ((object)this).GetType().Name + "." + MethodBase.GetCurrentMethod()?.Name + "()"); PrefabManager.OnVanillaPrefabsAvailable += AddClonedItems; } private void AddClonedItems() { try { Log.Trace(Instance, "Digitalroot.ArrowsJvL." + MethodBase.GetCurrentMethod()?.DeclaringType?.Name + "." + MethodBase.GetCurrentMethod()?.Name); _assetBundle = AssetUtils.LoadAssetBundleFromResources("atoarrows", typeof(Main).Assembly); AddStoneArrows(); AddBluntedArrows(); AddBoneArrows(); AddFlintArrows(); AddObsidianArrows(); AddNeedleArrows(); AddFireArrows(); AddIceArrows(); AddPoisonArrows(); AddBombs(); AddXBow(); AddBoneArrow(); AddLightningArrow(); _assetBundle.Unload(false); PrefabManager.OnVanillaPrefabsAvailable -= AddClonedItems; } catch (Exception e) { Log.Error(Instance, e); } } private void AddBombs() { //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Expected O, but got Unknown //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Expected O, but got Unknown //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: 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_0104: Expected O, but got Unknown //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Expected O, but got Unknown //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Expected O, but got Unknown //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Expected O, but got Unknown //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Expected O, but got Unknown //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Expected O, but got Unknown //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Expected O, but got Unknown //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Expected O, but got Unknown //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Expected O, but got Unknown try { Log.Trace(Instance, ((object)this).GetType().Namespace + "." + ((object)this).GetType().Name + "." + MethodBase.GetCurrentMethod()?.Name + "()"); if (EnableFireBomb.Value) { GameObject obj = _assetBundle.LoadAsset<GameObject>("assets/atosarrows/items/firebomb.prefab"); ItemConfig val = new ItemConfig(); val.Amount = 5; val.CraftingStation = "piece_workbench"; val.Enabled = true; val.MinStationLevel = 3; val.Name = "FireBomb"; val.Requirements = (RequirementConfig[])(object)new RequirementConfig[4] { new RequirementConfig { Item = "Coal", Amount = 10 }, new RequirementConfig { Item = "Resin", Amount = 8 }, new RequirementConfig { Item = "LeatherScraps", Amount = 8 }, new RequirementConfig { Item = "Entrails", Amount = 2 } }; CustomItem val2 = new CustomItem(obj, false, val); val2.ItemDrop.m_itemData.m_shared.m_name = "$item_ato_firebomb"; ItemManager.Instance.AddItem(val2); } if (EnableIceBomb.Value) { GameObject obj2 = _assetBundle.LoadAsset<GameObject>("assets/atosarrows/items/icebomb.prefab"); ItemConfig val = new ItemConfig(); val.Amount = 5; val.CraftingStation = "piece_workbench"; val.Enabled = true; val.MinStationLevel = 3; val.Name = "IceBomb"; val.Requirements = (RequirementConfig[])(object)new RequirementConfig[4] { new RequirementConfig { Item = "FreezeGland", Amount = 10 }, new RequirementConfig { Item = "Resin", Amount = 8 }, new RequirementConfig { Item = "LeatherScraps", Amount = 8 }, new RequirementConfig { Item = "Entrails", Amount = 2 } }; CustomItem val3 = new CustomItem(obj2, false, val); val3.ItemDrop.m_itemData.m_shared.m_name = "$item_ato_icebomb"; ItemManager.Instance.AddItem(val3); } } catch (Exception e) { Log.Error(Instance, e); } } private void AddBoneArrows() { //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Expected O, but got Unknown //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Expected O, but got Unknown //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: 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_0104: Expected O, but got Unknown //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Expected O, but got Unknown //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Expected O, but got Unknown //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Expected O, but got Unknown //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Expected O, but got Unknown //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_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Expected O, but got Unknown //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Expected O, but got Unknown try { Log.Trace(Instance, ((object)this).GetType().Namespace + "." + ((object)this).GetType().Name + "." + MethodBase.GetCurrentMethod()?.Name + "()"); if (EnableBoneArrow.Value) { GameObject obj = _assetBundle.LoadAsset<GameObject>("assets/atosarrows/arrows/arrowbone.prefab"); ItemConfig val = new ItemConfig(); val.Amount = 20; val.CraftingStation = "piece_workbench"; val.Enabled = true; val.MinStationLevel = 3; val.Name = "BoneArrow"; val.Requirements = (RequirementConfig[])(object)new RequirementConfig[3] { new RequirementConfig { Item = "BoneFragments", Amount = 4 }, new RequirementConfig { Item = "Wood", Amount = 8 }, new RequirementConfig { Item = "Feathers", Amount = 2 } }; CustomItem val2 = new CustomItem(obj, false, val); val2.ItemDrop.m_itemData.m_shared.m_name = "$item_atoarrow_bone"; val2.ItemDrop.m_itemData.m_shared.m_ammoType = "$ammo_arrows"; val2.ItemDrop.m_itemData.m_shared.m_damages.m_pierce = 24f; val2.ItemDrop.m_itemData.m_shared.m_damages.m_slash = 30f; ItemManager.Instance.AddItem(val2); } if (EnableHeavyBoneArrow.Value) { GameObject obj2 = _assetBundle.LoadAsset<GameObject>("assets/atosarrows/arrows/heavy/arrowheavybone.prefab"); ItemConfig val = new ItemConfig(); val.Amount = 10; val.CraftingStation = "piece_workbench"; val.Enabled = true; val.MinStationLevel = 3; val.Name = "HeavyBoneArrow"; val.Requirements = (RequirementConfig[])(object)new RequirementConfig[3] { new RequirementConfig { Item = "BoneFragments", Amount = 6 }, new RequirementConfig { Item = "RoundLog", Amount = 10 }, new RequirementConfig { Item = "Feathers", Amount = 5 } }; CustomItem val3 = new CustomItem(obj2, false, val); val3.ItemDrop.m_itemData.m_shared.m_description = "$item_atoarrow_heavy_bone_description"; val3.ItemDrop.m_itemData.m_shared.m_name = "$item_atoarrow_heavy_bone"; val3.ItemDrop.m_itemData.m_shared.m_ammoType = "$ammo_arrows"; val3.ItemDrop.m_itemData.m_shared.m_damages.m_pierce = 36f; val3.ItemDrop.m_itemData.m_shared.m_damages.m_slash = 36f; val3.ItemDrop.m_itemData.m_shared.m_attack.m_projectileVel = 14f; ItemManager.Instance.AddItem(val3); } } catch (Exception e) { Log.Error(Instance, e); } } private void AddBluntedArrows() { //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Expected O, but got Unknown //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Expected O, but got Unknown //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: 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_0104: Expected O, but got Unknown //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Expected O, but got Unknown //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Expected O, but got Unknown //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Expected O, but got Unknown //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Expected O, but got Unknown //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Expected O, but got Unknown //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Expected O, but got Unknown //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Expected O, but got Unknown //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Expected O, but got Unknown try { Log.Trace(Instance, ((object)this).GetType().Namespace + "." + ((object)this).GetType().Name + "." + MethodBase.GetCurrentMethod()?.Name + "()"); if (EnableBluntedArrow.Value) { GameObject obj = _assetBundle.LoadAsset<GameObject>("assets/atosarrows/arrows/arrowcore.prefab"); ItemConfig val = new ItemConfig(); val.Amount = 20; val.CraftingStation = "forge"; val.Enabled = true; val.MinStationLevel = 2; val.Name = "CoreArrow"; val.Requirements = (RequirementConfig[])(object)new RequirementConfig[4] { new RequirementConfig { Item = "Bronze", Amount = 1 }, new RequirementConfig { Item = "Stone", Amount = 2 }, new RequirementConfig { Item = "RoundLog", Amount = 8 }, new RequirementConfig { Item = "Feathers", Amount = 2 } }; CustomItem val2 = new CustomItem(obj, false, val); val2.ItemDrop.m_itemData.m_shared.m_name = "$item_atoarrow_core"; val2.ItemDrop.m_itemData.m_shared.m_ammoType = "$ammo_arrows"; ItemManager.Instance.AddItem(val2); } if (EnableHeavyBluntedArrow.Value) { GameObject obj2 = _assetBundle.LoadAsset<GameObject>("assets/atosarrows/arrows/heavy/arrowheavycore.prefab"); ItemConfig val = new ItemConfig(); val.Amount = 10; val.CraftingStation = "forge"; val.Enabled = true; val.MinStationLevel = 3; val.Name = "HeavyCoreArrow"; val.Requirements = (RequirementConfig[])(object)new RequirementConfig[4] { new RequirementConfig { Item = "Bronze", Amount = 2 }, new RequirementConfig { Item = "Stone", Amount = 4 }, new RequirementConfig { Item = "RoundLog", Amount = 12 }, new RequirementConfig { Item = "Feathers", Amount = 2 } }; CustomItem val3 = new CustomItem(obj2, false, val); val3.ItemDrop.m_itemData.m_shared.m_description = "$item_atoarrow_heavy_core_description"; val3.ItemDrop.m_itemData.m_shared.m_name = "$item_atoarrow_heavy_core"; val3.ItemDrop.m_itemData.m_shared.m_ammoType = "$ammo_arrows"; val3.ItemDrop.m_itemData.m_shared.m_damages.m_blunt = 64f; val3.ItemDrop.m_itemData.m_shared.m_attack.m_projectileVel = 10f; ItemManager.Instance.AddItem(val3); } } catch (Exception e) { Log.Error(Instance, e); } } private void AddFireArrows() { //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Expected O, but got Unknown //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Expected O, but got Unknown //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: 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_0104: Expected O, but got Unknown //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Expected O, but got Unknown //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Expected O, but got Unknown //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Expected O, but got Unknown //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Expected O, but got Unknown //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Expected O, but got Unknown //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Expected O, but got Unknown //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Expected O, but got Unknown //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Expected O, but got Unknown //IL_0310: Unknown result type (might be due to invalid IL or missing references) //IL_0316: Expected O, but got Unknown //IL_034a: Unknown result type (might be due to invalid IL or missing references) //IL_034f: Unknown result type (might be due to invalid IL or missing references) //IL_035a: Unknown result type (might be due to invalid IL or missing references) //IL_0362: Expected O, but got Unknown //IL_0364: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_0374: Unknown result type (might be due to invalid IL or missing references) //IL_037c: Expected O, but got Unknown //IL_037e: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Unknown result type (might be due to invalid IL or missing references) //IL_038e: Unknown result type (might be due to invalid IL or missing references) //IL_0396: Expected O, but got Unknown //IL_0398: Unknown result type (might be due to invalid IL or missing references) //IL_039d: Unknown result type (might be due to invalid IL or missing references) //IL_03a8: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: Expected O, but got Unknown //IL_03b6: Unknown result type (might be due to invalid IL or missing references) //IL_03bc: Expected O, but got Unknown try { Log.Trace(Instance, ((object)this).GetType().Namespace + "." + ((object)this).GetType().Name + "." + MethodBase.GetCurrentMethod()?.Name + "()"); if (EnableObsidianFireArrow.Value) { GameObject obj = _assetBundle.LoadAsset<GameObject>("assets/atosarrows/arrows/arrowobsidianfire.prefab"); ItemConfig val = new ItemConfig(); val.Amount = 20; val.CraftingStation = "piece_workbench"; val.Enabled = true; val.MinStationLevel = 4; val.Name = "BigFireArrow"; val.Requirements = (RequirementConfig[])(object)new RequirementConfig[4] { new RequirementConfig { Item = "Obsidian", Amount = 4 }, new RequirementConfig { Item = "Resin", Amount = 8 }, new RequirementConfig { Item = "Wood", Amount = 8 }, new RequirementConfig { Item = "Feathers", Amount = 2 } }; CustomItem val2 = new CustomItem(obj, false, val); val2.ItemDrop.m_itemData.m_shared.m_name = "$item_arrow_obsidianfire"; val2.ItemDrop.m_itemData.m_shared.m_ammoType = "$ammo_arrows"; ItemManager.Instance.AddItem(val2); } if (EnableHeavyFireArrow.Value) { GameObject obj2 = _assetBundle.LoadAsset<GameObject>("assets/atosarrows/arrows/heavy/arrowheavyfire.prefab"); ItemConfig val = new ItemConfig(); val.Amount = 10; val.CraftingStation = "piece_workbench"; val.Enabled = true; val.MinStationLevel = 4; val.Name = "HeavyFireArrow"; val.Requirements = (RequirementConfig[])(object)new RequirementConfig[4] { new RequirementConfig { Item = "Obsidian", Amount = 6 }, new RequirementConfig { Item = "Resin", Amount = 10 }, new RequirementConfig { Item = "FineWood", Amount = 10 }, new RequirementConfig { Item = "Feathers", Amount = 5 } }; CustomItem val3 = new CustomItem(obj2, false, val); val3.ItemDrop.m_itemData.m_shared.m_description = "$item_arrow_heavyfire_description"; val3.ItemDrop.m_itemData.m_shared.m_name = "$item_arrow_heavyfire"; val3.ItemDrop.m_itemData.m_shared.m_ammoType = "$ammo_arrows"; val3.ItemDrop.m_itemData.m_shared.m_damages.m_pierce = 32f; val3.ItemDrop.m_itemData.m_shared.m_damages.m_fire = 72f; val3.ItemDrop.m_itemData.m_shared.m_attack.m_projectileVel = 10f; ItemManager.Instance.AddItem(val3); } if (EnableExplodingFireArrow.Value) { GameObject obj3 = _assetBundle.LoadAsset<GameObject>("assets/atosarrows/arrows/arrowfireaoe.prefab"); ItemConfig val = new ItemConfig(); val.Amount = 5; val.CraftingStation = "forge"; val.Enabled = true; val.MinStationLevel = 6; val.Name = "FireAoeArrow"; val.Requirements = (RequirementConfig[])(object)new RequirementConfig[4] { new RequirementConfig { Item = "Crystal", Amount = 4 }, new RequirementConfig { Item = "FireBomb", Amount = 1 }, new RequirementConfig { Item = "FineWood", Amount = 8 }, new RequirementConfig { Item = "Feathers", Amount = 2 } }; CustomItem val4 = new CustomItem(obj3, false, val); val4.ItemDrop.m_itemData.m_shared.m_name = "$item_atoarrow_bigfire"; val4.ItemDrop.m_itemData.m_shared.m_ammoType = "$ammo_arrows"; ItemManager.Instance.AddItem(val4); } } catch (Exception e) { Log.Error(Instance, e); } } private void AddFlintArrows() { //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Expected O, but got Unknown //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Expected O, but got Unknown //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Expected O, but got Unknown try { Log.Trace(Instance, ((object)this).GetType().Namespace + "." + ((object)this).GetType().Name + "." + MethodBase.GetCurrentMethod()?.Name + "()"); if (EnableHeavyFlintArrow.Value) { GameObject obj = _assetBundle.LoadAsset<GameObject>("assets/atosarrows/arrows/heavy/arrowheavyflint.prefab"); ItemConfig val = new ItemConfig(); val.Amount = 10; val.CraftingStation = "piece_workbench"; val.Enabled = true; val.MinStationLevel = 3; val.Name = "HeavyFlintArrow"; val.Requirements = (RequirementConfig[])(object)new RequirementConfig[3] { new RequirementConfig { Item = "Flint", Amount = 6 }, new RequirementConfig { Item = "RoundLog", Amount = 12 }, new RequirementConfig { Item = "Feathers", Amount = 5 } }; CustomItem val2 = new CustomItem(obj, false, val); val2.ItemDrop.m_itemData.m_shared.m_description = "$item_atoarrow_heavy_flint_description"; val2.ItemDrop.m_itemData.m_shared.m_name = "$item_atoarrow_heavy_flint"; val2.ItemDrop.m_itemData.m_shared.m_ammoType = "$ammo_arrows"; val2.ItemDrop.m_itemData.m_shared.m_damages.m_pierce = 47f; val2.ItemDrop.m_itemData.m_shared.m_attack.m_projectileVel = 10f; ItemManager.Instance.AddItem(val2); } } catch (Exception e) { Log.Error(Instance, e); } } private void AddIceArrows() { //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Expected O, but got Unknown //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Expected O, but got Unknown //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Expected O, but got Unknown //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Expected O, but got Unknown //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Expected O, but got Unknown //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0228: 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_023b: Expected O, but got Unknown //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0242: 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_0255: Expected O, but got Unknown //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_025c: 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_026f: Expected O, but got Unknown //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Expected O, but got Unknown //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Expected O, but got Unknown try { Log.Trace(Instance, ((object)this).GetType().Namespace + "." + ((object)this).GetType().Name + "." + MethodBase.GetCurrentMethod()?.Name + "()"); if (EnableHeavyIceArrow.Value) { GameObject obj = _assetBundle.LoadAsset<GameObject>("assets/atosarrows/arrows/heavy/arrowheavyfrost.prefab"); ItemConfig val = new ItemConfig(); val.Amount = 10; val.CraftingStation = "piece_workbench"; val.Enabled = true; val.MinStationLevel = 4; val.Name = "HeavyIceArrow"; val.Requirements = (RequirementConfig[])(object)new RequirementConfig[4] { new RequirementConfig { Item = "Obsidian", Amount = 6 }, new RequirementConfig { Item = "FreezeGland", Amount = 10 }, new RequirementConfig { Item = "FineWood", Amount = 10 }, new RequirementConfig { Item = "Feathers", Amount = 5 } }; CustomItem val2 = new CustomItem(obj, false, val); val2.ItemDrop.m_itemData.m_shared.m_name = "$item_arrow_heavy_frost"; val2.ItemDrop.m_itemData.m_shared.m_ammoType = "$ammo_arrows"; val2.ItemDrop.m_itemData.m_shared.m_damages.m_pierce = 32f; val2.ItemDrop.m_itemData.m_shared.m_damages.m_frost = 72f; val2.ItemDrop.m_itemData.m_shared.m_attack.m_projectileVel = 10f; ItemManager.Instance.AddItem(val2); } if (EnableExplodingIceArrow.Value) { GameObject obj2 = _assetBundle.LoadAsset<GameObject>("assets/atosarrows/arrows/arrowiceaoe.prefab"); ItemConfig val = new ItemConfig(); val.Amount = 5; val.CraftingStation = "forge"; val.Enabled = true; val.MinStationLevel = 6; val.Name = "IceAoeArrow"; val.Requirements = (RequirementConfig[])(object)new RequirementConfig[4] { new RequirementConfig { Item = "Crystal", Amount = 4 }, new RequirementConfig { Item = "IceBomb", Amount = 1 }, new RequirementConfig { Item = "FineWood", Amount = 8 }, new RequirementConfig { Item = "Feathers", Amount = 2 } }; CustomItem val3 = new CustomItem(obj2, false, val); val3.ItemDrop.m_itemData.m_shared.m_description = "$item_atoarrow_bigice_description"; val3.ItemDrop.m_itemData.m_shared.m_name = "$item_atoarrow_bigice"; val3.ItemDrop.m_itemData.m_shared.m_ammoType = "$ammo_arrows"; ItemManager.Instance.AddItem(val3); } } catch (Exception e) { Log.Error(Instance, e); } } private void AddNeedleArrows() { //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Expected O, but got Unknown //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Expected O, but got Unknown //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Expected O, but got Unknown //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Expected O, but got Unknown try { Log.Trace(Instance, ((object)this).GetType().Namespace + "." + ((object)this).GetType().Name + "." + MethodBase.GetCurrentMethod()?.Name + "()"); if (EnableHeavyNeedleArrow.Value) { GameObject obj = _assetBundle.LoadAsset<GameObject>("assets/atosarrows/arrows/heavy/arrowheavyneedle.prefab"); ItemConfig val = new ItemConfig(); val.Amount = 10; val.CraftingStation = "piece_workbench"; val.Enabled = true; val.MinStationLevel = 4; val.Name = "HeavyNeedleArrow"; val.Requirements = (RequirementConfig[])(object)new RequirementConfig[3] { new RequirementConfig { Item = "Needle", Amount = 10 }, new RequirementConfig { Item = "FineWood", Amount = 10 }, new RequirementConfig { Item = "Feathers", Amount = 5 } }; CustomItem val2 = new CustomItem(obj, false, val); val2.ItemDrop.m_itemData.m_shared.m_name = "$item_arrow_heavyneedle"; val2.ItemDrop.m_itemData.m_shared.m_ammoType = "$ammo_arrows"; val2.ItemDrop.m_itemData.m_shared.m_damages.m_pierce = 72f; val2.ItemDrop.m_itemData.m_shared.m_attack.m_projectileVel = 10f; ItemManager.Instance.AddItem(val2); } } catch (Exception e) { Log.Error(Instance, e); } } private void AddObsidianArrows() { //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Expected O, but got Unknown //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Expected O, but got Unknown //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Expected O, but got Unknown try { Log.Trace(Instance, ((object)this).GetType().Namespace + "." + ((object)this).GetType().Name + "." + MethodBase.GetCurrentMethod()?.Name + "()"); if (EnableHeavyObsidianArrow.Value) { GameObject obj = _assetBundle.LoadAsset<GameObject>("assets/atosarrows/arrows/heavy/arrowheavyobsidian.prefab"); ItemConfig val = new ItemConfig(); val.Amount = 10; val.CraftingStation = "piece_workbench"; val.Enabled = true; val.MinStationLevel = 4; val.Name = "HeavyObsidianArrow"; val.Requirements = (RequirementConfig[])(object)new RequirementConfig[3] { new RequirementConfig { Item = "Obsidian", Amount = 6 }, new RequirementConfig { Item = "FineWood", Amount = 12 }, new RequirementConfig { Item = "Feathers", Amount = 5 } }; CustomItem val2 = new CustomItem(obj, false, val); val2.ItemDrop.m_itemData.m_shared.m_name = "$item_arrow_heavyobsidian"; val2.ItemDrop.m_itemData.m_shared.m_damages.m_pierce = 67f; val2.ItemDrop.m_itemData.m_shared.m_attack.m_projectileVel = 10f; val2.ItemDrop.m_itemData.m_shared.m_ammoType = "$ammo_arrows"; ItemManager.Instance.AddItem(val2); } } catch (Exception e) { Log.Error(Instance, e); } } private void AddPoisonArrows() { //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Expected O, but got Unknown //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Expected O, but got Unknown //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Expected O, but got Unknown //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Expected O, but got Unknown //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Expected O, but got Unknown //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0228: 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_023b: Expected O, but got Unknown //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0242: 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_0255: Expected O, but got Unknown //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_025c: 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_026f: Expected O, but got Unknown //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Expected O, but got Unknown //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Expected O, but got Unknown try { Log.Trace(Instance, ((object)this).GetType().Namespace + "." + ((object)this).GetType().Name + "." + MethodBase.GetCurrentMethod()?.Name + "()"); if (EnableHeavyPoisonArrow.Value) { GameObject obj = _assetBundle.LoadAsset<GameObject>("assets/atosarrows/arrows/heavy/arrowheavypoison.prefab"); ItemConfig val = new ItemConfig(); val.Amount = 10; val.CraftingStation = "piece_workbench"; val.Enabled = true; val.MinStationLevel = 4; val.Name = "HeavyPoisonArrow"; val.Requirements = (RequirementConfig[])(object)new RequirementConfig[4] { new RequirementConfig { Item = "Obsidian", Amount = 6 }, new RequirementConfig { Item = "Ooze", Amount = 10 }, new RequirementConfig { Item = "FineWood", Amount = 10 }, new RequirementConfig { Item = "Feathers", Amount = 5 } }; CustomItem val2 = new CustomItem(obj, false, val); val2.ItemDrop.m_itemData.m_shared.m_name = "$item_arrow_heavy_poison"; val2.ItemDrop.m_itemData.m_shared.m_damages.m_pierce = 32f; val2.ItemDrop.m_itemData.m_shared.m_damages.m_poison = 72f; val2.ItemDrop.m_itemData.m_shared.m_attack.m_projectileVel = 10f; val2.ItemDrop.m_itemData.m_shared.m_ammoType = "$ammo_arrows"; ItemManager.Instance.AddItem(val2); } if (EnableExplodingPoisonArrow.Value) { GameObject obj2 = _assetBundle.LoadAsset<GameObject>("assets/atosarrows/arrows/arrowpoisonaoe.prefab"); ItemConfig val = new ItemConfig(); val.Amount = 5; val.CraftingStation = "forge"; val.Enabled = true; val.MinStationLevel = 6; val.Name = "PoisonAoeArrow"; val.Requirements = (RequirementConfig[])(object)new RequirementConfig[4] { new RequirementConfig { Item = "Crystal", Amount = 4 }, new RequirementConfig { Item = "BombOoze", Amount = 1 }, new RequirementConfig { Item = "FineWood", Amount = 8 }, new RequirementConfig { Item = "Feathers", Amount = 2 } }; CustomItem val3 = new CustomItem(obj2, false, val); val3.ItemDrop.m_itemData.m_shared.m_name = "$item_atoarrow_aoepoison"; val3.ItemDrop.m_itemData.m_shared.m_ammoType = "$ammo_arrows"; ItemManager.Instance.AddItem(val3); } } catch (Exception e) { Log.Error(Instance, e); } } private void AddStoneArrows() { //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Expected O, but got Unknown //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Expected O, but got Unknown //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: 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_0104: Expected O, but got Unknown //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Expected O, but got Unknown try { Log.Trace(Instance, ((object)this).GetType().Namespace + "." + ((object)this).GetType().Name + "." + MethodBase.GetCurrentMethod()?.Name + "()"); if (EnableStoneArrow.Value) { GameObject obj = _assetBundle.LoadAsset<GameObject>("assets/atosarrows/arrows/arrowstone.prefab"); ItemConfig val = new ItemConfig(); val.Amount = 20; val.CraftingStation = "piece_workbench"; val.Enabled = true; val.MinStationLevel = 1; val.Name = "StoneArrow"; val.Requirements = (RequirementConfig[])(object)new RequirementConfig[3] { new RequirementConfig { Item = "Stone", Amount = 2 }, new RequirementConfig { Item = "Wood", Amount = 8 }, new RequirementConfig { Item = "Feathers", Amount = 2 } }; CustomItem val2 = new CustomItem(obj, false, val); val2.ItemDrop.m_itemData.m_shared.m_name = "$item_atoarrow_stone"; val2.ItemDrop.m_itemData.m_shared.m_ammoType = "$ammo_arrows"; ItemManager.Instance.AddItem(val2); } } catch (Exception e) { Log.Error(Instance, e); } } private void AddXBow() { //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Expected O, but got Unknown //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: 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_0105: Expected O, but got Unknown //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_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Expected O, but got Unknown //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Expected O, but got Unknown //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Expected O, but got Unknown try { Log.Trace(Instance, ((object)this).GetType().Namespace + "." + ((object)this).GetType().Name + "." + MethodBase.GetCurrentMethod()?.Name + "()"); if (EnableXBow.Value) { GameObject obj = _assetBundle.LoadAsset<GameObject>("assets/atosarrows/bows/xbow.prefab"); ItemConfig val = new ItemConfig(); val.Amount = 1; val.CraftingStation = "forge"; val.RepairStation = "forge"; val.Enabled = true; val.MinStationLevel = 1; val.Name = "XBow"; val.Requirements = (RequirementConfig[])(object)new RequirementConfig[4] { new RequirementConfig { Item = "Crystal", Amount = 10, AmountPerLevel = 2 }, new RequirementConfig { Item = "BlackMetal", Amount = 60, AmountPerLevel = 10 }, new RequirementConfig { Item = "FineWood", Amount = 8 }, new RequirementConfig { Item = "LinenThread", Amount = 20, AmountPerLevel = 2 } }; CustomItem val2 = new CustomItem(obj, false, val); val2.ItemDrop.m_itemData.m_shared.m_name = "$item_xbow"; val2.ItemDrop.m_itemData.m_shared.m_attackForce = 0f; val2.ItemDrop.m_itemData.m_shared.m_attack.m_projectileVel = 65f; val2.ItemDrop.m_itemData.m_shared.m_maxDurability = 600f; val2.ItemDrop.m_itemData.m_shared.m_blockPower = 10f; val2.ItemDrop.m_itemData.m_shared.m_maxStackSize = 1; val2.ItemDrop.m_itemData.m_shared.m_ammoType = "$ammo_arrows"; ItemManager.Instance.AddItem(val2); } } catch (Exception e) { Log.Error(Instance, e); } } private void AddBoneArrow() { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Expected O, but got Unknown //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Expected O, but got Unknown //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Expected O, but got Unknown //IL_0131: Unknown result type (might be due to invalid IL or missing references) try { Log.Trace(Instance, "Digitalroot.ArrowsJvL." + MethodBase.GetCurrentMethod()?.DeclaringType?.Name + "." + MethodBase.GetCurrentMethod()?.Name); if (EnableSimpleBoneArrow.Value) { string arrowFlint = ItemDropNames.ArrowFlint; ItemConfig val = new ItemConfig(); val.CraftingStation = CraftingStationNames.Workbench; val.MinStationLevel = 1; val.Amount = 20; val.Requirements = (RequirementConfig[])(object)new RequirementConfig[2] { new RequirementConfig { Item = ItemDropNames.Wood, Amount = 8 }, new RequirementConfig { Item = ItemDropNames.BoneFragments, Amount = 3 } }; CustomItem val2 = new CustomItem("ArrowBoneSimple", arrowFlint, val); GameObject itemPrefab = val2.ItemPrefab; if ((Object)(object)itemPrefab == (Object)null) { throw new NullReferenceException("prefab"); } ItemDrop component = itemPrefab.GetComponent<ItemDrop>(); if ((Object)(object)component == (Object)null) { throw new NullReferenceException("itemDrop"); } component.m_itemData.m_shared.m_name = "$item_bone_arrow"; component.m_itemData.m_shared.m_description = "$item_bone_arrow_description"; component.m_itemData.m_shared.m_itemType = (ItemType)9; component.m_itemData.m_shared.m_maxStackSize = 100; component.m_itemData.m_shared.m_weight = 0.1f; component.m_itemData.m_shared.m_backstabBonus = 4f; component.m_itemData.m_shared.m_damages.m_pierce = 20f; component.m_itemData.m_shared.m_damages.m_slash = 15f; ItemManager.Instance.AddItem(val2); } } catch (Exception e) { Log.Error(Instance, e); } } private void AddLightningArrow() { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Expected O, but got Unknown //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Expected O, but got Unknown //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Expected O, but got Unknown //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Expected O, but got Unknown //IL_014b: Unknown result type (might be due to invalid IL or missing references) try { Log.Trace(Instance, "Digitalroot.ArrowsJvL." + MethodBase.GetCurrentMethod()?.DeclaringType?.Name + "." + MethodBase.GetCurrentMethod()?.Name); if (EnableLightningArrow.Value) { string arrowSilver = ItemDropNames.ArrowSilver; ItemConfig val = new ItemConfig(); val.CraftingStation = CraftingStationNames.Workbench; val.MinStationLevel = 1; val.Amount = 20; val.Requirements = (RequirementConfig[])(object)new RequirementConfig[3] { new RequirementConfig { Item = ItemDropNames.Wood, Amount = 8 }, new RequirementConfig { Item = ItemDropNames.Feathers, Amount = 2 }, new RequirementConfig { Item = ItemDropNames.HardAntler, Amount = 1 } }; CustomItem val2 = new CustomItem("ArrowLightning", arrowSilver, val); GameObject itemPrefab = val2.ItemPrefab; if ((Object)(object)itemPrefab == (Object)null) { throw new NullReferenceException("prefab"); } ItemDrop component = itemPrefab.GetComponent<ItemDrop>(); if ((Object)(object)component == (Object)null) { throw new NullReferenceException("itemDrop"); } component.m_itemData.m_shared.m_name = "$item_lightning_arrow"; component.m_itemData.m_shared.m_description = "$item_lightning_arrow_description"; component.m_itemData.m_shared.m_itemType = (ItemType)9; component.m_itemData.m_shared.m_maxStackSize = 100; component.m_itemData.m_shared.m_weight = 0.1f; component.m_itemData.m_shared.m_backstabBonus = 4f; component.m_itemData.m_shared.m_damages.m_pierce = 28f; component.m_itemData.m_shared.m_damages.m_lightning = 40f; component.m_itemData.m_shared.m_damages.m_spirit = 0f; component.m_itemData.m_shared.m_icons[0] = LoadResourceIcon("Lightning_Arrow"); ItemManager.Instance.AddItem(val2); } } catch (Exception e) { Log.Error(Instance, e); } } private void InitConfig() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Expected O, but got Unknown //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Expected O, but got Unknown //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Expected O, but got Unknown //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Expected O, but got Unknown //IL_0103: 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_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Expected O, but got Unknown //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Expected O, but got Unknown //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Expected O, but got Unknown //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Expected O, but got Unknown //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Expected O, but got Unknown //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Expected O, but got Unknown //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Expected O, but got Unknown //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Expected O, but got Unknown //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_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Expected O, but got Unknown //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Expected O, but got Unknown //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Expected O, but got Unknown //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Expected O, but got Unknown //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: 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_02e9: Expected O, but got Unknown //IL_02e9: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: Expected O, but got Unknown //IL_0317: Unknown result type (might be due to invalid IL or missing references) //IL_031c: Unknown result type (might be due to invalid IL or missing references) //IL_0328: Unknown result type (might be due to invalid IL or missing references) //IL_0335: Expected O, but got Unknown //IL_0335: Unknown result type (might be due to invalid IL or missing references) //IL_033f: Expected O, but got Unknown //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_0368: Unknown result type (might be due to invalid IL or missing references) //IL_0374: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Expected O, but got Unknown //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_038b: Expected O, but got Unknown //IL_03af: Unknown result type (might be due to invalid IL or missing references) //IL_03b4: Unknown result type (might be due to invalid IL or missing references) //IL_03c0: Unknown result type (might be due to invalid IL or missing references) //IL_03cd: Expected O, but got Unknown //IL_03cd: Unknown result type (might be due to invalid IL or missing references) //IL_03d7: Expected O, but got Unknown //IL_03fb: Unknown result type (might be due to invalid IL or missing references) //IL_0400: Unknown result type (might be due to invalid IL or missing references) //IL_040c: Unknown result type (might be due to invalid IL or missing references) //IL_0419: Expected O, but got Unknown //IL_0419: Unknown result type (might be due to invalid IL or missing references) //IL_0423: Expected O, but got Unknown //IL_0447: Unknown result type (might be due to invalid IL or missing references) //IL_044c: Unknown result type (might be due to invalid IL or missing references) //IL_0458: Unknown result type (might be due to invalid IL or missing references) //IL_0465: Expected O, but got Unknown //IL_0465: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Expected O, but got Unknown //IL_0493: Unknown result type (might be due to invalid IL or missing references) //IL_0498: Unknown result type (might be due to invalid IL or missing references) //IL_04a4: Unknown result type (might be due to invalid IL or missing references) //IL_04b1: Expected O, but got Unknown //IL_04b1: Unknown result type (might be due to invalid IL or missing references) //IL_04bb: Expected O, but got Unknown //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04e4: Unknown result type (might be due to invalid IL or missing references) //IL_04f0: Unknown result type (might be due to invalid IL or missing references) //IL_04fd: Expected O, but got Unknown //IL_04fd: Unknown result type (might be due to invalid IL or missing references) //IL_0507: Expected O, but got Unknown //IL_052b: Unknown result type (might be due to invalid IL or missing references) //IL_0530: Unknown result type (might be due to invalid IL or missing references) //IL_053c: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Expected O, but got Unknown //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Expected O, but got Unknown //IL_0577: Unknown result type (might be due to invalid IL or missing references) //IL_057c: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_0595: Expected O, but got Unknown //IL_0595: Unknown result type (might be due to invalid IL or missing references) //IL_059f: Expected O, but got Unknown //IL_05c3: Unknown result type (might be due to invalid IL or missing references) //IL_05c8: Unknown result type (might be due to invalid IL or missing references) //IL_05d4: Unknown result type (might be due to invalid IL or missing references) //IL_05e1: Expected O, but got Unknown //IL_05e1: Unknown result type (might be due to invalid IL or missing references) //IL_05eb: Expected O, but got Unknown EnableFireBomb = ((BaseUnityPlugin)this).Config.Bind<bool>("Toggles", "EnableFireBomb", true, new ConfigDescription("Enable Fire Bomb", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes { Browsable = true, ReadOnly = false } })); EnableIceBomb = ((BaseUnityPlugin)this).Config.Bind<bool>("Toggles", "EnableIceBomb", true, new ConfigDescription("Enable Ice Bomb", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes { Browsable = true, ReadOnly = false } })); EnableBoneArrow = ((BaseUnityPlugin)this).Config.Bind<bool>("Toggles", "EnableBoneArrow", true, new ConfigDescription("Enable Bone Arrow", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes { Browsable = true, ReadOnly = false } })); EnableHeavyBoneArrow = ((BaseUnityPlugin)this).Config.Bind<bool>("Toggles", "EnableHeavyBoneArrow", true, new ConfigDescription("Enable Heavy Bone Arrow", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes { Browsable = true, ReadOnly = false } })); EnableBluntedArrow = ((BaseUnityPlugin)this).Config.Bind<bool>("Toggles", "EnableBluntedArrow", true, new ConfigDescription("Enable Blunted Arrow", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes { Browsable = true, ReadOnly = false } })); EnableHeavyBluntedArrow = ((BaseUnityPlugin)this).Config.Bind<bool>("Toggles", "EnableHeavyBluntedArrow", true, new ConfigDescription("Enable Heavy Blunted Arrow", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes { Browsable = true, ReadOnly = false } })); EnableObsidianFireArrow = ((BaseUnityPlugin)this).Config.Bind<bool>("Toggles", "EnableObsidianFireArrow", true, new ConfigDescription("Enable Obsidian Fire Arrow", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes { Browsable = true, ReadOnly = false } })); EnableHeavyFireArrow = ((BaseUnityPlugin)this).Config.Bind<bool>("Toggles", "EnableHeavyFireArrow", true, new ConfigDescription("Enable Heavy Fire Arrow", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes { Browsable = true, ReadOnly = false } })); EnableExplodingFireArrow = ((BaseUnityPlugin)this).Config.Bind<bool>("Toggles", "EnableExplodingFireArrow", true, new ConfigDescription("Enable Exploding Fire Arrow", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes { Browsable = true, ReadOnly = false } })); EnableHeavyFlintArrow = ((BaseUnityPlugin)this).Config.Bind<bool>("Toggles", "EnableHeavyFlintArrow", true, new ConfigDescription("Enable Heavy Flint Arrow", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes { Browsable = true, ReadOnly = false } })); EnableHeavyIceArrow = ((BaseUnityPlugin)this).Config.Bind<bool>("Toggles", "EnableHeavyIceArrow", true, new ConfigDescription("Enable Heavy Ice Arrow", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes { Browsable = true, ReadOnly = false } })); EnableExplodingIceArrow = ((BaseUnityPlugin)this).Config.Bind<bool>("Toggles", "EnableExplodingIceArrow", true, new ConfigDescription("Enable Exploding Ice Arrow", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes { Browsable = true, ReadOnly = false } })); EnableHeavyNeedleArrow = ((BaseUnityPlugin)this).Config.Bind<bool>("Toggles", "EnableHeavyNeedleArrow", true, new ConfigDescription("Enable Heavy Needle Arrow", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes { Browsable = true, ReadOnly = false } })); EnableHeavyObsidianArrow = ((BaseUnityPlugin)this).Config.Bind<bool>("Toggles", "EnableHeavyObsidianArrow", true, new ConfigDescription("Enable Heavy Obsidian Arrow", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes { Browsable = true, ReadOnly = false } })); EnableHeavyPoisonArrow = ((BaseUnityPlugin)this).Config.Bind<bool>("Toggles", "EnableHeavyPoisonArrow", true, new ConfigDescription("Enable Heavy Poison Arrow", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes { Browsable = true, ReadOnly = false } })); EnableExplodingPoisonArrow = ((BaseUnityPlugin)this).Config.Bind<bool>("Toggles", "EnableExplodingPoisonArrow", true, new ConfigDescription("Enable Exploding Poison Arrow", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes { Browsable = true, ReadOnly = false } })); EnableStoneArrow = ((BaseUnityPlugin)this).Config.Bind<bool>("Toggles", "EnableStoneArrow", true, new ConfigDescription("Enable Stone Arrow", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes { Browsable = true, ReadOnly = false } })); EnableXBow = ((BaseUnityPlugin)this).Config.Bind<bool>("Toggles", "EnableXBow", true, new ConfigDescription("Enable XBow", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes { Browsable = true, ReadOnly = false } })); EnableSimpleBoneArrow = ((BaseUnityPlugin)this).Config.Bind<bool>("Toggles", "EnableSimpleBoneArrow", true, new ConfigDescription("Enable Simple Bone Arrow", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes { Browsable = true, ReadOnly = false } })); EnableLightningArrow = ((BaseUnityPlugin)this).Config.Bind<bool>("Toggles", "EnableLightningArrow", true, new ConfigDescription("Enable Lightning Arrow", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes { Browsable = true, ReadOnly = false } })); } private static Sprite LoadResourceIcon(string name) { Log.Trace(Instance, "Digitalroot.ArrowsJvL." + MethodBase.GetCurrentMethod()?.DeclaringType?.Name + "." + MethodBase.GetCurrentMethod()?.Name); return LoadSpriteFromTexture(AssetUtils.LoadImage(GetResource(Assembly.GetCallingAssembly(), "Digitalroot.ArrowsJvL.Assets." + name + ".png"))); } private static Sprite LoadSpriteFromTexture(Texture2D spriteTexture, float pixelsPerUnit = 100f) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)spriteTexture)) { return null; } return Sprite.Create(spriteTexture, new Rect(0f, 0f, (float)((Texture)spriteTexture).width, (float)((Texture)spriteTexture).height), new Vector2(0f, 0f), pixelsPerUnit); } private static byte[] GetResource(Assembly asm, string resourceName) { Log.Trace(Instance, "Digitalroot.ArrowsJvL." + MethodBase.GetCurrentMethod()?.DeclaringType?.Name + "." + MethodBase.GetCurrentMethod()?.Name); Stream manifestResourceStream = asm.GetManifestResourceStream(resourceName); Log.Trace(Instance, $"[{MethodBase.GetCurrentMethod()?.DeclaringType?.Name}.{MethodBase.GetCurrentMethod()?.Name}] manifestResourceStream == null : {manifestResourceStream == null}"); if (manifestResourceStream == null) { throw new Exception("Unable to load the manifestResourceStream from " + asm.FullName + " for " + resourceName); } Log.Trace(Instance, $"[{MethodBase.GetCurrentMethod()?.DeclaringType?.Name}.{MethodBase.GetCurrentMethod()?.Name}] manifestResourceStream.Length : {manifestResourceStream.Length}"); byte[] array = new byte[manifestResourceStream.Length]; manifestResourceStream.Read(array, 0, checked((int)manifestResourceStream.Length)); Log.Trace(Instance, $"[{MethodBase.GetCurrentMethod()?.DeclaringType?.Name}.{MethodBase.GetCurrentMethod()?.Name}] array.Length : {array.Length}"); return array; } } } namespace Digitalroot.Valheim.Common { internal interface ITraceableLogging { string Source { get; } bool EnableTrace { get; } } internal sealed class Log { private static readonly Dictionary<string, TraceLogger> TraceLoggers; [UsedImplicitly] private static Log Instance { get; } static Log() { TraceLoggers = new Dictionary<string, TraceLogger>(); Instance = new Log(); } private Log() { TraceLoggers.Add("Digitalroot", new TraceLogger("Digitalroot", enableTrace: false)); } public static void RegisterSource(ITraceableLogging sender) { if ((!TraceLoggers.ContainsKey(sender.Source) || TraceLoggers[sender.Source].IsTraceEnabled != sender.EnableTrace) && (!TraceLoggers.ContainsKey(sender.Source) || sender.EnableTrace)) { if (TraceLoggers.ContainsKey(sender.Source) && sender.EnableTrace) { TraceLoggers[sender.Source].EnableTrace(); } else { TraceLoggers.Add(sender.Source, new TraceLogger(sender.Source, sender.EnableTrace)); } } } private static TraceLogger GetTraceLogger(ITraceableLogging sender) { if (!TraceLoggers.ContainsKey(sender.Source)) { return TraceLoggers["Digitalroot"]; } return TraceLoggers[sender.Source]; } [UsedImplicitly] public static void SetEnableTrace(ITraceableLogging sender, bool value) { if (value) { GetTraceLogger(sender).EnableTrace(); } else { GetTraceLogger(sender).DisableTrace(); } } [UsedImplicitly] public static void SetEnableTraceForAllLoggers(bool value) { foreach (TraceLogger value2 in TraceLoggers.Values) { if (value) { value2.EnableTrace(); } else { value2.DisableTrace(); } } } [UsedImplicitly] public static void Debug(ITraceableLogging sender, object value) { GetTraceLogger(sender).LoggerRef.LogDebug(value); } [UsedImplicitly] public static void Error(ITraceableLogging sender, Exception e, int i = 1) { Error(sender, "Message: " + e.Message); Error(sender, $"TargetSite: {e.TargetSite}"); Error(sender, "StackTrace: " + e.StackTrace); Error(sender, "Source: " + e.Source); if (e.Data.Count > 0) { foreach (object key in e.Data.Keys) { Error(sender, $"key: {key}, value: {e.Data[key]}"); } } if (e.InnerException != null) { Error(sender, $"--- InnerException [{i}][Start] ---"); Error(sender, e.InnerException, ++i); } } [UsedImplicitly] public static void Error(ITraceableLogging sender, object value) { GetTraceLogger(sender).LoggerRef.LogError(value); } [UsedImplicitly] public static void Info(ITraceableLogging sender, object value) { GetTraceLogger(sender).LoggerRef.LogInfo(value); } [UsedImplicitly] public static void Fatal(ITraceableLogging sender, Exception e, int i = 1) { Fatal(sender, "Message: " + e.Message); Fatal(sender, $"TargetSite: {e.TargetSite}"); Fatal(sender, "StackTrace: " + e.StackTrace); Fatal(sender, "Source: " + e.Source); if (e.Data.Count > 0) { foreach (object key in e.Data.Keys) { Fatal(sender, $"key: {key}, value: {e.Data[key]}"); } } if (e.InnerException != null) { Fatal(sender, $"--- InnerException [{i}][Start] ---"); Fatal(sender, e.InnerException, ++i); } } [UsedImplicitly] public static void Fatal(ITraceableLogging sender, object value) { GetTraceLogger(sender).LoggerRef.LogFatal(value); } [UsedImplicitly] public static void Message(ITraceableLogging sender, object value) { GetTraceLogger(sender).LoggerRef.LogMessage(value); } [UsedImplicitly] public static void Trace(ITraceableLogging sender, object value) { if (GetTraceLogger(sender).IsTraceEnabled || sender.EnableTrace) { GetTraceLogger(sender).LoggerRef.Log((LogLevel)63, value); } } [UsedImplicitly] public static void Warning(ITraceableLogging sender, object value) { GetTraceLogger(sender).LoggerRef.LogWarning(value); } } internal class TraceLogger { internal readonly ManualLogSource LoggerRef; private readonly string _source; private readonly FileInfo _traceFileInfo; public bool IsTraceEnabled { get; private set; } private DirectoryInfo AssemblyDirectory => new FileInfo(Uri.UnescapeDataString(new UriBuilder(Assembly.GetExecutingAssembly().CodeBase).Path)).Directory; public TraceLogger(string source, bool enableTrace) { _source = source; IsTraceEnabled = enableTrace; LoggerRef = Logger.CreateLogSource(_source); _traceFileInfo = new FileInfo(Path.Combine(Paths.BepInExRootPath ?? AssemblyDirectory.FullName, "logs", _source + ".Trace.log")); if (_traceFileInfo.DirectoryName != null) { Directory.CreateDirectory(_traceFileInfo.DirectoryName); } if (_traceFileInfo.Exists) { _traceFileInfo.Delete(); _traceFileInfo.Refresh(); } LoggerRef.LogEvent += OnLogEvent; } public void EnableTrace() { IsTraceEnabled = true; } public void DisableTrace() { IsTraceEnabled = false; } [UsedImplicitly] public void StopTrace() { LoggerRef.LogEvent -= OnLogEvent; } private void OnLogEvent(object sender, LogEventArgs e) { //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) if (e.Source.SourceName != _source || !IsTraceEnabled) { return; } using Mutex mutex = new Mutex(initiallyOwned: false, "Digitalroot.Valheim.Common.TraceLogger." + _source); mutex.WaitOne(); try { if (e.Data is string) { string contents = $"[{e.Level,-7}:{e.Source.SourceName,10}] {e.Data}{Environment.NewLine}"; File.AppendAllText(_traceFileInfo.FullName, contents, Encoding.UTF8); } else { string contents2 = $"[{e.Level,-7}:{e.Source.SourceName,10}] {JsonSerializationProvider.Serialize(e.Data)}{Environment.NewLine}"; File.AppendAllText(_traceFileInfo.FullName, contents2, Encoding.UTF8); } } finally { mutex.ReleaseMutex(); } } } } namespace Digitalroot.Valheim.Common.Json { [UsedImplicitly] internal static class JsonSerializationProvider { [Obsolete("Use Deserialize<T>()")] public static T FromJson<T>(string json) { return Deserialize<T>(json); } public static T Deserialize<T>(string json) { return SimpleJson.DeserializeObject<T>(json, (IJsonSerializerStrategy)(object)new DigitalrootJsonSerializerStrategy()); } [Obsolete("Use Serialize()")] public static string ToJson(object obj, bool pretty = false) { return Serialize(obj); } public static string Serialize(object obj) { return SimpleJson.SerializeObject(obj, (IJsonSerializerStrategy)(object)new DigitalrootJsonSerializerStrategy()); } } internal class DigitalrootJsonSerializerStrategy : PocoJsonSerializerStrategy { public override bool TrySerializeNonPrimitiveObject(object input, out object output) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) if (!(input is Vector3 val)) { if (input is Quaternion val2) { output = new float[4] { val2.x, val2.y, val2.z, val2.w }; return true; } return ((PocoJsonSerializerStrategy)this).TrySerializeNonPrimitiveObject(input, ref output); } output = new float[3] { val.x, val.y, val.z }; return true; } public override object DeserializeObject(object value, Type type) { //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) if (type == null) { throw new ArgumentNullException("type"); } if (value == null) { throw new ArgumentNullException("value"); } if (value is string value2) { if (string.IsNullOrWhiteSpace(value2)) { throw new ArgumentNullException("value"); } if (type == typeof(Vector3)) { if (!(((PocoJsonSerializerStrategy)this).DeserializeObject(value, typeof(float[])) is float[] array) || (array != null && array.Length != 3)) { throw new ArgumentException(string.Format("The value '{0}' can be converted to a {1}.", value, "Vector3"), "value"); } return (object)new Vector3(array[0], array[1], array[2]); } if (type == typeof(Quaternion)) { if (!(((PocoJsonSerializerStrategy)this).DeserializeObject(value, typeof(float[])) is float[] array2) || (array2 != null && array2.Length != 4)) { throw new ArgumentException(string.Format("The value '{0}' can be converted to a {1}.", value, "Quaternion"), "value"); } return (object)new Quaternion(array2[0], array2[1], array2[2], array2[3]); } return ((PocoJsonSerializerStrategy)this).DeserializeObject(value, type); } throw new ArgumentException($"The value '{value}' can be converted to a {type.Name}.", "value"); } } } namespace Digitalroot.Valheim.Common.Names.Vanilla { internal static class ItemDropNames { public static readonly IEnumerable<string> AllNames = Utils.AllNames(typeof(ItemDropNames)); public static string Acorn = "Acorn"; public static string Amber = "Amber"; public static string AmberPearl = "AmberPearl"; public static string AncientSkull = "ancient_skull"; public static string AncientSeed = "AncientSeed"; public static string ArmorCarapaceChest = "ArmorCarapaceChest"; public static string ArmorCarapaceLegs = "ArmorCarapaceLegs"; public static string ArmorDress1 = "ArmorDress1"; public static string ArmorDress2 = "ArmorDress2"; public static string ArmorDress3 = "ArmorDress3"; public static string ArmorDress4 = "ArmorDress4"; public static string ArmorDress5 = "ArmorDress5"; public static string ArmorDress6 = "ArmorDress6"; public static string ArmorDress7 = "ArmorDress7"; public static string ArmorDress8 = "ArmorDress8"; public static string ArmorDress9 = "ArmorDress9"; public static string ArmorDress10 = "ArmorDress10"; public static string ArmorFenringChest = "ArmorFenringChest"; public static string ArmorFenringLegs = "ArmorFenringLegs"; public static string ArmorFlametalChest = "ArmorFlametalChest"; public static string ArmorFlametalLegs = "ArmorFlametalLegs"; public static string ArmorHarvester1 = "ArmorHarvester1"; public static string ArmorHarvester2 = "ArmorHarvester2"; public static string ArmorAshlandsMediumChest = "ArmorAshlandsMediumChest"; public static string ArmorAshlandsMediumlegs = "ArmorAshlandsMediumlegs"; public static string ArmorBronzeChest = "ArmorBronzeChest"; public static string ArmorBronzeLegs = "ArmorBronzeLegs"; public static string ArmorIronChest = "ArmorIronChest"; public static string ArmorIronLegs = "ArmorIronLegs"; public static string ArmorMageChest = "ArmorMageChest"; public static string ArmorMageLegs = "ArmorMageLegs"; public static string ArmorMageLegsAshlands = "ArmorMageLegs_Ashlands"; public static string ArmorLeatherChest = "ArmorLeatherChest"; public static string ArmorLeatherLegs = "ArmorLeatherLegs"; public static string ArmorPaddedCuirass = "ArmorPaddedCuirass"; public static string ArmorPaddedGreaves = "ArmorPaddedGreaves"; public static string ArmorRagsChest = "ArmorRagsChest"; public static string ArmorRagsLegs = "ArmorRagsLegs"; public static string ArmorRootChest = "ArmorRootChest"; public static string ArmorRootLegs = "ArmorRootLegs"; public static string ArmorTrollLeatherChest = "ArmorTrollLeatherChest"; public static string ArmorTrollLeatherLegs = "ArmorTrollLeatherLegs"; public static string ArmorTunic1 = "ArmorTunic1"; public static string ArmorTunic2 = "ArmorTunic2"; public static string ArmorTunic3 = "ArmorTunic3"; public static string ArmorTunic4 = "ArmorTunic4"; public static string ArmorTunic5 = "ArmorTunic5"; public static string ArmorTunic6 = "ArmorTunic6"; public static string ArmorTunic7 = "ArmorTunic7"; public static string ArmorTunic8 = "ArmorTunic8"; public static string ArmorTunic9 = "ArmorTunic9"; public static string ArmorTunic10 = "ArmorTunic10"; public static string ArmorWolfChest = "ArmorWolfChest"; public static string ArmorWolfLegs = "ArmorWolfLegs"; public static string ArrowBronze = "ArrowBronze"; public static string ArrowCarapace = "ArrowCarapace"; public static string ArrowCharred = "ArrowCharred"; public static string ArrowFire = "ArrowFire"; public static string ArrowFlint = "ArrowFlint"; public static string ArrowFrost = "ArrowFrost"; public static string ArrowIron = "ArrowIron"; public static string ArrowNeedle = "ArrowNeedle"; public static string ArrowObsidian = "ArrowObsidian"; public static string ArrowPoison = "ArrowPoison"; public static string ArrowSilver = "ArrowSilver"; public static string ArrowWood = "ArrowWood"; public static string AsksvinEgg = "AsksvinEgg"; public static string AsksvinMeat = "AsksvinMeat"; public static string AtgeirBlackmetal = "AtgeirBlackmetal"; public static string AtgeirBronze = "AtgeirBronze"; public static string AtgeirHimminAfl = "AtgeirHimminAfl"; public static string AtgeirIron = "AtgeirIron"; public static string AtgeirWood = "AtgeirWood"; public static string AxeBlackMetal = "AxeBlackMetal"; public static string AxeBronze = "AxeBronze"; public static string AxeEarly = "AxeEarly"; public static string AxeFlint = "AxeFlint"; public static string AxeIron = "AxeIron"; public static string AxeJotunBane = "AxeJotunBane"; public static string AxeStone = "AxeStone"; public static string AxeWood = "AxeWood"; public static string BarberKit = "BarberKit"; public static string Barley = "Barley"; public static string BarleyFlour = "BarleyFlour"; public static string BarleyWine = "BarleyWine"; public static string BarleyWineBase = "BarleyWineBase"; public static string BarrelRings = "BarrelRings"; public static string Battleaxe = "Battleaxe"; public static string BattleaxeCrystal = "BattleaxeCrystal"; public static string BeechSeeds = "BeechSeeds"; public static string Bell = "Bell"; public static string BeltStrength = "BeltStrength"; public static string Bilebag = "Bilebag"; public static string BirchSeeds = "BirchSeeds"; public static string BjornHide = "BjornHide"; public static string BjornMeat = "BjornMeat"; public static string BjornPaw = "BjornPaw"; public static string BlackCore = "BlackCore"; public static string BlackMarble = "BlackMarble"; public static string BlackMetal = "BlackMetal"; public static string BlackMetalScrap = "BlackMetalScrap"; public static string BlackSoup = "BlackSoup"; public static string Blackwood = "Blackwood"; public static string Bloodbag = "Bloodbag"; public static string BloodPudding = "BloodPudding"; public static string Blueberries = "Blueberries"; public static string BoarJerky = "BoarJerky"; public static string BoltBlackmetal = "BoltBlackmetal"; public static string BoltBone = "BoltBone"; public static string BoltCarapace = "BoltCarapace"; public static string BoltCharred = "BoltCharred"; public static string BoltIron = "BoltIron"; public static string BombBile = "BombBile"; public static string BombLava = "BombLava"; public static string BombOoze = "BombOoze"; public static string BombSiege = "BombSiege"; public static string BombSmoke = "BombSmoke"; public static string BoneFragments = "BoneFragments"; public static string BoneMawSerpentMeat = "BoneMawSerpentMeat"; public static string BonemawSerpentScale = "BonemawSerpentScale"; public static string BonemawSerpentTooth = "BonemawSerpentTooth"; public static string Bow = "Bow"; public static string BowAshlands = "BowAshlands"; public static string BowAshlandsBlood = "BowAshlandsBlood"; public static string BowAshlandsRoot = "BowAshlandsRoot"; public static string BowAshlandsStorm = "BowAshlandsStorm"; public static string BowDraugrFang = "BowDraugrFang"; public static string BowFineWood = "BowFineWood"; public static string BowHuntsman = "BowHuntsman"; public static string BowSpineSnap = "BowSpineSnap"; public static string Bread = "Bread"; public static string BreadDough = "BreadDough"; public static string Bronze = "Bronze"; public static string BronzeNails = "BronzeNails"; public static string BronzeScrap = "BronzeScrap"; public static string BugMeat = "BugMeat"; public static string CandleWick = "CandleWick"; public static string CapeAsh = "CapeAsh"; public static string CapeAsksvin = "CapeAsksvin"; public static string CapeDeerHide = "CapeDeerHide"; public static string CapeFeather = "CapeFeather"; public static string CapeLinen = "CapeLinen"; public static string CapeLox = "CapeLox"; public static string CapeOdin = "CapeOdin"; public static string CapeTest = "CapeTest"; public static string CapeTrollHide = "CapeTrollHide"; public static string CapeWolf = "CapeWolf"; public static string Carapace = "Carapace"; public static string Carrot = "Carrot"; public static string CarrotSeeds = "CarrotSeeds"; public static string CarrotSoup = "CarrotSoup"; public static string CelestialFeather = "CelestialFeather"; public static string CeramicPlate = "CeramicPlate"; public static string Chain = "Chain"; public static string CharcoalResin = "CharcoalResin"; public static string CharredBone = "CharredBone"; public static string CharredCogwheel = "CharredCogwheel"; public static string CharredBreastplate = "Charred_Breastplate"; public static string CharredHelmet = "Charred_Helmet"; public static string CharredHipCloth = "Charred_HipCloth"; public static string CharredMageCloths = "Charred_MageCloths"; public static string ChestHildir1 = "chest_hildir1"; public static string ChestHildir2 = "chest_hildir2"; public static string ChestHildir3 = "chest_hildir3"; public static string Chicken = "Chicken"; public static string ChickenEgg = "ChickenEgg"; public static string ChickenMeat = "ChickenMeat"; public static string Chitin = "Chitin"; public static string Cinder = "Cinder"; public static string Cloudberry = "Cloudberry"; public static string Club = "Club"; public static string Coal = "Coal"; public static string Coins = "Coins"; public static string CookedAsksvinMeat = "CookedAsksvinMeat"; public static string CookedBoneMawSerpentMeat = "CookedBoneMawSerpentMeat"; public static string CookedBugMeat = "CookedBugMeat"; public static string CookedChickenMeat = "CookedChickenMeat"; public static string CookedDeerMeat = "CookedDeerMeat"; public static string CookedEgg = "CookedEgg"; public static string CookedHareMeat = "CookedHareMeat"; public static string CookedLoxMeat = "CookedLoxMeat"; public static string CookedWolfMeat = "CookedWolfMeat"; public static string CookedMeat = "CookedMeat"; public static string CookedVoltureMeat = "CookedVoltureMeat"; public static string Copper = "Copper"; public static string CopperOre = "CopperOre"; public static string CopperScrap = "CopperScrap"; public static string CrossbowArbalest = "CrossbowArbalest"; public static string CryptKey = "CryptKey"; public static string Crystal = "Crystal"; public static string Cultivator = "Cultivator"; public static string CuredSquirrelHamstring = "CuredSquirrelHamstring"; public static string Dandelion = "Dandelion"; public static string DeerHide = "DeerHide"; public static string DeerMeat = "DeerMeat"; public static string DeerStew = "DeerStew"; public static string Demister = "Demister"; public static string DragonEgg = "DragonEgg"; public static string DragonTear = "DragonTear"; public static string DvergrKey = "DvergrKey"; public static string DvergrKeyFragment = "DvergrKeyFragment"; public static string DvergrNeedle = "DvergrNeedle"; public static string DvergerStaffFire = "DvergerStaffFire"; public static string DvergerStaffHeal = "DvergerStaffHeal"; public static string DvergerStaffIce = "DvergerStaffIce"; public static string DvergerStaffSupport = "DvergerStaffSupport"; public static string DvergerSuitArbalest = "DvergerSuitArbalest"; public static string DvergerSuitArbalestAshlands = "DvergerSuitArbalest_Ashlands"; public static string DvergerSuitFire = "DvergerSuitFire"; public static string DvergerSuitIce = "DvergerSuitIce"; public static string DvergerSuitSupport = "DvergerSuitSupport"; public static string DyrnwynBladeFragment = "DyrnwynBladeFragment"; public static string DyrnwynHiltFragment = "DyrnwynHiltFragment"; public static string DyrnwynTipFragment = "DyrnwynTipFragment"; public static string Eitr = "Eitr"; public static string Eikthyrnir = "Eikthyrnir"; public static string ElderBark = "ElderBark"; public static string Entrails = "Entrails"; public static string Eyescream = "Eyescream"; public static string FaderDrop = "FaderDrop"; public static string FeastAshlandsMaterial = "FeastAshlands_Material"; public static string FeastBlackforestMaterial = "FeastBlackforest_Material"; public static string Feaster = "Feaster"; public static string FeastMeadowsMaterial = "FeastMeadows_Material"; public static string FeastMistlandsMaterial = "FeastMistlands_Material"; public static string FeastMountainsMaterial = "FeastMountains_Material"; public static string FeastOceansMaterial = "FeastOceans_Material"; public static string FeastPlainsMaterial = "FeastPlains_Material"; public static string FeastSwampsMaterial = "FeastSwamps_Material"; public static string Feathers = "Feathers"; public static string FineWood = "FineWood"; public static string FirCone = "FirCone"; public static string FishAndBread = "FishAndBread"; public static string FishAndBreadUncooked = "FishAndBreadUncooked"; public static string FishAnglerRaw = "FishAnglerRaw"; public static string FishCooked = "FishCooked"; public static string FishingBait = "FishingBait"; public static string FishingBaitAshlands = "FishingBaitAshlands"; public static string FishingBaitCave = "FishingBaitCave"; public static string FishingBaitDeepNorth = "FishingBaitDeepNorth"; public static string FishingBaitForest = "FishingBaitForest"; public static string FishingBaitMistlands = "FishingBaitMistlands"; public static string FishingBaitOcean = "FishingBaitOcean"; public static string FishingBaitPlains = "FishingBaitPlains"; public static string FishingBaitSwamp = "FishingBaitSwamp"; public static string FishingRod = "FishingRod"; public static string FishRaw = "FishRaw"; public static string FishWraps = "FishWraps"; public static string FistFenrirClaw = "FistFenrirClaw"; public static string Flametal = "Flametal"; public static string FlametalNew = "FlametalNew"; public static string FlametalOre = "FlametalOre"; public static string FlametalOreNew = "FlametalOreNew"; public static string Flax = "Flax"; public static string Flint = "Flint"; public static string FragrantBundle = "FragrantBundle"; public static string FreezeGland = "FreezeGland"; public static string FreshSeaweed = "FreshSeaweed"; public static string GemstoneBlue = "GemstoneBlue"; public static string GemstoneGreen = "GemstoneGreen"; public static string GemstoneRed = "GemstoneRed"; public static string GiantBloodSack = "GiantBloodSack"; public static string GlowingMushroom = "GlowingMushroom"; public static string GoblinGem = "Goblin_Gem"; public static string GoblinTotem = "GoblinTotem"; public static string Grausten = "Grausten"; public static string GreydwarfEye = "GreydwarfEye"; public static string Guck = "Guck"; public static string Hammer = "Hammer"; public static string HareMeat = "HareMeat"; public static string HardAntler = "HardAntler"; public static string HelmetAshlandsMediumHood = "HelmetAshlandsMediumHood"; public static string HelmetBronze = "HelmetBronze"; public static string HelmetCarapace = "HelmetCarapace"; public static string HelmetDrake = "HelmetDrake"; public static string HelmetDverger = "HelmetDverger"; public static string HelmetFenring = "HelmetFenring"; public static string HelmetFishingHat = "HelmetFishingHat"; public static string HelmetFlametal = "HelmetFlametal"; public static string HelmetHat1 = "HelmetHat1"; public static string HelmetHat2 = "HelmetHat2"; public static string HelmetHat3 = "HelmetHat3"; public static string HelmetHat4 = "HelmetHat4"; public static string HelmetHat5 = "HelmetHat5"; public static string HelmetHat6 = "HelmetHat6"; public static string HelmetHat7 = "HelmetHat7"; public static string HelmetHat8 = "HelmetHat8"; public static string HelmetHat9 = "HelmetHat9"; public static string HelmetHat10 = "HelmetHat10"; public static string HelmetIron = "HelmetIron"; public static string HelmetLeather = "HelmetLeather"; public static string HelmetMage = "HelmetMage"; public static string HelmetMageAshlands = "HelmetMage_Ashlands"; public stat