Decompiled source of vrp v11.9.1
files/plugins/goldbees.dll
Decompiled 2 weeks agousing System; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using HarmonyLib; using Jotunn.Configs; using Jotunn.Entities; using Jotunn.Managers; using Jotunn.Utils; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("goldbees")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("goldbees")] [assembly: AssemblyCopyright("Copyright © 2021")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("3B95EEF7-4A97-4393-91A0-3626434F3631")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace goldbees; [BepInPlugin("1010101110.goldbees", "goldbees", "1.0.6")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Mod : BaseUnityPlugin { public static readonly Harmony harmony = new Harmony(typeof(Mod).GetCustomAttributes(typeof(BepInPlugin), inherit: false).Cast<BepInPlugin>().First() .GUID); private void Awake() { harmony.PatchAll(); PrefabManager.OnVanillaPrefabsAvailable += AddPrefabs; } private void OnDestroy() { harmony.UnpatchSelf(); } private void AddPrefabs() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Expected O, but got Unknown //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Expected O, but got Unknown //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Expected O, but got Unknown //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Expected O, but got Unknown //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Expected O, but got Unknown //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Expected O, but got Unknown //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Expected O, but got Unknown //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Expected O, but got Unknown //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Expected O, but got Unknown //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Expected O, but got Unknown //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: 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_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Expected O, but got Unknown //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Expected O, but got Unknown //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_020b: 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_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_025b: 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_0273: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Expected O, but got Unknown //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Expected O, but got Unknown //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_0316: Expected O, but got Unknown //IL_0311: Unknown result type (might be due to invalid IL or missing references) //IL_031b: Expected O, but got Unknown //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_0334: Expected O, but got Unknown //IL_0365: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_0376: Unknown result type (might be due to invalid IL or missing references) //IL_0380: Expected O, but got Unknown //IL_0382: Unknown result type (might be due to invalid IL or missing references) //IL_0387: Unknown result type (might be due to invalid IL or missing references) //IL_0393: Unknown result type (might be due to invalid IL or missing references) //IL_039b: Unknown result type (might be due to invalid IL or missing references) //IL_03a4: Expected O, but got Unknown //IL_03ac: Unknown result type (might be due to invalid IL or missing references) //IL_03b6: Expected O, but got Unknown //IL_03fa: Unknown result type (might be due to invalid IL or missing references) //IL_0443: Unknown result type (might be due to invalid IL or missing references) //IL_0449: Expected O, but got Unknown //IL_0498: Unknown result type (might be due to invalid IL or missing references) //IL_04e1: Unknown result type (might be due to invalid IL or missing references) //IL_04e8: Expected O, but got Unknown //IL_053d: Unknown result type (might be due to invalid IL or missing references) //IL_058d: Unknown result type (might be due to invalid IL or missing references) //IL_0594: Expected O, but got Unknown //IL_05e9: Unknown result type (might be due to invalid IL or missing references) //IL_0639: Unknown result type (might be due to invalid IL or missing references) //IL_0640: Expected O, but got Unknown //IL_0657: Unknown result type (might be due to invalid IL or missing references) //IL_065e: Expected O, but got Unknown //IL_0694: Unknown result type (might be due to invalid IL or missing references) //IL_0699: Unknown result type (might be due to invalid IL or missing references) //IL_06a5: Unknown result type (might be due to invalid IL or missing references) //IL_06ae: Expected O, but got Unknown //IL_06b0: Unknown result type (might be due to invalid IL or missing references) //IL_06b5: Unknown result type (might be due to invalid IL or missing references) //IL_06c1: Unknown result type (might be due to invalid IL or missing references) //IL_06ca: Expected O, but got Unknown //IL_06cc: Unknown result type (might be due to invalid IL or missing references) //IL_06d1: Unknown result type (might be due to invalid IL or missing references) //IL_06dd: Unknown result type (might be due to invalid IL or missing references) //IL_06e6: Expected O, but got Unknown //IL_06ee: Unknown result type (might be due to invalid IL or missing references) //IL_06f5: Expected O, but got Unknown //IL_0743: Unknown result type (might be due to invalid IL or missing references) //IL_074a: Expected O, but got Unknown //IL_078e: Unknown result type (might be due to invalid IL or missing references) //IL_0793: Unknown result type (might be due to invalid IL or missing references) //IL_079f: Unknown result type (might be due to invalid IL or missing references) //IL_07a8: Expected O, but got Unknown //IL_07b0: Unknown result type (might be due to invalid IL or missing references) //IL_07b7: Expected O, but got Unknown //IL_07c9: Unknown result type (might be due to invalid IL or missing references) //IL_084f: Unknown result type (might be due to invalid IL or missing references) //IL_0854: Unknown result type (might be due to invalid IL or missing references) //IL_0860: Unknown result type (might be due to invalid IL or missing references) //IL_086c: Unknown result type (might be due to invalid IL or missing references) //IL_087a: Expected O, but got Unknown //IL_0875: Unknown result type (might be due to invalid IL or missing references) //IL_087f: Expected O, but got Unknown //IL_088a: Unknown result type (might be due to invalid IL or missing references) //IL_0891: Expected O, but got Unknown //IL_08c7: Unknown result type (might be due to invalid IL or missing references) //IL_08cc: Unknown result type (might be due to invalid IL or missing references) //IL_08d8: Unknown result type (might be due to invalid IL or missing references) //IL_08e1: Expected O, but got Unknown //IL_08e3: Unknown result type (might be due to invalid IL or missing references) //IL_08e8: Unknown result type (might be due to invalid IL or missing references) //IL_08f4: Unknown result type (might be due to invalid IL or missing references) //IL_08fd: Expected O, but got Unknown //IL_08ff: Unknown result type (might be due to invalid IL or missing references) //IL_0904: Unknown result type (might be due to invalid IL or missing references) //IL_0910: Unknown result type (might be due to invalid IL or missing references) //IL_0919: Expected O, but got Unknown //IL_0921: Unknown result type (might be due to invalid IL or missing references) //IL_0928: Expected O, but got Unknown //IL_0977: Unknown result type (might be due to invalid IL or missing references) //IL_097e: Expected O, but got Unknown //IL_09c2: Unknown result type (might be due to invalid IL or missing references) //IL_09c7: Unknown result type (might be due to invalid IL or missing references) //IL_09d3: Unknown result type (might be due to invalid IL or missing references) //IL_09dc: Expected O, but got Unknown //IL_09e4: Unknown result type (might be due to invalid IL or missing references) //IL_09eb: Expected O, but got Unknown //IL_09fd: Unknown result type (might be due to invalid IL or missing references) //IL_0a84: Unknown result type (might be due to invalid IL or missing references) //IL_0a89: Unknown result type (might be due to invalid IL or missing references) //IL_0a95: Unknown result type (might be due to invalid IL or missing references) //IL_0aa1: Unknown result type (might be due to invalid IL or missing references) //IL_0aaf: Expected O, but got Unknown //IL_0aaa: Unknown result type (might be due to invalid IL or missing references) //IL_0ab4: Expected O, but got Unknown //IL_0abf: Unknown result type (might be due to invalid IL or missing references) //IL_0ac6: Expected O, but got Unknown //IL_0afc: Unknown result type (might be due to invalid IL or missing references) //IL_0b01: Unknown result type (might be due to invalid IL or missing references) //IL_0b0d: Unknown result type (might be due to invalid IL or missing references) //IL_0b16: Expected O, but got Unknown //IL_0b18: Unknown result type (might be due to invalid IL or missing references) //IL_0b1d: Unknown result type (might be due to invalid IL or missing references) //IL_0b29: Unknown result type (might be due to invalid IL or missing references) //IL_0b32: Expected O, but got Unknown //IL_0b34: Unknown result type (might be due to invalid IL or missing references) //IL_0b39: Unknown result type (might be due to invalid IL or missing references) //IL_0b45: Unknown result type (might be due to invalid IL or missing references) //IL_0b4e: Expected O, but got Unknown //IL_0b50: Unknown result type (might be due to invalid IL or missing references) //IL_0b55: Unknown result type (might be due to invalid IL or missing references) //IL_0b61: Unknown result type (might be due to invalid IL or missing references) //IL_0b6a: Expected O, but got Unknown //IL_0b72: Unknown result type (might be due to invalid IL or missing references) //IL_0b79: Expected O, but got Unknown //IL_0bc8: Unknown result type (might be due to invalid IL or missing references) //IL_0bcf: Expected O, but got Unknown //IL_0c13: Unknown result type (might be due to invalid IL or missing references) //IL_0c18: Unknown result type (might be due to invalid IL or missing references) //IL_0c24: Unknown result type (might be due to invalid IL or missing references) //IL_0c2d: Expected O, but got Unknown //IL_0c35: Unknown result type (might be due to invalid IL or missing references) //IL_0c3c: Expected O, but got Unknown //IL_0c4e: Unknown result type (might be due to invalid IL or missing references) //IL_0cd5: Unknown result type (might be due to invalid IL or missing references) //IL_0cda: Unknown result type (might be due to invalid IL or missing references) //IL_0ce6: Unknown result type (might be due to invalid IL or missing references) //IL_0cf2: Unknown result type (might be due to invalid IL or missing references) //IL_0d00: Expected O, but got Unknown //IL_0cfb: Unknown result type (might be due to invalid IL or missing references) //IL_0d05: Expected O, but got Unknown //IL_0d10: Unknown result type (might be due to invalid IL or missing references) //IL_0d17: Expected O, but got Unknown //IL_0d4d: Unknown result type (might be due to invalid IL or missing references) //IL_0d52: Unknown result type (might be due to invalid IL or missing references) //IL_0d5e: Unknown result type (might be due to invalid IL or missing references) //IL_0d67: Expected O, but got Unknown //IL_0d69: Unknown result type (might be due to invalid IL or missing references) //IL_0d6e: Unknown result type (might be due to invalid IL or missing references) //IL_0d7a: Unknown result type (might be due to invalid IL or missing references) //IL_0d83: Expected O, but got Unknown //IL_0d85: Unknown result type (might be due to invalid IL or missing references) //IL_0d8a: Unknown result type (might be due to invalid IL or missing references) //IL_0d96: Unknown result type (might be due to invalid IL or missing references) //IL_0d9f: Expected O, but got Unknown //IL_0da1: Unknown result type (might be due to invalid IL or missing references) //IL_0da6: Unknown result type (might be due to invalid IL or missing references) //IL_0db2: Unknown result type (might be due to invalid IL or missing references) //IL_0dbb: Expected O, but got Unknown //IL_0dc3: Unknown result type (might be due to invalid IL or missing references) //IL_0dca: Expected O, but got Unknown //IL_0e19: Unknown result type (might be due to invalid IL or missing references) //IL_0e20: Expected O, but got Unknown //IL_0e64: Unknown result type (might be due to invalid IL or missing references) //IL_0e69: Unknown result type (might be due to invalid IL or missing references) //IL_0e75: Unknown result type (might be due to invalid IL or missing references) //IL_0e7e: Expected O, but got Unknown //IL_0e86: Unknown result type (might be due to invalid IL or missing references) //IL_0e8d: Expected O, but got Unknown //IL_0e9f: Unknown result type (might be due to invalid IL or missing references) //IL_0f26: Unknown result type (might be due to invalid IL or missing references) //IL_0f2b: Unknown result type (might be due to invalid IL or missing references) //IL_0f37: Unknown result type (might be due to invalid IL or missing references) //IL_0f43: Unknown result type (might be due to invalid IL or missing references) //IL_0f51: Expected O, but got Unknown //IL_0f4c: Unknown result type (might be due to invalid IL or missing references) //IL_0f56: Expected O, but got Unknown AssetBundle val = AssetUtils.LoadAssetBundleFromResources("goldbees", typeof(Mod).Assembly); ItemManager instance = ItemManager.Instance; GameObject obj = val.LoadAsset<GameObject>("QueenBeeGold"); ItemConfig val2 = new ItemConfig(); val2.Description = "this sweetie sure is shiny"; val2.CraftingStation = "forge"; val2.MinStationLevel = 1; val2.Amount = 1; val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[2] { new RequirementConfig { Item = "QueenBee", Amount = 2 }, new RequirementConfig { Item = "Coins", Amount = 999 } }; instance.AddItem(new CustomItem(obj, false, val2)); ItemManager.Instance.AddItem(new CustomItem(val.LoadAsset<GameObject>("HoneyGold"), false, new ItemConfig { Enabled = false })); ItemManager.Instance.AddItem(new CustomItem(val.LoadAsset<GameObject>("Mums"), false, new ItemConfig { Enabled = false })); ItemManager.Instance.AddItem(new CustomItem(val.LoadAsset<GameObject>("Edelweiss"), false, new ItemConfig { Enabled = false })); ItemManager.Instance.AddItem(new CustomItem(val.LoadAsset<GameObject>("Scabiosa"), false, new ItemConfig { Enabled = false })); PrefabManager.Instance.AddPrefab(val.LoadAsset<GameObject>("BeehiveGold")); ZoneManager.Instance.AddCustomVegetation(new CustomVegetation(val.LoadAsset<GameObject>("Pickable_mums"), false, new VegetationConfig { Biome = (Biome)1, Max = 0.75f, BlockCheck = true, InForest = false, GroupSizeMin = 2, GroupSizeMax = 5, GroupRadius = 4f, MinAltitude = 1f, ScaleMin = 1.3f, ScaleMax = 1.8f })); ZoneManager.Instance.AddCustomVegetation(new CustomVegetation(val.LoadAsset<GameObject>("Pickable_edelweiss"), false, new VegetationConfig { Biome = (Biome)4, Max = 1f, BlockCheck = true, GroupSizeMin = 2, GroupSizeMax = 8, GroupRadius = 4f, MinAltitude = 1f, TerrainDeltaRadius = 2f, MinTerrainDelta = 0f, MaxTerrainDelta = 3f, ScaleMin = 0.6f, ScaleMax = 0.8f })); ZoneManager.Instance.AddCustomVegetation(new CustomVegetation(val.LoadAsset<GameObject>("Pickable_scabiosa"), false, new VegetationConfig { Biome = (Biome)16, Max = 0.5f, BlockCheck = true, InForest = false, GroupSizeMin = 5, GroupSizeMax = 8, GroupRadius = 4f, MinAltitude = 1f, ScaleMin = 0.4f, ScaleMax = 0.6f })); PieceManager instance2 = PieceManager.Instance; GameObject obj2 = val.LoadAsset<GameObject>("piece_beehive_gold"); PieceConfig val3 = new PieceConfig(); val3.PieceTable = "Hammer"; val3.Category = "Crafting"; val3.CraftingStation = "piece_workbench"; val3.Requirements = (RequirementConfig[])(object)new RequirementConfig[2] { new RequirementConfig { Item = "FineWood", Amount = 10 }, new RequirementConfig { Item = "QueenBeeGold", Amount = 1, Recover = true } }; instance2.AddPiece(new CustomPiece(obj2, true, val3)); SE_Stats val4 = ScriptableObject.CreateInstance<SE_Stats>(); ((Object)val4).name = "Soothin"; ((StatusEffect)val4).m_name = "Soothin"; ((StatusEffect)val4).m_icon = PrefabManager.Instance.GetPrefab("Honey").GetComponent<ItemDrop>().m_itemData.GetIcon(); ((StatusEffect)val4).m_startMessageType = (MessageType)1; ((StatusEffect)val4).m_startMessage = "you feel soothed and comforted."; val4.m_speedModifier = -0.8f; val4.m_healthOverTime = 20f; val4.m_staminaOverTime = 20f; val4.m_healthOverTimeInterval = 2f; ((StatusEffect)val4).m_ttl = 10f; CustomStatusEffect val5 = new CustomStatusEffect((StatusEffect)(object)val4, false); ItemManager.Instance.AddStatusEffect(val5); SE_Stats val6 = ScriptableObject.CreateInstance<SE_Stats>(); ((Object)val6).name = "Golden"; ((StatusEffect)val6).m_name = "Golden"; ((StatusEffect)val6).m_icon = PrefabManager.Instance.GetPrefab("HoneyGold").GetComponent<ItemDrop>().m_itemData.GetIcon(); ((StatusEffect)val6).m_startMessageType = (MessageType)1; ((StatusEffect)val6).m_startMessage = "you feel shiny and comforted."; val6.m_speedModifier = -0.8f; val6.m_healthOverTime = 30f; val6.m_staminaOverTime = 30f; val6.m_healthOverTimeInterval = 2f; ((StatusEffect)val6).m_ttl = 10f; CustomStatusEffect val7 = new CustomStatusEffect((StatusEffect)(object)val6, false); ItemManager.Instance.AddStatusEffect(val7); SE_Stats val8 = ScriptableObject.CreateInstance<SE_Stats>(); ((Object)val8).name = "Chillin"; ((StatusEffect)val8).m_name = "Chillin"; ((StatusEffect)val8).m_icon = PrefabManager.Instance.GetPrefab("Edelweiss").GetComponent<ItemDrop>().m_itemData.GetIcon(); ((StatusEffect)val8).m_startMessageType = (MessageType)1; ((StatusEffect)val8).m_startMessage = "so refreshing! sweet and cool and comforting!"; val8.m_speedModifier = -0.8f; val8.m_healthOverTime = 69f; val8.m_healthOverTimeInterval = 1f; val8.m_staminaOverTime = 69f; ((StatusEffect)val8).m_ttl = 10f; CustomStatusEffect val9 = new CustomStatusEffect((StatusEffect)(object)val8, false); ItemManager.Instance.AddStatusEffect(val9); SE_Stats val10 = ScriptableObject.CreateInstance<SE_Stats>(); ((Object)val10).name = "Easy"; ((StatusEffect)val10).m_name = "Easy"; ((StatusEffect)val10).m_icon = PrefabManager.Instance.GetPrefab("Scabiosa").GetComponent<ItemDrop>().m_itemData.GetIcon(); ((StatusEffect)val10).m_startMessageType = (MessageType)1; ((StatusEffect)val10).m_startMessage = "just taking it easy comfortably"; val10.m_speedModifier = -0.8f; val10.m_healthOverTime = 69f; val10.m_healthOverTimeInterval = 1f; val10.m_staminaOverTime = 420f; ((StatusEffect)val10).m_ttl = 10f; CustomStatusEffect val11 = new CustomStatusEffect((StatusEffect)(object)val10, false); ItemManager.Instance.AddStatusEffect(val11); val2 = new ItemConfig(); val2.Description = "This mush smells pleasant, throw it in a fermenter?"; val2.Amount = 1; val2.CraftingStation = "piece_cauldron"; val2.MinStationLevel = 1; val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[3] { new RequirementConfig { Item = "Dandelion", Amount = 5 }, new RequirementConfig { Item = "Raspberry", Amount = 5 }, new RequirementConfig { Item = "Honey", Amount = 4 } }; CustomItem val12 = new CustomItem("MushSoothing", "MeadBaseTasty", val2); val12.ItemDrop.m_itemData.m_shared.m_name = "Soothing Mush"; val12.ItemDrop.m_itemData.m_shared.m_consumeStatusEffect = val5.StatusEffect; ItemManager.Instance.AddItem(val12); val2 = new ItemConfig(); val2.Name = "Honey Tea"; val2.Description = "a soothing tea"; val2.CraftingStation = "piece_cauldron"; val2.MinStationLevel = 1; val2.Amount = 20; val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[1] { new RequirementConfig { Item = "SledgeCheat", Amount = 1 } }; CustomItem val13 = new CustomItem("HoneyTea", "Tankard", val2); val13.ItemDrop.m_itemData.m_shared.m_itemType = (ItemType)2; val13.ItemDrop.m_itemData.m_shared.m_ammoType = "mead"; val13.ItemDrop.m_itemData.m_shared.m_attack.m_attackAnimation = "emote_drink"; val13.ItemDrop.m_itemData.m_shared.m_consumeStatusEffect = val5.StatusEffect; val13.ItemDrop.m_itemData.m_shared.m_maxStackSize = 30; ItemManager.Instance.AddItem(val13); ItemManager.Instance.AddItemConversion(new CustomItemConversion((ConversionConfig)new FermenterConversionConfig { FromItem = "MushSoothing", ToItem = "HoneyTea", ProducedItems = 10 })); val2 = new ItemConfig(); val2.Description = "This shiny mush, throw it in a fermenter?"; val2.Amount = 1; val2.CraftingStation = "piece_cauldron"; val2.MinStationLevel = 1; val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[3] { new RequirementConfig { Item = "Mums", Amount = 5 }, new RequirementConfig { Item = "Blueberries", Amount = 5 }, new RequirementConfig { Item = "HoneyGold", Amount = 4 } }; CustomItem val14 = new CustomItem("MushGolden", "MeadBaseTasty", val2); val14.ItemDrop.m_itemData.m_shared.m_name = "Golden Mush"; val14.ItemDrop.m_itemData.m_shared.m_consumeStatusEffect = val7.StatusEffect; ItemManager.Instance.AddItem(val14); val2 = new ItemConfig(); val2.Name = "Golden Tea"; val2.Description = "a radiant tea"; val2.CraftingStation = "piece_cauldron"; val2.MinStationLevel = 2; val2.Amount = 20; val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[1] { new RequirementConfig { Item = "SledgeCheat", Amount = 1 } }; CustomItem val15 = new CustomItem("GoldenTea", "Tankard", val2); val15.ItemDrop.m_itemData.m_shared.m_itemType = (ItemType)2; val15.ItemDrop.m_itemData.m_shared.m_ammoType = "mead"; val15.ItemDrop.m_itemData.m_shared.m_attack.m_attackAnimation = "emote_drink"; val15.ItemDrop.m_itemData.m_shared.m_consumeStatusEffect = val7.StatusEffect; val15.ItemDrop.m_itemData.m_shared.m_maxStackSize = 30; ItemManager.Instance.AddItem(val15); ItemManager.Instance.AddItemConversion(new CustomItemConversion((ConversionConfig)new FermenterConversionConfig { FromItem = "MushGolden", ToItem = "GoldenTea", ProducedItems = 10 })); val2 = new ItemConfig(); val2.Description = "This mush is cold, throw it in a fermenter?"; val2.Amount = 1; val2.CraftingStation = "piece_cauldron"; val2.MinStationLevel = 2; val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[4] { new RequirementConfig { Item = "Edelweiss", Amount = 5 }, new RequirementConfig { Item = "Dandelion", Amount = 5 }, new RequirementConfig { Item = "Crystal", Amount = 1 }, new RequirementConfig { Item = "HoneyGold", Amount = 4 } }; CustomItem val16 = new CustomItem("MushIced", "MeadBaseTasty", val2); val16.ItemDrop.m_itemData.m_shared.m_name = "Iced Mush"; val16.ItemDrop.m_itemData.m_shared.m_consumeStatusEffect = val9.StatusEffect; ItemManager.Instance.AddItem(val16); val2 = new ItemConfig(); val2.Name = "Iced Tea"; val2.Description = "a chilly tea"; val2.CraftingStation = "piece_cauldron"; val2.MinStationLevel = 1; val2.Amount = 20; val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[1] { new RequirementConfig { Item = "SledgeCheat", Amount = 1 } }; CustomItem val17 = new CustomItem("IcedTea", "Tankard", val2); val17.ItemDrop.m_itemData.m_shared.m_itemType = (ItemType)2; val17.ItemDrop.m_itemData.m_shared.m_ammoType = "mead"; val17.ItemDrop.m_itemData.m_shared.m_attack.m_attackAnimation = "emote_drink"; val17.ItemDrop.m_itemData.m_shared.m_consumeStatusEffect = val9.StatusEffect; val17.ItemDrop.m_itemData.m_shared.m_maxStackSize = 30; ItemManager.Instance.AddItem(val17); ItemManager.Instance.AddItemConversion(new CustomItemConversion((ConversionConfig)new FermenterConversionConfig { FromItem = "MushIced", ToItem = "IcedTea", ProducedItems = 10 })); val2 = new ItemConfig(); val2.Description = "This mush is flowery, throw it in a fermenter?"; val2.Amount = 1; val2.CraftingStation = "piece_cauldron"; val2.MinStationLevel = 2; val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[4] { new RequirementConfig { Item = "Mums", Amount = 5 }, new RequirementConfig { Item = "Scabiosa", Amount = 5 }, new RequirementConfig { Item = "Cloudberry", Amount = 5 }, new RequirementConfig { Item = "HoneyGold", Amount = 4 } }; CustomItem val18 = new CustomItem("MushEasy", "MeadBaseTasty", val2); val18.ItemDrop.m_itemData.m_shared.m_name = "Easy Mush"; val18.ItemDrop.m_itemData.m_shared.m_consumeStatusEffect = val11.StatusEffect; ItemManager.Instance.AddItem(val18); val2 = new ItemConfig(); val2.Name = "Easy Tea"; val2.Description = "it's not easy to make but it do make you feel at ease!"; val2.CraftingStation = "piece_cauldron"; val2.MinStationLevel = 1; val2.Amount = 20; val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[1] { new RequirementConfig { Item = "SledgeCheat", Amount = 1 } }; CustomItem val19 = new CustomItem("EasyTea", "Tankard", val2); val19.ItemDrop.m_itemData.m_shared.m_itemType = (ItemType)2; val19.ItemDrop.m_itemData.m_shared.m_ammoType = "mead"; val19.ItemDrop.m_itemData.m_shared.m_attack.m_attackAnimation = "emote_drink"; val19.ItemDrop.m_itemData.m_shared.m_consumeStatusEffect = val11.StatusEffect; val19.ItemDrop.m_itemData.m_shared.m_maxStackSize = 30; ItemManager.Instance.AddItem(val19); ItemManager.Instance.AddItemConversion(new CustomItemConversion((ConversionConfig)new FermenterConversionConfig { FromItem = "MushEasy", ToItem = "EasyTea", ProducedItems = 10 })); } } public class MyPatches { [HarmonyPatch(typeof(SE_Rested), "CalculateComfortLevel", new Type[] { typeof(Player) })] private class restedadditions { private static void Postfix(Player player, ref int __result) { if (((Character)player).m_seman.HaveStatusEffect(StringExtensionMethods.GetStableHashCode("Soothin"))) { __result += 5; } if (((Character)player).m_seman.HaveStatusEffect(StringExtensionMethods.GetStableHashCode("Golden"))) { __result += 5; } if (((Character)player).m_seman.HaveStatusEffect(StringExtensionMethods.GetStableHashCode("Chillin"))) { __result += 5; } if (((Character)player).m_seman.HaveStatusEffect(StringExtensionMethods.GetStableHashCode("Easy"))) { __result += 10; } } } }
files/plugins/me.dll
Decompiled 2 weeks agousing System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using HarmonyLib; using TMPro; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("me")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("me")] [assembly: AssemblyCopyright("Copyright © 2021")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("3B95EEF7-4A97-4393-91A0-3626434F3631")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace tripping { [BepInPlugin("1010101110.me", "me", "1.0.0")] public class Mod : BaseUnityPlugin { public static readonly Harmony harmony = new Harmony(typeof(Mod).GetCustomAttributes(typeof(BepInPlugin), inherit: false).Cast<BepInPlugin>().First() .GUID); private void Awake() { harmony.PatchAll(); } private void OnDestroy() { harmony.UnpatchSelf(); } } } namespace tripping.Patches { public class TrippingPatches { [HarmonyPatch(typeof(Chat), "Awake")] private class awakepatch { private static void Postfix(ref Chat __instance) { ((Terminal)__instance).AddString("/me textttttttt"); ((Terminal)__instance).AddString(""); } } [HarmonyPatch(typeof(Chat), "InputText")] private class sendtextpatch { private static bool Prefix(ref Chat __instance) { if (((TMP_InputField)((Terminal)__instance).m_input).text.StartsWith("/me ")) { try { string text = ((TMP_InputField)((Terminal)__instance).m_input).text.Substring(4); ((TMP_InputField)((Terminal)__instance).m_input).text = text + "{|me|}"; } catch { ((Terminal)__instance).AddString("failed me... /me blah blah blah"); return false; } } return true; } } [HarmonyPatch(typeof(Chat), "OnNewChatMessage")] private class addstringpatch { private static bool Prefix(GameObject go, long senderID, Vector3 pos, Type type, UserInfo user, string text, string senderNetworkUserId, ref Chat __instance) { if (text.Contains("{|me|}")) { string text2 = text.Replace("{|me|}", ""); ((Terminal)__instance).AddString("<color=#d65804>" + user.GetDisplayName(senderNetworkUserId) + " " + text2 + "</color>"); return false; } return true; } } } }
files/plugins/modelchanger.dll
Decompiled 2 weeks agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using HarmonyLib; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("modelchanger")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("1010101110")] [assembly: AssemblyProduct("modelchanger")] [assembly: AssemblyCopyright("Copyright © 2021")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("3B95EEF7-4A97-4393-91A0-3626434F3631")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace modelchanger; [BepInPlugin("1010101110.modelchanger", "modelchanger", "1.0.4")] public class Mod : BaseUnityPlugin { [HarmonyPatch(typeof(Player), "Start")] private static class PlayerStartPatch { private static void Postfix(Player __instance) { if ((Object)(object)CustomRuntime == (Object)null) { CustomRuntime = MakeAOC(replacementMap, ((Character)__instance).m_animator.runtimeAnimatorController); } if (!Object.op_Implicit((Object)(object)Player.m_localPlayer)) { return; } string @string = ((Character)__instance).m_nview.m_zdo.GetString("KGmodelchanged", ""); if (!string.IsNullOrWhiteSpace(@string)) { ApplyModelOnPlayer(__instance, @string); } if (Humanoids != null) { return; } Humanoids = new Dictionary<string, string>(); foreach (GameObject prefab in ZNetScene.instance.m_prefabs) { Humanoid component = prefab.GetComponent<Humanoid>(); if (Object.op_Implicit((Object)(object)component)) { if (((Character)component).m_name != null) { Humanoids.Add(((Object)prefab.gameObject).name, ((Character)prefab.GetComponent<Humanoid>()).m_name); } else { Humanoids.Add(((Object)prefab.gameObject).name, ((Object)prefab.gameObject).name); } } OrderedHumanoids = Humanoids.OrderBy(delegate(KeyValuePair<string, string> name) { Localization instance = Localization.instance; KeyValuePair<string, string> keyValuePair = name; return instance.Localize(keyValuePair.Value); }); } } } [HarmonyPatch(typeof(ZNetScene), "Awake")] private static class AddingZroutMethods { private static void Postfix() { ZRoutedRpc.instance.Register<ZPackage>("KGchangemodel", (Action<long, ZPackage>)PlayerChangedModel); } } [HarmonyPatch(typeof(Terminal), "InitTerminal")] public static class addcheats { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static ConsoleEvent <>9__0_0; public static ConsoleEvent <>9__0_1; internal void <Postfix>b__0_0(ConsoleEventArgs args) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown //IL_0058: Unknown result type (might be due to invalid IL or missing references) if (args.Length == 2) { if (Humanoids.ContainsKey(args[1])) { ((Character)Player.m_localPlayer).m_nview.m_zdo.Set("KGmodelchanged", args[1]); ZPackage val = new ZPackage(); val.Write(((Character)Player.m_localPlayer).GetZDOID()); val.Write(args[1]); ZRoutedRpc.instance.InvokeRoutedRPC(ZRoutedRpc.Everybody, "KGchangemodel", new object[1] { val }); args.Context.AddString("model changed! " + args[1]); } else { args.Context.AddString("invalid model"); } } else { args.Context.AddString("you must specify a model, use modellist to get the options"); } } internal void <Postfix>b__0_1(ConsoleEventArgs args) { string text = "Models you can change to(hopefully): "; foreach (KeyValuePair<string, string> orderedHumanoid in OrderedHumanoids) { text = text + orderedHumanoid.Key + ", "; } args.Context.AddString(text); } } private static void Postfix() { //IL_0033: 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_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Expected O, but got Unknown object obj = <>c.<>9__0_0; if (obj == null) { ConsoleEvent val = delegate(ConsoleEventArgs args) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown //IL_0058: Unknown result type (might be due to invalid IL or missing references) if (args.Length == 2) { if (Humanoids.ContainsKey(args[1])) { ((Character)Player.m_localPlayer).m_nview.m_zdo.Set("KGmodelchanged", args[1]); ZPackage val3 = new ZPackage(); val3.Write(((Character)Player.m_localPlayer).GetZDOID()); val3.Write(args[1]); ZRoutedRpc.instance.InvokeRoutedRPC(ZRoutedRpc.Everybody, "KGchangemodel", new object[1] { val3 }); args.Context.AddString("model changed! " + args[1]); } else { args.Context.AddString("invalid model"); } } else { args.Context.AddString("you must specify a model, use modellist to get the options"); } }; <>c.<>9__0_0 = val; obj = (object)val; } new ConsoleCommand("modelchange", "", (ConsoleEvent)obj, true, false, false, true, false, (ConsoleOptionsFetcher)null, false, false, false); object obj2 = <>c.<>9__0_1; if (obj2 == null) { ConsoleEvent val2 = delegate(ConsoleEventArgs args) { string text = "Models you can change to(hopefully): "; foreach (KeyValuePair<string, string> orderedHumanoid in OrderedHumanoids) { text = text + orderedHumanoid.Key + ", "; } args.Context.AddString(text); }; <>c.<>9__0_1 = val2; obj2 = (object)val2; } new ConsoleCommand("modellist", "", (ConsoleEvent)obj2, true, false, false, true, false, (ConsoleOptionsFetcher)null, false, false, false); } } public static readonly Harmony harmony = new Harmony(typeof(Mod).GetCustomAttributes(typeof(BepInPlugin), inherit: false).Cast<BepInPlugin>().First() .GUID); private static RuntimeAnimatorController CustomRuntime; private static Dictionary<string, string> Humanoids; private static IOrderedEnumerable<KeyValuePair<string, string>> OrderedHumanoids; private static Dictionary<string, string> replacementMap = new Dictionary<string, string>(); public static Dictionary<string, AnimationClip> ExternalAnimations = new Dictionary<string, AnimationClip>(); private void Awake() { harmony.PatchAll(); } private void OnDestroy() { harmony.UnpatchSelf(); } private static void ResetPlayerModel(Player p) { Transform val = ((Component)p).transform.Find("NewVisual"); if (Object.op_Implicit((Object)(object)(((Object)(object)val != (Object)null) ? ((Component)val).gameObject : null))) { Object.Destroy((Object)(object)((Component)((Component)p).transform.Find("NewVisual")).gameObject); } ((Character)p).m_visual = ((Component)((Component)p).transform.Find("Visual")).gameObject; ((Character)p).m_visual.transform.SetSiblingIndex(0); ((Character)p).m_visual.SetActive(true); ((Character)p).m_animator = ((Character)p).m_visual.GetComponent<Animator>(); ((Character)p).m_zanim.m_animator = ((Character)p).m_visual.GetComponent<Animator>(); ((Humanoid)p).m_visEquipment.m_visual = ((Character)p).m_visual; ((Component)p).GetComponent<FootStep>().m_feet = (Transform[])(object)new Transform[2] { Utils.FindChild(((Character)p).m_visual.transform, "LeftFoot", (IterativeSearchType)0), Utils.FindChild(((Character)p).m_visual.transform, "RightFoot", (IterativeSearchType)0) }; ((Humanoid)p).m_visEquipment.m_rightHand = Utils.FindChild(((Character)p).m_visual.transform, "RightHand_Attach", (IterativeSearchType)0); ((Humanoid)p).m_visEquipment.m_leftHand = Utils.FindChild(((Character)p).m_visual.transform, "LeftHand_Attach", (IterativeSearchType)0); ((Humanoid)p).m_visEquipment.m_helmet = Utils.FindChild(((Character)p).m_visual.transform, "Helmet_attach", (IterativeSearchType)0); ((Collider)((Character)p).m_collider).enabled = true; } private static void ApplyModelOnPlayer(Player p, string changedModel) { //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) ResetPlayerModel(p); GameObject prefab = ZNetScene.instance.GetPrefab(changedModel); if (!Object.op_Implicit((Object)(object)prefab) || !Object.op_Implicit((Object)(object)prefab.GetComponent<Humanoid>())) { return; } prefab = ((Component)prefab.GetComponentInChildren<Animator>()).gameObject; ((Character)p).m_visual = Object.Instantiate<GameObject>(prefab, ((Component)p).transform); ((Character)p).m_visual.transform.SetSiblingIndex(0); ((Object)((Character)p).m_visual.transform).name = "NewVisual"; Collider val = CopyComponent<Collider>(ZNetScene.instance.GetPrefab(changedModel).GetComponent<Collider>(), ((Character)p).m_visual); ((Component)val).gameObject.layer = ((Component)((Character)p).m_collider).gameObject.layer; Transform val2 = Utils.FindChild(((Character)p).m_visual.transform, "Armature", (IterativeSearchType)0); if (Object.op_Implicit((Object)(object)val2)) { Vector3 localScale = val2.localScale; Bounds bounds = ((Character)p).m_visual.GetComponentInChildren<SkinnedMeshRenderer>().sharedMesh.bounds; Vector3 val3 = Vector3.Scale(localScale, ((Bounds)(ref bounds)).size); if (((Vector3)(ref val3)).magnitude >= 12f) { val2.localScale = new Vector3(val2.localScale.x / 3.5f, val2.localScale.y / 3.5f, val2.localScale.z / 3.5f); CapsuleCollider val4 = (CapsuleCollider)(object)((val is CapsuleCollider) ? val : null); if ((Object)(object)val4 != (Object)null) { val4.radius /= 3.5f; } } } ((Character)p).m_visual.transform.localPosition = Vector3.zero; ((Character)p).m_visual.GetComponent<Animator>().runtimeAnimatorController = CustomRuntime; ((Character)p).m_animator = ((Character)p).m_visual.GetComponent<Animator>(); ((Character)p).m_zanim.m_animator = ((Character)p).m_visual.GetComponent<Animator>(); ((Component)((Component)p).transform.Find("Visual")).gameObject.SetActive(false); ((Humanoid)p).m_visEquipment.m_visual = ((Character)p).m_visual; if ((Object)(object)Utils.FindChild(((Character)p).m_visual.transform, "RightHand_Attach", (IterativeSearchType)0) != (Object)null) { ((Humanoid)p).m_visEquipment.m_rightHand = Utils.FindChild(((Character)p).m_visual.transform, "RightHand_Attach", (IterativeSearchType)0); ((Humanoid)p).m_visEquipment.m_leftHand = Utils.FindChild(((Character)p).m_visual.transform, "LeftHand_Attach", (IterativeSearchType)0); ((Humanoid)p).m_visEquipment.m_helmet = Utils.FindChild(((Character)p).m_visual.transform, "Helmet_attach", (IterativeSearchType)0); } else if ((Object)(object)Utils.FindChild(((Character)p).m_visual.transform, "RightAttach", (IterativeSearchType)0) != (Object)null) { ((Humanoid)p).m_visEquipment.m_rightHand = Utils.FindChild(((Character)p).m_visual.transform, "RightAttach", (IterativeSearchType)0); ((Humanoid)p).m_visEquipment.m_leftHand = Utils.FindChild(((Character)p).m_visual.transform, "LeftAttach", (IterativeSearchType)0); ((Humanoid)p).m_visEquipment.m_helmet = Utils.FindChild(((Character)p).m_visual.transform, "HelmetAttach", (IterativeSearchType)0); } else if ((Object)(object)Utils.FindChild(((Character)p).m_visual.transform, "RightHand", (IterativeSearchType)0) != (Object)null) { ((Humanoid)p).m_visEquipment.m_rightHand = Utils.FindChild(((Character)p).m_visual.transform, "RightHand", (IterativeSearchType)0); ((Humanoid)p).m_visEquipment.m_leftHand = Utils.FindChild(((Character)p).m_visual.transform, "LeftHand", (IterativeSearchType)0); ((Humanoid)p).m_visEquipment.m_helmet = Utils.FindChild(((Character)p).m_visual.transform, "Head", (IterativeSearchType)0); } else if ((Object)(object)Utils.FindChild(((Character)p).m_visual.transform, "l_hand", (IterativeSearchType)0) != (Object)null) { ((Humanoid)p).m_visEquipment.m_rightHand = Utils.FindChild(((Character)p).m_visual.transform, "r_hand", (IterativeSearchType)0); ((Humanoid)p).m_visEquipment.m_leftHand = Utils.FindChild(((Character)p).m_visual.transform, "l_hand", (IterativeSearchType)0); ((Humanoid)p).m_visEquipment.m_helmet = Utils.FindChild(((Character)p).m_visual.transform, "head", (IterativeSearchType)0); } else if ((Object)(object)Utils.FindChild(((Character)p).m_visual.transform, "mixamorig:RightHand", (IterativeSearchType)0) != (Object)null) { ((Humanoid)p).m_visEquipment.m_rightHand = Utils.FindChild(((Character)p).m_visual.transform, "mixamorig:RightHand", (IterativeSearchType)0); ((Humanoid)p).m_visEquipment.m_leftHand = Utils.FindChild(((Character)p).m_visual.transform, "mixamorig:LeftHand", (IterativeSearchType)0); ((Humanoid)p).m_visEquipment.m_helmet = Utils.FindChild(((Character)p).m_visual.transform, "mixamorig:HeadTop_End", (IterativeSearchType)0); } ((Collider)((Character)p).m_collider).enabled = false; ((Component)p).GetComponent<FootStep>().m_feet = (Transform[])(object)new Transform[2] { Utils.FindChild(((Character)p).m_visual.transform, "LeftFoot", (IterativeSearchType)0), Utils.FindChild(((Character)p).m_visual.transform, "RightFoot", (IterativeSearchType)0) }; } private static void PlayerChangedModel(long sender, ZPackage pkg) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) ZDOID val = pkg.ReadZDOID(); string changedModel = pkg.ReadString(); GameObject val2 = ZNetScene.instance.FindInstance(val); if (Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)val2.GetComponent<Player>())) { Player component = val2.GetComponent<Player>(); ApplyModelOnPlayer(component, changedModel); } } private static T CopyComponent<T>(T original, GameObject destination) where T : Component { Type type = ((object)original).GetType(); Component val = destination.AddComponent(type); try { BindingFlags bindingAttr = BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; PropertyInfo[] properties = type.GetProperties(bindingAttr); PropertyInfo[] array = properties; foreach (PropertyInfo propertyInfo in array) { if (propertyInfo.CanWrite) { propertyInfo.SetValue(val, propertyInfo.GetValue(original, null), null); } } FieldInfo[] fields = type.GetFields(bindingAttr); FieldInfo[] array2 = fields; foreach (FieldInfo fieldInfo in array2) { fieldInfo.SetValue(val, fieldInfo.GetValue(original)); } } catch { } return (T)(object)((val is T) ? val : null); } public static RuntimeAnimatorController MakeAOC(Dictionary<string, string> replacement, RuntimeAnimatorController ORIGINAL) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown AnimatorOverrideController val = new AnimatorOverrideController(ORIGINAL); List<KeyValuePair<AnimationClip, AnimationClip>> list = new List<KeyValuePair<AnimationClip, AnimationClip>>(); AnimationClip[] animationClips = ((RuntimeAnimatorController)val).animationClips; foreach (AnimationClip val2 in animationClips) { string name = ((Object)val2).name; if (replacement.ContainsKey(name)) { AnimationClip value = Object.Instantiate<AnimationClip>(ExternalAnimations[replacement[name]]); list.Add(new KeyValuePair<AnimationClip, AnimationClip>(val2, value)); } else { list.Add(new KeyValuePair<AnimationClip, AnimationClip>(val2, val2)); } } val.ApplyOverrides((IList<KeyValuePair<AnimationClip, AnimationClip>>)list); return (RuntimeAnimatorController)(object)val; } }
files/plugins/ReadWriteBook.dll.notreally
Decompiled 2 weeks ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; using System.ComponentModel; using System.Diagnostics; using System.Dynamic; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Serialization; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Text.RegularExpressions; using System.Xml.Serialization; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using HarmonyLib; using ItemDataManager; using ItemManager; using JetBrains.Annotations; using Microsoft.CodeAnalysis; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.UI; using fastJSON; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("ReadWriteBook")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ReadWriteBook")] [assembly: AssemblyCopyright("Copyright © 2024")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("481E504E-B321-458E-9D0F-25344E38AB24")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace ReadWriteBook { [BepInPlugin("kg.ReadWriteBook", "ReadWriteBook", "1.0.0")] public class ReadWriteBook : BaseUnityPlugin { public class Book_IDM : ItemData { private class _internal { public int MaxPages; public string BookName; public bool IsMagic; public bool CannotEdit; public Dictionary<int, string> Pages = new Dictionary<int, string>(); } private _internal Data; public void LoadFromOther(Book_IDM other) { Data = new _internal { MaxPages = other.Data.MaxPages, BookName = other.Data.BookName, IsMagic = other.Data.IsMagic, CannotEdit = true, Pages = new Dictionary<int, string>(other.Data.Pages) }; Save(); } public string GetBookName() { return Data.BookName; } public string GetTextForPage(int page) { if (!Data.Pages.TryGetValue(page, out var value) || string.IsNullOrWhiteSpace(value)) { return ""; } return Data.Pages[page]; } public int GetMaxPages() { return Data.MaxPages; } public bool IsMagic() { return Data.IsMagic; } public bool CanEdit() { return !Data.CannotEdit; } public void SetTextForPage(int page, string text) { if (page >= 0 && page <= Data.MaxPages) { Data.Pages[page] = text; Save(); } } public void SetBookName(string name) { Data.BookName = name; Save(); } public void Init(int maxPages, bool isMagic) { Data = new _internal { MaxPages = maxPages, BookName = "Bookname", IsMagic = isMagic }; Save(); } public override void Save() { if (Data != null) { base.Value = JSON.ToJSON(Data); } } public override void Load() { if (string.IsNullOrEmpty(base.Value)) { Data = new _internal(); } else { Data = JSON.ToObject<_internal>(base.Value); } } } [HarmonyPatch(typeof(ItemData), "GetTooltip", new Type[] { typeof(ItemData), typeof(int), typeof(bool), typeof(float) })] private static class ItemDrop__Patch { [UsedImplicitly] private static void Postfix(ItemData item, bool crafting, ref string __result) { Book_IDM book_IDM = item.Data().Get<Book_IDM>(); if (book_IDM != null && !crafting) { __result = __result + "\n<color=yellow>Book Name:</color> <color=green>" + book_IDM.GetBookName() + "</color>"; __result += $"\n<color=yellow>Max Pages:</color> <color=green>{book_IDM.GetMaxPages()}</color>"; __result += "\n<color=green>Right Click</color> <color=yellow>to read</color>"; if (book_IDM.CanEdit()) { __result += "\n<color=yellow>Hold <color=green>L. Shift + L. Ctrl + Right Click</color> to copy</color>"; } } } } [HarmonyPatch(typeof(ItemStand), "CanAttach")] private static class ItemStand_CanAttach_Patch { [UsedImplicitly] private static void Postfix(ItemStand __instance, ItemData item, ref bool __result) { Book_IDM book_IDM = item.Data().Get<Book_IDM>(); if (book_IDM != null) { __result = true; } } } [HarmonyPatch(typeof(Humanoid), "UseItem")] private static class Humanoid_UseItem_Patch { [UsedImplicitly] private static void Postfix(ItemData item) { //IL_00dd: 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) GameObject hoverObject = ((Humanoid)Player.m_localPlayer).GetHoverObject(); if (hoverObject != null && Object.op_Implicit((Object)(object)hoverObject.GetComponentInParent<ItemStand>())) { return; } Book_IDM book_IDM = item.Data().Get<Book_IDM>(); if (book_IDM == null) { return; } if (book_IDM.CanEdit() && Input.GetKey((KeyCode)304) && Input.GetKey((KeyCode)306)) { string name = ((Object)item.m_dropPrefab).name; Recipe recipe = ObjectDB.instance.GetRecipe(ZNetScene.instance.GetPrefab(name).GetComponent<ItemDrop>().m_itemData); if (Object.op_Implicit((Object)(object)recipe)) { if (!Player.m_localPlayer.HaveRequirementItems(recipe, false, 1)) { MessageHud.instance.ShowMessage((MessageType)2, "Missing materials", 0, (Sprite)null); return; } Player.m_localPlayer.ConsumeResources(recipe.m_resources, 1, -1); } GameObject prefab = ZNetScene.instance.GetPrefab(name); GameObject val = Object.Instantiate<GameObject>(prefab, ((Component)Player.m_localPlayer).transform.position, Quaternion.identity); val.GetComponent<ItemDrop>().m_itemData.Data().Get<Book_IDM>().LoadFromOther(book_IDM); val.GetComponent<ItemDrop>().m_itemData.m_crafterName = book_IDM.Item.m_crafterName; val.GetComponent<ItemDrop>().m_itemData.m_crafterID = book_IDM.Item.m_crafterID; val.GetComponent<ItemDrop>().Save(); if (((Humanoid)Player.m_localPlayer).m_inventory.AddItem(val.GetComponent<ItemDrop>().m_itemData)) { ZNetScene.instance.Destroy(val); } MessageHud.instance.ShowMessage((MessageType)2, "Book copied", 0, (Sprite)null); } else { ReadWriteBookUI.Show(book_IDM); } } } private const string GUID = "kg.ReadWriteBook"; private const string NAME = "ReadWriteBook"; private const string VERSION = "1.0.0"; public static AssetBundle asset; private static ReadWriteBook _thistype; private static AssetBundle GetAssetBundle(string filename) { Assembly executingAssembly = Assembly.GetExecutingAssembly(); string name = executingAssembly.GetManifestResourceNames().Single((string str) => str.EndsWith(filename)); using Stream stream = executingAssembly.GetManifestResourceStream(name); return AssetBundle.LoadFromStream(stream); } private void Awake() { //IL_013b: Unknown result type (might be due to invalid IL or missing references) _thistype = this; asset = GetAssetBundle("kg_readwritebook"); Item item = new Item(asset, "kg_ReadWriteBook"); item.Name.English("Book"); item.Crafting.Add(CraftingTable.Workbench, 1); item.RequiredItems.Add("Coal", 5); item.RequiredItems.Add("DeerHide", 3); item.Configurable = Configurability.Recipe; item.Prefab.GetComponent<ItemDrop>().m_itemData.Data().Add<Book_IDM>().Init(10, isMagic: false); Item item2 = new Item(asset, "kg_ReadWriteBook_Magic"); item2.Name.English("Heavy Book"); item2.Crafting.Add(CraftingTable.Workbench, 1); item2.RequiredItems.Add("Coal", 5); item2.RequiredItems.Add("DeerHide", 3); item2.RequiredItems.Add("FineWood", 3); item2.Configurable = Configurability.Recipe; item2.Prefab.GetComponent<ItemDrop>().m_itemData.Data().Add<Book_IDM>().Init(20, isMagic: true); ReadWriteBookUI.Init(); new Harmony("kg.ReadWriteBook").PatchAll(); } private void Update() { if (Input.GetKeyDown((KeyCode)27) && ReadWriteBookUI.IsVisible) { if (ReadWriteBookUI.IsSelectedInputField(EventSystem.current.currentSelectedGameObject)) { EventSystem.current.SetSelectedGameObject((GameObject)null); } else { ((MonoBehaviour)_thistype).StartCoroutine(DelayedAction(ReadWriteBookUI.Hide, 1)); } } } private static IEnumerator DelayedAction(Action invoke, int skipFrames) { for (int i = 0; i < skipFrames; i++) { yield return null; } invoke(); } } public static class ReadWriteBookUI { [HarmonyPatch(typeof(TextInput), "IsVisible")] private static class IsVisible_Patch { [UsedImplicitly] private static void Postfix(ref bool __result) { __result |= IsVisible; } } [HarmonyPatch(typeof(StoreGui), "IsVisible")] private static class IsVisible_Patch2 { [UsedImplicitly] private static void Postfix(ref bool __result) { __result |= IsVisible; } } [HarmonyPatch(typeof(InventoryGui), "Hide")] private static class InventoryGui_Hide_Patch { [UsedImplicitly] private static bool Prefix() { return !IsVisible; } } [HarmonyPatch(typeof(InputField), "DeactivateInputField")] private static class InputField_DeactivateInputField_Patch { [UsedImplicitly] private static void Prefix(InputField __instance) { if (!((Object)(object)__instance != (Object)(object)PageLeftInput) || !((Object)(object)__instance != (Object)(object)PageRightInput)) { AccessTools.Field(typeof(InputField), "m_WasCanceled").SetValue(__instance, false); } } } [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static UnityAction<string> <>9__12_0; public static UnityAction<string> <>9__12_1; public static UnityAction<string> <>9__12_2; public static UnityAction <>9__12_3; public static UnityAction <>9__12_4; internal void <Init>b__12_0(string text) { SaveLeft(); } internal void <Init>b__12_1(string text) { SaveRight(); } internal void <Init>b__12_2(string text) { SaveName(); } internal void <Init>b__12_3() { ChangePage(-2); } internal void <Init>b__12_4() { ChangePage(2); } } private static GameObject UI; private static Text PageLeftText; private static Text PageRightText; private static InputField PageLeftInput; private static InputField PageRightInput; private static InputField BookNameInput; private static Button PageLeftButton; private static Button PageRightButton; private static ReadWriteBook.Book_IDM CurrentBook; private static int CurrentPage; private static bool SkipSaveEvent; public static bool IsVisible { get { if (Object.op_Implicit((Object)(object)UI)) { return UI.activeSelf; } return false; } } public static void Init() { //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Expected O, but got Unknown //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Expected O, but got Unknown UI = Object.Instantiate<GameObject>(ReadWriteBook.asset.LoadAsset<GameObject>("kg_ReadWriteBookUI")); Object.DontDestroyOnLoad((Object)(object)UI); UI.SetActive(false); PageLeftText = ((Component)UI.transform.Find("Canvas/MainTab/PageLeftText")).GetComponent<Text>(); PageRightText = ((Component)UI.transform.Find("Canvas/MainTab/PageRightText")).GetComponent<Text>(); PageLeftInput = ((Component)UI.transform.Find("Canvas/MainTab/TextLeft")).GetComponent<InputField>(); PageRightInput = ((Component)UI.transform.Find("Canvas/MainTab/TextRight")).GetComponent<InputField>(); BookNameInput = ((Component)UI.transform.Find("Canvas/MainTab/BookName")).GetComponent<InputField>(); PageLeftButton = ((Component)UI.transform.Find("Canvas/MainTab/PageLeft")).GetComponent<Button>(); PageRightButton = ((Component)UI.transform.Find("Canvas/MainTab/PageRight")).GetComponent<Button>(); ((UnityEvent<string>)(object)PageLeftInput.onEndEdit).AddListener((UnityAction<string>)delegate { SaveLeft(); }); ((UnityEvent<string>)(object)PageRightInput.onEndEdit).AddListener((UnityAction<string>)delegate { SaveRight(); }); ((UnityEvent<string>)(object)BookNameInput.onEndEdit).AddListener((UnityAction<string>)delegate { SaveName(); }); ButtonClickedEvent onClick = PageLeftButton.onClick; object obj = <>c.<>9__12_3; if (obj == null) { UnityAction val = delegate { ChangePage(-2); }; <>c.<>9__12_3 = val; obj = (object)val; } ((UnityEvent)onClick).AddListener((UnityAction)obj); ButtonClickedEvent onClick2 = PageRightButton.onClick; object obj2 = <>c.<>9__12_4; if (obj2 == null) { UnityAction val2 = delegate { ChangePage(2); }; <>c.<>9__12_4 = val2; obj2 = (object)val2; } ((UnityEvent)onClick2).AddListener((UnityAction)obj2); } private static void SaveLeft() { if (CurrentBook != null && !SkipSaveEvent) { CurrentBook.SetTextForPage(CurrentPage, PageLeftInput.text); } } private static void SaveRight() { if (CurrentBook != null && !SkipSaveEvent) { CurrentBook.SetTextForPage(CurrentPage + 1, PageRightInput.text); } } private static void SaveName() { if (CurrentBook != null && !SkipSaveEvent) { CurrentBook.SetBookName(BookNameInput.text); } } private static void ChangePage(int delta) { if (CurrentBook != null && CurrentPage + delta > 0 && CurrentPage + delta <= CurrentBook.GetMaxPages()) { CurrentPage += delta; FillInputs(); } } private static void FillInputs() { PageLeftInput.text = ""; PageRightInput.text = ""; if (CurrentBook != null) { SkipSaveEvent = true; PageLeftInput.text = CurrentBook.GetTextForPage(CurrentPage); PageRightInput.text = CurrentBook.GetTextForPage(CurrentPage + 1); PageLeftText.text = $"{CurrentPage}"; PageRightText.text = $"{CurrentPage + 1}"; BookNameInput.text = CurrentBook.GetBookName(); SkipSaveEvent = false; bool flag = CurrentBook.CanEdit(); PageLeftInput.readOnly = !flag; PageRightInput.readOnly = !flag; BookNameInput.readOnly = !flag; } } public static void Show(ReadWriteBook.Book_IDM book) { if (!IsVisible) { CurrentBook = book; CurrentPage = 1; FillInputs(); UI.SetActive(true); } } public static void Hide() { UI.SetActive(false); } public static bool IsSelectedInputField(GameObject go) { if (!Object.op_Implicit((Object)(object)go)) { return false; } if (!((Object)(object)go == (Object)(object)((Component)PageLeftInput).gameObject) && !((Object)(object)go == (Object)(object)((Component)PageRightInput).gameObject)) { return (Object)(object)go == (Object)(object)((Component)BookNameInput).gameObject; } return true; } } } namespace ItemManager { [PublicAPI] public enum CraftingTable { Disabled, Inventory, [InternalName("piece_workbench")] Workbench, [InternalName("piece_cauldron")] Cauldron, [InternalName("forge")] Forge, [InternalName("piece_artisanstation")] ArtisanTable, [InternalName("piece_stonecutter")] StoneCutter, [InternalName("piece_magetable")] MageTable, [InternalName("blackforge")] BlackForge, Custom } [PublicAPI] public enum ConversionPiece { Disabled, [InternalName("smelter")] Smelter, [InternalName("charcoal_kiln")] CharcoalKiln, [InternalName("blastfurnace")] BlastFurnace, [InternalName("windmill")] Windmill, [InternalName("piece_spinningwheel")] SpinningWheel, [InternalName("eitrrefinery")] EitrRefinery, Custom } public class InternalName : Attribute { public readonly string internalName; public InternalName(string internalName) { this.internalName = internalName; } } [PublicAPI] public class RequiredResourceList { public readonly List<Requirement> Requirements = new List<Requirement>(); public bool Free; public void Add(string itemName, int amount, int quality = 0) { Requirements.Add(new Requirement { itemName = itemName, amount = amount, quality = quality }); } public void Add(string itemName, ConfigEntry<int> amountConfig, int quality = 0) { Requirements.Add(new Requirement { itemName = itemName, amountConfig = amountConfig, quality = quality }); } } [PublicAPI] public class CraftingStationList { public readonly List<CraftingStationConfig> Stations = new List<CraftingStationConfig>(); public void Add(CraftingTable table, int level) { Stations.Add(new CraftingStationConfig { Table = table, level = level }); } public void Add(string customTable, int level) { Stations.Add(new CraftingStationConfig { Table = CraftingTable.Custom, level = level, custom = customTable }); } } [PublicAPI] public class ItemRecipe { public readonly RequiredResourceList RequiredItems = new RequiredResourceList(); public readonly RequiredResourceList RequiredUpgradeItems = new RequiredResourceList(); public readonly CraftingStationList Crafting = new CraftingStationList(); public int CraftAmount = 1; public bool RequireOnlyOneIngredient; public float QualityResultAmountMultiplier = 1f; public ConfigEntryBase? RecipeIsActive; } [PublicAPI] public class Trade { public Trader Trader; public uint Price; public uint Stack = 1u; public string? RequiredGlobalKey; } [PublicAPI] [Flags] public enum Trader { None = 0, Haldor = 1, Hildir = 2 } public struct Requirement { public string itemName; public int amount; public ConfigEntry<int>? amountConfig; [Description("Set to a non-zero value to apply the requirement only for a specific quality")] public int quality; } public struct CraftingStationConfig { public CraftingTable Table; public int level; public string? custom; } [Flags] public enum Configurability { Disabled = 0, Recipe = 1, Stats = 2, Drop = 4, Trader = 8, Full = 0xF } [PublicAPI] public class DropTargets { public readonly List<DropTarget> Drops = new List<DropTarget>(); public void Add(string creatureName, float chance, int min = 1, int? max = null, bool levelMultiplier = true) { Drops.Add(new DropTarget { creature = creatureName, chance = chance, min = min, max = (max ?? min), levelMultiplier = levelMultiplier }); } } public struct DropTarget { public string creature; public int min; public int max; public float chance; public bool levelMultiplier; } public enum Toggle { On = 1, Off = 0 } [PublicAPI] public class Item { private class ItemConfig { public ConfigEntry<string>? craft; public ConfigEntry<string>? upgrade; public ConfigEntry<CraftingTable> table; public ConfigEntry<int> tableLevel; public ConfigEntry<string> customTable; public ConfigEntry<int>? maximumTableLevel; public ConfigEntry<Toggle> requireOneIngredient; public ConfigEntry<float> qualityResultAmountMultiplier; } private class TraderConfig { public ConfigEntry<Trader> trader; public ConfigEntry<uint> price; public ConfigEntry<uint> stack; public ConfigEntry<string> requiredGlobalKey; } private class RequirementQuality { public int quality; } private class ConfigurationManagerAttributes { [UsedImplicitly] public int? Order; [UsedImplicitly] public bool? Browsable; [UsedImplicitly] public string? Category; [UsedImplicitly] public Action<ConfigEntryBase>? CustomDrawer; public Func<bool>? browsability; } [PublicAPI] public enum DamageModifier { Normal, Resistant, Weak, Immune, Ignore, VeryResistant, VeryWeak, None } private delegate void setDmgFunc(ref DamageTypes dmg, float value); private class SerializedRequirements { public readonly List<Requirement> Reqs; public SerializedRequirements(List<Requirement> reqs) { Reqs = reqs; } public SerializedRequirements(string reqs) : this(reqs.Split(new char[1] { ',' }).Select(delegate(string r) { string[] array = r.Split(new char[1] { ':' }); Requirement result = default(Requirement); result.itemName = array[0]; result.amount = ((array.Length <= 1 || !int.TryParse(array[1], out var result2)) ? 1 : result2); result.quality = ((array.Length > 2 && int.TryParse(array[2], out var result3)) ? result3 : 0); return result; }).ToList()) { } public override string ToString() { return string.Join(",", Reqs.Select((Requirement r) => $"{r.itemName}:{r.amount}" + ((r.quality > 0) ? $":{r.quality}" : ""))); } public static ItemDrop? fetchByName(ObjectDB objectDB, string name) { GameObject itemPrefab = objectDB.GetItemPrefab(name); ItemDrop val = ((itemPrefab != null) ? itemPrefab.GetComponent<ItemDrop>() : null); if ((Object)(object)val == (Object)null) { Debug.LogWarning((object)("The required item '" + name + "' does not exist.")); } return val; } public static Requirement[] toPieceReqs(ObjectDB objectDB, SerializedRequirements craft, SerializedRequirements upgrade) { //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: 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_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Expected O, but got Unknown //IL_0194: Expected O, but got Unknown //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Expected O, but got Unknown Dictionary<string, Requirement> dictionary = craft.Reqs.Where((Requirement r) => r.itemName != "").ToDictionary((Func<Requirement, string>)((Requirement r) => r.itemName), (Func<Requirement, Requirement>)delegate(Requirement r) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown ItemDrop val6 = ResItem(r); return (val6 != null) ? new Requirement { m_amount = (r.amountConfig?.Value ?? r.amount), m_resItem = val6, m_amountPerLevel = 0 } : ((Requirement)null); }); List<Requirement> list = dictionary.Values.Where((Requirement v) => v != null).ToList(); foreach (Requirement item in upgrade.Reqs.Where((Requirement r) => r.itemName != "")) { if (item.quality > 0) { ItemDrop val = ResItem(item); if (val != null) { Requirement val2 = new Requirement { m_resItem = val, m_amountPerLevel = (item.amountConfig?.Value ?? item.amount), m_amount = 0 }; list.Add(val2); requirementQuality.Add(val2, new RequirementQuality { quality = item.quality }); } continue; } if (!dictionary.TryGetValue(item.itemName, out var value) || value == null) { ItemDrop val3 = ResItem(item); if (val3 != null) { string itemName = item.itemName; Requirement val4 = new Requirement { m_resItem = val3, m_amount = 0 }; Requirement val5 = val4; dictionary[itemName] = val4; value = val5; list.Add(value); } } if (value != null) { value.m_amountPerLevel = item.amountConfig?.Value ?? item.amount; } } return list.ToArray(); ItemDrop? ResItem(Requirement r) { return fetchByName(objectDB, r.itemName); } } } private class SerializedDrop { public readonly List<DropTarget> Drops; public SerializedDrop(List<DropTarget> drops) { Drops = drops; } public SerializedDrop(string drops) { Drops = ((drops == "") ? ((IEnumerable<string>)Array.Empty<string>()) : ((IEnumerable<string>)drops.Split(new char[1] { ',' }))).Select(delegate(string r) { string[] array = r.Split(new char[1] { ':' }); if (array.Length <= 2 || !int.TryParse(array[2], out var result)) { result = 1; } if (array.Length <= 3 || !int.TryParse(array[3], out var result2)) { result2 = result; } bool levelMultiplier = array.Length <= 4 || array[4] != "0"; DropTarget result3 = default(DropTarget); result3.creature = array[0]; result3.chance = ((array.Length > 1 && float.TryParse(array[1], out var result4)) ? result4 : 1f); result3.min = result; result3.max = result2; result3.levelMultiplier = levelMultiplier; return result3; }).ToList(); } public override string ToString() { return string.Join(",", Drops.Select((DropTarget r) => $"{r.creature}:{r.chance.ToString(CultureInfo.InvariantCulture)}:{r.min}:" + ((r.min == r.max) ? "" : $"{r.max}") + (r.levelMultiplier ? "" : ":0"))); } private static Character? fetchByName(ZNetScene netScene, string name) { GameObject prefab = netScene.GetPrefab(name); Character val = ((prefab != null) ? prefab.GetComponent<Character>() : null); if ((Object)(object)val == (Object)null) { Debug.LogWarning((object)("The drop target character '" + name + "' does not exist.")); } return val; } public Dictionary<Character, Drop> toCharacterDrops(ZNetScene netScene, GameObject item) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Expected O, but got Unknown Dictionary<Character, Drop> dictionary = new Dictionary<Character, Drop>(); foreach (DropTarget drop in Drops) { Character val = fetchByName(netScene, drop.creature); if (val != null) { dictionary[val] = new Drop { m_prefab = item, m_amountMin = drop.min, m_amountMax = drop.max, m_chance = drop.chance, m_levelMultiplier = drop.levelMultiplier }; } } return dictionary; } } private static readonly List<Item> registeredItems = new List<Item>(); private static readonly Dictionary<ItemDrop, Item> itemDropMap = new Dictionary<ItemDrop, Item>(); private static Dictionary<Item, Dictionary<string, List<Recipe>>> activeRecipes = new Dictionary<Item, Dictionary<string, List<Recipe>>>(); private static Dictionary<Recipe, ConfigEntryBase?> hiddenCraftRecipes = new Dictionary<Recipe, ConfigEntryBase>(); private static Dictionary<Recipe, ConfigEntryBase?> hiddenUpgradeRecipes = new Dictionary<Recipe, ConfigEntryBase>(); private static Dictionary<Item, Dictionary<string, ItemConfig>> itemCraftConfigs = new Dictionary<Item, Dictionary<string, ItemConfig>>(); private static Dictionary<Item, ConfigEntry<string>> itemDropConfigs = new Dictionary<Item, ConfigEntry<string>>(); private Dictionary<CharacterDrop, Drop> characterDrops = new Dictionary<CharacterDrop, Drop>(); private readonly Dictionary<ConfigEntryBase, Action> statsConfigs = new Dictionary<ConfigEntryBase, Action>(); private static readonly ConditionalWeakTable<Requirement, RequirementQuality> requirementQuality = new ConditionalWeakTable<Requirement, RequirementQuality>(); public static Configurability DefaultConfigurability = Configurability.Full; public Configurability? Configurable; private Configurability configurationVisible = Configurability.Full; private TraderConfig? traderConfig; public readonly GameObject Prefab; [Description("Specifies the maximum required crafting station level to upgrade and repair the item.\nDefault is calculated from crafting station level and maximum quality.")] public int MaximumRequiredStationLevel = int.MaxValue; [Description("Assigns the item as a drop item to a creature.\nUses a creature name, a drop chance and a minimum and maximum amount.")] public readonly DropTargets DropsFrom = new DropTargets(); [Description("Configures whether the item can be bought at the trader.\nDon't forget to set cost to something above 0 or the item will be sold for free.")] public readonly Trade Trade = new Trade(); internal List<Conversion> Conversions = new List<Conversion>(); internal List<ItemConversion> conversions = new List<ItemConversion>(); public Dictionary<string, ItemRecipe> Recipes = new Dictionary<string, ItemRecipe>(); private LocalizeKey? _name; private LocalizeKey? _description; private static object? configManager; private static Localization? _english; private static BaseUnityPlugin? _plugin; private static bool hasConfigSync = true; private static object? _configSync; private Configurability configurability => Configurable ?? DefaultConfigurability; [Description("Specifies the resources needed to craft the item.\nUse .Add to add resources with their internal ID and an amount.\nUse one .Add for each resource type the item should need.")] public RequiredResourceList RequiredItems => this[""].RequiredItems; [Description("Specifies the resources needed to upgrade the item.\nUse .Add to add resources with their internal ID and an amount. This amount will be multipled by the item quality level.\nUse one .Add for each resource type the upgrade should need.")] public RequiredResourceList RequiredUpgradeItems => this[""].RequiredUpgradeItems; [Description("Specifies the crafting station needed to craft the item.\nUse .Add to add a crafting station, using the CraftingTable enum and a minimum level for the crafting station.\nUse one .Add for each crafting station.")] public CraftingStationList Crafting => this[""].Crafting; [Description("Specifies a config entry which toggles whether a recipe is active.")] public ConfigEntryBase? RecipeIsActive { get { return this[""].RecipeIsActive; } set { this[""].RecipeIsActive = value; } } [Description("Specifies the number of items that should be given to the player with a single craft of the item.\nDefaults to 1.")] public int CraftAmount { get { return this[""].CraftAmount; } set { this[""].CraftAmount = value; } } public bool RequireOnlyOneIngredient { get { return this[""].RequireOnlyOneIngredient; } set { this[""].RequireOnlyOneIngredient = value; } } public float QualityResultAmountMultiplier { get { return this[""].QualityResultAmountMultiplier; } set { this[""].QualityResultAmountMultiplier = value; } } public ItemRecipe this[string name] { get { if (Recipes.TryGetValue(name, out var value)) { return value; } return Recipes[name] = new ItemRecipe(); } } public LocalizeKey Name { get { LocalizeKey name = _name; if (name != null) { return name; } SharedData shared = Prefab.GetComponent<ItemDrop>().m_itemData.m_shared; if (shared.m_name.StartsWith("$")) { _name = new LocalizeKey(shared.m_name); } else { string text = "$item_" + ((Object)Prefab).name.Replace(" ", "_"); _name = new LocalizeKey(text).English(shared.m_name); shared.m_name = text; } return _name; } } public LocalizeKey Description { get { LocalizeKey description = _description; if (description != null) { return description; } SharedData shared = Prefab.GetComponent<ItemDrop>().m_itemData.m_shared; if (shared.m_description.StartsWith("$")) { _description = new LocalizeKey(shared.m_description); } else { string text = "$itemdesc_" + ((Object)Prefab).name.Replace(" ", "_"); _description = new LocalizeKey(text).English(shared.m_description); shared.m_description = text; } return _description; } } private static Localization english => _english ?? (_english = LocalizationCache.ForLanguage("English")); private static BaseUnityPlugin plugin { get { //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Expected O, but got Unknown if (_plugin == null) { IEnumerable<TypeInfo> source; try { source = Assembly.GetExecutingAssembly().DefinedTypes.ToList(); } catch (ReflectionTypeLoadException ex) { source = from t in ex.Types where t != null select t.GetTypeInfo(); } _plugin = (BaseUnityPlugin)Chainloader.ManagerObject.GetComponent((Type)source.First((TypeInfo t) => t.IsClass && typeof(BaseUnityPlugin).IsAssignableFrom(t))); } return _plugin; } } private static object? configSync { get { if (_configSync == null && hasConfigSync) { Type type = Assembly.GetExecutingAssembly().GetType("ServerSync.ConfigSync"); if ((object)type != null) { _configSync = Activator.CreateInstance(type, plugin.Info.Metadata.GUID + " ItemManager"); type.GetField("CurrentVersion").SetValue(_configSync, plugin.Info.Metadata.Version.ToString()); type.GetProperty("IsLocked").SetValue(_configSync, true); } else { hasConfigSync = false; } } return _configSync; } } public Item(string assetBundleFileName, string prefabName, string folderName = "assets") : this(PrefabManager.RegisterAssetBundle(assetBundleFileName, folderName), prefabName) { } public Item(AssetBundle bundle, string prefabName) : this(PrefabManager.RegisterPrefab(bundle, prefabName, addToObjectDb: true), skipRegistering: true) { } public Item(GameObject prefab, bool skipRegistering = false) { if (!skipRegistering) { PrefabManager.RegisterPrefab(prefab, addToObjectDb: true); } Prefab = prefab; registeredItems.Add(this); itemDropMap[Prefab.GetComponent<ItemDrop>()] = this; Prefab.GetComponent<ItemDrop>().m_itemData.m_dropPrefab = Prefab; } public void ToggleConfigurationVisibility(Configurability visible) { configurationVisible = visible; if (itemDropConfigs.TryGetValue(this, out var value)) { Toggle((ConfigEntryBase)(object)value, Configurability.Drop); } if (itemCraftConfigs.TryGetValue(this, out var value2)) { foreach (ItemConfig value4 in value2.Values) { ToggleObj(value4, Configurability.Recipe); } } foreach (Conversion conversion in Conversions) { if (conversion.config != null) { ToggleObj(conversion.config, Configurability.Recipe); } } foreach (KeyValuePair<ConfigEntryBase, Action> statsConfig in statsConfigs) { Toggle(statsConfig.Key, Configurability.Stats); if ((visible & Configurability.Stats) != 0) { statsConfig.Value(); } } reloadConfigDisplay(); void Toggle(ConfigEntryBase cfg, Configurability check) { object[] tags = cfg.Description.Tags; foreach (object obj2 in tags) { if (obj2 is ConfigurationManagerAttributes configurationManagerAttributes) { configurationManagerAttributes.Browsable = (visible & check) != 0 && (configurationManagerAttributes.browsability == null || configurationManagerAttributes.browsability()); } } } void ToggleObj(object obj, Configurability check) { FieldInfo[] fields = obj.GetType().GetFields(); foreach (FieldInfo fieldInfo in fields) { object? value3 = fieldInfo.GetValue(obj); ConfigEntryBase val = (ConfigEntryBase)((value3 is ConfigEntryBase) ? value3 : null); if (val != null) { Toggle(val, check); } } } } internal static void reloadConfigDisplay() { object obj = configManager?.GetType().GetProperty("DisplayingWindow").GetValue(configManager); if (obj is bool && (bool)obj) { configManager.GetType().GetMethod("BuildSettingList").Invoke(configManager, Array.Empty<object>()); } } private void UpdateItemTableConfig(string recipeKey, CraftingTable table, string customTableValue) { if (activeRecipes.ContainsKey(this) && activeRecipes[this].TryGetValue(recipeKey, out var value)) { value.First().m_enabled = table != CraftingTable.Disabled; if ((uint)table <= 1u) { value.First().m_craftingStation = null; } else if (table == CraftingTable.Custom) { Recipe obj = value.First(); GameObject prefab = ZNetScene.instance.GetPrefab(customTableValue); obj.m_craftingStation = ((prefab != null) ? prefab.GetComponent<CraftingStation>() : null); } else { value.First().m_craftingStation = ZNetScene.instance.GetPrefab(getInternalName(table)).GetComponent<CraftingStation>(); } } } private void UpdateCraftConfig(string recipeKey, SerializedRequirements craftRequirements, SerializedRequirements upgradeRequirements) { if (!Object.op_Implicit((Object)(object)ObjectDB.instance) || !activeRecipes.ContainsKey(this) || !activeRecipes[this].TryGetValue(recipeKey, out var value)) { return; } foreach (Recipe item in value) { item.m_resources = SerializedRequirements.toPieceReqs(ObjectDB.instance, craftRequirements, upgradeRequirements); } } internal static void Patch_FejdStartup() { //IL_0eb6: Unknown result type (might be due to invalid IL or missing references) //IL_0ebb: Unknown result type (might be due to invalid IL or missing references) //IL_21af: Unknown result type (might be due to invalid IL or missing references) //IL_21b9: Expected O, but got Unknown //IL_0f81: Unknown result type (might be due to invalid IL or missing references) //IL_0f84: Unknown result type (might be due to invalid IL or missing references) //IL_0fda: Expected I4, but got Unknown //IL_0b9b: Unknown result type (might be due to invalid IL or missing references) //IL_0ba5: Expected O, but got Unknown //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Expected O, but got Unknown //IL_1111: Unknown result type (might be due to invalid IL or missing references) //IL_1114: Unknown result type (might be due to invalid IL or missing references) //IL_1116: Invalid comparison between Unknown and I4 //IL_1118: Unknown result type (might be due to invalid IL or missing references) //IL_111c: Invalid comparison between Unknown and I4 //IL_0cc4: Unknown result type (might be due to invalid IL or missing references) //IL_0cce: Expected O, but got Unknown //IL_0d6f: Unknown result type (might be due to invalid IL or missing references) //IL_0d79: Expected O, but got Unknown //IL_111e: Unknown result type (might be due to invalid IL or missing references) //IL_1122: Invalid comparison between Unknown and I4 //IL_0406: Unknown result type (might be due to invalid IL or missing references) //IL_0410: Expected O, but got Unknown //IL_0e23: Unknown result type (might be due to invalid IL or missing references) //IL_0e2d: Expected O, but got Unknown //IL_1322: Unknown result type (might be due to invalid IL or missing references) //IL_1325: Unknown result type (might be due to invalid IL or missing references) //IL_1327: Invalid comparison between Unknown and I4 //IL_1329: Unknown result type (might be due to invalid IL or missing references) //IL_132d: Unknown result type (might be due to invalid IL or missing references) //IL_132f: Invalid comparison between Unknown and I4 //IL_0541: Unknown result type (might be due to invalid IL or missing references) //IL_054b: Expected O, but got Unknown //IL_1331: Unknown result type (might be due to invalid IL or missing references) //IL_1335: Invalid comparison between Unknown and I4 //IL_140c: Unknown result type (might be due to invalid IL or missing references) //IL_1411: Unknown result type (might be due to invalid IL or missing references) //IL_1413: Unknown result type (might be due to invalid IL or missing references) //IL_1416: Invalid comparison between Unknown and I4 //IL_1418: Unknown result type (might be due to invalid IL or missing references) //IL_141c: Invalid comparison between Unknown and I4 //IL_06f8: Unknown result type (might be due to invalid IL or missing references) //IL_0702: Expected O, but got Unknown //IL_0659: Unknown result type (might be due to invalid IL or missing references) //IL_0663: Expected O, but got Unknown //IL_148c: Unknown result type (might be due to invalid IL or missing references) //IL_148f: Unknown result type (might be due to invalid IL or missing references) //IL_1491: Invalid comparison between Unknown and I4 //IL_0802: Unknown result type (might be due to invalid IL or missing references) //IL_080c: Expected O, but got Unknown //IL_1493: Unknown result type (might be due to invalid IL or missing references) //IL_1497: Unknown result type (might be due to invalid IL or missing references) //IL_1499: Invalid comparison between Unknown and I4 //IL_149b: Unknown result type (might be due to invalid IL or missing references) //IL_149f: Invalid comparison between Unknown and I4 //IL_15dd: Unknown result type (might be due to invalid IL or missing references) //IL_15e0: Invalid comparison between Unknown and I4 //IL_17e2: Unknown result type (might be due to invalid IL or missing references) //IL_17e9: Invalid comparison between Unknown and I4 //IL_18b4: Unknown result type (might be due to invalid IL or missing references) //IL_18b9: Unknown result type (might be due to invalid IL or missing references) //IL_18bb: Unknown result type (might be due to invalid IL or missing references) //IL_18bf: Unknown result type (might be due to invalid IL or missing references) //IL_18c1: Invalid comparison between Unknown and I4 //IL_1931: Unknown result type (might be due to invalid IL or missing references) //IL_1934: Unknown result type (might be due to invalid IL or missing references) //IL_1936: Invalid comparison between Unknown and I4 //IL_1552: Unknown result type (might be due to invalid IL or missing references) //IL_1557: Unknown result type (might be due to invalid IL or missing references) //IL_1938: Unknown result type (might be due to invalid IL or missing references) //IL_193c: Invalid comparison between Unknown and I4 //IL_193e: Unknown result type (might be due to invalid IL or missing references) //IL_1942: Invalid comparison between Unknown and I4 //IL_1dbd: Unknown result type (might be due to invalid IL or missing references) //IL_1dc0: Invalid comparison between Unknown and I4 Type type = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault((Assembly a) => a.GetName().Name == "ConfigurationManager")?.GetType("ConfigurationManager.ConfigurationManager"); if (DefaultConfigurability != 0) { bool saveOnConfigSet = plugin.Config.SaveOnConfigSet; plugin.Config.SaveOnConfigSet = false; foreach (Item item4 in registeredItems.Where((Item i) => i.configurability != Configurability.Disabled)) { Item item3 = item4; string name2 = item3.Prefab.GetComponent<ItemDrop>().m_itemData.m_shared.m_name; string englishName = new Regex("['\\[\"\\]]").Replace(english.Localize(name2), "").Trim(); string localizedName = Localization.instance.Localize(name2).Trim(); int order = 0; if ((item3.configurability & Configurability.Recipe) != 0) { itemCraftConfigs[item3] = new Dictionary<string, ItemConfig>(); foreach (string item5 in item3.Recipes.Keys.DefaultIfEmpty("")) { string configKey = item5; string text = ((configKey == "") ? "" : (" (" + configKey + ")")); if (!item3.Recipes.ContainsKey(configKey) || item3.Recipes[configKey].Crafting.Stations.Count <= 0) { continue; } ItemConfig itemConfig2 = (itemCraftConfigs[item3][configKey] = new ItemConfig()); ItemConfig cfg = itemConfig2; List<ConfigurationManagerAttributes> hideWhenNoneAttributes = new List<ConfigurationManagerAttributes>(); cfg.table = config(englishName, "Crafting Station" + text, item3.Recipes[configKey].Crafting.Stations.First().Table, new ConfigDescription("Crafting station where " + englishName + " is available.", (AcceptableValueBase)null, new object[1] { new ConfigurationManagerAttributes { Order = (order -= 1), Browsable = ((item3.configurationVisible & Configurability.Recipe) != 0), Category = localizedName } })); ConfigurationManagerAttributes customTableAttributes = new ConfigurationManagerAttributes { Order = (order -= 1), browsability = CustomTableBrowsability, Browsable = (CustomTableBrowsability() && (item3.configurationVisible & Configurability.Recipe) != 0), Category = localizedName }; cfg.customTable = config(englishName, "Custom Crafting Station" + text, item3.Recipes[configKey].Crafting.Stations.First().custom ?? "", new ConfigDescription("", (AcceptableValueBase)null, new object[1] { customTableAttributes })); cfg.table.SettingChanged += TableConfigChanged; cfg.customTable.SettingChanged += TableConfigChanged; ConfigurationManagerAttributes configurationManagerAttributes = new ConfigurationManagerAttributes { Order = (order -= 1), browsability = TableLevelBrowsability, Browsable = (TableLevelBrowsability() && (item3.configurationVisible & Configurability.Recipe) != 0), Category = localizedName }; hideWhenNoneAttributes.Add(configurationManagerAttributes); cfg.tableLevel = config(englishName, "Crafting Station Level" + text, item3.Recipes[configKey].Crafting.Stations.First().level, new ConfigDescription("Required crafting station level to craft " + englishName + ".", (AcceptableValueBase)null, new object[1] { configurationManagerAttributes })); cfg.tableLevel.SettingChanged += delegate { if (activeRecipes.ContainsKey(item3) && activeRecipes[item3].TryGetValue(configKey, out var value6)) { value6.First().m_minStationLevel = cfg.tableLevel.Value; } }; if (item3.Prefab.GetComponent<ItemDrop>().m_itemData.m_shared.m_maxQuality > 1) { cfg.maximumTableLevel = config(englishName, "Maximum Crafting Station Level" + text, (item3.MaximumRequiredStationLevel == int.MaxValue) ? (item3.Recipes[configKey].Crafting.Stations.First().level + item3.Prefab.GetComponent<ItemDrop>().m_itemData.m_shared.m_maxQuality - 1) : item3.MaximumRequiredStationLevel, new ConfigDescription("Maximum crafting station level to upgrade and repair " + englishName + ".", (AcceptableValueBase)null, new object[1] { configurationManagerAttributes })); } cfg.requireOneIngredient = config(englishName, "Require only one resource" + text, item3.Recipes[configKey].RequireOnlyOneIngredient ? Toggle.On : Toggle.Off, new ConfigDescription("Whether only one of the ingredients is needed to craft " + englishName, (AcceptableValueBase)null, new object[1] { new ConfigurationManagerAttributes { Order = (order -= 1), Category = localizedName } })); ConfigurationManagerAttributes qualityResultAttributes = new ConfigurationManagerAttributes { Order = (order -= 1), browsability = QualityResultBrowsability, Browsable = (QualityResultBrowsability() && (item3.configurationVisible & Configurability.Recipe) != 0), Category = localizedName }; cfg.requireOneIngredient.SettingChanged += delegate { if (activeRecipes.ContainsKey(item3) && activeRecipes[item3].TryGetValue(configKey, out var value5)) { foreach (Recipe item6 in value5) { item6.m_requireOnlyOneIngredient = cfg.requireOneIngredient.Value == Toggle.On; } } qualityResultAttributes.Browsable = QualityResultBrowsability(); reloadConfigDisplay(); }; cfg.qualityResultAmountMultiplier = config(englishName, "Quality Multiplier" + text, item3.Recipes[configKey].QualityResultAmountMultiplier, new ConfigDescription("Multiplies the crafted amount based on the quality of the resources when crafting " + englishName + ". Only works, if Require Only One Resource is true.", (AcceptableValueBase)null, new object[1] { qualityResultAttributes })); cfg.qualityResultAmountMultiplier.SettingChanged += delegate { if (activeRecipes.ContainsKey(item3) && activeRecipes[item3].TryGetValue(configKey, out var value4)) { foreach (Recipe item7 in value4) { item7.m_qualityResultAmountMultiplier = cfg.qualityResultAmountMultiplier.Value; } } }; if ((!item3.Recipes[configKey].RequiredItems.Free || item3.Recipes[configKey].RequiredItems.Requirements.Count > 0) && item3.Recipes[configKey].RequiredItems.Requirements.All((Requirement r) => r.amountConfig == null)) { cfg.craft = itemConfig("Crafting Costs" + text, new SerializedRequirements(item3.Recipes[configKey].RequiredItems.Requirements).ToString(), "Item costs to craft " + englishName, isUpgrade: false); } if (item3.Prefab.GetComponent<ItemDrop>().m_itemData.m_shared.m_maxQuality > 1 && (!item3.Recipes[configKey].RequiredUpgradeItems.Free || item3.Recipes[configKey].RequiredUpgradeItems.Requirements.Count > 0) && item3.Recipes[configKey].RequiredUpgradeItems.Requirements.All((Requirement r) => r.amountConfig == null)) { cfg.upgrade = itemConfig("Upgrading Costs" + text, new SerializedRequirements(item3.Recipes[configKey].RequiredUpgradeItems.Requirements).ToString(), "Item costs per level to upgrade " + englishName, isUpgrade: true); } if (cfg.craft != null) { cfg.craft.SettingChanged += ConfigChanged; } if (cfg.upgrade != null) { cfg.upgrade.SettingChanged += ConfigChanged; } void ConfigChanged(object o, EventArgs e) { item3.UpdateCraftConfig(configKey, new SerializedRequirements(cfg.craft?.Value ?? ""), new SerializedRequirements(cfg.upgrade?.Value ?? "")); } bool CustomTableBrowsability() { return cfg.table.Value == CraftingTable.Custom; } bool ItemBrowsability() { return cfg.table.Value != CraftingTable.Disabled; } bool QualityResultBrowsability() { return cfg.requireOneIngredient.Value == Toggle.On; } void TableConfigChanged(object o, EventArgs e) { item3.UpdateItemTableConfig(configKey, cfg.table.Value, cfg.customTable.Value); customTableAttributes.Browsable = cfg.table.Value == CraftingTable.Custom; foreach (ConfigurationManagerAttributes item8 in hideWhenNoneAttributes) { item8.Browsable = cfg.table.Value != CraftingTable.Disabled; } reloadConfigDisplay(); } bool TableLevelBrowsability() { return cfg.table.Value != CraftingTable.Disabled; } ConfigEntry<string> itemConfig(string name, string value, string desc, bool isUpgrade) { //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Expected O, but got Unknown ConfigurationManagerAttributes configurationManagerAttributes3 = new ConfigurationManagerAttributes { CustomDrawer = drawRequirementsConfigTable(item3, isUpgrade), Order = (order -= 1), browsability = ItemBrowsability, Browsable = (ItemBrowsability() && (item3.configurationVisible & Configurability.Recipe) != 0), Category = localizedName }; hideWhenNoneAttributes.Add(configurationManagerAttributes3); return config(englishName, name, value, new ConfigDescription(desc, (AcceptableValueBase)null, new object[1] { configurationManagerAttributes3 })); } } if ((item3.configurability & Configurability.Drop) != 0) { ConfigEntry<string> val3 = (itemDropConfigs[item3] = config(englishName, "Drops from", new SerializedDrop(item3.DropsFrom.Drops).ToString(), new ConfigDescription(englishName + " drops from this creature.", (AcceptableValueBase)null, new object[1] { new ConfigurationManagerAttributes { CustomDrawer = drawDropsConfigTable, Category = localizedName, Browsable = ((item3.configurationVisible & Configurability.Drop) != 0) } }))); ConfigEntry<string> val4 = val3; val4.SettingChanged += delegate { item3.UpdateCharacterDrop(); }; } for (int j = 0; j < item3.Conversions.Count; j++) { string text2 = ((item3.Conversions.Count > 1) ? $"{j + 1}. " : ""); Conversion conversion = item3.Conversions[j]; conversion.config = new Conversion.ConversionConfig(); int index = j; conversion.config.input = config(englishName, text2 + "Conversion Input Item", conversion.Input, new ConfigDescription("Input item to create " + englishName, (AcceptableValueBase)null, new object[1] { new ConfigurationManagerAttributes { Category = localizedName, Browsable = ((item3.configurationVisible & Configurability.Recipe) != 0) } })); conversion.config.input.SettingChanged += delegate { if (index < item3.conversions.Count) { ObjectDB instance = ObjectDB.instance; if (instance != null) { ItemDrop from = SerializedRequirements.fetchByName(instance, conversion.config.input.Value); item3.conversions[index].m_from = from; UpdatePiece(); } } }; conversion.config.piece = config(englishName, text2 + "Conversion Piece", conversion.Piece, new ConfigDescription("Conversion piece used to create " + englishName, (AcceptableValueBase)null, new object[1] { new ConfigurationManagerAttributes { Category = localizedName, Browsable = ((item3.configurationVisible & Configurability.Recipe) != 0) } })); conversion.config.piece.SettingChanged += delegate { UpdatePiece(); }; conversion.config.customPiece = config(englishName, text2 + "Conversion Custom Piece", conversion.customPiece ?? "", new ConfigDescription("Custom conversion piece to create " + englishName, (AcceptableValueBase)null, new object[1] { new ConfigurationManagerAttributes { Category = localizedName, Browsable = ((item3.configurationVisible & Configurability.Recipe) != 0) } })); conversion.config.customPiece.SettingChanged += delegate { UpdatePiece(); }; void UpdatePiece() { if (index < item3.conversions.Count && Object.op_Implicit((Object)(object)ZNetScene.instance)) { string text3 = ((conversion.config.piece.Value == ConversionPiece.Disabled) ? null : ((conversion.config.piece.Value == ConversionPiece.Custom) ? conversion.config.customPiece.Value : getInternalName(conversion.config.piece.Value))); string activePiece = conversion.config.activePiece; if (conversion.config.activePiece != null) { Smelter component = ZNetScene.instance.GetPrefab(conversion.config.activePiece).GetComponent<Smelter>(); int num = component.m_conversion.IndexOf(item3.conversions[index]); if (num >= 0) { Smelter[] array3 = Resources.FindObjectsOfTypeAll<Smelter>(); foreach (Smelter val6 in array3) { if (Utils.GetPrefabName(((Component)val6).gameObject) == activePiece) { val6.m_conversion.RemoveAt(num); } } } conversion.config.activePiece = null; } if (item3.conversions[index].m_from != null && conversion.config.piece.Value != 0) { GameObject prefab = ZNetScene.instance.GetPrefab(text3); if (((prefab != null) ? prefab.GetComponent<Smelter>() : null) != null) { conversion.config.activePiece = text3; Smelter[] array4 = Resources.FindObjectsOfTypeAll<Smelter>(); foreach (Smelter val7 in array4) { if (Utils.GetPrefabName(((Component)val7).gameObject) == text3) { val7.m_conversion.Add(item3.conversions[index]); } } } } } } } } if ((item3.configurability & Configurability.Stats) != 0) { item3.statsConfigs.Clear(); SharedData shared2 = item3.Prefab.GetComponent<ItemDrop>().m_itemData.m_shared; ItemType itemType = shared2.m_itemType; statcfg<float>("Weight", "Weight of " + englishName + ".", (SharedData shared) => shared.m_weight, delegate(SharedData shared, float value) { shared.m_weight = value; }); statcfg<int>("Trader Value", "Trader value of " + englishName + ".", (SharedData shared) => shared.m_value, delegate(SharedData shared, int value) { shared.m_value = value; }); bool flag; switch (itemType - 3) { case 0: case 1: case 2: case 3: case 4: case 8: case 9: case 11: case 14: case 16: case 19: flag = true; break; default: flag = false; break; } if (flag) { statcfg<float>("Durability", "Durability of " + englishName + ".", (SharedData shared) => shared.m_maxDurability, delegate(SharedData shared, float value) { shared.m_maxDurability = value; }); statcfg<float>("Durability per Level", "Durability gain per level of " + englishName + ".", (SharedData shared) => shared.m_durabilityPerLevel, delegate(SharedData shared, float value) { shared.m_durabilityPerLevel = value; }); statcfg<float>("Movement Speed Modifier", "Movement speed modifier of " + englishName + ".", (SharedData shared) => shared.m_movementModifier, delegate(SharedData shared, float value) { shared.m_movementModifier = value; }); } if ((itemType - 3 <= 2 || (int)itemType == 14 || (int)itemType == 22) ? true : false) { statcfg<float>("Block Armor", "Block armor of " + englishName + ".", (SharedData shared) => shared.m_blockPower, delegate(SharedData shared, float value) { shared.m_blockPower = value; }); statcfg<float>("Block Armor per Level", "Block armor per level for " + englishName + ".", (SharedData shared) => shared.m_blockPowerPerLevel, delegate(SharedData shared, float value) { shared.m_blockPowerPerLevel = value; }); statcfg<float>("Block Force", "Block force of " + englishName + ".", (SharedData shared) => shared.m_deflectionForce, delegate(SharedData shared, float value) { shared.m_deflectionForce = value; }); statcfg<float>("Block Force per Level", "Block force per level for " + englishName + ".", (SharedData shared) => shared.m_deflectionForcePerLevel, delegate(SharedData shared, float value) { shared.m_deflectionForcePerLevel = value; }); statcfg<float>("Parry Bonus", "Parry bonus of " + englishName + ".", (SharedData shared) => shared.m_timedBlockBonus, delegate(SharedData shared, float value) { shared.m_timedBlockBonus = value; }); } else if ((itemType - 6 <= 1 || itemType - 11 <= 1 || (int)itemType == 17) ? true : false) { statcfg<float>("Armor", "Armor of " + englishName + ".", (SharedData shared) => shared.m_armor, delegate(SharedData shared, float value) { shared.m_armor = value; }); statcfg<float>("Armor per Level", "Armor per level for " + englishName + ".", (SharedData shared) => shared.m_armorPerLevel, delegate(SharedData shared, float value) { shared.m_armorPerLevel = value; }); } SkillType skillType = shared2.m_skillType; if (((int)skillType == 7 || (int)skillType == 12) ? true : false) { statcfg<int>("Tool tier", "Tool tier of " + englishName + ".", (SharedData shared) => shared.m_toolTier, delegate(SharedData shared, int value) { shared.m_toolTier = value; }); } if ((itemType - 5 <= 2 || itemType - 11 <= 1 || (int)itemType == 17) ? true : false) { Dictionary<DamageType, DamageModifier> modifiers = shared2.m_damageModifiers.ToDictionary((DamageModPair d) => d.m_type, (DamageModPair d) => (DamageModifier)d.m_modifier); DamageType[] first = (DamageType[])Enum.GetValues(typeof(DamageType)); DamageType[] array = new DamageType[5]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); foreach (DamageType item9 in first.Except((IEnumerable<DamageType>)(object)array)) { DamageType damageType = item9; statcfg<DamageModifier>(((object)(DamageType)(ref damageType)).ToString() + " Resistance", ((object)(DamageType)(ref damageType)).ToString() + " resistance of " + englishName + ".", (SharedData _) => (!modifiers.TryGetValue(damageType, out var value3)) ? DamageModifier.None : value3, delegate(SharedData shared, DamageModifier value) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) DamageModPair val8 = default(DamageModPair); val8.m_type = damageType; val8.m_modifier = (DamageModifier)value; DamageModPair val9 = val8; for (int num2 = 0; num2 < shared.m_damageModifiers.Count; num2++) { if (shared.m_damageModifiers[num2].m_type == damageType) { if (value == DamageModifier.None) { shared.m_damageModifiers.RemoveAt(num2); } else { shared.m_damageModifiers[num2] = val9; } return; } } if (value != DamageModifier.None) { shared.m_damageModifiers.Add(val9); } }); } } if ((int)itemType == 2 && shared2.m_food > 0f) { statcfg<float>("Health", "Health value of " + englishName + ".", (SharedData shared) => shared.m_food, delegate(SharedData shared, float value) { shared.m_food = value; }); statcfg<float>("Stamina", "Stamina value of " + englishName + ".", (SharedData shared) => shared.m_foodStamina, delegate(SharedData shared, float value) { shared.m_foodStamina = value; }); statcfg<float>("Eitr", "Eitr value of " + englishName + ".", (SharedData shared) => shared.m_foodEitr, delegate(SharedData shared, float value) { shared.m_foodEitr = value; }); statcfg<float>("Duration", "Duration of " + englishName + ".", (SharedData shared) => shared.m_foodBurnTime, delegate(SharedData shared, float value) { shared.m_foodBurnTime = value; }); statcfg<float>("Health Regen", "Health regen value of " + englishName + ".", (SharedData shared) => shared.m_foodRegen, delegate(SharedData shared, float value) { shared.m_foodRegen = value; }); } if ((int)shared2.m_skillType == 10) { statcfg<float>("Health Cost", "Health cost of " + englishName + ".", (SharedData shared) => shared.m_attack.m_attackHealth, delegate(SharedData shared, float value) { shared.m_attack.m_attackHealth = value; }); statcfg<float>("Health Cost Percentage", "Health cost percentage of " + englishName + ".", (SharedData shared) => shared.m_attack.m_attackHealthPercentage, delegate(SharedData shared, float value) { shared.m_attack.m_attackHealthPercentage = value; }); } skillType = shared2.m_skillType; if (skillType - 9 <= 1) { statcfg<float>("Eitr Cost", "Eitr cost of " + englishName + ".", (SharedData shared) => shared.m_attack.m_attackEitr, delegate(SharedData shared, float value) { shared.m_attack.m_attackEitr = value; }); } if ((itemType - 3 <= 1 || (int)itemType == 14 || (int)itemType == 22) ? true : false) { statcfg<float>("Knockback", "Knockback of " + englishName + ".", (SharedData shared) => shared.m_attackForce, delegate(SharedData shared, float value) { shared.m_attackForce = value; }); statcfg<float>("Backstab Bonus", "Backstab bonus of " + englishName + ".", (SharedData shared) => shared.m_backstabBonus, delegate(SharedData shared, float value) { shared.m_backstabBonus = value; }); statcfg<float>("Attack Stamina", "Attack stamina of " + englishName + ".", (SharedData shared) => shared.m_attack.m_attackStamina, delegate(SharedData shared, float value) { shared.m_attack.m_attackStamina = value; }); SetDmg("True", (DamageTypes dmg) => dmg.m_damage, delegate(ref DamageTypes dmg, float val) { dmg.m_damage = val; }); SetDmg("Slash", (DamageTypes dmg) => dmg.m_slash, delegate(ref DamageTypes dmg, float val) { dmg.m_slash = val; }); SetDmg("Pierce", (DamageTypes dmg) => dmg.m_pierce, delegate(ref DamageTypes dmg, float val) { dmg.m_pierce = val; }); SetDmg("Blunt", (DamageTypes dmg) => dmg.m_blunt, delegate(ref DamageTypes dmg, float val) { dmg.m_blunt = val; }); SetDmg("Chop", (DamageTypes dmg) => dmg.m_chop, delegate(ref DamageTypes dmg, float val) { dmg.m_chop = val; }); SetDmg("Pickaxe", (DamageTypes dmg) => dmg.m_pickaxe, delegate(ref DamageTypes dmg, float val) { dmg.m_pickaxe = val; }); SetDmg("Fire", (DamageTypes dmg) => dmg.m_fire, delegate(ref DamageTypes dmg, float val) { dmg.m_fire = val; }); SetDmg("Poison", (DamageTypes dmg) => dmg.m_poison, delegate(ref DamageTypes dmg, float val) { dmg.m_poison = val; }); SetDmg("Frost", (DamageTypes dmg) => dmg.m_frost, delegate(ref DamageTypes dmg, float val) { dmg.m_frost = val; }); SetDmg("Lightning", (DamageTypes dmg) => dmg.m_lightning, delegate(ref DamageTypes dmg, float val) { dmg.m_lightning = val; }); SetDmg("Spirit", (DamageTypes dmg) => dmg.m_spirit, delegate(ref DamageTypes dmg, float val) { dmg.m_spirit = val; }); if ((int)itemType == 4) { statcfg<int>("Projectiles", "Number of projectiles that " + englishName + " shoots at once.", (SharedData shared) => shared.m_attack.m_projectileBursts, delegate(SharedData shared, int value) { shared.m_attack.m_projectileBursts = value; }); statcfg<float>("Burst Interval", "Time between the projectiles " + englishName + " shoots at once.", (SharedData shared) => shared.m_attack.m_burstInterval, delegate(SharedData shared, float value) { shared.m_attack.m_burstInterval = value; }); statcfg<float>("Minimum Accuracy", "Minimum accuracy for " + englishName + ".", (SharedData shared) => shared.m_attack.m_projectileAccuracyMin, delegate(SharedData shared, float value) { shared.m_attack.m_projectileAccuracyMin = value; }); statcfg<float>("Accuracy", "Accuracy for " + englishName + ".", (SharedData shared) => shared.m_attack.m_projectileAccuracy, delegate(SharedData shared, float value) { shared.m_attack.m_projectileAccuracy = value; }); statcfg<float>("Minimum Velocity", "Minimum velocity for " + englishName + ".", (SharedData shared) => shared.m_attack.m_projectileVelMin, delegate(SharedData shared, float value) { shared.m_attack.m_projectileVelMin = value; }); statcfg<float>("Velocity", "Velocity for " + englishName + ".", (SharedData shared) => shared.m_attack.m_projectileVel, delegate(SharedData shared, float value) { shared.m_attack.m_projectileVel = value; }); statcfg<float>("Maximum Draw Time", "Time until " + englishName + " is fully drawn at skill level 0.", (SharedData shared) => shared.m_attack.m_drawDurationMin, delegate(SharedData shared, float value) { shared.m_attack.m_drawDurationMin = value; }); statcfg<float>("Stamina Drain", "Stamina drain per second while drawing " + englishName + ".", (SharedData shared) => shared.m_attack.m_drawStaminaDrain, delegate(SharedData shared, float value) { shared.m_attack.m_drawStaminaDrain = value; }); } } } List<ConfigurationManagerAttributes> traderAttributes; if ((item3.configurability & Configurability.Trader) != 0) { traderAttributes = new List<ConfigurationManagerAttributes>(); item3.traderConfig = new TraderConfig { trader = config(englishName, "Trader Selling", item3.Trade.Trader, new ConfigDescription("Which traders sell " + englishName + ".", (AcceptableValueBase)null, new object[1] { new ConfigurationManagerAttributes { Order = (order -= 1), Browsable = ((item3.configurationVisible & Configurability.Trader) != 0), Category = localizedName } })) }; item3.traderConfig.trader.SettingChanged += delegate { item3.ReloadTraderConfiguration(); foreach (ConfigurationManagerAttributes item10 in traderAttributes) { item10.Browsable = TraderBrowsability(); } reloadConfigDisplay(); }; item3.traderConfig.price = traderConfig<uint>("Trader Price", item3.Trade.Price, "Price of " + englishName + " at the trader."); item3.traderConfig.stack = traderConfig<uint>("Trader Stack", item3.Trade.Stack, "Stack size of " + englishName + " in the trader. Also known as the number of items sold by a trader in one transaction."); item3.traderConfig.requiredGlobalKey = traderConfig<string>("Trader Required Global Key", item3.Trade.RequiredGlobalKey ?? "", "Required global key to unlock " + englishName + " at the trader."); if (item3.traderConfig.trader.Value != 0) { PrefabManager.AddItemToTrader(item3.Prefab, item3.traderConfig.trader.Value, item3.traderConfig.price.Value, item3.traderConfig.stack.Value, item3.traderConfig.requiredGlobalKey.Value); } } else if (item3.Trade.Trader != 0) { PrefabManager.AddItemToTrader(item3.Prefab, item3.Trade.Trader, item3.Trade.Price, item3.Trade.Stack, item3.Trade.RequiredGlobalKey); } void SetDmg(string dmgType, Func<DamageTypes, float> readDmg, setDmgFunc setDmg) { statcfg<float>(dmgType + " Damage", dmgType + " damage dealt by " + englishName + ".", (SharedData shared) => readDmg(shared.m_damages), delegate(SharedData shared, float val) { setDmg(ref shared.m_damages, val); }); statcfg<float>(dmgType + " Damage Per Level", dmgType + " damage dealt increase per level for " + englishName + ".", (SharedData shared) => readDmg(shared.m_damagesPerLevel), delegate(SharedData shared, float val) { setDmg(ref shared.m_damagesPerLevel, val); }); } bool TraderBrowsability() { return item3.traderConfig.trader.Value != Trader.None; } void statcfg<T>(string configName, string description, Func<SharedData, T> readDefault, Action<SharedData, T> setValue) { //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Expected O, but got Unknown SharedData shared3 = item3.Prefab.GetComponent<ItemDrop>().m_itemData.m_shared; ConfigEntry<T> cfg2 = config(englishName, configName, readDefault(shared3), new ConfigDescription(description, (AcceptableValueBase)null, new object[1] { new ConfigurationManagerAttributes { Category = localizedName, Browsable = ((item3.configurationVisible & Configurability.Stats) != 0) } })); if ((item3.configurationVisible & Configurability.Stats) != 0) { setValue(shared3, cfg2.Value); } item3.statsConfigs.Add((ConfigEntryBase)(object)cfg2, ApplyConfig); cfg2.SettingChanged += delegate { if ((item3.configurationVisible & Configurability.Stats) != 0) { ApplyConfig(); } }; void ApplyConfig() { item3.ApplyToAllInstances(delegate(ItemData item) { setValue(item.m_shared, cfg2.Value); }); } } ConfigEntry<T> traderConfig<T>(string name, T value, string desc) { //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Expected O, but got Unknown ConfigurationManagerAttributes configurationManagerAttributes2 = new ConfigurationManagerAttributes { Order = (order -= 1), browsability = TraderBrowsability, Browsable = (TraderBrowsability() && (item3.configurationVisible & Configurability.Trader) != 0), Category = localizedName }; traderAttributes.Add(configurationManagerAttributes2); ConfigEntry<T> val5 = config(englishName, name, value, new ConfigDescription(desc, (AcceptableValueBase)null, new object[1] { configurationManagerAttributes2 })); val5.SettingChanged += delegate { item3.ReloadTraderConfiguration(); }; return val5; } } if (saveOnConfigSet) { plugin.Config.SaveOnConfigSet = true; plugin.Config.Save(); } } configManager = ((type == null) ? null : Chainloader.ManagerObject.GetComponent(type)); foreach (Item registeredItem in registeredItems) { Item item2 = registeredItem; foreach (KeyValuePair<string, ItemRecipe> recipe in item2.Recipes) { KeyValuePair<string, ItemRecipe> kv = recipe; RequiredResourceList[] array2 = new RequiredResourceList[2] { kv.Value.RequiredItems, kv.Value.RequiredUpgradeItems }; foreach (RequiredResourceList requiredResourceList in array2) { for (int l = 0; l < requiredResourceList.Requirements.Count; l++) { ConfigEntry<int> amountCfg; int resourceIndex; if ((item2.configurability & Configurability.Recipe) != 0) { amountCfg = requiredResourceList.Requirements[l].amountConfig; if (amountCfg != null) { resourceIndex = l; amountCfg.SettingChanged += ConfigChanged; } } void ConfigChanged(object o, EventArgs e) { if (Object.op_Implicit((Object)(object)ObjectDB.instance) && activeRecipes.ContainsKey(item2) && activeRecipes[item2].TryGetValue(kv.Key, out var value2)) { foreach (Recipe item11 in value2) { item11.m_resources[resourceIndex].m_amount = amountCfg.Value; } } } } } } item2.InitializeNewRegisteredItem(); } } private void InitializeNewRegisteredItem() { foreach (KeyValuePair<string, ItemRecipe> recipe in Recipes) { KeyValuePair<string, ItemRecipe> kv = recipe; ConfigEntryBase enabledCfg = kv.Value.RecipeIsActive; if (enabledCfg != null) { ((object)enabledCfg).GetType().GetEvent("SettingChanged").AddEventHandler(enabledCfg, new EventHandler(ConfigChanged)); } void ConfigChanged(object o, EventArgs e) { if (Object.op_Implicit((Object)(object)ObjectDB.instance) && activeRecipes.ContainsKey(this) && activeRecipes[this].TryGetValue(kv.Key, out var value)) { foreach (Recipe item in value) { item.m_enabled = (int)enabledCfg.BoxedValue != 0; } } } } } public void ReloadCraftingConfiguration() { if (Object.op_Implicit((Object)(object)ObjectDB.instance) && ObjectDB.instance.GetItemPrefab(StringExtensionMethods.GetStableHashCode(((Object)Prefab).name)) == null) { registerRecipesInObjectDB(ObjectDB.instance); ObjectDB.instance.m_items.Add(Prefab); ObjectDB.instance.m_itemByHash.Add(StringExtensionMethods.GetStableHashCode(((Object)Prefab).name), Prefab); ZNetScene.instance.m_prefabs.Add(Prefab); ZNetScene.instance.m_namedPrefabs.Add(StringExtensionMethods.GetStableHashCode(((Object)Prefab).name), Prefab); } foreach (string item in Recipes.Keys.DefaultIfEmpty("")) { if (Recipes.TryGetValue(item, out var value) && value.Crafting.Stations.Count > 0) { UpdateItemTableConfig(item, value.Crafting.Stations.First().Table, value.Crafting.Stations.First().custom ?? ""); UpdateCraftConfig(item, new SerializedRequirements(value.RequiredItems.Requirements), new SerializedRequirements(value.RequiredUpgradeItems.Requirements)); } } } private void ReloadTraderConfiguration() { if (traderConfig.trader.Value == Trader.None) { PrefabManager.RemoveItemFromTrader(Prefab); } else { PrefabManager.AddItemToTrader(Prefab, traderConfig.trader.Value, traderConfig.price.Value, traderConfig.stack.Value, traderConfig.requiredGlobalKey.Value); } } public static void ApplyToAllInstances(GameObject prefab, Action<ItemData> callback) { callback(prefab.GetComponent<ItemDrop>().m_itemData); string name = prefab.GetComponent<ItemDrop>().m_itemData.m_shared.m_name; Inventory[] source = (from c in Player.s_players.Select((Player p) => ((Humanoid)p).GetInventory()).Concat(from c in Object.FindObjectsOfType<Container>() select c.GetInventory()) where c != null select c).ToArray(); foreach (ItemData item in (from i in (from p in ObjectDB.instance.m_items select p.GetComponent<ItemDrop>() into c where Object.op_Implicit((Object)(object)c) && Object.op_Implicit((Object)(object)((Component)c).GetComponent<ZNetView>()) select c).Concat(ItemDrop.s_instances) select i.m_itemData).Concat(source.SelectMany((Inventory i) => i.GetAllItems()))) { if (item.m_shared.m_name == name) { callback(item); } } } public void ApplyToAllInstances(Action<ItemData> callback) { ApplyToAllInstances(Prefab, callback); } private static string getInternalName<T>(T value) where T : struct { return ((InternalName)typeof(T).GetMember(value.ToString())[0].GetCustomAttributes(typeof(InternalName)).First()).internalName; } private void registerRecipesInObjectDB(ObjectDB objectDB) { //IL_044e: Unknown result type (might be due to invalid IL or missing references) //IL_0453: Unknown result type (might be due to invalid IL or missing references) //IL_0486: Unknown result type (might be due to invalid IL or missing references) //IL_049c: Expected O, but got Unknown activeRecipes[this] = new Dictionary<string, List<Recipe>>(); itemCraftConfigs.TryGetValue(this, out var value); foreach (KeyValuePair<string, ItemRecipe> recipe in Recipes) { List<Recipe> list = new List<Recipe>(); foreach (CraftingStationConfig station in recipe.Value.Crafting.Stations) { ItemConfig itemConfig = value?[recipe.Key]; Recipe val = ScriptableObject.CreateInstance<Recipe>(); string name = ((Object)Prefab).name; CraftingTable table = station.Table; ((Object)val).name = name + "_Recipe_" + table; val.m_amount = recipe.Value.CraftAmount; bool enabled; if (itemConfig != null) { enabled = itemConfig.table.Value != CraftingTable.Disabled; } else { ConfigEntryBase? recipeIsActive = recipe.Value.RecipeIsActive; enabled = (int)(((recipeIsActive != null) ? recipeIsActive.BoxedValue : null) ?? ((object)1)) != 0; } val.m_enabled = enabled; val.m_item = Prefab.GetComponent<ItemDrop>(); val.m_resources = SerializedRequirements.toPieceReqs(objectDB, (itemConfig?.craft == null) ? new SerializedRequirements(recipe.Value.RequiredItems.Requirements) : new SerializedRequirements(itemConfig.craft.Value), (itemConfig?.upgrade == null) ? new SerializedRequirements(recipe.Value.RequiredUpgradeItems.Requirements) : new SerializedRequirements(itemConfig.upgrade.Value)); table = ((itemConfig == null || list.Count > 0) ? station.Table : itemConfig.table.Value); if ((uint)table <= 1u) { val.m_craftingStation = null; } else if (((itemConfig == null || list.Count > 0) ? station.Table : itemConfig.table.Value) == CraftingTable.Custom) { GameObject prefab = ZNetScene.instance.GetPrefab((itemConfig == null || list.Count > 0) ? station.custom : itemConfig.customTable.Value); if (prefab != null) { val.m_craftingStation = prefab.GetComponent<CraftingStation>(); } else { Debug.LogWarning((object)("Custom crafting station '" + ((itemConfig == null || list.Count > 0) ? station.custom : itemConfig.customTable.Value) + "' does not exist")); } } else { val.m_craftingStation = ZNetScene.instance.GetPrefab(getInternalName((itemConfig == null || list.Count > 0) ? station.Table : itemConfig.table.Value)).GetComponent<CraftingStation>(); } val.m_minStationLevel = ((itemConfig == null || list.Count > 0) ? station.level : itemConfig.tableLevel.Value); val.m_requireOnlyOneIngredient = ((itemConfig == null) ? recipe.Value.RequireOnlyOneIngredient : (itemConfig.requireOneIngredient.Value == Toggle.On)); val.m_qualityResultAmountMultiplier = itemConfig?.qualityResultAmountMultiplier.Value ?? recipe.Value.QualityResultAmountMultiplier; list.Add(val); RequiredResourceList requiredItems = recipe.Value.RequiredItems; if (requiredItems != null && !requiredItems.Free) { List<Requirement> requirements = requiredItems.Requirements; if (requirements != null && requirements.Count == 0) { hiddenCraftRecipes.Add(val, recipe.Value.RecipeIsActive); } } requiredItems = recipe.Value.RequiredUpgradeItems; if (requiredItems != null && !requiredItems.Free) { List<Requirement> requirements = requiredItems.Requirements; if (requirements != null && requirements.Count == 0) { hiddenUpgradeRecipes.Add(val, recipe.Value.RecipeIsActive); } } } activeRecipes[this].Add(recipe.Key, list); objectDB.m_recipes.AddRange(list); } conversions = new List<ItemConversion>(); for (int i = 0; i < Conversions.Count; i++) { Conversion conversion = Conversions[i]; conversions.Add(new ItemConversion { m_from = SerializedRequirements.fetchByName(ObjectDB.instance, conversion.config?.input.Value ?? conversion.Input), m_to = Prefab.GetComponent<ItemDrop>() }); ConversionPiece conversionPiece = conversion.config?.piece.Value ?? conversion.Piece; string text = null; if (conversionPiece != 0 && conversions[i].m_from != null) { text = ((conversionPiece != ConversionPiece.Custom) ? getInternalName(conversionPiece) : (conversion.config?.customPiece.Value ?? conversion.customPiece)); GameObject prefab2 = ZNetScene.instance.GetPrefab(text); Smelter val2 = ((prefab2 != null) ? prefab2.GetComponent<Smelter>() : null); if (val2 != null) { val2.m_conversion.Add(conversions[i]); } else { text = null; } } if (conversion.config != null) { conversion.config.activePiece = text; } } } [HarmonyPriority(0)] internal static void Patch_ObjectDBInit(ObjectDB __instance) { if ((Object)(object)__instance.GetItemPrefab("Wood") == (Object)null) { return; } hiddenCraftRecipes.Clear(); hiddenUpgradeRecipes.Clear(); foreach (Item registeredItem in registeredItems) { registeredItem.registerRecipesInObjectDB(__instance); } } internal static void Patch_TraderGetAvailableItems(Trader __instance, ref List<TradeItem> __result) { string prefabName = Utils.GetPrefabName(((Component)__instance).gameObject); Trader trader2 = ((prefabName == "Haldor") ? Trader.Haldor : ((prefabName == "Hildir") ? Trader.Hildir : Trader.None)); Trader trader = trader2; __result.AddRange(from tuple in PrefabManager.CustomTradeItems.Values where (tuple.Item1 & trader) != 0 select tuple.Item2 into tradeItem where string.IsNullOrEmpty(tradeItem.m_requiredGlobalKey) || ZoneSystem.instance.GetGlobalKey(tradeItem.m_requiredGlobalKey) select tradeItem); } internal static void Patch_OnAddSmelterInput(ItemData item, bool __result) { if (__result) { ((Humanoid)Player.m_localPlayer).UnequipItem(item, true); } } internal static void Patch_MaximumRequiredStationLevel(Recipe __instance, ref int __result, int quality) { if (!itemDropMap.TryGetValue(__instance.m_item, out var value)) { return; } IEnumerable<ItemConfig> source; if (!itemCraftConfigs.TryGetValue(value, out var value2)) { source = Enumerable.Empty<ItemConfig>(); } else { CraftingStation currentCraftingStation = Player.m_localPlayer.GetCurrentCraftingStation(); if (currentCraftingStation != null) { string stationName = Utils.GetPrefabName(((Component)currentCraftingStation).gameObject); source = from c in value2.Where(delegate(KeyValuePair<string, ItemConfig> c) { switch (c.Value.table.Value) { case CraftingTable.Disabled: case CraftingTable.Inventory: return false; case CraftingTable.Custom: return c.Value.customTable.Value == stationName; default: return getInternalName(c.Value.table.Value) == stationName; } }) select c.Value; } else { source = value2.Values; } } __result = Mathf.Min(Mathf.Max(1, __instance.m_minStationLevel) + (quality - 1), (from cfg in source where cfg.maximumTableLevel != null select cfg.maximumTableLevel.Value).DefaultIfEmpty(value.MaximumRequiredStationLevel).Max()); } internal static void Patch_GetAvailableRecipesPrefix(ref Dictionary<Assembly, Dictionary<Recipe, ConfigEntryBase?>>? __state) { if (__state == null) { __state = new Dictionary<Assembly, Dictionary<Recipe, ConfigEntryBase>>(); } Dictionary<Recipe, ConfigEntryBase> dictionary; if (InventoryGui.instance.InCraftTab()) { dictionary = hiddenCraftRecipes; } else { if (!InventoryGui.instance.InUpradeTab()) { return; } dictionary = hiddenUpgradeRecipes; } foreach (Recipe key in dictionary.Keys) { key.m_enabled = false; } __state[Assembly.GetExecutingAssembly()] = dictionary; } internal static void Patch_GetAvailableRecipesFinalizer(Dictionary<Assembly, Dictionary<Recipe, ConfigEntryBase?>> __state) { if (!__state.TryGetValue(Assembly.GetExecutingAssembly(), out Dictionary<Recipe, ConfigEntryBase> value)) { return; } foreach (KeyValuePair<Recipe, ConfigEntryBase> item in value) { Recipe key = item.Key; ConfigEntryBase value2 = item.Value; key.m_enabled = (int)(((value2 != null) ? value2.BoxedValue : null) ?? ((object)1)) != 0; } } internal static IEnumerable<CodeInstruction> Transpile_SetupRequirementList(IEnumerable<CodeInstruction> instructionsEnumerable, ILGenerator ilg) { //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Expected O, but got Unknown //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Expected O, but got Unknown //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Expected O, but got Unknown //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Expected O, but got Unknown //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Expected O, but got Unknown //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Expected O, but got Unknown //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Expected O, but got Unknown //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Expected O, but got Unknown //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Expected O, but got Unknown //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Expected O, but got Unknown //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Expected O, but got Unknown List<CodeInstruction> list = instructionsEnumerable.ToList(); MethodInfo methodInfo = AccessTools.DeclaredMethod(typeof(InventoryGui), "SetupRequirement", (Type[])null, (Type[])null); CodeInstruction val = null; CodeInstruction val2 = null; LocalBuilder localBuilder = ilg.DeclareLocal(typeof(int)); Dictionary<Label, int> dictionary = new Dictionary<Label, int>(); bool flag = false; int num = 0; int value = 0; Label? label = default(Label?); for (int i = 0; i < list.Count; i++) { if (CodeInstructionExtensions.Calls(list[i], methodInfo)) { val = list[i + 2]; val2 = list[i + 5]; flag = true; } if (flag) { if (CodeInstructionExtensions.Branches(list[i], ref label) && dictionary.TryGetValue(label.Value, out value)) { num = i; break; } continue; } foreach (Label label4 in list[i].labels) { dictionary[label4] = i; } } if (list[value - 3].opcode == OpCodes.Dup) { return list; } Label label2 = ilg.DefineLabel(); Label label3 = ilg.DefineLabel(); list[num + 1].labels.Add(label2); list.InsertRange(num + 1, (IEnumerable<CodeInstruction>)(object)new CodeInstruction[11] { new CodeInstruction(OpCodes.Ldloc, (object)localBuilder), new CodeInstruction(OpCodes.Brfalse, (object)label2), val.Clone(), new CodeInstruction(OpCodes.Ldarg_0, (object)null), new CodeInstruction(OpCodes.Ldfld, (object)AccessTools.DeclaredField(typeof(InventoryGui), "m_recipeRequirementList")), new CodeInstruction(OpCodes.Ldlen, (object)null), new CodeInstruction(OpCodes.Bgt, (object)label2), new CodeInstruction(OpCodes.Ldc_I4_0, (object)null), val2.Clone(), new CodeInstruction(OpCodes.Ldc_I4_0, (object)null), new CodeInstruction(OpCodes.Br, (object)label3) }); list.InsertRange(value - 2, (IEnumerable<CodeInstruction>)(object)new CodeInstruction[2] { new CodeInstruction(OpCodes.Dup, (object)null) { labels = new List<Label> { label3 } }, new CodeInstruction(OpCodes.Stloc, (object)localBuilder) }); return list; } internal static bool Patch_RequirementGetAmount(Requirement __instance, int qualityLevel, ref int __result) { if (requirementQuality.TryGetValue(__instance, out var value)) { __result = ((value.quality == qualityLevel) ? __instance.m_amountPerLevel : 0); return false; } return true; } internal static void Patch_ZNetSceneAwake(ZNetScene __instance) { foreach (Item registeredItem in registeredItems) { registeredItem.AssignDropToCreature(); } } public void AssignDropToCreature() { foreach (KeyValuePair<CharacterDrop, Drop> characterDrop in characterDrops) { if (Object.op_Implicit((Object)(object)characterDrop.Key)) { characterDrop.Key.m_drops.Remove(characterDrop.Value); } } characterDrops.Clear(); SerializedDrop serializedDrop = new SerializedDrop(DropsFrom.Drops); if (itemDropConfigs.TryGetValue(this, out var value)) { serializedDrop = new SerializedDrop(value.Value); } foreach (KeyValuePair<Character, Drop> item in serializedDrop.toCharacterDrops(ZNetScene.s_instance, Prefab)) { CharacterDrop val = ((Component)item.Key).GetComponent<CharacterDrop>(); if (val == null) { val = ((Component)item.Key).gameObject.AddComponent<CharacterDrop>(); } val.m_drops.Add(item.Value); characterDrops.Add(val, item.Value); } } public void UpdateCharacterDrop() { if (Object.op_Implicit((Object)(object)ZNetScene.instance)) { AssignDropToCreature(); } } public void Snapshot(float lightIntensity = 1.3f, Quaternion? cameraRotation = null, Quaternion? itemRotation = null) { SnapshotItem(Prefab.GetComponent<ItemDrop>(), lightIntensity, cameraRotation, itemRotation); } public static void SnapshotItem(ItemDrop item, float lightIntensity = 1.3f, Quaternion? cameraRotation = null, Quaternion? itemRotation = null) { if (Object.op_Implicit((Object)(object)ObjectDB.instance)) { Do(); } else { ((MonoBehaviour)plugin).StartCoroutine(Delay()); } IEnumerator Delay() { yield return null; Do(); } void Do() { //IL_0018: 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_0085: 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_00a7: 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_016a: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01db: 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_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0206: 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_020a: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0248: 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_0286: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_032b: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Expected O, but got Unknown //IL_0334: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Unknown result type (might be due to invalid IL or missing references) //IL_036f: Unknown result type (might be due to invalid IL or missing references) Camera component = new GameObject("Camera", new Type[1] { typeof(Camera) }).GetComponent<Camera>(); component.backgroundColor = Color.clear; component.clearFlags = (CameraClearFlags)2; component.fieldOfView = 0.5f; component.farClipPlane = 10000000f; component.cullingMask = 1073741824; ((Component)component).transform.rotation = (Quaternion)(((??)cameraRotation) ?? Quaternion.Euler(90f, 0f, 45f)); Light component2 = new GameObject("Light", new Type[1] { typeof(Light) }).GetComponent<Light>(); ((Component)component2).transform.rotation = Quaternion.Euler(150f, 0f, -5f); component2.type = (LightType)1; component2.cullingMask = 1073741824; component2.intensity = lightIntensity; Rect val = default(Rect); ((Rect)(ref val))..ctor(0f, 0f, 64f, 64f); Transform val2 = ((Component)item).transform.Find("attach"); GameObject val3; if (val2 != null) { val3 = Object.Instantiate<GameObject>(((Component)val2).gameObject); } else { ZNetView.m_forceDisableInit = true; val3 = Object.Instantiate<GameObject>(((Component)i
files/plugins/roll.dll
Decompiled 2 weeks agousing System; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using HarmonyLib; using TMPro; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("roll")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("roll")] [assembly: AssemblyCopyright("Copyright © 2021")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("3B95EEF7-4A97-4393-91A0-3626434F3631")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace tripping { [BepInPlugin("1010101110.roll", "roll", "1.0.0")] public class Mod : BaseUnityPlugin { public static readonly Harmony harmony = new Harmony(typeof(Mod).GetCustomAttributes(typeof(BepInPlugin), inherit: false).Cast<BepInPlugin>().First() .GUID); private void Awake() { harmony.PatchAll(); } private void OnDestroy() { harmony.UnpatchSelf(); } } } namespace tripping.Patches { public class TrippingPatches { [HarmonyPatch(typeof(Chat), "Awake")] private class awakepatch { private static void Postfix(ref Chat __instance) { ((Terminal)__instance).AddString("/roll min(optional) max(optional) rolls dice, default (1-100)"); ((Terminal)__instance).AddString(""); } } [HarmonyPatch(typeof(Chat), "InputText")] private class sendtextpatch { private static bool Prefix(ref Chat __instance) { if (((TMP_InputField)((Terminal)__instance).m_input).text.StartsWith("/roll")) { try { int num = 1; int num2 = 100; string[] array = ((TMP_InputField)((Terminal)__instance).m_input).text.Split(new char[1] { ' ' }); if (array.Length == 2) { num2 = int.Parse(array[1]); } if (array.Length == 3) { num = int.Parse(array[1]); num2 = int.Parse(array[2]); } if (num > num2) { throw new Exception("invalid roll"); } Random random = new Random(); ((TMP_InputField)((Terminal)__instance).m_input).text = "rolls " + random.Next(num, num2 + 1) + " (" + num + "-" + num2 + "){|roll|}"; } catch { ((Terminal)__instance).AddString("failed roll, try /roll or /roll 100 or /roll 1 100"); return false; } } return true; } } [HarmonyPatch(typeof(Chat), "OnNewChatMessage")] private class addstringpatch { private static bool Prefix(GameObject go, long senderID, Vector3 pos, Type type, UserInfo user, string text, string senderNetworkUserId, ref Chat __instance) { if (text.Contains("{|roll|}")) { string text2 = text.Replace("{|roll|}", ""); ((Terminal)__instance).AddString("<color=#FFFF00>" + user.GetDisplayName(senderNetworkUserId) + " " + text2 + "</color>"); return false; } return true; } } } }
files/plugins/shrooms.dll
Decompiled 2 weeks agousing System.Collections; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using HarmonyLib; using Jotunn; using Jotunn.Configs; using Jotunn.Entities; using Jotunn.Managers; using Jotunn.Utils; using UnityEngine; using UnityEngine.PostProcessing; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("socketparams")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("socketparams")] [assembly: AssemblyCopyright("Copyright © 2021")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("3B95EEF7-4A97-4393-91A0-3626434F3631")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace tripping { [BepInPlugin("1010101110.shrooms", "shrooms", "1.3.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Mod : BaseUnityPlugin { public static readonly Harmony harmony = new Harmony(typeof(Mod).GetCustomAttributes(typeof(BepInPlugin), inherit: false).Cast<BepInPlugin>().First() .GUID); private void Awake() { harmony.PatchAll(); PrefabManager.OnVanillaPrefabsAvailable += AddShrooms; } private void OnDestroy() { harmony.UnpatchSelf(); } private void AddShrooms() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Expected O, but got Unknown //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Expected O, but got Unknown //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Expected O, but got Unknown //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Expected O, but got Unknown //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Expected O, but got Unknown //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Expected O, but got Unknown //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Expected O, but got Unknown //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0178: 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_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Expected O, but got Unknown //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Expected O, but got Unknown //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Expected O, but got Unknown //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Expected O, but got Unknown //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Expected O, but got Unknown //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Expected O, but got Unknown //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Expected O, but got Unknown //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Expected O, but got Unknown //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Expected O, but got Unknown //IL_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_0321: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Expected O, but got Unknown //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_0337: Expected O, but got Unknown //IL_034d: Unknown result type (might be due to invalid IL or missing references) //IL_0352: 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_0366: Unknown result type (might be due to invalid IL or missing references) //IL_036e: Unknown result type (might be due to invalid IL or missing references) //IL_0376: Unknown result type (might be due to invalid IL or missing references) //IL_037e: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Unknown result type (might be due to invalid IL or missing references) //IL_039b: Expected O, but got Unknown //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Expected O, but got Unknown //IL_03b2: Unknown result type (might be due to invalid IL or missing references) //IL_03b7: Unknown result type (might be due to invalid IL or missing references) //IL_03c4: Expected O, but got Unknown //IL_03bf: Unknown result type (might be due to invalid IL or missing references) //IL_03c9: Expected O, but got Unknown //IL_03db: Unknown result type (might be due to invalid IL or missing references) //IL_03e5: Expected O, but got Unknown //IL_03f7: Unknown result type (might be due to invalid IL or missing references) //IL_03fd: Expected O, but got Unknown //IL_041a: Unknown result type (might be due to invalid IL or missing references) //IL_041f: Unknown result type (might be due to invalid IL or missing references) //IL_042b: Unknown result type (might be due to invalid IL or missing references) //IL_0434: Expected O, but got Unknown //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_043b: Unknown result type (might be due to invalid IL or missing references) //IL_0447: Unknown result type (might be due to invalid IL or missing references) //IL_0450: Expected O, but got Unknown //IL_0452: Unknown result type (might be due to invalid IL or missing references) //IL_0457: Unknown result type (might be due to invalid IL or missing references) //IL_0463: Unknown result type (might be due to invalid IL or missing references) //IL_046c: Expected O, but got Unknown //IL_046e: Unknown result type (might be due to invalid IL or missing references) //IL_0473: Unknown result type (might be due to invalid IL or missing references) //IL_047f: Unknown result type (might be due to invalid IL or missing references) //IL_0488: Expected O, but got Unknown //IL_048f: Unknown result type (might be due to invalid IL or missing references) //IL_0499: Expected O, but got Unknown AssetBundle val = AssetUtils.LoadAssetBundleFromResources("mushroom", typeof(Mod).Assembly); ItemManager.Instance.AddItem(new CustomItem(val.LoadAsset<GameObject>("MushroomBlack"), false, new ItemConfig { Enabled = false })); PrefabManager.Instance.AddPrefab(new CustomPrefab(val.LoadAsset<GameObject>("Pickable_Mushroom_black"), false)); ZoneManager.Instance.AddCustomVegetation(new CustomVegetation(val.LoadAsset<GameObject>("Pickable_Mushroom_black"), false, new VegetationConfig { Biome = (Biome)8, Max = 0.1f, BlockCheck = true, GroupSizeMin = 1, GroupSizeMax = 1, GroupRadius = 4f, MinAltitude = 1f })); ItemManager instance = ItemManager.Instance; GameObject obj = val.LoadAsset<GameObject>("MushroomPink"); ItemConfig val2 = new ItemConfig(); val2.Amount = 2; val2.CraftingStation = "piece_cauldron"; val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[3] { new RequirementConfig { Item = "MushroomYellow", Amount = 2 }, new RequirementConfig { Item = "Raspberry", Amount = 4 }, new RequirementConfig { Item = "GreydwarfEye", Amount = 4 } }; instance.AddItem(new CustomItem(obj, false, val2)); PrefabManager.Instance.AddPrefab(new CustomPrefab(val.LoadAsset<GameObject>("Pickable_Mushroom_pink"), false)); ItemManager instance2 = ItemManager.Instance; GameObject obj2 = val.LoadAsset<GameObject>("MushroomBlood"); val2 = new ItemConfig(); val2.Amount = 2; val2.CraftingStation = "piece_cauldron"; val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[2] { new RequirementConfig { Item = "MushroomBlack", Amount = 2 }, new RequirementConfig { Item = "Bloodbag", Amount = 4 } }; instance2.AddItem(new CustomItem(obj2, false, val2)); PrefabManager.Instance.AddPrefab(new CustomPrefab(val.LoadAsset<GameObject>("Pickable_Mushroom_blood"), false)); ZoneManager.Instance.AddCustomVegetation(new CustomVegetation(val.LoadAsset<GameObject>("Pickable_Mushroom_blood"), false, new VegetationConfig { Biome = (Biome)2, Max = 0.1f, BlockCheck = true, GroupSizeMin = 1, GroupSizeMax = 1, GroupRadius = 4f, MinAltitude = 0f, MaxAltitude = 0.5f })); ItemManager.Instance.AddItem(new CustomItem(val.LoadAsset<GameObject>("MushroomGreen"), false, new ItemConfig { Enabled = false })); PrefabManager.Instance.AddPrefab(new CustomPrefab(val.LoadAsset<GameObject>("Pickable_Mushroom_green"), false)); ZoneManager.Instance.AddCustomVegetation(new CustomVegetation(val.LoadAsset<GameObject>("Pickable_Mushroom_green"), false, new VegetationConfig { Biome = (Biome)2, Max = 0.1f, BlockCheck = true, GroupSizeMin = 1, GroupSizeMax = 1, GroupRadius = 4f, MinAltitude = 0.2f, MaxAltitude = 2f })); ZoneManager.Instance.AddCustomVegetation(new CustomVegetation(PrefabManager.Instance.GetPrefab("Pickable_Mushroom_blue"), false, new VegetationConfig { Biome = (Biome)4, Max = 0.1f, BlockCheck = true, GroupSizeMin = 1, GroupSizeMax = 1, GroupRadius = 4f, MinAltitude = 20f })); ItemManager.Instance.AddItem(new CustomItem(val.LoadAsset<GameObject>("MushroomPurple"), false, new ItemConfig { Enabled = false })); PrefabManager.Instance.AddPrefab(new CustomPrefab(val.LoadAsset<GameObject>("Pickable_Mushroom_purple"), false)); ItemManager instance3 = ItemManager.Instance; GameObject obj3 = val.LoadAsset<GameObject>("MushroomRainbow"); val2 = new ItemConfig(); val2.Amount = 2; val2.CraftingStation = "piece_cauldron"; val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[4] { new RequirementConfig { Item = "MushroomBlack", Amount = 1 }, new RequirementConfig { Item = "MushroomGreen", Amount = 1 }, new RequirementConfig { Item = "MushroomBlue", Amount = 1 }, new RequirementConfig { Item = "MushroomPurple", Amount = 1 } }; instance3.AddItem(new CustomItem(obj3, false, val2)); PrefabManager.Instance.AddPrefab(val.LoadAsset<GameObject>("Pickable_Mushroom_rainbow")); } } } namespace tripping.Patches { public class TrippingPatches { [HarmonyPatch(typeof(Player), "FixedUpdate")] private class playerposty { private static void Postfix(ref Player __instance) { //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Expected O, but got Unknown //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0563: Unknown result type (might be due to invalid IL or missing references) //IL_0568: 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_04ff: Unknown result type (might be due to invalid IL or missing references) //IL_050f: Unknown result type (might be due to invalid IL or missing references) //IL_0514: Unknown result type (might be due to invalid IL or missing references) //IL_03c7: Unknown result type (might be due to invalid IL or missing references) //IL_03d6: Unknown result type (might be due to invalid IL or missing references) //IL_03e0: Unknown result type (might be due to invalid IL or missing references) //IL_03e5: Unknown result type (might be due to invalid IL or missing references) //IL_03ea: Unknown result type (might be due to invalid IL or missing references) //IL_03ef: Unknown result type (might be due to invalid IL or missing references) //IL_03f4: Unknown result type (might be due to invalid IL or missing references) //IL_05f3: Unknown result type (might be due to invalid IL or missing references) //IL_05f8: Unknown result type (might be due to invalid IL or missing references) //IL_0683: Unknown result type (might be due to invalid IL or missing references) //IL_0688: Unknown result type (might be due to invalid IL or missing references) if (!((Character)__instance).m_nview.IsValid() || !((Character)__instance).m_nview.IsOwner() || __instance.GetPlayerID() != Player.m_localPlayer.GetPlayerID()) { return; } StatusEffect statusEffect = ((Character)__instance).m_seman.GetStatusEffect(StringExtensionMethods.GetStableHashCode("se_alcohol")); bool flag = false; bool flag2 = false; bool flag3 = false; bool flag4 = false; bool flag5 = false; bool flag6 = false; foreach (Food food in Player.m_localPlayer.m_foods) { if (food.m_name == "MushroomBlue") { flag = true; } if (food.m_name == "MushroomBlack") { flag2 = true; blacktimer += Time.deltaTime; if (blacktimer > 0.5f) { HitData val = new HitData(); val.m_point = ((Character)__instance).GetCenterPoint(); val.m_damage.m_spirit = 1f; ((Character)__instance).ApplyDamage(val, true, false, (DamageModifier)0); blacktimer = 0f; } } if (food.m_name == "MushroomBlood") { flag3 = true; } if (food.m_name == "MushroomRainbow") { flag4 = true; } if (food.m_name == "MushroomPurple") { flag5 = true; } if (food.m_name == "MushroomGreen") { flag6 = true; } } if (flag6 || (((Humanoid)Player.m_localPlayer).m_utilityItem != null && ((Humanoid)Player.m_localPlayer).m_utilityItem.m_shared.m_name.Contains("wishbone"))) { ((Character)Player.m_localPlayer).m_seman.AddStatusEffect(StringExtensionMethods.GetStableHashCode("Wishbone"), false, 0, 0f); } else { ((Character)Player.m_localPlayer).m_seman.RemoveStatusEffect(StringExtensionMethods.GetStableHashCode("Wishbone"), false); } if (flag5 && Time.frameCount % 200 == 0) { int num = Random.Range(1, 200); GameObject val2 = null; switch (num) { case 100: val2 = PrefabManager.Instance.GetPrefab("sfx_ghost_alert"); break; case 99: val2 = PrefabManager.Instance.GetPrefab("sfx_haldor_laugh"); break; case 98: val2 = PrefabManager.Instance.GetPrefab("sfx_land_water"); break; case 97: val2 = PrefabManager.Instance.GetPrefab("sfx_offering"); break; case 96: val2 = PrefabManager.Instance.GetPrefab("sfx_secretfound"); break; case 95: val2 = PrefabManager.Instance.GetPrefab("sfx_tree_fall"); break; case 94: val2 = PrefabManager.Instance.GetPrefab("sfx_wraith_idle"); break; case 93: val2 = PrefabManager.Instance.GetPrefab("sfx_coins_pile_destroyed"); break; case 92: val2 = PrefabManager.Instance.GetPrefab("sfx_eikthyr_idle"); break; case 91: val2 = PrefabManager.Instance.GetPrefab("sfx_gui_craftitem_cauldron"); break; case 90: val2 = PrefabManager.Instance.GetPrefab("sfx_lootspawn"); break; case 89: ((Humanoid)Player.m_localPlayer).UnequipAllItems(); break; } if (Object.op_Implicit((Object)(object)val2)) { ZLog.LogError((object)("purple sound " + ((Object)val2).name)); Object.Instantiate<GameObject>(val2, ((Component)Player.m_localPlayer).transform.position + ((Component)Player.m_localPlayer).transform.forward * 2f + Vector3.up, Quaternion.identity); } } PostProcessingBehaviour component = ((Component)GameCamera.instance).gameObject.GetComponent<PostProcessingBehaviour>(); if (!((Object)(object)component != (Object)null)) { return; } if (flag4) { ((PostProcessingModel)((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model).enabled = true; ((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.intensity = Mathf.Min(2f, ((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.intensity + 0.01f); rainbowtimer += Time.deltaTime; if (rainbowtimer > rainbowchangeevery) { rainbowcurrent = (rainbowcurrent + 1) % rainbowcolors.Length; rainbownext = (rainbowcurrent + 1) % rainbowcolors.Length; rainbowtimer = 0f; } ((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.color = Color.Lerp(rainbowcolors[rainbowcurrent], rainbowcolors[rainbownext], rainbowtimer / rainbowchangeevery); } else if (flag3) { ((PostProcessingModel)((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model).enabled = true; ((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.color = new Color(5f, 0f, 0f, 1f); ((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.intensity = Mathf.Min(1f, ((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.intensity + 0.01f); } else if (flag2) { ((PostProcessingModel)((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model).enabled = true; ((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.color = new Color(0f, 0f, 0f, 1f); ((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.intensity = Mathf.Min(0.8f, ((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.intensity + 0.01f); } else if (flag) { ((PostProcessingModel)((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model).enabled = true; ((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.color = new Color(0f, 0f, 2f, 1f); ((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.intensity = Mathf.Min(0.2f, ((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.intensity + 0.01f); } else if (((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.intensity > 0.05f) { ((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.intensity = Mathf.Max(0.05f, ((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.intensity - 0.001f); } else { ((PostProcessingModel)((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model).enabled = false; } if (flag || flag2 || flag3 || flag4 || flag5) { ((PostProcessingComponent<ChromaticAberrationModel>)(object)component.m_ChromaticAberration).model.m_Settings.intensity = Mathf.Min(20f, ((PostProcessingComponent<ChromaticAberrationModel>)(object)component.m_ChromaticAberration).model.m_Settings.intensity + 0.5f); } else if ((Object)(object)statusEffect != (Object)null) { ((PostProcessingComponent<ChromaticAberrationModel>)(object)component.m_ChromaticAberration).model.m_Settings.intensity += 0.003f; } else if (((PostProcessingComponent<ChromaticAberrationModel>)(object)component.m_ChromaticAberration).model.m_Settings.intensity > 0.14f) { ((PostProcessingComponent<ChromaticAberrationModel>)(object)component.m_ChromaticAberration).model.m_Settings.intensity = Mathf.Max(0.14f, ((PostProcessingComponent<ChromaticAberrationModel>)(object)component.m_ChromaticAberration).model.m_Settings.intensity - 0.01f); } if (flag || flag4) { if (((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.m_Settings.basic.saturation != 2f) { ((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.m_Settings.basic.saturation = Mathf.Min(2f, ((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.m_Settings.basic.saturation + 0.05f); ((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.isDirty = true; } } else if (flag2 || flag6) { if (((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.m_Settings.basic.saturation != 0.2f) { ((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.m_Settings.basic.saturation = 0.2f; ((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.isDirty = true; } } else if (((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.m_Settings.basic.saturation != 1f) { if (((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.m_Settings.basic.saturation < 1f) { ((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.m_Settings.basic.saturation = Mathf.Min(1f, ((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.m_Settings.basic.saturation + 0.01f); } else { ((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.m_Settings.basic.saturation = Mathf.Max(1f, ((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.m_Settings.basic.saturation - 0.01f); } ((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.isDirty = true; } } } [HarmonyPatch(typeof(Pickable), "Awake")] private class pickableposty { private static void Postfix(ref Pickable __instance) { ((MonoBehaviour)__instance).StartCoroutine(CheckPinkMushroom(__instance)); } } [HarmonyPatch(typeof(Pickable), "SetPicked")] private class pickablepostpick { private static void Postfix(bool picked, ref Pickable __instance) { if (!picked) { return; } GameObject gameObject = ((Component)((Component)__instance).transform).gameObject; if ((Object)(object)gameObject != (Object)null) { Transform val = gameObject.transform.Find("pinkfloaters"); if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)((Component)val).gameObject)) { Object.Destroy((Object)(object)((Component)val).gameObject); } } } } private static Color[] rainbowcolors = (Color[])(object)new Color[8] { new Color(5f, 0f, 0f, 1f), new Color(5f, 2f, 0f, 1f), new Color(5f, 5f, 0f, 1f), new Color(0f, 5f, 0f, 1f), new Color(0f, 3f, 2f, 1f), new Color(0f, 0f, 5f, 1f), new Color(3f, 0f, 5f, 1f), new Color(4f, 0f, 2f, 1f) }; private static int rainbowcurrent = 0; private static int rainbownext = 1; private static float rainbowtimer = 0f; private static float rainbowchangeevery = 0.5f; private static float blacktimer = 0f; public static IEnumerator CheckPinkMushroom(Pickable __instance) { while (true) { if (__instance.m_nview.IsValid() && (Object)(object)Player.m_localPlayer != (Object)null && ((Character)Player.m_localPlayer).m_nview.IsValid()) { bool pinkshroom = false; foreach (Food food in Player.m_localPlayer.m_foods) { if (food.m_name == "MushroomPink") { pinkshroom = true; } } if (!__instance.m_picked && pinkshroom) { GameObject parento2 = ((Component)((Component)__instance).transform).gameObject; if ((Object)(object)parento2 != (Object)null) { bool found = false; Transform floaterstransform2 = parento2.transform.Find("pinkfloaters"); if (Object.op_Implicit((Object)(object)floaterstransform2) && Object.op_Implicit((Object)(object)((Component)floaterstransform2).gameObject)) { found = true; } if (!found) { GameObject pinkprefab = PrefabManager.Instance.GetPrefab("MushroomPink"); if (Object.op_Implicit((Object)(object)pinkprefab)) { Transform pinkfloaterstransform = pinkprefab.transform.Find("attach/floaters"); if (Object.op_Implicit((Object)(object)pinkfloaterstransform) && Object.op_Implicit((Object)(object)((Component)pinkfloaterstransform).gameObject)) { GameObject pinkfloaters = Object.Instantiate<GameObject>(((Component)pinkfloaterstransform).gameObject, parento2.transform); ((Object)pinkfloaters).name = "pinkfloaters"; pinkfloaters.transform.localScale = new Vector3(2f, 2f, 2f); } else { Logger.LogError((object)"failed to find MushroomPink floaters"); } } else { Logger.LogError((object)"failed to find MushroomPink"); } } } } else { GameObject parento = ((Component)((Component)__instance).transform).gameObject; if ((Object)(object)parento != (Object)null) { Transform floaterstransform = parento.transform.Find("pinkfloaters"); if (Object.op_Implicit((Object)(object)floaterstransform) && Object.op_Implicit((Object)(object)((Component)floaterstransform).gameObject)) { Object.Destroy((Object)(object)((Component)floaterstransform).gameObject); } } } } yield return (object)new WaitForSeconds(Random.Range(10f, 20f)); } } } }
files/plugins/vrp.dll
Decompiled 2 weeks ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; using BepInEx; using BepInEx.Bootstrap; using HarmonyLib; using Jotunn; using Jotunn.Configs; using Jotunn.Entities; using Jotunn.Managers; using Jotunn.Utils; using SimpleJson; using TMPro; using UnityEngine; using UnityEngine.Networking; using UnityEngine.PostProcessing; using UnityEngine.UI; using vrp.Patches; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("vrp")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("1010101110")] [assembly: AssemblyProduct("vrp")] [assembly: AssemblyCopyright("Copyright © 2021")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("3B95EEF7-4A97-4393-91A0-3626434F3631")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace vrp { [Serializable] public class DbLog { public string p { get; set; } public string i { get; set; } public string a { get; set; } public string c { get; set; } public string r { get; set; } } [Serializable] public class DbPlayer { public string player { get; set; } } [Serializable] public class DbWhitelist { public int pid { get; set; } public int cid { get; set; } public string steamid { get; set; } public string charactername { get; set; } public bool isnew { get; set; } public bool banned { get; set; } public bool permadeath { get; set; } } [Serializable] public class DbWhitelistNew { public int pid { get; set; } public int cid { get; set; } public string steamid { get; set; } public string charName { get; set; } } [Serializable] public class DbGroup { public int id { get; set; } public string charName { get; set; } public string groupName { get; set; } public bool deleted { get; set; } } [Serializable] public class DbRecipe { public int id { get; set; } public string recipeName { get; set; } public string groups { get; set; } public bool enabled { get; set; } public bool deleted { get; set; } } internal class Api { public static IEnumerator LogInsert(string json) { UnityWebRequest request = new UnityWebRequest("http://localhost:3333/db/log/insert", "POST"); try { byte[] bodyRaw = Encoding.UTF8.GetBytes(json); request.uploadHandler = (UploadHandler)new UploadHandlerRaw(bodyRaw); request.downloadHandler = (DownloadHandler)new DownloadHandlerBuffer(); request.SetRequestHeader("Content-Type", "application/json"); yield return request.SendWebRequest(); } finally { ((IDisposable)request)?.Dispose(); } } public static IEnumerator WhitelistAuth(string steamid, string charName, int pid, int cid) { string json = SimpleJson.SerializeObject((object)new DbWhitelistNew { steamid = steamid, charName = charName, cid = cid, pid = pid }); UnityWebRequest request = new UnityWebRequest("http://localhost:3333/db/whitelist/new", "POST"); try { byte[] bodyRaw = Encoding.UTF8.GetBytes(json); request.uploadHandler = (UploadHandler)new UploadHandlerRaw(bodyRaw); request.downloadHandler = (DownloadHandler)new DownloadHandlerBuffer(); request.SetRequestHeader("Content-Type", "application/json"); yield return request.SendWebRequest(); ZLog.Log((object)("api whitelist sent " + charName + " " + steamid)); } finally { ((IDisposable)request)?.Dispose(); } } public static IEnumerator WhitelistPermadeath(DbWhitelist deadplayer) { deadplayer.permadeath = true; string json = SimpleJson.SerializeObject((object)deadplayer); UnityWebRequest request = new UnityWebRequest("http://localhost:3333/db/whitelist/dead", "POST"); try { byte[] bodyRaw = Encoding.UTF8.GetBytes(json); request.uploadHandler = (UploadHandler)new UploadHandlerRaw(bodyRaw); request.downloadHandler = (DownloadHandler)new DownloadHandlerBuffer(); request.SetRequestHeader("Content-Type", "application/json"); yield return request.SendWebRequest(); ZLog.Log((object)("api permadeath sent " + deadplayer.charactername + " " + deadplayer.steamid)); } finally { ((IDisposable)request)?.Dispose(); } } public static IEnumerator ServerGetWhitelist() { UnityWebRequest request = UnityWebRequest.Get("http://localhost:3333/db/whitelist/"); yield return request.SendWebRequest(); if ((int)request.result == 1) { string raw = Encoding.UTF8.GetString(request.downloadHandler.data); DbWhitelist[] obj = SimpleJson.DeserializeObject<DbWhitelist[]>(raw); if (obj != null) { ServerPatches.whitelist.Clear(); DbWhitelist[] array = obj; foreach (DbWhitelist x in array) { ServerPatches.whitelist.Add(x); } } else { ZLog.LogError((object)"error whitelist json"); } } else { ZLog.LogError((object)"error in whitelist request"); } } public static IEnumerator ServerGetGroups() { UnityWebRequest request = UnityWebRequest.Get("http://localhost:3333/db/groups/"); yield return request.SendWebRequest(); if ((int)request.result == 1) { string raw = Encoding.UTF8.GetString(request.downloadHandler.data); DbGroup[] obj = SimpleJson.DeserializeObject<DbGroup[]>(raw); if (obj != null) { ServerPatches.groups.Clear(); DbGroup[] array = obj; foreach (DbGroup x in array) { if (!x.deleted) { ServerPatches.groups.Add(x); } } } else { ZLog.LogError((object)"error groups json"); } } else { ZLog.LogError((object)"error in groups request"); } } public static IEnumerator ServerGetRecipes() { UnityWebRequest request = UnityWebRequest.Get("http://localhost:3333/db/recipes"); yield return request.SendWebRequest(); if ((int)request.result == 1) { string raw = Encoding.UTF8.GetString(request.downloadHandler.data); ServerPatches.recipesraw = raw; } else { ZLog.LogError((object)"error in recipes request"); } } } [BepInPlugin("1010101110.vrp", "vrp", "11.9.1")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Mod : BaseUnityPlugin { public static readonly Harmony harmony = new Harmony(typeof(Mod).GetCustomAttributes(typeof(BepInPlugin), inherit: false).Cast<BepInPlugin>().First() .GUID); private void Awake() { harmony.PatchAll(); JotunnPatches.AddVariants(); } private void OnDestroy() { harmony.UnpatchSelf(); } } } namespace vrp.Patches { public class ClientPatches { [HarmonyPatch(typeof(GameVersion), "ToString")] private class fixver { private static void Postfix(GameVersion __instance, ref string __result) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) if (__instance == Version.CurrentVersion) { __result += "-vrp11.9.1"; } } } [HarmonyPatch(typeof(FejdStartup), "ShowCharacterSelection")] public static class checkforbadmods2 { } [HarmonyPatch(typeof(ZNet), "RPC_ClientHandshake")] public static class checkforbadmods { private static void Postfix() { //IL_05a1: Unknown result type (might be due to invalid IL or missing references) Dictionary<string, bool> dictionary = new Dictionary<string, bool>(); Dictionary<string, bool> dictionary2 = new Dictionary<string, bool>(); int num = 0; bool flag = false; if (ZNet.instance.IsServer()) { return; } ZLog.LogWarning((object)"VRP CLIENT 11.9.1"); if ((Object)(object)Game.instance != (Object)null && Game.instance.m_playerProfile != null && isAdmin()) { ZLog.LogError((object)"VRP ADMIN"); dictionary2.Add("SKTOOLBOX", value: false); dictionary2.Add("EASYSPAWNER", value: false); dictionary2.Add("TERRAINRESET", value: false); dictionary2.Add("MAPTELEPORT", value: false); dictionary2.Add("PLANBUILD", value: false); dictionary2.Add("UNITYEXPLORER", value: false); dictionary2.Add("INFINITY", value: false); dictionary2.Add("VNEI", value: false); dictionary2.Add("DEVCOMMANDS", value: false); dictionary2.Add("XRAY", value: false); dictionary2.Add("ESP", value: false); dictionary2.Add("WORLD_EDIT_COMMANDS", value: false); dictionary2.Add("UPGRADE_WORLD", value: false); dictionary2.Add("ZONESCOUTER", value: false); } dictionary.Add("COM.JOTUNN.JOTUNN", value: false); dictionary.Add("1010101110.GOLDBEES", value: false); dictionary.Add("1010101110.ME", value: false); dictionary.Add("1010101110.MODELCHANGER", value: false); dictionary.Add("1010101110.ROLL", value: false); dictionary.Add("1010101110.SHROOMS", value: false); dictionary.Add("1010101110.VRP", value: false); dictionary.Add("1010101110.VRPSTABLE", value: false); dictionary.Add("AZUMATT.AZUANTIARTHRITICCRAFTING", value: false); dictionary.Add("BLACKS7AR.BOATADDITIONS", value: false); dictionary.Add("BLACKS7AR.COREWOODPIECES", value: false); dictionary.Add("BLACKS7AR.FINEWOODFURNITURES", value: false); dictionary.Add("BLACKS7AR.OREMINES", value: false); dictionary.Add("BLACKS7AR.TAMEABLENECK", value: false); dictionary.Add("BRUCE.VALHEIM.COMFY.DUMPSTERFIRE", value: false); dictionary.Add("BRUCE.VALHEIM.COMFYMODS.GIZMO", value: false); dictionary.Add("COM.BRUCE.VALHEIM.COMFYQUICKSLOTS", value: false); dictionary.Add("COM.ORIANAVENTURE.MOD.INCOGNITOMODE", value: false); dictionary.Add("CW_JESSE.BETTERNETWORKING", value: false); dictionary.Add("MIDNIGHTSFX.VALHEIMARMORY", value: false); dictionary.Add("NEOBOTICS.VALHEIM_MOD.HUDCOMPASS", value: false); dictionary.Add("ORG.BEPINEX.PLUGINS.CREATURELEVELCONTROL", value: false); dictionary.Add("ORG.BEPINEX.PLUGINS.SERVERCHARACTERS", value: false); dictionary.Add("ORG.JROBSONCHASE.VALHEIM.PLUGINS.POSITIONALAUDIO", value: false); dictionary.Add("ORYXEN.VALHEIM.UI.DISPLAYDAYTIME", value: false); dictionary.Add("RAELAZIEL.ODINHORSE", value: false); dictionary.Add("SHUDNAL.MOREGATESEXTENDED", value: false); dictionary.Add("SHUDNAL.SEASONS", value: false); dictionary.Add("SOUTHSIL.SOUTHSILARMOR", value: false); dictionary.Add("VIRTUACODE.VALHEIM.EMOTEWHEEL", value: false); dictionary.Add("WACKYMOLE.WACKYSDATABASE", value: false); dictionary.Add("SPAWN", value: false); dictionary.Add("DROP", value: false); num += dictionary.Count; num++; num++; foreach (KeyValuePair<string, PluginInfo> pluginInfo in Chainloader.PluginInfos) { string text = pluginInfo.Key.ToString().ToUpperInvariant(); foreach (string item in dictionary.Keys.ToList()) { if (Contains(text, item, StringComparison.InvariantCultureIgnoreCase)) { ZLog.Log((object)("VRP CLIENT - found required plugin " + item + " " + text)); dictionary[item] = true; } } } foreach (KeyValuePair<string, bool> item2 in dictionary) { if (!item2.Value) { ZLog.LogError((object)("VRP CLIENT - did not find required plugin " + item2.Key)); flag = true; } } dictionary2.Add("QUICK_STACK", value: false); dictionary2.Add("VALHEIM.DISPLAYINFO", value: false); dictionary2.Add("ONTRIGGER.VPO", value: false); dictionary2.Add("BETTERDISCORDPRESENCE", value: false); dictionary2.Add("CUSTOMLOADINGSCREENS", value: false); foreach (KeyValuePair<string, PluginInfo> pluginInfo2 in Chainloader.PluginInfos) { string source = pluginInfo2.Key.ToString().ToUpperInvariant(); foreach (string item3 in dictionary2.Keys.ToList()) { if (Contains(source, item3, StringComparison.InvariantCultureIgnoreCase)) { ZLog.Log((object)("VRP CLIENT - found optional plugin " + item3)); dictionary2[item3] = true; num++; } } } if (Chainloader.PluginInfos.Count > num) { ZLog.LogError((object)("VRP CLIENT - #plugins req" + num + " found" + Chainloader.PluginInfos.Count)); flag = true; } if (!flag) { return; } ZLog.LogError((object)"VRP ERROR"); foreach (KeyValuePair<string, PluginInfo> pluginInfo3 in Chainloader.PluginInfos) { ZLog.Log((object)pluginInfo3.Key.ToString().ToUpper()); } ZNet.m_connectionStatus = (ConnectionStatus)12; } } [HarmonyPatch(typeof(EnemyHud), "TestShow")] public static class hudfix { private static bool Prefix(ref Character c, ref EnemyHud __instance, ref bool __result) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) __result = false; float num = Vector3.SqrMagnitude(((Component)c).transform.position - __instance.m_refPoint); if (c.IsBoss() && num < __instance.m_maxShowDistanceBoss * __instance.m_maxShowDistanceBoss) { __result = ((Component)c).GetComponent<BaseAI>().IsAlerted(); } else if (c.IsPlayer() && !isAdmin()) { float num2 = 2f; __result = !c.IsCrouching() && num < num2 * num2; __result = false; } else if (num < 100f) { __result = true; } return false; } } [HarmonyPatch(typeof(WearNTear), "RPC_Damage")] public static class DamageWard { private static bool Prefix(long sender, HitData hit, WearNTear __instance) { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown //IL_00c5: Unknown result type (might be due to invalid IL or missing references) bool result = true; if (hit != null && (Object)(object)hit.GetAttacker() != (Object)null && hit.GetAttacker().IsPlayer() && (Object)(object)((Component)__instance).gameObject != (Object)null) { Player val = (Player)hit.GetAttacker(); if (((Object)((Component)__instance).gameObject).name.Contains("chest") || ((Object)((Component)__instance).gameObject).name.Contains("guard_stone") || ((Object)((Component)__instance).gameObject).name.Contains("vrp_ward")) { foreach (PrivateArea allArea in PrivateArea.m_allAreas) { if (allArea.IsEnabled() && allArea.IsInside(hit.m_point, 1f)) { string raw = ((Object)((Component)__instance).gameObject).name + " damaged | " + allArea.m_piece.m_creator + " creator | " + val.GetPlayerID() + " damage by"; SendModerationLog(((Character)val).GetHoverName(), ((Object)((Component)__instance).gameObject).name, "damaged", allArea.m_piece.m_creator.ToString(), raw); if (isAdmin()) { result = true; } else if (allArea.m_piece.m_creator != val.GetPlayerID() && !allArea.IsPermitted(val.GetPlayerID())) { allArea.FlashShield(false); result = false; } } } } } return result; } } [HarmonyPatch(typeof(PrivateArea), "Awake")] private class wardrange { private static bool Prefix(ref PrivateArea __instance) { if (Object.op_Implicit((Object)(object)__instance)) { Piece component = ((Component)__instance).gameObject.GetComponent<Piece>(); if ((Object)(object)component != (Object)null) { } if (component.m_name == "WardAdmin") { __instance.m_radius = 100f; } if (component.m_name == "Gloam Ward") { __instance.m_radius = 40f; } else { __instance.m_radius = 25f; } } return true; } private static void Postfix(ref PrivateArea __instance) { //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: 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) if (!Object.op_Implicit((Object)(object)__instance)) { return; } if ((Object)(object)__instance.m_areaMarker != (Object)null) { __instance.m_areaMarker.m_radius = __instance.m_radius; } if (__instance.m_flashEffect != null && __instance.m_flashEffect.m_effectPrefabs != null && __instance.m_flashEffect.m_effectPrefabs.Length != 0) { ParticleSystem componentInChildren = ((Component)__instance.m_flashEffect.m_effectPrefabs[0].m_prefab.transform).GetComponentInChildren<ParticleSystem>(); if ((Object)(object)componentInChildren != (Object)null) { MainModule main = componentInChildren.main; ((MainModule)(ref main)).startSize = MinMaxCurve.op_Implicit(__instance.m_radius * 2f); } } } } [HarmonyPatch(typeof(PrivateArea), "GetHoverText")] private class wardText { private static void Postfix(ref string __result, ref PrivateArea __instance) { if (!((Object)(object)Player.m_localPlayer != (Object)null) || string.IsNullOrWhiteSpace(__result)) { return; } string value = ((Character)Player.m_localPlayer).GetHoverName().ToUpperInvariant(); string text = __result.ToUpperInvariant(); if (!isAdmin() && !text.Contains(value)) { if (__instance.IsEnabled()) { __result = "unauthorized - active"; } else { __result = "unauthorized - deactivated" + Environment.NewLine + "press e to add yourself to this ward"; } return; } long @long = __instance.m_nview.GetZDO().GetLong("decaytimer", 123L); if (@long != 123) { DateTime dateTime = new DateTime(@long).AddDays(10.0).ToLocalTime(); __result = __result + "\n[<color=purple><b>" + dateTime.ToShortDateString() + " " + dateTime.ToShortTimeString() + "</b></color>] until decay" + Environment.NewLine; } Piece component = ((Component)__instance).gameObject.GetComponent<Piece>(); if ((Object)(object)component != (Object)null) { if (component.m_name == "Gloam Ward") { __result += "use 5 gloam to recharge this ward!"; } if (component.m_name == "Floam Ward") { __result += "use 5 floam to recharge this ward!"; } } } } [HarmonyPatch(typeof(PrivateArea), "UseItem")] private class wardupdate { private static void Postfix(Humanoid user, ItemData item, ref PrivateArea __instance, ref bool __result) { Piece component = ((Component)__instance).gameObject.GetComponent<Piece>(); if (!((Object)(object)component != (Object)null)) { return; } if (component.m_name == "Gloam Ward" && item.m_shared.m_name == "Gloam") { if (__instance.m_nview.IsValid()) { Inventory inventory = user.GetInventory(); int num = inventory.CountItems(item.m_shared.m_name, -1, true); if (num >= 5) { ((Character)user).Message((MessageType)2, "the ward is recharged", 0, (Sprite)null); inventory.RemoveItem(item, 5); __instance.m_nview.GetZDO().Set("decaytimer", DateTime.Now.Ticks); } } __result = true; } if (!(component.m_name == "Floam Ward") || !(item.m_shared.m_name == "Floam")) { return; } if (__instance.m_nview.IsValid()) { Inventory inventory2 = user.GetInventory(); int num2 = inventory2.CountItems(item.m_shared.m_name, -1, true); if (num2 >= 5) { ((Character)user).Message((MessageType)2, "the ward is recharged", 0, (Sprite)null); inventory2.RemoveItem(item, 5); __instance.m_nview.GetZDO().Set("decaytimer", DateTime.Now.Ticks); } } __result = true; } } [HarmonyPatch(typeof(PrivateArea), "Interact")] public static class wardinteract { private static bool Prefix(ref Humanoid human, ref bool hold, PrivateArea __instance) { if ((isAdmin() || __instance.IsPermitted(Player.m_localPlayer.GetPlayerID())) && !hold) { __instance.m_nview.InvokeRPC("ToggleEnabled", new object[1] { __instance.m_piece.m_creator }); return false; } return true; } } [HarmonyPatch(typeof(PrivateArea), "CheckAccess")] public static class wardaccess { private static void Postfix(Vector3 point, float radius, bool flash, ref bool __result) { if (isAdmin()) { __result = true; } } } [HarmonyPatch(typeof(PrivateArea), "UpdateStatus")] public static class wardstatus { private static void Postfix(ref PrivateArea __instance) { if (__instance.m_nview.IsValid() && __instance.m_nview.IsOwner()) { long num = __instance.m_nview.GetZDO().GetLong("decaytimer", 123L); if (num == 123) { SendModerationLog("", "", "new ward", __instance.GetCreatorName(), ""); num = DateTime.Now.Ticks; __instance.m_nview.GetZDO().Set("decaytimer", num); } DateTime dateTime = new DateTime(num); if (DateTime.Now > dateTime.AddDays(10.0) && __instance.IsEnabled()) { SendModerationLog("", "", "ward timer deactivate!", __instance.GetCreatorName(), dateTime.ToLongDateString() + " " + DateTime.Now.ToLongTimeString()); __instance.SetEnabled(false); } } } } [HarmonyPatch(typeof(Container), "CheckAccess")] public static class ContainerAccessPatch { private static void Postfix(long playerID, ref bool __result) { Player player = Player.GetPlayer(playerID); if (isAdmin(player.GetPlayerName())) { __result = true; } } } [HarmonyPatch(typeof(ItemStand), "Interact")] private class standFix { private static bool Prefix(Humanoid user, bool hold, ItemStand __instance) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) return PrivateArea.CheckAccess(((Component)__instance).transform.position, 0f, true, false); } } [HarmonyPatch(typeof(ConsoleCommand), "RunAction")] public static class cheatlogg { private static void Postfix(ConsoleEventArgs args, ConsoleCommand __instance) { try { if (__instance.Command != "say" && __instance.Command != "s") { SendModerationLog(Player.m_localPlayer.GetPlayerName(), __instance.Command, "CHEAT COMMAND", "", ""); } } catch (Exception) { } } } [HarmonyPatch(typeof(EnvMan), "CanSleep")] public static class cansleepyes { private static void Postfix(EnvMan __instance, bool __result) { __result = true; } } [HarmonyPatch(typeof(Humanoid), "EquipItem")] public static class PlayerEquip { private static void Postfix(ItemData item, bool triggerEquipEffects, ref Humanoid __instance) { playerEqp(ref item, ref __instance); } } [HarmonyPatch(typeof(Humanoid), "UnequipItem")] public static class PlayerUnEquip { private static void Postfix(ItemData item, bool triggerEquipEffects, ref Humanoid __instance) { playerEqp(ref item, ref __instance); } } [HarmonyPatch(typeof(Player), "ConsumeItem")] public static class ConsumeLog { private static void Postfix(Inventory inventory, ItemData item, ref bool __result, ref Player __instance) { if (!__result || !((Object)(object)__instance != (Object)null) || item == null || item.m_shared == null || !((Character)__instance).m_nview.IsValid()) { return; } if (((Character)__instance).IsOwner()) { if (item.m_shared.m_name == "Bandage") { StatusEffect statusEffect = ((Character)__instance).m_seman.GetStatusEffect(StringExtensionMethods.GetStableHashCode("Wounded")); if ((Object)(object)statusEffect != (Object)null) { float num = statusEffect.GetRemaningTime() * 0.5f; statusEffect.m_time += num; Player obj = __instance; obj.m_timeSinceDeath += num; } } if (item.m_shared.m_name == "BandageShiny") { StatusEffect statusEffect2 = ((Character)__instance).m_seman.GetStatusEffect(StringExtensionMethods.GetStableHashCode("Wounded")); if ((Object)(object)statusEffect2 != (Object)null) { float num2 = statusEffect2.GetRemaningTime() * 0.75f; statusEffect2.m_time += num2; Player obj2 = __instance; obj2.m_timeSinceDeath += num2; } } } string creator = ((item.m_crafterID == 0L) ? " | uncrafted | " : (" | crafted by | " + item.m_crafterName + " ")); SendModerationLog(__instance.GetPlayerName(), item.m_shared.m_name, "consume", creator, ""); } } [HarmonyPatch(typeof(Sign), "SetText")] public static class SignText { private static void Postfix(string text, Sign __instance) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_002b: 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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) string text2 = ((Component)__instance).transform.position.x + " "; text2 = text2 + ((Component)__instance).transform.position.z + " "; text2 += ((Component)__instance).transform.position.y; SendModerationLog(Player.m_localPlayer.GetPlayerName(), text, "sign_text", "", text2); } } [HarmonyPatch(typeof(TeleportWorld), "SetText")] public static class TeleportText { private static void Postfix(string text, TeleportWorld __instance) { SendModerationLog(Player.m_localPlayer.GetPlayerName(), text, "teleport_text", "", ""); } } [HarmonyPatch(typeof(Chat), "InputText")] public static class ChatText { private static void Postfix(ref Chat __instance) { if (!((Object)(object)Chat.instance != (Object)null) || !((Object)(object)((Terminal)Chat.instance).m_input != (Object)null) || string.IsNullOrWhiteSpace(((TMP_InputField)((Terminal)Chat.instance).m_input).text)) { return; } SendModerationLog(Player.m_localPlayer.GetPlayerName(), ((TMP_InputField)((Terminal)Chat.instance).m_input).text, "chat_text", "", ""); try { if (((TMP_InputField)((Terminal)__instance).m_input).text.StartsWith("/bc ")) { string message = ((TMP_InputField)((Terminal)__instance).m_input).text.Substring(4); SendBroadcast(message); } if (((TMP_InputField)((Terminal)__instance).m_input).text.StartsWith("/sleepers") && Object.op_Implicit((Object)(object)Player.m_localPlayer)) { int hash = ZSyncAnimation.GetHash("attach_bed"); bool @bool = ((Character)Player.m_localPlayer).m_zanim.m_animator.GetBool(hash); ((Character)Player.m_localPlayer).m_zanim.SetBool("attach_bed", !@bool); } if (!(((TMP_InputField)((Terminal)__instance).m_input).text == "/raft")) { } } catch (Exception) { ZLog.LogError((object)"failed text processing"); } } } [HarmonyPatch(typeof(Player), "SetIntro")] public static class SpawnLog { private static void Postfix(bool intro, Player __instance) { if (!ZNet.instance.IsServer() && (Object)(object)__instance != (Object)null && ((Character)__instance).m_nview.IsValid() && ZRoutedRpc.instance != null) { ZLog.LogWarning((object)("FRESH " + __instance.GetPlayerName())); SendModerationLog(__instance.GetPlayerName(), "", "Fresh", "", ""); } } } [HarmonyPatch(typeof(ZSteamMatchmaking))] [HarmonyPatch("GetServers")] private class PatchUpdateServerListGui { private static void Postfix(ref List<ServerStatus> allServers) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown ServerJoinDataDedicated val = new ServerJoinDataDedicated("159.223.189.211"); ((ServerJoinData)val).m_serverName = "VRP Miniseason 3"; ServerStatus val2 = new ServerStatus((ServerJoinData)(object)val); val2.m_playerCount = 69u; allServers.Add(val2); } } [HarmonyPatch(typeof(Chat), "Awake")] private class textinputfix { private static void Postfix(ref Chat __instance) { __instance.m_worldTextTTL = 20f; ((TMP_InputField)((Terminal)__instance).m_input).characterLimit = 300; __instance.m_hideDelay = 10f; Graphic[] componentsInChildren = ((Component)((Terminal)__instance).m_chatWindow).GetComponentsInChildren<Graphic>(); Graphic[] array = componentsInChildren; foreach (Graphic val in array) { val.raycastTarget = false; } } } [HarmonyPatch(typeof(Talker), "Awake")] private class talkerrange { private static void Postfix(ref Talker __instance) { __instance.m_normalDistance = 25f; __instance.m_shoutDistance = 150f; } } [HarmonyPatch(typeof(Chat), "SendText")] private class notglobalshouts { private static bool Prefix(ref Type type, ref string text) { if (Object.op_Implicit((Object)(object)Player.m_localPlayer)) { ((Component)Player.m_localPlayer).GetComponent<Talker>().Say(type, text); } return false; } } [HarmonyPatch(typeof(Chat), "GetShoutWorldTexts")] private class nominimapshouts { private static void Postfix(ref List<WorldTextInstance> texts) { texts.Clear(); } } [HarmonyPatch(typeof(Chat), "UpdateWorldTextField")] private static class nopings { private static void Postfix(ref WorldTextInstance wt) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Invalid comparison between Unknown and I4 if ((int)wt.m_type == 3) { ((TMP_Text)wt.m_textMeshField).text = ""; wt.m_text = ""; } } } [HarmonyPatch(typeof(Player), "FixedUpdate")] private class playerposty { private static void Postfix(ref Player __instance) { //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) if (!((Character)__instance).m_nview.IsValid() || !((Character)__instance).m_nview.IsOwner() || __instance.GetPlayerID() != Player.m_localPlayer.GetPlayerID()) { return; } if ((Object)(object)InventoryGui.instance != (Object)null) { InventoryGui.instance.m_pvp.isOn = true; } if (!((Character)__instance).IsPVPEnabled()) { __instance.SetPVP(true); } StatusEffect statusEffect = ((Character)__instance).m_seman.GetStatusEffect(StringExtensionMethods.GetStableHashCode("Poozy")); if ((Object)(object)statusEffect != (Object)null) { ((Character)__instance).m_swimDepth = 20f; } else { ((Character)__instance).m_swimDepth = 1.5f; } StatusEffect statusEffect2 = ((Character)__instance).m_seman.GetStatusEffect(StringExtensionMethods.GetStableHashCode("Wounded")); PostProcessingBehaviour component = ((Component)GameCamera.instance).gameObject.GetComponent<PostProcessingBehaviour>(); if (!((Object)(object)component != (Object)null)) { return; } if ((Object)(object)statusEffect2 != (Object)null) { ((PostProcessingModel)((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model).enabled = true; ((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.color = new Color(0f, 0f, 0f, 0.8f); ((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.intensity = 0.6f; } else if (((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.intensity > 0.05f) { ((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.intensity = Mathf.Max(0.05f, ((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.intensity - 0.001f); } else { ((PostProcessingModel)((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model).enabled = false; } if (!Object.op_Implicit((Object)(object)statusEffect2) && ((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.m_Settings.basic.saturation != 1f) { if (((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.m_Settings.basic.saturation < 1f) { ((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.m_Settings.basic.saturation = Mathf.Min(1f, ((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.m_Settings.basic.saturation + 0.01f); } else { ((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.m_Settings.basic.saturation = Mathf.Max(1f, ((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.m_Settings.basic.saturation - 0.01f); } ((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.isDirty = true; } } } [HarmonyPatch(typeof(Minimap), "UpdateExplore")] private class fixexplore { private static void Postfix(ref Minimap __instance, float dt, Player player) { //IL_005a: Unknown result type (might be due to invalid IL or missing references) float num = (((Object)(object)player.GetControlledShip() == (Object)null) ? __instance.m_exploreRadius : 180f); Minimap obj = __instance; obj.m_exploreTimer += Time.deltaTime; if (__instance.m_exploreTimer > __instance.m_exploreInterval) { __instance.m_exploreTimer = 0f; __instance.Explore(((Component)player).transform.position, num); } } } [HarmonyPatch(typeof(Fireplace), "Awake")] private class fixfireplace { private static void Postfix(ref Fireplace __instance) { Fireplace obj = __instance; obj.m_secPerFuel *= 5f; } } [HarmonyPatch(typeof(Fireplace), "UpdateFireplace")] private class updatefireplace { private static void Postfix(ref Fireplace __instance) { if (__instance.m_nview.IsValid() && __instance.m_nview.IsOwner() && __instance.m_nview.GetZDO().GetFloat("fuel", 0f) == 0f && !__instance.IsBurning() && (((Object)__instance).name == "fire_pit(Clone)" || ((Object)__instance).name == "rk_campfire(Clone)")) { WearNTear component = ((Component)__instance).gameObject.GetComponent<WearNTear>(); if ((Object)(object)component != (Object)null) { component.Remove(false); } } } } [HarmonyPatch(typeof(Ship), "Awake")] public static class shipfix { private static void Postfix(ref Ship __instance) { __instance.m_minWaterImpactForce = 100f; } } [HarmonyPatch(typeof(WearNTear), "OnPlaced")] private class shipCreated { private static void Postfix(ref WearNTear __instance) { if (Object.op_Implicit((Object)(object)__instance)) { Ship component = ((Component)__instance).gameObject.GetComponent<Ship>(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.m_nview) && component.m_nview.IsValid()) { component.m_nview.GetZDO().Set("creatorName", Game.instance.GetPlayerProfile().GetName()); SendModerationLog("", ((Object)((Component)component).gameObject).name, "ship created", Game.instance.GetPlayerProfile().GetName(), ""); } } } } [HarmonyPatch(typeof(Ship), "OnDestroyed")] private class shipDestroyed { private static void Postfix(ref Ship __instance) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) if (__instance.IsOwner() && Object.op_Implicit((Object)(object)__instance.m_nview) && __instance.m_nview.IsValid()) { List<Player> list = new List<Player>(); Player.GetPlayersInRange(((Component)__instance).transform.position, 30f, list); string text = ((Component)__instance).transform.position.x + " "; text = text + ((Component)__instance).transform.position.z + " "; text += ((Component)__instance).transform.position.y; SendModerationLog(string.Join(",", list.Select((Player p) => p.GetPlayerName())), ((Object)((Component)__instance).gameObject).name, "ship destroyed", __instance.m_nview.GetZDO().GetString("creatorName", ""), text); } } } [HarmonyPatch(typeof(Player), "StartDoodadControl")] private class shipControlled { private static void Postfix(ref ShipControlls shipControl) { Component controlledComponent = shipControl.GetControlledComponent(); Ship val = (Ship)(object)((controlledComponent is Ship) ? controlledComponent : null); if ((Object)(object)val != (Object)null) { SendModerationLog(Game.instance.GetPlayerProfile().GetName(), ((Object)shipControl.GetControlledComponent().gameObject).name, "ship controlled", val.m_nview.GetZDO().GetString("creatorName", ""), ""); } } } [HarmonyPatch(typeof(ShipControlls), "GetHoverText")] private class shipName { private static void Postfix(ref ShipControlls __instance, ref string __result) { Component controlledComponent = __instance.GetControlledComponent(); Ship val = (Ship)(object)((controlledComponent is Ship) ? controlledComponent : null); if ((Object)(object)val != (Object)null) { __result = __result + Environment.NewLine + ((Object)((Component)val).gameObject).name + " " + val.m_nview.GetZDO().GetString("creatorName", ""); } } } [HarmonyPatch(typeof(Ship), "UpdateUpsideDmg")] private class raftdmg { private static void Postfix(float dt, Ship __instance) { //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Invalid comparison between Unknown and I4 //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Expected O, but got Unknown //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) raftdmgcounter += dt; if (!(raftdmgcounter > 2f)) { return; } raftdmgcounter = 0f; if (!__instance.IsOwner() || !Object.op_Implicit((Object)(object)__instance.m_nview) || !__instance.m_nview.IsValid() || !(((Object)((Component)__instance).gameObject).name == "Raft(Clone)")) { return; } Biome val = Heightmap.FindBiome(((Component)__instance).transform.position); if ((int)val == 256) { IDestructible component = ((Component)__instance).GetComponent<IDestructible>(); if (component != null) { HitData val2 = new HitData(); val2.m_damage.m_blunt = 1f; val2.m_point = ((Component)__instance).transform.position; val2.m_dir = Vector3.up; component.Damage(val2); } } } } [HarmonyPatch(typeof(Game), "SpawnPlayer")] private class respawnclass { private static void Postfix() { try { ZRoutedRpc.instance.Register<string, string>("ClientSetClass", (Action<long, string, string>)RPC_SetClass); ZRoutedRpc.instance.Register<bool>("ClientSetWard", (Action<long, bool>)RPC_SetWard); } catch (Exception) { } ZRoutedRpc.instance.InvokeRoutedRPC("ServerGetClass", new object[1] { Player.m_localPlayer.GetPlayerName() }); ZRoutedRpc.instance.InvokeRoutedRPC("ServerGetWard", new object[1] { Player.m_localPlayer.GetPlayerName() }); } } [HarmonyPatch(typeof(Skill), "Raise")] private class skillcap { private static void Postfix(ref Skill __instance, ref bool __result) { float num = 25f; float num2 = 45f; switch (((object)(SkillType)(ref __instance.m_info.m_skill)).ToString().ToLower()) { case "swords": case "knives": case "axes": if (groups.Contains("Slash")) { num += num2; } break; case "bows": case "crossbows": if (groups.Contains("Ranged")) { num += num2; } break; case "polearms": case "spears": if (groups.Contains("Pierce")) { num += num2; } break; case "unarmed": case "clubs": if (groups.Contains("Blunt")) { num += num2; } break; case "woodcutting": case "pickaxes": if (groups.Contains("Laborer")) { num += num2; } break; case "elementalmagic": case "bloodmagic": if (groups.Contains("Magic")) { num += num2; } break; case "jump": case "run": case "swim": case "sneak": case "ride": case "fishing": case "blocking": num = 50f; break; } if (__instance.m_level > num) { __instance.m_level = num; __instance.m_accumulator = 0f; __result = false; } } } [HarmonyPatch(typeof(Player), "GetMaxCarryWeight")] private class laborerweightfix { private static void Postfix(ref float __result) { if (groups.Contains("Laborer")) { __result += 100f; } } } [HarmonyPatch(typeof(EnvMan), "Awake")] private class envmanawakefix { private static void Postfix() { EnvMan.instance.m_dayLengthSec = 3600L; } } [HarmonyPatch(typeof(TextViewer), "ShowText")] private class textviewerfix { private static void Prefix(Style style, string topic, ref string textId, bool autoHide) { if (textId.Contains("lore_intro")) { textId = "Time and space have been ripped apart" + Environment.NewLine; textId += Environment.NewLine; textId += Environment.NewLine; textId = textId + "The veils between worlds." + Environment.NewLine; textId = textId + "The space between Now and Before have been broken." + Environment.NewLine; textId += Environment.NewLine; textId += Environment.NewLine; textId = textId + "There must be a cause" + Environment.NewLine; textId = textId + "There must be a solution" + Environment.NewLine; textId += Environment.NewLine; textId += Environment.NewLine; textId = textId + "If you remain here" + Environment.NewLine; textId = textId + "Whatever and wherever and whenever this here is" + Environment.NewLine; textId = textId + "Everything everywhere else is sure to break" + Environment.NewLine; textId = textId + "To crumble, To die" + Environment.NewLine; textId += Environment.NewLine; textId += Environment.NewLine; textId = textId + "You must return to where you came" + Environment.NewLine; textId = textId + "You must end this place" + Environment.NewLine; textId += Environment.NewLine; textId = textId + "VRP MS3" + Environment.NewLine; } } } [HarmonyPatch(typeof(Container), "Awake")] public static class ApplyContainerSizeChanges { private static void Prefix(ref Container __instance) { applyContainerSizes(__instance); } private static void applyContainerSizes(Container instance) { if (Object.op_Implicit((Object)(object)instance.m_wagon)) { instance.m_width = 6; instance.m_height = 4; return; } Transform parent = ((Component)instance).gameObject.transform.parent; Ship val = ((parent != null) ? ((Component)parent).GetComponent<Ship>() : null); if (Object.op_Implicit((Object)(object)val)) { if (((Object)val).name.StartsWith("VikingShip")) { instance.m_width = 6; instance.m_height = 4; } else if (((Object)val).name.StartsWith("Karve")) { instance.m_width = 4; instance.m_height = 3; } else if (((Object)val).name.StartsWith("Kurve")) { instance.m_width = 1; instance.m_height = 1; } } else if (((Object)instance).name.StartsWith("piece_chest_wood")) { instance.m_width = 5; instance.m_height = 4; } else if (((Object)instance).name.StartsWith("piece_chest_private")) { instance.m_width = 5; instance.m_height = 3; } else if (((Object)instance).name.StartsWith("piece_chest_blackmetal")) { instance.m_width = 7; instance.m_height = 6; } else if (((Object)instance).name.StartsWith("piece_chest")) { instance.m_width = 7; instance.m_height = 4; } } } [HarmonyPatch(typeof(ConsoleCommand), "IsValid")] private static class cheatfix { private static bool Prefix(ref bool __result, ref Terminal context, ref ConsoleCommand __instance) { __result = Object.op_Implicit((Object)(object)ZNet.instance) && Object.op_Implicit((Object)(object)Player.m_localPlayer) && (!__instance.IsCheat || isAdmin()); return false; } } [HarmonyPatch(typeof(Fish), "Interact")] private static class fishfix { private static bool Prefix(ref Humanoid character, bool repeat, bool alt, ref Fish __instance, ref bool __result) { __result = !repeat && __instance.Pickup(character); return false; } } [HarmonyPatch(typeof(Fish), "Start")] private static class fishhookfix { private static void Postfix(ref Fish __instance) { __instance.m_baseHookChance = 0.8f; } } [HarmonyPatch(typeof(FishingFloat), "Awake")] private static class floathfix { private static void Postfix(ref FishingFloat __instance) { __instance.m_range = 20f; } } [HarmonyPatch(typeof(Trader), "Start")] private static class traderbye { private static void Postfix(ref Trader __instance) { ((Component)__instance).gameObject.SetActive(false); } } [HarmonyPatch(typeof(Piece), "SetCreator")] private static class piecelog { private static void Postfix(long uid, ref Piece __instance) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_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) Player player = Player.GetPlayer(uid); if (Object.op_Implicit((Object)(object)player) && Object.op_Implicit((Object)(object)__instance.m_nview) && __instance.m_nview.GetZDO() != null) { string text = ((Component)__instance).transform.position.x + " "; text = text + ((Component)__instance).transform.position.z + " "; text += ((Component)__instance).transform.position.y; SendModerationLog(player.GetPlayerName(), ((Object)((Component)__instance).gameObject).name, "piece created", "", text); __instance.m_nview.GetZDO().Set("creatorName", player.GetPlayerName()); if (__instance.m_name == "Ward") { ZRoutedRpc.instance.InvokeRoutedRPC("ServerSetWard", new object[2] { player.GetPlayerName(), true }); } } } } [HarmonyPatch(typeof(Piece), "DropResources")] private static class piecelogd { private static void Postfix(ref Piece __instance) { //IL_002d: 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) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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_009c: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)__instance.m_nview) && __instance.m_nview.IsOwner()) { string text = ((Component)__instance).transform.position.x + " "; text = text + ((Component)__instance).transform.position.z + " "; text += ((Component)__instance).transform.position.y; List<Player> list = new List<Player>(); Player.GetPlayersInRange(((Component)__instance).transform.position, 30f, list); SendModerationLog(string.Join(",", list.Select((Player p) => p.GetPlayerName())), ((Object)((Component)__instance).gameObject).name, "piece destroyed", __instance.m_nview.GetZDO().GetString("creatorName", ""), text); ZRoutedRpc.instance.InvokeRoutedRPC("ServerSetWard", new object[2] { __instance.m_nview.GetZDO().GetString("creatorName", ""), false }); } } } [HarmonyPatch(typeof(Container), "RPC_RequestOpen")] private static class chestlog { private static void Postfix(ref Container __instance, long uid, long playerID) { //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: 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_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) Player player = Player.GetPlayer(playerID); if (!((Object)(object)player != (Object)null) || !((Character)player).m_nview.IsValid() || !((Object)(object)__instance.m_nview != (Object)null) || !__instance.m_nview.IsValid()) { return; } string creator = ""; if ((Object)(object)__instance.m_piece != (Object)null) { ZDO zDO = __instance.m_piece.m_nview.GetZDO(); if (zDO != null && zDO.IsValid()) { creator = zDO.GetString("creatorName", ""); } } string text = ((Component)__instance).transform.position.x + " "; text = text + ((Component)__instance).transform.position.z + " "; text += ((Component)__instance).transform.position.y; SendModerationLog(((Character)player).GetHoverName(), ((Object)((Component)__instance).gameObject).name, "chest open", creator, text); } } [HarmonyPatch(typeof(InventoryGui), "DoCrafting")] private static class craftlog { private static void Postfix(Player player, ref InventoryGui __instance) { SendModerationLog(((Character)player).GetHoverName(), __instance.m_craftRecipe.m_item.m_itemData.m_shared.m_name, "item created", "", ""); } } [HarmonyPatch(typeof(Player), "Awake")] private static class playerawake { private static void Postfix(ref Player __instance) { __instance.m_hardDeathCooldown = 1f; __instance.m_baseHP = 50f; } } [HarmonyPatch(typeof(Player), "OnSpawned")] private static class novalk { private static bool Prefix(ref Player __instance, bool spawnValkyrie) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) __instance.m_spawnEffects.Create(((Component)__instance).transform.position, Quaternion.identity, (Transform)null, 1f, -1); if (spawnValkyrie) { __instance.SetIntro(true); } SetActiveRecursive(Minimap.instance.m_smallRoot, a: false); Image component = Minimap.instance.m_smallRoot.GetComponent<Image>(); if (Object.op_Implicit((Object)(object)component)) { ((Behaviour)component).enabled = false; } if (__instance.m_timeSinceDeath < 30f) { ((Character)__instance).m_seman.AddStatusEffect(StringExtensionMethods.GetStableHashCode("Panic"), false, 0, 0f); } if (__instance.m_timeSinceDeath < 1800f) { StatusEffect val = ((Character)__instance).m_seman.AddStatusEffect(StringExtensionMethods.GetStableHashCode("Wounded"), false, 0, 0f); val.m_time = __instance.m_timeSinceDeath; } JotunnPatches.DurabilityIncrease(); return false; } } [HarmonyPatch(typeof(Game), "Awake")] private static class noarrived { private static void Postfix(ref Game __instance) { __instance.m_firstSpawn = false; } } [HarmonyPatch(typeof(Player), "HaveSeenTutorial")] private static class notutorial { private static void Postfix(string name, ref bool __result) { __result = true; } } [HarmonyPatch(typeof(Player), "OnDeath")] private static class reworkdeath { private static bool Prefix(ref Player __instance) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Expected I4, but got Unknown //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Invalid comparison between Unknown and I4 //IL_04e4: Unknown result type (might be due to invalid IL or missing references) //IL_050c: Unknown result type (might be due to invalid IL or missing references) deathpoint = ((Component)__instance).transform.position; StatusEffect statusEffect = ((Character)__instance).m_seman.GetStatusEffect(StringExtensionMethods.GetStableHashCode("Wounded")); if (Object.op_Implicit((Object)(object)statusEffect)) { woundeddeathcounter++; if (woundeddeathcounter > 1) { deathpoint = lumbyspawn; woundeddeathcounter = 0; } } else { woundeddeathcounter = 0; } float num = 100f; if (((Humanoid)__instance).m_chestItem != null) { ((Humanoid)__instance).m_chestItem.m_durability = Mathf.Max(0f, ((Humanoid)__instance).m_chestItem.m_durability - num); } if (((Humanoid)__instance).m_legItem != null) { ((Humanoid)__instance).m_legItem.m_durability = Mathf.Max(0f, ((Humanoid)__instance).m_legItem.m_durability - num); } if (((Humanoid)__instance).m_helmetItem != null) { ((Humanoid)__instance).m_helmetItem.m_durability = Mathf.Max(0f, ((Humanoid)__instance).m_helmetItem.m_durability - num); } if (((Humanoid)__instance).m_shoulderItem != null) { ((Humanoid)__instance).m_shoulderItem.m_durability = Mathf.Max(0f, ((Humanoid)__instance).m_shoulderItem.m_durability - num); } if (deathpoint == lumbyspawn) { List<ItemData> allItems = ((Humanoid)__instance).m_inventory.GetAllItems(); foreach (ItemData item in allItems) { if ((int)item.m_shared.m_itemType == 1) { Random random = new Random(); if (random.Next(1, 10) >= 6) { item.m_stack = 1; } } } } ((Character)__instance).m_nview.GetZDO().Set("dead", true); ((Character)__instance).m_nview.InvokeRPC(ZNetView.Everybody, "OnDeath", Array.Empty<object>()); Game.instance.IncrementPlayerStat((PlayerStatType)0, 1f); HitType hitType = ((Character)__instance).m_lastHit.m_hitType; HitType val = hitType; switch ((int)val) { case 0: Game.instance.IncrementPlayerStat((PlayerStatType)55, 1f); break; case 1: Game.instance.IncrementPlayerStat((PlayerStatType)56, 1f); break; case 2: Game.instance.IncrementPlayerStat((PlayerStatType)57, 1f); break; case 3: Game.instance.IncrementPlayerStat((PlayerStatType)58, 1f); break; case 4: Game.instance.IncrementPlayerStat((PlayerStatType)59, 1f); break; case 5: Game.instance.IncrementPlayerStat((PlayerStatType)60, 1f); break; case 6: Game.instance.IncrementPlayerStat((PlayerStatType)61, 1f); break; case 7: Game.instance.IncrementPlayerStat((PlayerStatType)62, 1f); break; case 8: Game.instance.IncrementPlayerStat((PlayerStatType)64, 1f); break; case 9: Game.instance.IncrementPlayerStat((PlayerStatType)63, 1f); break; case 10: Game.instance.IncrementPlayerStat((PlayerStatType)65, 1f); break; case 11: Game.instance.IncrementPlayerStat((PlayerStatType)66, 1f); break; case 12: Game.instance.IncrementPlayerStat((PlayerStatType)67, 1f); break; case 13: Game.instance.IncrementPlayerStat((PlayerStatType)68, 1f); break; case 14: Game.instance.IncrementPlayerStat((PlayerStatType)69, 1f); break; case 15: Game.instance.IncrementPlayerStat((PlayerStatType)70, 1f); break; case 16: Game.instance.IncrementPlayerStat((PlayerStatType)71, 1f); break; case 17: Game.instance.IncrementPlayerStat((PlayerStatType)72, 1f); break; case 18: Game.instance.IncrementPlayerStat((PlayerStatType)73, 1f); break; default: ZLog.LogWarning((object)("Not implemented death type " + ((object)(HitType)(ref ((Character)__instance).m_lastHit.m_hitType)).ToString())); break; } Game.instance.GetPlayerProfile().SetDeathPoint(((Component)__instance).transform.position); __instance.CreateDeathEffects(); __instance.CreateTombStone(); __instance.m_foods.Clear(); ((Character)__instance).m_seman.RemoveAllStatusEffects(false); if (deathpoint == lumbyspawn) { __instance.m_timeSinceDeath = 1810f; } else { __instance.m_timeSinceDeath = 0f; } Game.instance.GetPlayerProfile().SetLogoutPoint(((Component)__instance).transform.position); Game.instance.RequestRespawn(15f, false); Minimap.instance.AddPin(((Component)__instance).transform.position, (PinType)4, $"$hud_mapday {EnvMan.instance.GetDay(ZNet.instance.GetTimeSeconds())}", true, false, 0L, ""); return false; } } [HarmonyPatch(typeof(Game), "SpawnPlayer")] private static class deathspawnlocation { private static void Prefix(ref Vector3 spawnPoint, Game __instance) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) if (deathpoint != Vector3.zero) { spawnPoint.x = deathpoint.x; spawnPoint.y = deathpoint.y; spawnPoint.z = deathpoint.z; deathpoint = Vector3.zero; } } } [HarmonyPatch(typeof(TombStone), "Awake")] private static class nocorpserun { private static void Postfix(ref TombStone __instance) { __instance.m_lootStatusEffect = null; __instance.m_worldText.text = ""; } } [HarmonyPatch(typeof(TombStone), "Start")] private static class notombstonename { private static void Postfix(ref TombStone __instance) { __instance.m_worldText.text = ""; if (Object.op_Implicit((Object)(object)Player.m_localPlayer) && Player.m_localPlayer.GetPlayerName() == __instance.m_nview.GetZDO().GetString("ownerName", "")) { __instance.m_worldText.text = "Mine"; } } } [HarmonyPatch(typeof(TombStone), "Setup")] private static class notombstonename2 { private static void Postfix(ref TombStone __instance) { __instance.m_worldText.text = ""; if (Object.op_Implicit((Object)(object)Player.m_localPlayer) && Player.m_localPlayer.GetPlayerName() == __instance.m_nview.GetZDO().GetString("ownerName", "")) { __instance.m_worldText.text = "Mine"; } } } [HarmonyPatch(typeof(TombStone), "GetHoverText")] private static class notombstonemessage { private static void Postfix(ref TombStone __instance, ref string __result) { __result = "dont touch"; } } [HarmonyPatch(typeof(MapTable), "OnRead", new Type[] { typeof(Switch), typeof(Humanoid), typeof(ItemData), typeof(bool) })] private static class noaddmap { private static bool Prefix(Switch caller, Humanoid user, ItemData item, bool __result) { __result = false; return false; } } [HarmonyPatch(typeof(MapTable), "OnWrite")] private static class nogetmap { private static bool Prefix(Switch caller, Humanoid user, ItemData item, bool __result) { __result = false; return false; } } [HarmonyPatch(typeof(EnvMan), "GetCurrentEnvironment")] private static class smallerwaves { private static void Postfix(ref EnvSetup __result) { __result.m_windMin = 0.2f; __result.m_windMax = 0.5f; } } [HarmonyPatch(typeof(Door), "HaveKey")] private static class consumekeys { private static void Postfix(ref Humanoid player, ref Door __instance, ref bool __result) { //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_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) if (__result) { string raw = ((Component)__instance).transform.position.x + " " + ((Component)__instance).transform.position.z + " " + ((Component)__instance).transform.position.y; SendModerationLog(((Character)player).GetHoverName(), __instance.m_keyItem.m_itemData.m_shared.m_name, "Key", "", raw); player.GetInventory().RemoveItem(__instance.m_keyItem.m_itemData.m_shared.m_name, 1, -1, true); } } } [HarmonyPatch(typeof(Character), "InInterior", new Type[] { typeof(Transform) })] private static class buildindungeonlol { private static void Postfix(Transform me, ref bool __result) { if (isAdmin()) { __result = false; } } } [HarmonyPatch(typeof(Inventory), "IsTeleportable")] private static class teleporteverything { private static void Postfix(ref bool __result) { __result = true; } } [HarmonyPatch(typeof(InventoryGui), "HaveRepairableItems")] private static class norepairgui { private static void Postfix(ref bool __result) { __result = false; } } [HarmonyPatch(typeof(Vagon), "AttachTo")] private static class cartlogattach { private static void Postfix(Vagon __instance) { Piece component = ((Component)__instance).gameObject.GetComponent<Piece>(); SendModerationLog(((Character)Player.m_localPlayer).GetHoverName(), ((Object)((Component)__instance).gameObject).name, "cart control", component.m_nview.GetZDO().GetString("creatorName", ""), ""); } } [HarmonyPatch(typeof(Player), "GetTotalFoodValue")] private static class foodburntime { private static void Postfix(ref float hp, ref float stamina, ref float eitr, Player __instance) { hp = __instance.m_baseHP; stamina = __instance.m_baseStamina; eitr = 0f; foreach (Food food in __instance.m_foods) { hp += food.m_item.m_shared.m_food; stamina += food.m_item.m_shared.m_foodStamina; eitr += food.m_item.m_shared.m_foodEitr; } } } [HarmonyPatch(typeof(Incinerator), "Incinerate")] private static class incinlog { private static void Prefix(ref Incinerator __instance, long uid) { List<ItemData> allItems = __instance.m_container.m_inventory.GetAllItems(); foreach (ItemData item in allItems) { SendModerationLog(((Character)Player.m_localPlayer).GetHoverName(), item.m_shared.m_name, "incinerator", item.m_crafterName, item.m_shared.m_name + " " + item.m_stack); } } } [HarmonyPatch(typeof(Sign), "Awake")] private static class SignAwakePatch { private static void Prefix(Sign __instance) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) Transform val = Utils.FindChild(((Component)__instance).transform, "Text", (IterativeSearchType)0); if ((Object)(object)val != (Object)null) { Text component = ((Component)val).GetComponent<Text>(); if ((Object)(object)component != (Object)null) { GameObject val2 = new GameObject("Text"); val2.transform.SetParent(((Component)val).transform.parent); Transform transform = ((Component)val).transform; val2.transform.localPosition = transform.localPosition; val2.transform.localRotation = transform.localRotation; val2.transform.localScale = transform.localScale; TextMeshProUGUI val3 = val2.AddComponent<TextMeshProUGUI>(); ((TMP_Text)val3).text = component.text; ((TMP_Text)val3).font = TMP_FontAsset.CreateFontAsset(component.font); ((TMP_Text)val3).fontSize = component.fontSize; ((Graphic)val3).color = ((Graphic)component).color; ((TMP_Text)val3).alignment = (TextAlignmentOptions)514; __instance.m_textWidget = val3; Object.Destroy((Object)(object)((Component)component).gameObject); } } } private static void Postfix(Sign __instance) { if (!((Behaviour)__instance).enabled) { ((Behaviour)__instance).enabled = true; } } } public const string vrpversion = "11.9.1"; public static List<string> groups = new List<string>(); public static List<DbRecipe> recipes = new List<DbRecipe>(); public static bool canWard = false; public static List<string> admins = new List<string> { "ADMIN", "UNKNOWN", "DOOUG", "SAGE DONOVAN", "CHARBEL", "BLOOD RICK", "BLAETH", "ONAR", "THE NIGHTMARE", "FISHER", "LUCERNA", "MR. B", "LANDGRAVE SAM", "SAGE ZERICO", "JOVIA", "SHARD", "DIVINE ABIGAIL", "RUTHIX", "NECROMANCER", "SWINE BROTHER", "SWINE SISTER", "DULLAHAN", "FRAGAS" }; private static float raftdmgcounter = 0f; private static Vector3 deathpoint = Vector3.zero; private static Vector3 lumbyspawn = new Vector3(0f, 35f, -4f); private static int woundeddeathcounter = 0; public static bool Contains(string source, string toCheck, StringComparison comp) { Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US"); string text = source.ToUpperInvariant(); string value = toCheck.ToUpperInvariant(); return text.Contains(value); } public static bool isAdmin() { bool result = false; if ((Object)(object)Game.instance != (Object)null && Game.instance.m_playerProfile != null) { result = admins.Contains(Game.instance.m_playerProfile.m_playerName.ToUpperInvariant()); } return result; } public static bool isAdmin(string name) { return admins.Contains(name.ToUpperInvariant()); } public static void SendModerationLog(string player, string item, string action, string creator, string raw) { DbLog dbLog = new DbLog(); dbLog.p = player; dbLog.i = Encoding.ASCII.GetString(Encoding.ASCII.GetBytes(item)); dbLog.a = action; dbLog.c = creator; dbLog.r = Encoding.ASCII.GetString(Encoding.ASCII.GetBytes(raw)); string input = SimpleJson.SerializeObject((object)dbLog); input = Regex.Replace(input, "[^\\u0009\\u000A\\u000D\\u0020-\\u007E]", ""); if (ZRoutedRpc.instance != null && !ZRoutedRpc.instance.m_server) { ZRoutedRpc.instance.InvokeRoutedRPC("ServerModerationLog", new object[1] { input }); } } public static void SendBroadcast(string message) { if (ZRoutedRpc.instance != null && !ZRoutedRpc.instance.m_server && isAdmin()) { ZRoutedRpc.instance.InvokeRoutedRPC("ServerBroadcast", new object[1] { message }); } } public static void playerEqp(ref ItemData item, ref Humanoid huma) { if (item != null && item.IsEquipable() && (Object)(object)huma != (Object)null && ((Character)huma).IsPlayer()) { Humanoid obj = huma; Player val = (Player)(object)((obj is Player) ? obj : null); if ((Object)(object)val != (Object)null && ((Character)val).m_nview.IsValid() && (Object)(object)Player.m_localPlayer != (Object)null) { string raw = ((Character)val).GetHoverName() + " | equip | " + item.m_shared.m_name + ((item.m_crafterID == 0L) ? " | uncrafted | " : (" | crafted by | " + item.m_crafterName + " ")); SendModerationLog(((Character)val).GetHoverName(), item.m_shared.m_name, "equip", (item.m_crafterID == 0L) ? " | uncrafted | " : (" | crafted by | " + item.m_crafterName + " "), raw); } } } public static void RPC_SetClass(long sender, string groups, string recipesraw) { if (!((Object)(object)ZNet.instance != (Object)null) || ZNet.instance.IsServer()) { return; } ZLog.LogWarning((object)("got groups from server " + groups)); ClientPatches.groups = groups.Split(new char[1] { ',' }).ToList(); DbRecipe[] array = SimpleJson.DeserializeObject<DbRecipe[]>(recipesraw); if (array != null) { recipes.Clear(); DbRecipe[] array2 = array; foreach (DbRecipe dbRecipe in array2) { if (!dbRecipe.deleted) { recipes.Add(dbRecipe); } } } else { ZLog.LogError((object)"error recipes json"); } } public static void RPC_SetWard(long sender, bool canPlaceWard) { if ((Object)(object)ZNet.instance != (Object)null && !ZNet.instance.IsServer()) { ZLog.LogWarning((object)("got ward status from server " + canPlaceWard)); canWard = canPlaceWard; } } private static void SetActiveRecursive(GameObject go, bool a) { go.SetActive(a); for (int i = 0; i < go.transform.childCount; i++) { Transform child = go.transform.GetChild(i); SetActiveRecursive(((Component)child).gameObject, a); } } } internal class JotunnPatches { public static AssetBundle bandage; public static AssetBundle mushbundle; public static AssetBundle bonefirebundle; public static AssetBundle vrpbundle; public static AssetBundle valonbundle; public static AssetBundle phatbundle; public static AssetBundle loraxbundle; public static AssetBundle bronzehelm; public static void AddVariants() { bandage = AssetUtils.LoadAssetBundle("1010101110-vrp/Assets/bandage"); mushbundle = AssetUtils.LoadAssetBundle("1010101110-vrp/Assets/gold"); bonefirebundle = AssetUtils.LoadAssetBundle("1010101110-vrp/Assets/bonefire"); vrpbundle = AssetUtils.LoadAssetBundle("1010101110-vrp/Assets/stoneage"); valonbundle = AssetUtils.LoadAssetBundle("1010101110-vrp/Assets/valon"); phatbundle = AssetUtils.LoadAssetBundle("1010101110-vrp/Assets/phats"); loraxbundle = AssetUtils.LoadAssetBundle("1010101110-vrp/Assets/loraxia"); bronzehelm = AssetUtils.LoadAssetBundle("1010101110-vrp/Assets/bronzehelmsrgb"); PrefabManager.OnVanillaPrefabsAvailable += AddArmor; PrefabManager.OnVanillaPrefabsAvailable += AddDisableItems; PrefabManager.OnVanillaPrefabsAvailable += AddMerchantItems; PrefabManager.OnVanillaPrefabsAvailable += AddMushrooms; PrefabManager.OnVanillaPrefabsAvailable += AddBandage; PrefabManager.OnPrefabsRegistered += EditStatusEffects; PrefabManager.OnPrefabsRegistered += AddWineBeer; PrefabManager.OnPrefabsRegistered += AddFishItems; PrefabManager.OnPrefabsRegistered += AddStatus; } internal static void DurabilityIncrease() { //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_03a4: Unknown result type (might be due to invalid IL or missing references) //IL_04b1: Unknown result type (might be due to invalid IL or missing references) //IL_0a7b: Unknown result type (might be due to invalid IL or missing references) //IL_0a81: Invalid comparison between Unknown and I4 //IL_0a91: Unknown result type (might be due to invalid IL or missing references) //IL_0a98: Invalid comparison between Unknown and I4 //IL_0b64: Unknown result type (might be due to invalid IL or missing references) //IL_0b6a: Invalid comparison between Unknown and I4 //IL_0aa8: Unknown result type (might be due to invalid IL or missing references) //IL_0aae: Invalid comparison between Unknown and I4 //IL_0c55: Unknown result type (might be due to invalid IL or missing references) //IL_0c5b: Invalid comparison between Unknown and I4 //IL_0b77: Unknown result type (might be due to invalid IL or missing references) //IL_0b7e: Invalid comparison between Unknown and I4 //IL_0abe: Unknown result type (might be due to invalid IL or missing references) //IL_0ac5: Invalid comparison between Unknown and I4 //IL_0c68: Unknown result type (might be due to invalid IL or missing references) //IL_0c6f: Invalid comparison between Unknown and I4 //IL_0b8b: Unknown result type (might be due to invalid IL or missing references) //IL_0b91: Invalid comparison between Unknown and I4 //IL_0ad2: Unknown result type (might be due to invalid IL or missing references) //IL_0ad8: Invalid comparison between Unknown and I4 //IL_0c7c: Unknown result type (might be due to invalid IL or missing references) //IL_0c82: Invalid comparison between Unknown and I4 //IL_0ae5: Unknown result type (might be due to invalid IL or missing references) //IL_0aeb: Invalid comparison between Unknown and I4 //IL_0c8f: Unknown result type (might be due to invalid IL or missing references) //IL_0c96: Invalid comparison between Unknown and I4 //IL_0af8: Unknown result type (might be due to invalid IL or missing references) //IL_0aff: Invalid comparison between Unknown and I4 //IL_0ca3: Unknown result type (might be due to invalid IL or missing references) //IL_0caa: Invalid comparison between Unknown and I4 //IL_0c0d: Unknown result type (might be due to invalid IL or missing references) //IL_0c14: Invalid comparison between Unknown and I4 //IL_0b0c: Unknown result type (might be due to invalid IL or missing references) //IL_0b13: Invalid comparison between Unknown and I4 //IL_0b20: Unknown result type (might be due to invalid IL or missing references) //IL_0b27: Invalid comparison between Unknown and I4 //IL_0b34: Unknown result type (might be due to invalid IL or missing references) //IL_0b3a: Invalid comparison between Unknown and I4 ZLog.Log((object)"VRP DURABILITY"); for (int i = 0; i < ObjectDB.instance.m_items.Count; i++) { ItemDrop component = ObjectDB.instance.m_items[i].GetComponent<ItemDrop>(); if (Object.op_Implicit((Object)(object)component) && (component.m_itemData.m_shared.m_name.Contains("item_finewood") || component.m_itemData.m_shared.m_name.Contains("item_roundlog") || component.m_itemData.m_shared.m_name.Contains("item_wood"))) { component.m_itemData.m_shared.m_weight = 3f; } if (Object.op_Implicit((Object)(object)component) && component.m_itemData.m_shared.m_name.Contains("item_stone")) { component.m_itemData.m_shared.m_weight = 5f; } if (Object.op_Implicit((Object)(object)component) && component.m_itemData.m_shared.m_name.Contains("item_blueberries")) { component.m_itemData.m_shared.m_food = 7f; component.m_itemData.m_shared.m_foodStamina = 26f; } if (Object.op_Implicit((Object)(object)component) && component.m_itemData.m_shared.m_name.Contains("item_raspberries")) { component.m_itemData.m_shared.m_food = 8f; component.m_itemData.m_shared.m_foodStamina = 25f; } if (Object.op_Implicit((Object)(object)component) && component.m_itemData.m_shared.m_name.Contains("item_cloudberries")) { component.m_itemData.m_shared.m_food = 9f; component.m_itemData.m_shared.m_foodStamina = 24f; } if (Object.op_Implicit((Object)(object)component) && component.m_itemData.m_shared.m_name.Contains("Floam")) { component.m_itemData.m_shared.m_food = 10f; component.m_itemData.m_shared.m_foodBurnTime = 300f; component.m_itemData.m_shared.m_foodStamina = 15f; component.m_itemData.m_shared.m_foodEitr = 10f; component.m_itemData.m_shared.m_itemType = (ItemType)2; } if (Object.op_Implicit((Object)(object)component) && component.m_itemData.m_shared.m_name.Contains("Gloam")) { component.m_itemData.m_shared.m_food = 25f; component.m_itemData.m_shared.m_foodBurnTime = 3600f; component.m_itemData.m_shared.m_foodStamina = 69f; component.m_itemData.m_shared.m_foodEitr = 69f; component.m_itemData.m_shared.m_itemType = (ItemType)2; } if (Object.op_Implicit((Object)(object)component) && (component.m_itemData.m_shared.m_name.Contains("$item_chicken_meat_cooked") || component.m_itemData.m_shared.m_name.Contains("$item_hare_meat_cooked"))) { component.m_itemData.m_shared.m_food = 35f; component.m_itemData.m_shared.m_foodStamina = 12f; component.m_itemData.m_shared.m_foodRegen = 2f; component.m_itemData.m_shared.m_itemType = (ItemType)2; } if (Object.op_Implicit((Object)(object)component) && component.m_itemData.m_shared.m_name.Contains("item_sword")) { component.m_itemData.m_shared.m_secondaryAttack.m_attackStamina = 30f; component.m_itemData.m_shared.m_secondaryAttack.m_damageMultiplier = 2.2f; } if (Object.op_Implicit((Object)(object)component) && component.m_itemData.m_shared.m_name.ToUpperInvariant().Contains("GREATSWORD")) { component.m_itemData.m_shared.m_secondaryAttack.m_damageMultiplier = 2.2f; } if (Object.op_Implicit((Object)(object)component) && component.m_itemData.m_shared.m_name.Contains("item_axe")) { component.m_itemData.m_shared.m_secondaryAttack.m_attackAnimation = "swing_pickaxe"; component.m_itemData.m_shared.m_secondaryAttack.m_attackType = (AttackType)1; component.m_itemData.m_shared.m_secondaryAttack.m_attackRange = 2.2f; component.m_itemData.m_shared.m_secondaryAttack.m_attackHeight = 0.8f; component.m_itemData.m_shared.m_secondaryAttack.m_attackAngle = 60f; component.m_itemData.m_shared.m_secondaryAttack.m_attackRayWidth = 0.2f; component.m_itemData.m_shared.m_secondaryAttack.m_damageMultiplier = 2f; component.m_itemData.m_shared.m_secondaryAttack.m_attackStamina = 30f; } if (Object.op_Implicit((Object)(object)component) && component.m_itemData.m_shared.m_name.Contains("item_knife")) { component.m_itemData.m_shared.m_backstabBonus = 4f; component.m_itemData.m_shared.m_attack.m_lastChainDamageMultiplier = 2f; component.m_itemData.m_shared.m_secondaryAttack.m_damageMultiplier = 3f; component.m_itemData.m_shared.m_secondaryAttack.m_attackStamina = 30f; } if (Object.op_Implicit((Object)(object)component) && component.m_itemData.m_shared.m_name.Contains("item_atgeir")) { component.m_itemData.m_shared.m_attack.m_attackStamina = 8f; component.m_itemData.m_shared.m_secondaryAttack.m_attackStamina = 30f; component.m_itemData.m_shared.m_secondaryAttack.m_forceMultiplier = 12f; } if (Object.op_Implicit((Object)(object)component) && (component.m_itemData.m_shared.m_name.Contains("item_spear_bronze") || component.m_itemData.m_shared.m_name.Contains("item_spear_flint") || component.m_itemData.m_shared.m_name.Contains("item_spear_ancientbark") || component.m_itemData.m_shared.m_name.Contains("item_spear_wolffang") || component.m_itemData.m_shared.m_name.Contains("item_spear_carapace"))) { component.m_itemData.m_shared.m_attack.m_attackHeight = 1f; component.m_itemData.m_shared.m_attack.m_attackRange = 2.2f; component.m_itemData.m_shared.m_secondaryAttack.m_consumeItem = false; component.m_itemData.m_shared.m_secondaryAttack.m_destroyPreviousProjectile = true; component.m_itemData.m_shared.m_secondaryAttack.m_attackStamina = 50f; Projectile component2 = component.m_itemData.m_shared.m_secondaryAttack.m_attackProjectile.GetComponent<Projectile>(); component2.m_respawnItemOnHit = false; } if (!Object.op_Implicit((Object)(object)component) || component.m_itemData.m_shared.m_name.Contains("item_stagbreaker") || component.m_itemData.m_shared.m_name.Contains("item_sledge_iron")) { } if (Object.op_Implicit((Object)(object)component) && (component.m_itemData.m_shared.m_name.Contains("item_chest_pcuirass") || component.m_itemData.m_shared.m_name.Contains("item_legs_pgreaves") || component.m_itemData.m_shared.m_name.Contains("item_helmet_padded"))) { component.m_itemData.m_shared.m_armor = 20f; } if (Object.op_Implicit((Object)(object)component) && (component.m_itemData.m_shared.m_name.Contains("item_chest_fenris") || component.m_itemData.m_shared.m_name.Contains("item_legs_fenris") || component.m_itemData.m_shared.m_name.Contains("item_helmet_fenris"))) { component.m_itemData.m_shared.m_armor = 20f; } if (Object.op_Implicit((Object)(object)component) && component.m_itemData.m_shared.m_name.Contains("item_sword_blackmetal")) { component.m_itemData.m_shared.m_damages.m_slash = 75f; } if (Object.op_Implicit((Object)(object)component) && component.m_itemData.m_shared.m_name.Contains("item_battleaxe_crystal")) { component.m_itemData.m_shared.m_damages.m_slash = 110f; } if (Object.op_Implicit((Object)(object)component) && component.m_itemData.m_shared.m_name.Contains("item_knife_silver")) { component.m_itemData.m_shared.m_damages.m_slash = 39f; component.m_itemData.m_shared.m_damages.m_pierce = 39f; } if (Object.op_Implicit((Object)(object)component) && component.m_itemData.m_shared.m_name.Contains("item_mace_silver")) { component.m_itemData.m_shared.m_damages.m_blunt = 40f; } if (Object.op_Implicit((Object)(object)component) && component.m_itemData.m_shared.m_name.Contains("item_spear_wolffang")) { component.m_itemData.m_shared.m_damages.m_pierce = 90f; } if (Object.op_Implicit((Object)(object)component) && ((int)component.m_itemData.m_shared.m_itemType == 7 || (int)component.m_itemData.m_shared.m_itemType == 11 || (int)component.m_itemData.m_shared.m_itemType == 6 || (int)component.m_itemData.m_shared.m_itemType == 17 || (int)component.m_itemData.m_shared.m_itemType == 5 || (int)component.m_itemData.m_shared.m_itemType == 3 || (int)component.m_itemData.m_shared.m_itemType == 14 || (int)component.m_itemData.m_shared.m_itemType == 22 || (int)component.m_itemData.m_shared.m_itemType == 19 || (int)component.m_itemData.m_shared.m_itemType == 4) && component.m_itemData.m_shared.m_canBeReparied) { if ((int)component.m_itemData.m_shared.m_itemType == 3 || (int)component.m_itemData.m_shared.m_itemType == 14 || (int)component.m_itemData.m_shared.m_itemType == 4) { component.m_itemData.m_shared.m_maxDurability = 200f; } component.m_itemData.m_shared.m_maxDurability = ((component.m_itemData.m_shared.m_maxDurability > 1500f) ? 1500f : component.m_itemData.m_shared.m_maxDurability); component.m_itemData.m_shared.m_canBeReparied = false; float num = (((int)component.m_itemData.m_shared.m_itemType == 19) ? 10 : 5); component.m_itemData.m_shared.m_maxDurability = component.m_itemData.m_shared.m_maxDurability * num; } if (Object.op_Implicit((Object)(object)component) && ((int)component.m_itemData.m_shared.m_itemType == 7 || (int)component.m_itemData.m_shared.m_itemType == 11 || (int)component.m_itemData.m_shared.m_itemType == 6 || (int)component.m_itemData.m_shared.m_itemType == 17 || (int)component.m_itemData.m_shared.m_itemType == 18)) { component.m_itemData.m_shared.m_equipDuration = 3f; } } } private static void AddStatus() { //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Expected O, but got Unknown //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0195: 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_01a7: Expected O, but got Unknown ZLog.Log((object)"VRP STATUS"); StatusEffect statusEffect = ObjectDB.instance.GetStatusEffect(StringExtensionMethods.GetStableHashCode("Wounded")); if (Object.op_Implicit((Object)(object)statusEffect)) { return; } StatusEffect statusEffect2 = ObjectDB.instance.GetStatusEffect(StringExtensionMethods.GetStableHashCode("SoftDeath")); if (Object.op_Implicit((Object)(object)statusEffect2)) { SE_Stats val = ScriptableObject.CreateInstance<SE_Stats>(); ((StatusEffect)val).m_icon = statusEffect2.m_icon; ((StatusEffect)val).m_name = "Wounded"; ((Object)val).name = "Wounded"; ((StatusEffect)val).m_ttl = 1800f; ((StatusEffect)val).m_repeatInterval = 0f; val.m_speedModifier = -0.1f; CustomStatusEffect val2 = new CustomStatusEffect((StatusEffect)(object)val, false); ItemManager.Instance.AddStatusEffect(val2); SE_Stats val3 = ScriptableObject.CreateInstance<SE_Stats>(); ((StatusEffect)val3).m_icon = statusEffect2.m_icon; ((StatusEffect)val3).m_name = "Panic"; ((Object)val3).name = "Panic"; ((StatusEffect)val3).m_ttl = 30f; ((StatusEffect)val3).m_repeatInterval = 0f; val3.m_tickInterval = 1f; val3.m_healthPerTick = 5f; val3.m_addMaxCarryWeight = 300f; val3.m_mods.Add(new DamageModPair { m_modifier = (DamageModifier)5, m_type = (DamageType)1 }); val3.m_mods.Add(new DamageModPair { m_modifier = (DamageModifier)5, m_type = (DamageType)4 }); val3.m_mods.Add(new DamageModPair { m_modifier = (DamageModifier)5, m_type = (DamageType)2 }); CustomStatusEffect val4 = new CustomStatusEffect((StatusEffect)(object)val3, false); ItemManager.Instance.AddStatusEffect(val4); } CustomItem item = ItemManager.Instance.GetItem("Handcuffs"); if (item != null) { StatusEffect statusEffect3 = ObjectDB.instance.GetStatusEffect(StringExtensionMethods.GetStableHashCode("Harpooned")); if (!Object.op_Implicit((Object)(object)statusEffect3)) { ZLog.LogError((object)"didn't find harpooned"); } else { item.ItemDrop.m_itemData.m_shared.m_attackStatusEffect = statusEffect3; } } } private static void AddWineBeer() { //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Expected O, but got Unknown //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Expected O, but got Unknown //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Expected O, but got Unknown //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Expected O, but got Unknown //IL_035b: Unknown result type (might be due to invalid IL or missing references) //IL_0362: Expected O, but got Unknown //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_043d: Expected O, but got Unknown //IL_0400: Unknown result type (might be due to invalid IL or missing references) //IL_0409: Unknown result type (might be due to invalid IL or missing references) //IL_0412: Unknown result type (might be due to invalid IL or missing references) //IL_041e: Unknown result type (might be due to invalid IL or missing references) //IL_04f2: Unknown result type (might be due to invalid IL or missing references) //IL_04f9: Expected O, but got Unknown //IL_0511: Unknown result type (might be due to invalid IL or missing references) //IL_0516: Unknown result type (might be due to invalid IL or missing references) //IL_0522: Unknown result type (might be due to invalid IL or missing references) //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_053b: Expected O, but got Unknown //IL_0536: Unknown result type (might be due to invalid IL or missing references) //IL_053d: Expected O, but got Unknown //IL_0555: Unknown result type (might be due to invalid IL or missing references) //IL_055c: Expected O, but got Unknown //IL_05a0: Unknown result type (might be due to invalid IL or missing references) //IL_05a5: Unknown result type (might be due to invalid IL or missing references) //IL_05b1: Unknown result type (might be due to invalid IL or missing references) //IL_05bb: Expected O, but got Unknown //IL_05bd: Unknown result type (might be due to invalid IL or missing references) //IL_05c2: Unknown result type (might be due to invalid IL or missing references) //IL_05ce: Unknown result type (might be due to invalid IL or missing references) //IL_05d7: Expected O, but got Unknown //IL_05df: Unknown result type (might be due to invalid IL or missing references) //IL_05e6: Expected O, but got Unknown //IL_05f8: Unknown result type (might be due to invalid IL or missing references) //IL_0690: Unknown result type (might be due to invalid IL or missing references) //IL_0697: Expected O, but got Unknown //IL_06db: Unknown result type (might be due to invalid IL or missing references) //IL_06e0: Unknown result type (might be due to invalid IL or missing references) //IL_06ec: Unknown result type (might be due to invalid IL or missing references) //IL_06f6: Expected O, but got Unknown //IL_06f8: Unknown result type (might be due to invalid IL or missing references) //IL_06fd: Unknown result type (might be due to invalid IL or missing references) //IL_0709: Unknown result type (might be due to invalid IL or missing references) //IL_0712: Expected O, but got Unknown //IL_071a: Unknown result type (might be due to invalid IL or missing references) //IL_0721: Expected O, but got Unknown //IL_0733: Unknown result type (might be due to invalid IL or missing references) //IL_07ca: Unknown result type (might be due to invalid IL or missing references) //IL_07d1: Expected O, but got Unknown //IL_0807: Unknown result type (might be due to invalid IL or missing references) //IL_080c: Unknown result type (might be due to invalid IL or missing references) //IL_0818: Unknown result type (might be due to invalid IL or missing references) //IL_0822: Expected O, but got Unknown //IL_0824: Unknown result type (might be due to invalid IL or missing references) //IL_0829: Unknown result type (might be due to invalid IL or missing references) //IL_0835: Unknown result type (might be due to invalid IL or missing references) //IL_083e: Expected O, but got Unknown //IL_0846: Unknown result type (might be due to invalid IL or missing references) //IL_084d: Expected O, but got Unknown //IL_087a: Unknown result type (might be due to invalid IL or missing references) //IL_0911: Unknown result type (might be due to invalid IL or missing references) //IL_0918: Expected O, but got Unknown //IL_094e: Unknown result type (might be due to invalid IL or missing references) //IL_0953: Unknown result type (might be due to invalid IL or missing references) //IL_095f: Unknown result type (might be due to invalid IL or missing references) //IL_0968: Expected O, but got Unknown //IL_096a: Unknown result type (might be due to invalid IL or missing references) //IL_096f: Unknown result type (might be due to invalid IL or missing references) //IL_097b: Unknown result type (might be due to invalid IL or missing references) //IL_0984: Expected O, but got Unknown //IL_0986: Unknown result type (might be due to invalid IL or missing references) //IL_098b: Unknown result type (might be due to invalid IL or missing references) //IL_0997: Unknown result type (might be due to invalid IL or missing references) //IL_09a0: Expected O, but got Unknown //IL_09a2: Unknown result type (might be due to invalid IL or missing references) //IL_09a7: Unknown result type (might be due to invalid IL or missing references) //IL_09b3: Unknown result type (might be due to invalid IL or missing references) //IL_09bc: Expected O, but got Unknown //IL_09c4: Unknown result type (might be due to invalid IL or missing references) //IL_09cb: Expected O, but got Unknown //IL_0a1a: Unknown result type (might be due to invalid IL or missing references) //IL_0a21: Expected O, but got Unknown //IL_0a58: Unknown result type (might be due to invalid IL or missing references) //IL_0a5d: Unknown result type (might be due to invalid IL or missing references) //IL_0a69: Unknown result type (might be due to invalid IL or missing references) //IL_0a72: Expected O, but got Unknown //IL_0a7a: Unknown result type (might be due to invalid IL or missing references) //IL_0a81: Expected O, but got Unknown //IL_0aae: Unknown result type (might be due to invalid IL or missing references) //IL_0b3b: Unknown result type (might be due to invalid IL or missing references) //IL_0b40: Unknown result type (might be due to invalid IL or missing references) //IL_0b4c: Unknown result type (might be due to invalid IL or missing references) //IL_0b58: Unknown result type (might be due to invalid IL or missing references) //IL_0b66: Expected O, but got Unknown //IL_0b61: Unknown result type (might be due to invalid IL or missing references) //IL_0b68: Expected O, but got Unknown //IL_0b7f: Unknown result type (might be due to invalid IL or missing references) //IL_0b86: Expected O, but got Unknown //IL_0bbc: Unknown result type (might be due to invalid IL or missing references) //IL_0bc1: Unknown result type (might be due to invalid IL or missing references) //IL_0bcd: Unknown result type (might be due to invalid IL or missing references) //IL_0bd6: Expected O, but got Unknown //IL_0bd8: Unknown result type (might be due to invalid IL or missing references) //IL_0bdd: Unknown result type (might be due to invalid IL or missing references) //IL_0be9: Unknown result type (might be due to invalid IL or missing references) //IL_0bf2: Expected O, but got Unknown //IL_0bf4: Unknown result type (might be due to invalid IL or missing references) //IL_0bf9: Unknown result type (might be due to invalid IL or missing references) //IL_0c05: Unknown result type (might be due to invalid IL or missing references) //IL_0c0e: Expected O, but got Unknown //IL_0c16: Unknown result type (might be due to invalid IL or missing references) //IL_0c1d: Expected O, but got Unknown //IL_0c6c: Unknown result type (might be due to invalid IL or missing references) //IL_0c73: Expected O, but got Unknown //IL_0c93: Unknown result type (might be due to invalid IL or missing references) //IL_0c98: Unknown result type (might be due to invalid IL or missing references) //IL_0ca4: Unknown result type (might be due to invalid IL or missing references) //IL_0cad: Expected O, but got Unknown //IL_0cb5: Unknown result type (might be due to invalid IL or missing references) //IL_0cbc: Expected O, but got Unknown //IL_0ce9: Unknown result type (might be due to invalid IL or missing references) //IL_0d76: Unknown result type (might be due to invalid IL or missing references) //IL_0d7b: Unknown result type (might be due to invalid IL or missing references) //IL_0d87: Unknown result type (might be due to invalid IL or missing references) //IL_0d93: Unknown result type (might be due to invalid IL or missing references) //IL_0da1: Expected O, but got Unknown //IL_0d9c: Unknown result type (might be due to invalid IL or missing references) //IL_0da3: Expected O, but got Unknown ZLog.Log((object)"VRP WINE"); try { GameObject prefab = PrefabManager.Instance.GetPrefab("MeadTasty"); ItemDrop component = prefab.GetComponent<ItemDrop>(); StatusEffect obj = Object.Instantiate<StatusEffect>(component.m_itemData.m_shared.m_consumeStatusEffect); SE_Stats val = (SE_Stats)(object)((obj is SE_Stats) ? obj : null); if ((Object)(object)val != (Object)null) { ((Object)val).name = "se_alcohol"; ((StatusEffect)val).m_cooldown = 3f; ((StatusEffect)val).m_name = "Tipsy"; ((StatusEffect)val).m_tooltip = "Alcohol is great!"; val.m_healthOverTime = 0f; val.m_staminaRegenMultiplier = 3f; val.m_healthRegenMultiplier = 0.5f; ((StatusEffect)val).m_ttl = 10f; } CustomStatusEffect val2 = new CustomStatusEffect((StatusEffect)(object)val, false); ItemManager.Instance.AddStatusEffect(val2); StatusEffect obj2 = Object.Instantiate<StatusEffect>(component.m_itemData.m_shared.m_consumeStatusEffect); SE_Stats val3 = (SE_Stats)(object)((obj2 is SE_Stats) ? obj2 : null); if ((Object)(object)val3 != (Object)null) { ((Object)val3).name = "Musty"; ((StatusEffect)val3).m_cooldown = 300f; ((StatusEffect)val3).m_name = "Musty"; ((StatusEffect)val3).m_tooltip = "this feels strange"; val3.m_healthOverTime = 0f; val3.m_staminaRegenMultiplier = 1f; val3.m_healthRegenMultiplier = 1f; ((StatusEffect)val3).m_ttl = 600f; } CustomStatusEffect val4 = new CustomStatusEffect((StatusEffect)(object)val3, false); ItemManager.Instance.AddStatusEffect(val4); StatusEffect obj3 = Object.Instantiate<StatusEffect>(component.m_itemData.m_shared.m_consumeStatusEffect); SE_Stats val5 = (SE_Stats)(object)((obj3 is SE_Stats) ? obj3 : null); if ((Object)(object)val5 != (Object)null) { ((Object)val5).name = "Poozy"; ((StatusEffect)val5).m_cooldown = 600f; ((StatusEffect)val5).m_name = "Poozy"; ((StatusEffect)val5).m_tooltip = "i have a sinking feeling about this"; val5.m_healthOverTime = 0f; val5.m_staminaRegenMultiplier = 1f; val5.m_healthRegenMultiplier = 1f; ((StatusEffect)val5).m_ttl = 20f; } CustomStatusEffect val6 = new CustomStatusEffect((StatusEffect)(object)val5, false); ItemManager.Instance.AddStatusEffect(val6); StatusEffect obj4 = Object.Instantiate<StatusEffect>(component.m_itemData.m_shared.m_consumeStatusEffect); SE_Stats val7 = (SE_Stats)(object)((obj4 is SE_Stats) ? obj4 : null); if ((Object)(object)val7 != (Object)null) { ((Object)val7).name = "se_juiced"; ((StatusEffect)val7).m_cooldown = 15f; (