Decompiled source of Shawesomes Dark Gift v2.0.3
Shawesomes_Dark_Gift.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.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 BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Jotunn.Configs; using Jotunn.Entities; using Jotunn.Managers; using Jotunn.Utils; using Microsoft.CodeAnalysis; using Shawesomes_Dark_Gift.Core; using Shawesomes_Dark_Gift.Patches; using Shawesomes_Dark_Gift.Registration; using Shawesomes_Dark_Gift.Shader; using UnityEngine; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("Shawesomes_Infinte_Multiverse")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Shawesomes_Infinte_Multiverse")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("e0e26f8d-a8f0-41a7-a502-951624fa6f31")] [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] 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; } } } namespace Shawesomes_Dark_Gift { [BepInPlugin("Shawesome.Shawesomes_Dark_Gift", "Shawesomes_Dark_Gift", "2.0.3")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Shawesomes_Dark_Gift : BaseUnityPlugin { public static GameObject Root = null; public static ManualLogSource logger = null; public static ManualLogSource harmonyLog = null; private static AssetBundle Shawcassets = null; public static List<GameObject> EffectList = new List<GameObject>(); public string version = "1.0.0"; public Harmony harmony = null; public static AssetBundle GetAssetBundle() { return Shawcassets; } public void Awake() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Expected O, but got Unknown logger = ((BaseUnityPlugin)this).Logger; VanillaShaders.InitLogFilter(); harmony = new Harmony("IDshawesome4u5"); harmony.PatchAll(typeof(VampireConsumptionPatch)); harmony.PatchAll(typeof(VampireRespawnPatch)); harmony.PatchAll(typeof(ObjectDBAwakePatch)); harmony.PatchAll(typeof(SimpleMountController.MountControlsPatch)); harmony.PatchAll(typeof(SimpleMountController.FlightControlPatch)); harmony.PatchAll(typeof(SimpleMountController.EnableFlightOnMount)); harmony.PatchAll(typeof(SimpleMountController.DisableFlightOnDismount)); harmony.PatchAll(typeof(SimpleMountController.InputUpdatePatch)); harmony.PatchAll(typeof(SimpleMountController.DisableGravityWhileFlying)); harmony.PatchAll(typeof(SimpleMountController.FlyingPhysicsPatch)); harmony.PatchAll(typeof(DragonEggImprinting)); harmony.PatchAll(typeof(SaddleActivationPatch)); harmony.PatchAll(typeof(SaddleArmorSystem)); harmony.PatchAll(typeof(HomingProjectilePatch)); harmony.PatchAll(typeof(VampireEquipmentRestrictionPatch)); harmony.PatchAll(typeof(VampireEquipmentUseRestrictionPatch)); Root = new GameObject("Shaw Root"); harmonyLog = ((BaseUnityPlugin)this).Logger; harmonyLog.LogWarning((object)"The Bird of Hermes is my name, eating my wings to make me tame..."); Shawcassets = AssetUtils.LoadAssetBundleFromResources("shaw_v", Assembly.GetExecutingAssembly()); LoadAssets(); VampireConfig.Initialize(((BaseUnityPlugin)this).Config); Root.AddComponent<VampireSystem>(); Root.AddComponent<VampireGift>(); Root.AddComponent<ClockUI>(); Root.AddComponent<BloodHungerHUD>(); Root.AddComponent<ElixirConsumption>(); Root.AddComponent<BatCommandSystem>(); Root.AddComponent<BatSummonSystem>(); Root.AddComponent<SaddleArmorHUD>(); PrefabManager.OnVanillaPrefabsAvailable += additems; ZoneManager.OnVanillaLocationsAvailable += AddLocations; PrefabManager.OnPrefabsRegistered += delegate { AddEffectsToZNet(); AddBloodDropsToCreatures(); }; } public static void LoadAssets() { EffectList.Add(Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/Bat1.prefab")); EffectList.Add(Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/Batdraculaspawn.prefab")); EffectList.Add(Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/drac_taunt.prefab")); EffectList.Add(Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/sfx_fenring_howl1.prefab")); EffectList.Add(Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampHunter/sfx_whip_hit.prefab")); EffectList.Add(Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampHunter/sfx_whip_start.prefab")); EffectList.Add(Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/sfx_Puke_maleV.prefab")); EffectList.Add(Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/caverock_ice_wall_destruction1.prefab")); EffectList.Add(Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/caverock_ice_stalagmite_destruction1.prefab")); EffectList.Add(Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/fx_PukeV.prefab")); EffectList.Add(Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/_VampireDragon/Assets/Fireball/Prefabs/vampdragon_fireball_projectile.prefab")); EffectList.Add(Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/_VampireDragon/Assets/Fireball/Prefabs/vampdragon_spitball_projectile1.prefab")); EffectList.Add(Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/_VampireDragon/Assets/Fireball/Prefabs/fx_fireball_staff_explosiondragon.prefab")); EffectList.Add(Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/sfx_dragonball_explosion.prefab")); EffectList.Add(Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/vfx_Bloodshwsm.prefab")); EffectList.Add(Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/_VampireDragon/Assets/Firebreath/Prefabs/fx_vdrag_flames.prefab")); EffectList.Add(Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/_VampireDragon/Resources/FX/sfx_sdg_vampiredragon_groundslam.prefab")); EffectList.Add(Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/_VampireDragon/Resources/FX/fx_sdg_vampiredragon_groundslam.prefab")); EffectList.Add(Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/_VampireDragon/Resources/FX/vdragpoff_ring.prefab")); EffectList.Add(Shawcassets.LoadAsset<GameObject>("Assets/PrefabInstance/vdrac_attack_claw.prefab")); EffectList.Add(Shawcassets.LoadAsset<GameObject>("Assets/PrefabInstance/Vdrac_attack_kick.prefab")); EffectList.Add(Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/shwsm_Dragulia_Ragdoll.prefab")); EffectList.Add(Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/sfx_vampdrag_fireball_launch.prefab")); EffectList.Add(Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/sdg_vampiredragon_ragdoll.prefab")); EffectList.Add(Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/sfx_vampdragon_scream.prefab")); EffectList.Add(Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/windparent.prefab")); EffectList.Add(Shawcassets.LoadAsset<GameObject>("Assets/Shawesome/fx_vdragonlightning_red.prefab")); EffectList.Add(Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/_VampireDragon/Assets/Firebreath/Prefabs/fx_vdrag_flamesstart.prefab")); VampireGift.VampireSkinMaterial_Tier1 = Shawcassets.LoadAsset<Material>("vI_mat"); VampireGift.VampireSkinMaterial_Tier2 = Shawcassets.LoadAsset<Material>("vII_mat"); VampireGift.VampireSkinMaterial_Tier3 = Shawcassets.LoadAsset<Material>("vIII_mat"); VampireGift.VampireSkinMaterial_Tier4 = Shawcassets.LoadAsset<Material>("vIV_mat"); } public static void AddEffectsToZNet() { foreach (GameObject effect in EffectList) { if ((Object)(object)effect == (Object)null) { ManualLogSource obj = logger; if (obj != null) { obj.LogWarning((object)"Skipping null effect in EffectList"); } } else { int stableHashCode = StringExtensionMethods.GetStableHashCode(((Object)effect).name); if ((Object)(object)ZNetScene.instance != (Object)null && !ZNetScene.instance.m_namedPrefabs.ContainsKey(stableHashCode)) { PrefabManager.Instance.RegisterToZNetScene(effect); } } } } public static void AddLocations() { AddDraculaAltar(); ZoneManager.OnVanillaLocationsAvailable -= AddLocations; } private static void AddDraculaAltar() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Expected O, but got Unknown GameObject val = Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/Shwsmdracaltar.prefab"); RegisterLocationClutter(val); LocationConfig val2 = new LocationConfig(); val2.Biome = (Biome)64; val2.Quantity = 10; val2.Priotized = true; val2.ExteriorRadius = 25f; val2.ClearArea = true; val2.MinAltitude = 10f; val2.MaxAltitude = 100f; val2.MinTerrainDelta = 0f; val2.MaxTerrainDelta = 2f; val2.InForest = false; val2.ForestTresholdMin = 0f; val2.ForestTrasholdMax = 2.19f; val2.MinDistance = 500f; val2.MaxDistance = 50000f; val2.MinDistanceFromSimilar = 1350f; val2.Unique = false; val2.Group = "DraculaAltar"; val2.BiomeArea = (BiomeArea)3; CustomLocation val3 = new CustomLocation(val, true, val2); ZoneManager.Instance.AddCustomLocation(val3); } private static void RegisterLocationClutter(GameObject locationPrefab) { ZNetView[] componentsInChildren = locationPrefab.GetComponentsInChildren<ZNetView>(true); ZNetView[] array = componentsInChildren; foreach (ZNetView val in array) { if (!((Object)(object)((Component)val).gameObject == (Object)(object)locationPrefab)) { int stableHashCode = StringExtensionMethods.GetStableHashCode(((Object)((Component)val).gameObject).name); if ((Object)(object)ZNetScene.instance != (Object)null && !ZNetScene.instance.m_namedPrefabs.ContainsKey(stableHashCode)) { PrefabManager.Instance.RegisterToZNetScene(((Component)val).gameObject); } } } } public static void additems() { Adddraculaboss(); Addvdragon(); AddDragonegg(); Addsaddle(); AddVampireDragonWeapons(); AddBlood(); Adddbeitr(); Addsunblock(); AddDarkGift(); AddDarkGiftII(); AddDarkGiftIII(); AddDarkGiftIV(); AddCure(); Addvsword(); Adddwhip(); Addchainmace(); Adddvcape(); Adddvlegs(); Adddvschest(); Adddvshelm(); Addfvslegs(); Addfvschest(); Addfvshelm(); Addberserklegs(); Addberserkchest(); Addberserkhelm(); Addslayerbow(); Addslayersword(); Addslayersword2(); Addboc(); Addboc1(); PrefabManager.OnVanillaPrefabsAvailable -= additems; } public static void Adddvcape() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown ItemConfig val = new ItemConfig(); val.AddRequirement(new RequirementConfig("FlametalNew", 30, 15, false)); val.AddRequirement(new RequirementConfig("GemstoneRed", 4, 1, false)); val.AddRequirement(new RequirementConfig("BlackMetal", 20, 10, false)); val.CraftingStation = CraftingStations.BlackForge; val.MinStationLevel = 1; GameObject val2 = Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/shwsmdvarmorcape.prefab"); CustomItem val3 = new CustomItem(val2, true, val); ItemManager.Instance.AddItem(val3); } public static void Adddvlegs() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown ItemConfig val = new ItemConfig(); val.AddRequirement(new RequirementConfig("FlametalNew", 30, 15, false)); val.AddRequirement(new RequirementConfig("GemstoneRed", 4, 1, false)); val.AddRequirement(new RequirementConfig("BlackMetal", 20, 10, false)); val.CraftingStation = CraftingStations.BlackForge; val.MinStationLevel = 1; GameObject val2 = Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/shwsmdvarmorlegs.prefab"); CustomItem val3 = new CustomItem(val2, true, val); ItemManager.Instance.AddItem(val3); } public static void Adddvschest() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown ItemConfig val = new ItemConfig(); val.AddRequirement(new RequirementConfig("FlametalNew", 30, 15, false)); val.AddRequirement(new RequirementConfig("GemstoneRed", 4, 1, false)); val.AddRequirement(new RequirementConfig("BlackMetal", 20, 10, false)); val.CraftingStation = CraftingStations.BlackForge; val.MinStationLevel = 1; GameObject val2 = Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/shwsmdvarmorchest.prefab"); CustomItem val3 = new CustomItem(val2, true, val); ItemManager.Instance.AddItem(val3); } public static void Adddvshelm() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown ItemConfig val = new ItemConfig(); val.AddRequirement(new RequirementConfig("FlametalNew", 30, 15, false)); val.AddRequirement(new RequirementConfig("GemstoneRed", 4, 1, false)); val.AddRequirement(new RequirementConfig("BlackMetal", 20, 10, false)); val.CraftingStation = CraftingStations.BlackForge; val.MinStationLevel = 1; GameObject val2 = Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/shwsmdvarmorhead.prefab"); CustomItem val3 = new CustomItem(val2, true, val); ItemManager.Instance.AddItem(val3); } public static void Addfvslegs() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown ItemConfig val = new ItemConfig(); val.AddRequirement(new RequirementConfig("FlametalNew", 30, 15, false)); val.AddRequirement(new RequirementConfig("GemstoneRed", 4, 1, false)); val.AddRequirement(new RequirementConfig("BlackMetal", 20, 10, false)); val.CraftingStation = CraftingStations.BlackForge; val.MinStationLevel = 1; GameObject val2 = Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampHunter/shwsmfvhlegs.prefab"); CustomItem val3 = new CustomItem(val2, true, val); ItemManager.Instance.AddItem(val3); } public static void Addfvschest() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown ItemConfig val = new ItemConfig(); val.AddRequirement(new RequirementConfig("FlametalNew", 30, 15, false)); val.AddRequirement(new RequirementConfig("GemstoneRed", 4, 1, false)); val.AddRequirement(new RequirementConfig("BlackMetal", 20, 10, false)); val.CraftingStation = CraftingStations.BlackForge; val.MinStationLevel = 1; GameObject val2 = Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampHunter/shwsmfvhchest.prefab"); CustomItem val3 = new CustomItem(val2, true, val); ItemManager.Instance.AddItem(val3); } public static void Addfvshelm() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown ItemConfig val = new ItemConfig(); val.AddRequirement(new RequirementConfig("FlametalNew", 30, 15, false)); val.AddRequirement(new RequirementConfig("GemstoneRed", 4, 1, false)); val.AddRequirement(new RequirementConfig("BlackMetal", 20, 10, false)); val.CraftingStation = CraftingStations.BlackForge; val.MinStationLevel = 1; GameObject val2 = Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampHunter/shwsmfvhhelm.prefab"); CustomItem val3 = new CustomItem(val2, true, val); ItemManager.Instance.AddItem(val3); } public static void Addboc1() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Expected O, but got Unknown ItemConfig val = new ItemConfig(); val.AddRequirement(new RequirementConfig("FlametalNew", 10, 10, false)); val.AddRequirement(new RequirementConfig("TrophyFader", 1, 0, false)); val.AddRequirement(new RequirementConfig("GemstoneRed", 1, 1, false)); val.AddRequirement(new RequirementConfig("BlackMetal", 10, 10, false)); val.CraftingStation = CraftingStations.BlackForge; val.MinStationLevel = 1; GameObject val2 = Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampHunter/shwsm_BOC_chains.prefab"); CustomItem val3 = new CustomItem(val2, true, val); ItemManager.Instance.AddItem(val3); } public static void Addboc() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Expected O, but got Unknown ItemConfig val = new ItemConfig(); val.AddRequirement(new RequirementConfig("FlametalNew", 10, 10, false)); val.AddRequirement(new RequirementConfig("TrophyFader", 1, 0, false)); val.AddRequirement(new RequirementConfig("GemstoneRed", 1, 1, false)); val.AddRequirement(new RequirementConfig("BlackMetal", 10, 10, false)); val.CraftingStation = CraftingStations.BlackForge; val.MinStationLevel = 1; GameObject val2 = Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampHunter/shwsmboc.prefab"); CustomItem val3 = new CustomItem(val2, true, val); ItemManager.Instance.AddItem(val3); } public static void Addslayersword2() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Expected O, but got Unknown ItemConfig val = new ItemConfig(); val.AddRequirement(new RequirementConfig("FlametalNew", 10, 10, false)); val.AddRequirement(new RequirementConfig("TrophyFader", 1, 0, false)); val.AddRequirement(new RequirementConfig("GemstoneRed", 1, 1, false)); val.AddRequirement(new RequirementConfig("BlackMetal", 10, 10, false)); val.CraftingStation = CraftingStations.BlackForge; val.MinStationLevel = 1; GameObject val2 = Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampHunter/shwsmdsds1.prefab"); CustomItem val3 = new CustomItem(val2, true, val); ItemManager.Instance.AddItem(val3); } public static void Addslayersword() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown ItemConfig val = new ItemConfig(); val.AddRequirement(new RequirementConfig("FlametalNew", 60, 15, false)); val.AddRequirement(new RequirementConfig("TrophyFader", 1, 1, false)); val.AddRequirement(new RequirementConfig("GemstoneRed", 10, 4, false)); val.AddRequirement(new RequirementConfig("shwsmdsds1", 1, 0, false)); val.CraftingStation = CraftingStations.BlackForge; val.MinStationLevel = 1; GameObject val2 = Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampHunter/shwsmdsds.prefab"); CustomItem val3 = new CustomItem(val2, true, val); ItemManager.Instance.AddItem(val3); } public static void Addslayerbow() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Expected O, but got Unknown ItemConfig val = new ItemConfig(); val.AddRequirement(new RequirementConfig("FlametalNew", 5, 10, false)); val.AddRequirement(new RequirementConfig("GemstoneRed", 1, 1, false)); val.AddRequirement(new RequirementConfig("BlackMetal", 10, 10, false)); val.CraftingStation = CraftingStations.BlackForge; val.MinStationLevel = 1; GameObject val2 = Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampHunter/shwsmdsbow.prefab"); CustomItem val3 = new CustomItem(val2, true, val); ItemManager.Instance.AddItem(val3); } public static void Addberserklegs() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown ItemConfig val = new ItemConfig(); val.AddRequirement(new RequirementConfig("FlametalNew", 30, 15, false)); val.AddRequirement(new RequirementConfig("GemstoneRed", 4, 1, false)); val.AddRequirement(new RequirementConfig("BlackMetal", 20, 10, false)); val.CraftingStation = CraftingStations.BlackForge; val.MinStationLevel = 1; GameObject val2 = Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampHunter/shwsmdslegs.prefab"); CustomItem val3 = new CustomItem(val2, true, val); ItemManager.Instance.AddItem(val3); } public static void Addberserkchest() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown ItemConfig val = new ItemConfig(); val.AddRequirement(new RequirementConfig("FlametalNew", 30, 15, false)); val.AddRequirement(new RequirementConfig("GemstoneRed", 4, 1, false)); val.AddRequirement(new RequirementConfig("BlackMetal", 20, 10, false)); val.CraftingStation = CraftingStations.BlackForge; val.MinStationLevel = 1; GameObject val2 = Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampHunter/shwsmdschest.prefab"); CustomItem val3 = new CustomItem(val2, true, val); ItemManager.Instance.AddItem(val3); } public static void Addberserkhelm() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown ItemConfig val = new ItemConfig(); val.AddRequirement(new RequirementConfig("FlametalNew", 30, 15, false)); val.AddRequirement(new RequirementConfig("GemstoneRed", 4, 1, false)); val.AddRequirement(new RequirementConfig("BlackMetal", 20, 10, false)); val.CraftingStation = CraftingStations.BlackForge; val.MinStationLevel = 1; GameObject val2 = Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampHunter/shwsmdshelm.prefab"); CustomItem val3 = new CustomItem(val2, true, val); ItemManager.Instance.AddItem(val3); } public static void Addchainmace() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown ItemConfig val = new ItemConfig(); val.AddRequirement(new RequirementConfig("FlametalNew", 30, 15, false)); val.AddRequirement(new RequirementConfig("GemstoneRed", 4, 4, false)); val.AddRequirement(new RequirementConfig("BlackMetal", 20, 10, false)); val.CraftingStation = CraftingStations.BlackForge; val.MinStationLevel = 1; GameObject val2 = Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampHunter/shwsm_vslayer_mace.prefab"); CustomItem val3 = new CustomItem(val2, true, val); ItemManager.Instance.AddItem(val3); } public static void Addsaddle() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Expected O, but got Unknown ItemConfig val = new ItemConfig(); val.AddRequirement(new RequirementConfig("FlametalNew", 50, 10, false)); val.AddRequirement(new RequirementConfig("TrophyFader", 1, 0, false)); val.AddRequirement(new RequirementConfig("YggdrasilWood", 40, 0, false)); val.AddRequirement(new RequirementConfig("BlackMetal", 20, 10, false)); val.CraftingStation = CraftingStations.BlackForge; val.MinStationLevel = 1; GameObject val2 = Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/shwsmvdracsaddle.prefab"); CustomItem val3 = new CustomItem(val2, true, val); ItemManager.Instance.AddItem(val3); } public static void AddVampireDragonWeapons() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Expected O, but got Unknown //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Expected O, but got Unknown //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Expected O, but got Unknown //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Expected O, but got Unknown //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Expected O, but got Unknown //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Expected O, but got Unknown GameObject val = Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/_VampireDragon/Prefabs/Attacks/VampireDragonLeftClawSlam.prefab"); if ((Object)(object)val != (Object)null) { CustomItem val2 = new CustomItem(val, false); ItemManager.Instance.AddItem(val2); } GameObject val3 = Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/_VampireDragon/Prefabs/Attacks/VampireDragonRightClawSwipe.prefab"); if ((Object)(object)val3 != (Object)null) { CustomItem val4 = new CustomItem(val3, false); ItemManager.Instance.AddItem(val4); } GameObject val5 = Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/_VampireDragon/Prefabs/Attacks/VampireDragonFirebreath.prefab"); if ((Object)(object)val5 != (Object)null) { CustomItem val6 = new CustomItem(val5, false); ItemManager.Instance.AddItem(val6); } GameObject val7 = Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/_VampireDragon/Prefabs/Attacks/VampireDragonFireball.prefab"); if ((Object)(object)val7 != (Object)null) { CustomItem val8 = new CustomItem(val7, false); ItemManager.Instance.AddItem(val8); } GameObject val9 = Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/_VampireDragon/Prefabs/Attacks/VampireDragonFireballflying.prefab"); if ((Object)(object)val9 != (Object)null) { CustomItem val10 = new CustomItem(val9, false); ItemManager.Instance.AddItem(val10); } GameObject val11 = Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/_VampireDragon/Prefabs/Attacks/VampireDragonFirebreathflying.prefab"); if ((Object)(object)val11 != (Object)null) { CustomItem val12 = new CustomItem(val11, false); ItemManager.Instance.AddItem(val12); } GameObject val13 = Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/_VampireDragon/Prefabs/Attacks/VampireDragonStunt.prefab"); if ((Object)(object)val13 != (Object)null) { CustomItem val14 = new CustomItem(val13, false); ItemManager.Instance.AddItem(val14); } GameObject val15 = Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/_VampireDragon/Prefabs/Attacks/VampireDragonspitfireflying.prefab"); if ((Object)(object)val15 != (Object)null) { CustomItem val16 = new CustomItem(val15, false); ItemManager.Instance.AddItem(val16); } } public static void Addvdragon() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown CreatureConfig val = new CreatureConfig(); GameObject val2 = Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/sdg_vampiredragon.prefab"); CustomCreature val3 = new CustomCreature(val2, true, val); CreatureManager.Instance.AddCreature(val3); } public static void Adddraculaboss() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown CreatureConfig val = new CreatureConfig(); GameObject val2 = Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/shwsm_Dragulia.prefab"); CustomCreature val3 = new CustomCreature(val2, true, val); CreatureManager.Instance.AddCreature(val3); } public static void Addsunblock() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Expected O, but got Unknown ItemConfig val = new ItemConfig(); val.AddRequirement(new RequirementConfig("Tar", 10, 0, false)); val.AddRequirement(new RequirementConfig("DragonTear", 1, 0, false)); val.AddRequirement(new RequirementConfig("AncientSeed", 10, 0, false)); val.CraftingStation = CraftingStations.Cauldron; val.MinStationLevel = 1; val.Amount = 10; GameObject val2 = Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/shwsmsunblock.prefab"); CustomItem val3 = new CustomItem(val2, true, val); ItemManager.Instance.AddItem(val3); } public static void Adddbeitr() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Expected O, but got Unknown ItemConfig val = new ItemConfig(); val.AddRequirement(new RequirementConfig("Sap", 5, 0, false)); val.AddRequirement(new RequirementConfig("SBlood", 10, 0, false)); val.AddRequirement(new RequirementConfig("Honey", 20, 0, false)); val.CraftingStation = CraftingStations.Cauldron; val.MinStationLevel = 1; GameObject val2 = Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/shwsmbloodeitr.prefab"); CustomItem val3 = new CustomItem(val2, true, val); ItemManager.Instance.AddItem(val3); } public static void Addvsword() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Expected O, but got Unknown ItemConfig val = new ItemConfig(); val.AddRequirement(new RequirementConfig("FlametalNew", 50, 20, false)); val.AddRequirement(new RequirementConfig("TrophyFader", 1, 0, false)); val.AddRequirement(new RequirementConfig("GemstoneRed", 4, 4, false)); val.AddRequirement(new RequirementConfig("BlackMetal", 50, 20, false)); val.CraftingStation = CraftingStations.BlackForge; val.MinStationLevel = 1; GameObject val2 = Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/shwsmvblade.prefab"); CustomItem val3 = new CustomItem(val2, true, val); ItemManager.Instance.AddItem(val3); } public static void Adddwhip() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown ItemConfig val = new ItemConfig(); val.AddRequirement(new RequirementConfig("FlametalNew", 30, 15, false)); val.AddRequirement(new RequirementConfig("GemstoneRed", 4, 4, false)); val.AddRequirement(new RequirementConfig("BlackMetal", 20, 10, false)); val.CraftingStation = CraftingStations.BlackForge; val.MinStationLevel = 1; GameObject val2 = Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampHunter/shwsm_vslayer_whip.prefab"); CustomItem val3 = new CustomItem(val2, true, val); ItemManager.Instance.AddItem(val3); } public static void AddDragonegg() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown ItemConfig val = new ItemConfig(); GameObject val2 = Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/shwsmvdragegg.prefab"); CustomItem val3 = new CustomItem(val2, true, val); ItemManager.Instance.AddItem(val3); Drop val4 = new Drop(); val4.m_chance = 0.5f; val4.m_dontScale = true; val4.m_levelMultiplier = false; val4.m_prefab = PrefabManager.Instance.GetPrefab(((Object)val3.ItemPrefab).name); val4.m_amountMax = 1; val4.m_amountMin = 1; GameObject prefab = PrefabManager.Instance.GetPrefab("shwsm_Dragulia"); if ((Object)(object)prefab != (Object)null && (Object)(object)prefab.GetComponent<CharacterDrop>() != (Object)null) { prefab.GetComponent<CharacterDrop>().m_drops.Add(val4); } } public static void AddDarkGiftIV() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown ItemConfig val = new ItemConfig(); GameObject val2 = Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/shwsmDarkGiftIV.prefab"); CustomItem val3 = new CustomItem(val2, true, val); ItemManager.Instance.AddItem(val3); Drop val4 = new Drop(); val4.m_chance = 0.8f; val4.m_dontScale = true; val4.m_levelMultiplier = false; val4.m_prefab = PrefabManager.Instance.GetPrefab(((Object)val3.ItemPrefab).name); val4.m_amountMax = 4; val4.m_amountMin = 1; GameObject prefab = PrefabManager.Instance.GetPrefab("shwsm_Dragulia"); if ((Object)(object)prefab != (Object)null && (Object)(object)prefab.GetComponent<CharacterDrop>() != (Object)null) { prefab.GetComponent<CharacterDrop>().m_drops.Add(val4); } } public static void AddDarkGiftIII() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown ItemConfig val = new ItemConfig(); GameObject val2 = Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/shwsmDarkGiftIII.prefab"); CustomItem val3 = new CustomItem(val2, true, val); ItemManager.Instance.AddItem(val3); Drop val4 = new Drop(); val4.m_chance = 0.8f; val4.m_dontScale = true; val4.m_levelMultiplier = false; val4.m_prefab = PrefabManager.Instance.GetPrefab(((Object)val3.ItemPrefab).name); val4.m_amountMax = 4; val4.m_amountMin = 1; GameObject prefab = PrefabManager.Instance.GetPrefab("SeekerQueen"); prefab.GetComponent<CharacterDrop>().m_drops.Add(val4); } public static void AddDarkGiftII() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown ItemConfig val = new ItemConfig(); GameObject val2 = Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/shwsmDarkGiftII.prefab"); CustomItem val3 = new CustomItem(val2, true, val); ItemManager.Instance.AddItem(val3); Drop val4 = new Drop(); val4.m_chance = 0.8f; val4.m_dontScale = true; val4.m_levelMultiplier = false; val4.m_prefab = PrefabManager.Instance.GetPrefab(((Object)val3.ItemPrefab).name); val4.m_amountMax = 4; val4.m_amountMin = 1; GameObject prefab = PrefabManager.Instance.GetPrefab("GoblinKing"); prefab.GetComponent<CharacterDrop>().m_drops.Add(val4); } public static void AddDarkGift() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown ItemConfig val = new ItemConfig(); GameObject val2 = Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/shwsmDarkGift.prefab"); CustomItem val3 = new CustomItem(val2, true, val); ItemManager.Instance.AddItem(val3); Drop val4 = new Drop(); val4.m_chance = 0.8f; val4.m_dontScale = true; val4.m_levelMultiplier = false; val4.m_prefab = PrefabManager.Instance.GetPrefab(((Object)val3.ItemPrefab).name); val4.m_amountMax = 4; val4.m_amountMin = 1; GameObject prefab = PrefabManager.Instance.GetPrefab("Dragon"); prefab.GetComponent<CharacterDrop>().m_drops.Add(val4); } public static void AddCure() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown ItemConfig val = new ItemConfig(); GameObject val2 = Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/shwsmcure.prefab"); CustomItem val3 = new CustomItem(val2, true, val); ItemManager.Instance.AddItem(val3); Drop val4 = new Drop(); val4.m_chance = 0.8f; val4.m_dontScale = true; val4.m_levelMultiplier = false; val4.m_prefab = PrefabManager.Instance.GetPrefab(((Object)val3.ItemPrefab).name); val4.m_amountMax = 4; val4.m_amountMin = 1; GameObject prefab = PrefabManager.Instance.GetPrefab("shwsm_Dragulia"); if ((Object)(object)prefab != (Object)null && (Object)(object)prefab.GetComponent<CharacterDrop>() != (Object)null) { prefab.GetComponent<CharacterDrop>().m_drops.Add(val4); } } public static void AddBlood() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown ItemConfig val = new ItemConfig(); GameObject val2 = Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeVampire/SBlood.prefab"); CustomItem val3 = new CustomItem(val2, true, val); ItemManager.Instance.AddItem(val3); } public static void RegisterVampireStatusEffectsToObjectDB(ObjectDB objectDB) { if ((Object)(object)objectDB == (Object)null) { return; } string[] array = new string[4] { "Assets/ShawesomeVampire/Vampire1_se.asset", "Assets/ShawesomeVampire/Vampire1_se1.asset", "Assets/ShawesomeVampire/Vampire1_se2.asset", "Assets/ShawesomeVampire/Vampire1_se3.asset" }; string[] array2 = array; foreach (string text in array2) { StatusEffect val = Shawcassets.LoadAsset<StatusEffect>(text); if ((Object)(object)val == (Object)null) { continue; } bool flag = false; foreach (StatusEffect statusEffect in objectDB.m_StatusEffects) { if ((Object)(object)statusEffect != (Object)null && ((Object)statusEffect).name == ((Object)val).name) { flag = true; break; } } if (!flag) { objectDB.m_StatusEffects.Add(val); } } StatusEffect val2 = Shawcassets.LoadAsset<StatusEffect>("Assets/ShawesomeVampire/PukeV.asset"); if ((Object)(object)val2 != (Object)null) { bool flag2 = false; foreach (StatusEffect statusEffect2 in objectDB.m_StatusEffects) { if ((Object)(object)statusEffect2 != (Object)null && ((Object)statusEffect2).name == ((Object)val2).name) { flag2 = true; break; } } if (!flag2) { objectDB.m_StatusEffects.Add(val2); ManualLogSource obj = logger; if (obj != null) { obj.LogInfo((object)("Registered " + ((Object)val2).name + " status effect from asset bundle")); } } } else { ManualLogSource obj2 = logger; if (obj2 != null) { obj2.LogWarning((object)"Could not load PukeV.asset from asset bundle!"); } } } public static void AddBloodDropsToCreatures() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown GameObject prefab = PrefabManager.Instance.GetPrefab("SBlood"); if ((Object)(object)prefab == (Object)null) { return; } Drop val = new Drop(); val.m_chance = 0.7f; val.m_dontScale = true; val.m_levelMultiplier = false; val.m_prefab = prefab; val.m_amountMax = 3; val.m_amountMin = 1; if (!((Object)(object)ZNetScene.instance != (Object)null) || ZNetScene.instance.m_prefabs == null) { return; } int num = 0; foreach (GameObject prefab2 in ZNetScene.instance.m_prefabs) { if (!((Object)(object)prefab2 == (Object)null)) { CharacterDrop component = prefab2.GetComponent<CharacterDrop>(); if ((Object)(object)component != (Object)null && ((Object)(object)prefab2.GetComponent<Humanoid>() != (Object)null || (Object)(object)prefab2.GetComponent<Character>() != (Object)null)) { component.m_drops.Add(val); num++; } } } } public static T CopyIntoParent<T>(T go, T parent) where T : Component { //IL_0055: Unknown result type (might be due to invalid IL or missing references) T val = Object.Instantiate<T>(go); ((Object)(object)val).name = ((Object)(object)go).name; ((Component)val).transform.parent = ((Component)parent).transform; ((Component)val).transform.localPosition = new Vector3(0f, 0f, 0f); return val; } } } namespace Shawesomes_Dark_Gift.Shader { public static class VanillaShaders { private static bool s_logFilterInitialized; private static readonly HashSet<string> s_registeredPrefabs = new HashSet<string>(); public static void RegisterPrefab(string prefabName) { s_registeredPrefabs.Add(prefabName); } public static void AutoRegisterAllEffects() { if ((Object)(object)ZNetScene.instance == (Object)null) { Debug.LogWarning((object)"[VanillaShaders] ZNetScene not ready - cannot auto-register effects. Call this after ZNetScene is initialized."); return; } int num = 0; foreach (KeyValuePair<int, GameObject> namedPrefab in ZNetScene.instance.m_namedPrefabs) { GameObject value = namedPrefab.Value; if (!((Object)(object)value == (Object)null)) { string name = ((Object)value).name; if (!s_registeredPrefabs.Contains(name) && ((Object)(object)value.GetComponentInChildren<ParticleSystem>() != (Object)null || (Object)(object)value.GetComponentInChildren<Light>() != (Object)null || (Object)(object)value.GetComponentInChildren<AudioSource>() != (Object)null || value.GetComponent<EffectList>() != null)) { s_registeredPrefabs.Add(name); num++; } } } } public static void InitLogFilter() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Expected O, but got Unknown if (s_logFilterInitialized) { return; } s_logFilterInitialized = true; Harmony val = new Harmony("Shawesomes_Dark_Gift.VanillaShaders.LogFilter"); Type type = Type.GetType("BepInEx.Logging.UnityLogSource, BepInEx"); if (type != null) { MethodInfo method = type.GetMethod("OnUnityLogMessageReceived", BindingFlags.Static | BindingFlags.NonPublic); if (method != null) { val.Patch((MethodBase)method, new HarmonyMethod(typeof(VanillaShaders), "FilterUnityLogMessage", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } } } private static bool FilterUnityLogMessage(string message) { if (message != null && message.Contains("Failed to find expected binary shader data")) { return false; } return true; } } } namespace Shawesomes_Dark_Gift.Registration { public static class VampireConfig { public static ConfigEntry<float> TickInterval { get; set; } public static ConfigEntry<bool> Clock_Enabled { get; set; } public static ConfigEntry<bool> Clock_Use24HourFormat { get; set; } public static ConfigEntry<float> Clock_PositionX { get; set; } public static ConfigEntry<float> Clock_PositionY { get; set; } public static ConfigEntry<int> Clock_FontSize { get; set; } public static ConfigEntry<bool> BloodMeter_Enabled { get; set; } public static ConfigEntry<float> BloodMeter_PositionX { get; set; } public static ConfigEntry<float> BloodMeter_PositionY { get; set; } public static ConfigEntry<int> BloodMeter_FontSize { get; set; } public static ConfigEntry<float> BloodHunger_Tier1_Interval { get; set; } public static ConfigEntry<float> BloodHunger_Tier1_Damage { get; set; } public static ConfigEntry<float> BloodHunger_Tier1_HealthRestore { get; set; } public static ConfigEntry<float> BloodHunger_Tier2_Interval { get; set; } public static ConfigEntry<float> BloodHunger_Tier2_Damage { get; set; } public static ConfigEntry<float> BloodHunger_Tier2_HealthRestore { get; set; } public static ConfigEntry<float> BloodHunger_Tier3_Interval { get; set; } public static ConfigEntry<float> BloodHunger_Tier3_Damage { get; set; } public static ConfigEntry<float> BloodHunger_Tier3_HealthRestore { get; set; } public static ConfigEntry<float> BloodHunger_Tier4_Interval { get; set; } public static ConfigEntry<float> BloodHunger_Tier4_Damage { get; set; } public static ConfigEntry<float> BloodHunger_Tier4_HealthRestore { get; set; } public static ConfigEntry<string> BloodItem_Prefab { get; set; } public static ConfigEntry<string> CureItem_Prefab { get; set; } public static ConfigEntry<string> WhitelistItem_Prefab { get; set; } public static ConfigEntry<string> VampireOnlyEquipment_Prefab { get; set; } public static ConfigEntry<bool> WeatherProtection_Enabled { get; set; } public static ConfigEntry<string> WeatherProtection_Environments { get; set; } public static ConfigEntry<string> SunscreenItem_Prefab { get; set; } public static ConfigEntry<float> SunscreenItem_Duration { get; set; } public static ConfigEntry<bool> DarkGiftI_Enabled { get; set; } public static ConfigEntry<bool> DarkGiftI_EnableSFX { get; set; } public static ConfigEntry<bool> DarkGiftI_EnableVFX { get; set; } public static ConfigEntry<string> DarkGiftI_SFXPrefab { get; set; } public static ConfigEntry<string> DarkGiftI_VFXPrefab { get; set; } public static ConfigEntry<float> DarkGiftI_TickDamage { get; set; } public static ConfigEntry<float> DarkGiftI_DayStartHour { get; set; } public static ConfigEntry<float> DarkGiftI_DayEndHour { get; set; } public static ConfigEntry<float> DarkGiftI_WarningMinutesBefore { get; set; } public static ConfigEntry<string> DarkGiftI_WarningMessage { get; set; } public static ConfigEntry<float> DarkGiftI_SunsetWarningMinutesBefore { get; set; } public static ConfigEntry<string> DarkGiftI_SunsetWarningMessage { get; set; } public static ConfigEntry<bool> DarkGiftII_Enabled { get; set; } public static ConfigEntry<bool> DarkGiftII_EnableSFX { get; set; } public static ConfigEntry<bool> DarkGiftII_EnableVFX { get; set; } public static ConfigEntry<string> DarkGiftII_SFXPrefab { get; set; } public static ConfigEntry<string> DarkGiftII_VFXPrefab { get; set; } public static ConfigEntry<float> DarkGiftII_TickDamage { get; set; } public static ConfigEntry<float> DarkGiftII_DayStartHour { get; set; } public static ConfigEntry<float> DarkGiftII_DayEndHour { get; set; } public static ConfigEntry<float> DarkGiftII_WarningMinutesBefore { get; set; } public static ConfigEntry<string> DarkGiftII_WarningMessage { get; set; } public static ConfigEntry<float> DarkGiftII_SunsetWarningMinutesBefore { get; set; } public static ConfigEntry<string> DarkGiftII_SunsetWarningMessage { get; set; } public static ConfigEntry<bool> DarkGiftIII_Enabled { get; set; } public static ConfigEntry<bool> DarkGiftIII_EnableSFX { get; set; } public static ConfigEntry<bool> DarkGiftIII_EnableVFX { get; set; } public static ConfigEntry<string> DarkGiftIII_SFXPrefab { get; set; } public static ConfigEntry<string> DarkGiftIII_VFXPrefab { get; set; } public static ConfigEntry<float> DarkGiftIII_TickDamage { get; set; } public static ConfigEntry<float> DarkGiftIII_DayStartHour { get; set; } public static ConfigEntry<float> DarkGiftIII_DayEndHour { get; set; } public static ConfigEntry<float> DarkGiftIII_WarningMinutesBefore { get; set; } public static ConfigEntry<string> DarkGiftIII_WarningMessage { get; set; } public static ConfigEntry<float> DarkGiftIII_SunsetWarningMinutesBefore { get; set; } public static ConfigEntry<string> DarkGiftIII_SunsetWarningMessage { get; set; } public static ConfigEntry<bool> DarkGiftIV_Enabled { get; set; } public static ConfigEntry<bool> DarkGiftIV_EnableSFX { get; set; } public static ConfigEntry<bool> DarkGiftIV_EnableVFX { get; set; } public static ConfigEntry<string> DarkGiftIV_SFXPrefab { get; set; } public static ConfigEntry<string> DarkGiftIV_VFXPrefab { get; set; } public static ConfigEntry<float> DarkGiftIV_TickDamage { get; set; } public static ConfigEntry<float> DarkGiftIV_DayStartHour { get; set; } public static ConfigEntry<float> DarkGiftIV_DayEndHour { get; set; } public static ConfigEntry<float> DarkGiftIV_WarningMinutesBefore { get; set; } public static ConfigEntry<string> DarkGiftIV_WarningMessage { get; set; } public static ConfigEntry<float> DarkGiftIV_SunsetWarningMinutesBefore { get; set; } public static ConfigEntry<string> DarkGiftIV_SunsetWarningMessage { get; set; } public static ConfigEntry<string> Tier4_SkinToggleHotkey { get; set; } public static ConfigEntry<float> Tier4_SkinToggleCooldown { get; set; } public static ConfigEntry<float> RespawnSunDamageGracePeriod { get; set; } public static ConfigEntry<bool> BatCommand_Enabled { get; set; } public static ConfigEntry<string> BatCommand_Hotkey { get; set; } public static ConfigEntry<float> BatCommand_Radius { get; set; } public static ConfigEntry<bool> BatSummon_Enabled { get; set; } public static ConfigEntry<string> BatSummon_Hotkey { get; set; } public static ConfigEntry<bool> BatSummon_EnableSFX { get; set; } public static ConfigEntry<bool> BatSummon_EnableVFX { get; set; } public static ConfigEntry<string> BatSummon_SFXPrefab { get; set; } public static ConfigEntry<string> BatSummon_VFXPrefab { get; set; } public static ConfigEntry<int> BatSummon_Tier1_MaxBats { get; set; } public static ConfigEntry<float> BatSummon_Tier1_Cooldown { get; set; } public static ConfigEntry<int> BatSummon_Tier2_MaxBats { get; set; } public static ConfigEntry<float> BatSummon_Tier2_Cooldown { get; set; } public static ConfigEntry<int> BatSummon_Tier3_MaxBats { get; set; } public static ConfigEntry<float> BatSummon_Tier3_Cooldown { get; set; } public static ConfigEntry<int> BatSummon_Tier4_MaxBats { get; set; } public static ConfigEntry<float> BatSummon_Tier4_Cooldown { get; set; } public static ConfigEntry<bool> HomingProjectile_Enabled { get; set; } public static ConfigEntry<string> HomingProjectile_Whitelist { get; set; } public static void Initialize(ConfigFile config) { TickInterval = config.Bind<float>("01 - General", "01 - TickInterval", 2f, "How often (in seconds) to check for sun damage and apply it."); RespawnSunDamageGracePeriod = config.Bind<float>("01 - General", "02 - Respawn Grace Period", 120f, "Grace period in seconds after respawning before sun damage starts. Prevents death loops when spawning outside shelter."); Clock_Enabled = config.Bind<bool>("02 - Clock", "01 - Enabled", true, "Enable the in-game clock display."); Clock_Use24HourFormat = config.Bind<bool>("02 - Clock", "02 - Use 24 Hour Format", true, "Use 24-hour format (true) or 12-hour format with AM/PM (false)."); Clock_PositionX = config.Bind<float>("02 - Clock", "03 - Position X", 0.5f, "Horizontal position of the clock (0 = left, 1 = right)."); Clock_PositionY = config.Bind<float>("02 - Clock", "04 - Position Y", 5.7f, "Vertical position of the clock (0 = bottom, 1 = top)."); Clock_FontSize = config.Bind<int>("02 - Clock", "05 - Font Size", 14, "Font size for the clock display."); BloodMeter_Enabled = config.Bind<bool>("02 - Clock", "06 - Blood Meter Enabled", true, "Enable the blood hunger meter HUD display below the clock."); BloodMeter_PositionX = config.Bind<float>("02 - Clock", "07 - Blood Meter Position X", 0.5f, "Horizontal position of the blood meter (0 = left, 1 = right)."); BloodMeter_PositionY = config.Bind<float>("02 - Clock", "08 - Blood Meter Position Y", 5.3f, "Vertical position of the blood meter (0 = bottom, 1 = top). Default is below the clock."); BloodMeter_FontSize = config.Bind<int>("02 - Clock", "09 - Blood Meter Font Size", 18, "Font size for the blood meter display."); BloodHunger_Tier1_Interval = config.Bind<float>("03 - Blood Hunger", "01 - Tier 1 Interval", 90f, "Time in seconds before blood hunger damage starts for Tier 1 (default 1.5 minutes - low tier needs blood often)."); BloodHunger_Tier1_Damage = config.Bind<float>("03 - Blood Hunger", "02 - Tier 1 Damage", 10f, "Damage per tick when starving from blood hunger (Tier 1)."); BloodHunger_Tier1_HealthRestore = config.Bind<float>("03 - Blood Hunger", "03 - Tier 1 Health Restore %", 30f, "Percentage of max health restored when feeding blood (Tier 1)."); BloodHunger_Tier2_Interval = config.Bind<float>("03 - Blood Hunger", "04 - Tier 2 Interval", 120f, "Time in seconds before blood hunger damage starts for Tier 2 (default 2 minutes)."); BloodHunger_Tier2_Damage = config.Bind<float>("03 - Blood Hunger", "05 - Tier 2 Damage", 15f, "Damage per tick when starving from blood hunger (Tier 2)."); BloodHunger_Tier2_HealthRestore = config.Bind<float>("03 - Blood Hunger", "06 - Tier 2 Health Restore %", 50f, "Percentage of max health restored when feeding blood (Tier 2)."); BloodHunger_Tier3_Interval = config.Bind<float>("03 - Blood Hunger", "07 - Tier 3 Interval", 150f, "Time in seconds before blood hunger damage starts for Tier 3 (default 2.5 minutes)."); BloodHunger_Tier3_Damage = config.Bind<float>("03 - Blood Hunger", "08 - Tier 3 Damage", 20f, "Damage per tick when starving from blood hunger (Tier 3)."); BloodHunger_Tier3_HealthRestore = config.Bind<float>("03 - Blood Hunger", "09 - Tier 3 Health Restore %", 70f, "Percentage of max health restored when feeding blood (Tier 3)."); BloodHunger_Tier4_Interval = config.Bind<float>("03 - Blood Hunger", "10 - Tier 4 Interval", 240f, "Time in seconds before blood hunger damage starts for Tier 4 (default 4 minutes - high tier lasts longest)."); BloodHunger_Tier4_Damage = config.Bind<float>("03 - Blood Hunger", "11 - Tier 4 Damage", 30f, "Damage per tick when starving from blood hunger (Tier 4)."); BloodHunger_Tier4_HealthRestore = config.Bind<float>("03 - Blood Hunger", "12 - Tier 4 Health Restore %", 100f, "Percentage of max health restored when feeding blood (Tier 4)."); BloodItem_Prefab = config.Bind<string>("03 - Blood Hunger", "13 - Blood Item Prefab", "SBlood,shwsmbloodeitr", "Comma-separated list of prefab names that can be used to feed blood hunger (e.g., 'SBlood,BloodBag')."); CureItem_Prefab = config.Bind<string>("03 - Blood Hunger", "14 - Cleanse Item Prefab", "shwsmcure", "Comma-separated list of prefab names that Cleanse the vampire gift (e.g., 'MeadHealthMedium,MeadTasty')."); WhitelistItem_Prefab = config.Bind<string>("03 - Blood Hunger", "15 - Whitelist Item Prefab", "BloodPudding,MeadEitrMinor,MeadEitrLingering,MeadLightfoot,MeadHasty,MeadTamer,MeadStrength,MeadSwimmer,MeadBugRepellent,MeadTrollPheromones,MeadTasty,BarleyWine,MeadPoisonResist,MeadFrostResist,MeadStaminaLingering,MeadStaminaMedium,MeadStaminaMinor,MeadHealthLingering,MeadHealthMajor,MeadHealthMedium,MeadHealthMinor,", "Comma-separated list of prefab names that vampires can consume without triggering puke effect (e.g., 'MeadHealthMedium,MeadStaminaMedium'). Useful for potions and special items."); VampireOnlyEquipment_Prefab = config.Bind<string>("03 - Blood Hunger", "16 - Vampire-Only Equipment Prefab", "shwsmvblade", "Comma-separated list of prefab names that can ONLY be equipped by vampires (e.g., 'VampireSword,DarkBow'). Non-vampires will be unable to equip these items. Leave empty to disable this feature."); WeatherProtection_Enabled = config.Bind<bool>("04 - Sun Protection", "01 - Weather Protection Enabled", true, "Enable weather-based sun damage protection. Certain weather types (rain, thunderstorm, fog) will block sunlight and prevent sun damage."); WeatherProtection_Environments = config.Bind<string>("04 - Sun Protection", "02 - Weather Protection Environments", "LightRain,Rain,ThunderStorm,Twilight_Rain,Twilight_SnowStorm,SnowStorm,Twilight_Snow,Snow,Foggy,nofogts,Ashlands_ashrain,Ashlands_meteorshower,Ashlands_CinderRain,Ashlands_ashrain_clear,Ashlands_storm,Mistlands_thunder,Misty,Eikthyr,GDKing,Bonemass,Moder,Yagluth,GoblinKing,Queen,Fader,Crypt,SunkenCrypt", "Comma-separated list of environment names that provide sun protection. Common weather types: Rain, ThunderStorm, LightRain, SnowStorm, Ashrain, Misty, Mistlands_clear."); SunscreenItem_Prefab = config.Bind<string>("04 - Sun Protection", "03 - Sunblock Elixir Prefab", "shwsmsunblock", "Comma-separated list of prefab names that act as sunscreen, providing temporary sun protection when consumed (e.g., 'BarleyWine,Honey')."); SunscreenItem_Duration = config.Bind<float>("04 - Sun Protection", "04 - Sunscreen Duration", 300f, "Duration in seconds that sunscreen items provide sun protection (default 5 minutes)."); DarkGiftI_Enabled = config.Bind<bool>("05 - Dark Gift I", "01 - Enabled", true, "Enable sun damage for Dark Gift I."); DarkGiftI_EnableSFX = config.Bind<bool>("05 - Dark Gift I", "02 - EnableSFX", true, "Enable sound effects when taking sun damage."); DarkGiftI_EnableVFX = config.Bind<bool>("05 - Dark Gift I", "03 - EnableVFX", true, "Enable visual effects when taking sun damage."); DarkGiftI_SFXPrefab = config.Bind<string>("05 - Dark Gift I", "04 - SFXPrefab", "sfx_torch_burning", "Prefab name for the sound effect to play."); DarkGiftI_VFXPrefab = config.Bind<string>("05 - Dark Gift I", "05 - VFXPrefab", "vfx_FireAddFuel", "Prefab name for the visual effect to play."); DarkGiftI_TickDamage = config.Bind<float>("05 - Dark Gift I", "06 - TickDamage", 5f, "Damage dealt per tick when exposed to sunlight."); DarkGiftI_DayStartHour = config.Bind<float>("05 - Dark Gift I", "07 - DayStartHour", 7f, "Hour when sun damage starts (0-24 format). Use decimals: 7.5 = 07:30, 18.75 = 18:45. Default 7 = 07:00 (7:00 AM)."); DarkGiftI_DayEndHour = config.Bind<float>("05 - Dark Gift I", "08 - DayEndHour", 17f, "Hour when sun damage ends (0-24 format). Use decimals: 17.5 = 17:30, 18.75 = 18:45. Default 17 = 17:00 (5:00 PM)."); DarkGiftI_WarningMinutesBefore = config.Bind<float>("05 - Dark Gift I", "09 - WarningMinutesBefore", 5f, "Minutes before sunrise to show warning message."); DarkGiftI_WarningMessage = config.Bind<string>("05 - Dark Gift I", "10 - WarningMessage", "The sun rises soon... Seek shelter!", "Warning message shown before sunrise."); DarkGiftI_SunsetWarningMinutesBefore = config.Bind<float>("05 - Dark Gift I", "11 - SunsetWarningMinutesBefore", 5f, "Minutes before sunset to show warning message."); DarkGiftI_SunsetWarningMessage = config.Bind<string>("05 - Dark Gift I", "12 - SunsetWarningMessage", "The sun sets soon... You may roam freely!", "Warning message shown before sunset."); DarkGiftII_Enabled = config.Bind<bool>("06 - Dark Gift II", "01 - Enabled", true, "Enable sun damage for Dark Gift II."); DarkGiftII_EnableSFX = config.Bind<bool>("06 - Dark Gift II", "02 - EnableSFX", true, "Enable sound effects when taking sun damage."); DarkGiftII_EnableVFX = config.Bind<bool>("06 - Dark Gift II", "03 - EnableVFX", true, "Enable visual effects when taking sun damage."); DarkGiftII_SFXPrefab = config.Bind<string>("06 - Dark Gift II", "04 - SFXPrefab", "sfx_torch_burning", "Prefab name for the sound effect to play."); DarkGiftII_VFXPrefab = config.Bind<string>("06 - Dark Gift II", "05 - VFXPrefab", "vfx_FireAddFuel", "Prefab name for the visual effect to play."); DarkGiftII_TickDamage = config.Bind<float>("06 - Dark Gift II", "06 - TickDamage", 10f, "Damage dealt per tick when exposed to sunlight."); DarkGiftII_DayStartHour = config.Bind<float>("06 - Dark Gift II", "07 - DayStartHour", 7f, "Hour when sun damage starts (0-24 format). Use decimals: 7.5 = 07:30, 18.75 = 18:45. Default 7 = 07:00 (7:00 AM)."); DarkGiftII_DayEndHour = config.Bind<float>("06 - Dark Gift II", "08 - DayEndHour", 17f, "Hour when sun damage ends (0-24 format). Use decimals: 17.5 = 17:30, 18.75 = 18:45. Default 17 = 17:00 (5:00 PM)."); DarkGiftII_WarningMinutesBefore = config.Bind<float>("06 - Dark Gift II", "09 - WarningMinutesBefore", 5f, "Minutes before sunrise to show warning message."); DarkGiftII_WarningMessage = config.Bind<string>("06 - Dark Gift II", "10 - WarningMessage", "The sun rises soon... Seek shelter!", "Warning message shown before sunrise."); DarkGiftII_SunsetWarningMinutesBefore = config.Bind<float>("06 - Dark Gift II", "11 - SunsetWarningMinutesBefore", 5f, "Minutes before sunset to show warning message."); DarkGiftII_SunsetWarningMessage = config.Bind<string>("06 - Dark Gift II", "12 - SunsetWarningMessage", "The sun sets soon... You may roam freely!", "Warning message shown before sunset."); DarkGiftIII_Enabled = config.Bind<bool>("07 - Dark Gift III", "01 - Enabled", true, "Enable sun damage for Dark Gift III."); DarkGiftIII_EnableSFX = config.Bind<bool>("07 - Dark Gift III", "02 - EnableSFX", true, "Enable sound effects when taking sun damage."); DarkGiftIII_EnableVFX = config.Bind<bool>("07 - Dark Gift III", "03 - EnableVFX", true, "Enable visual effects when taking sun damage."); DarkGiftIII_SFXPrefab = config.Bind<string>("07 - Dark Gift III", "04 - SFXPrefab", "sfx_torch_burning", "Prefab name for the sound effect to play."); DarkGiftIII_VFXPrefab = config.Bind<string>("07 - Dark Gift III", "05 - VFXPrefab", "vfx_FireAddFuel", "Prefab name for the visual effect to play."); DarkGiftIII_TickDamage = config.Bind<float>("07 - Dark Gift III", "06 - TickDamage", 15f, "Damage dealt per tick when exposed to sunlight."); DarkGiftIII_DayStartHour = config.Bind<float>("07 - Dark Gift III", "07 - DayStartHour", 7f, "Hour when sun damage starts (0-24 format). Use decimals: 7.5 = 07:30, 18.75 = 18:45. Default 7 = 07:00 (7:00 AM)."); DarkGiftIII_DayEndHour = config.Bind<float>("07 - Dark Gift III", "08 - DayEndHour", 17f, "Hour when sun damage ends (0-24 format). Use decimals: 17.5 = 17:30, 18.75 = 18:45. Default 17 = 17:00 (5:00 PM)."); DarkGiftIII_WarningMinutesBefore = config.Bind<float>("07 - Dark Gift III", "09 - WarningMinutesBefore", 5f, "Minutes before sunrise to show warning message."); DarkGiftIII_WarningMessage = config.Bind<string>("07 - Dark Gift III", "10 - WarningMessage", "The sun rises soon... Seek shelter!", "Warning message shown before sunrise."); DarkGiftIII_SunsetWarningMinutesBefore = config.Bind<float>("07 - Dark Gift III", "11 - SunsetWarningMinutesBefore", 5f, "Minutes before sunset to show warning message."); DarkGiftIII_SunsetWarningMessage = config.Bind<string>("07 - Dark Gift III", "12 - SunsetWarningMessage", "The sun sets soon... You may roam freely!", "Warning message shown before sunset."); DarkGiftIV_Enabled = config.Bind<bool>("08 - Dark Gift IV", "01 - Enabled", true, "Enable sun damage for Dark Gift IV."); DarkGiftIV_EnableSFX = config.Bind<bool>("08 - Dark Gift IV", "02 - EnableSFX", true, "Enable sound effects when taking sun damage."); DarkGiftIV_EnableVFX = config.Bind<bool>("08 - Dark Gift IV", "03 - EnableVFX", true, "Enable visual effects when taking sun damage."); DarkGiftIV_SFXPrefab = config.Bind<string>("08 - Dark Gift IV", "04 - SFXPrefab", "sfx_torch_burning", "Prefab name for the sound effect to play."); DarkGiftIV_VFXPrefab = config.Bind<string>("08 - Dark Gift IV", "05 - VFXPrefab", "vfx_FireAddFuel", "Prefab name for the visual effect to play."); DarkGiftIV_TickDamage = config.Bind<float>("08 - Dark Gift IV", "06 - TickDamage", 20f, "Damage dealt per tick when exposed to sunlight."); DarkGiftIV_DayStartHour = config.Bind<float>("08 - Dark Gift IV", "07 - DayStartHour", 7f, "Hour when sun damage starts (0-24 format). Use decimals: 7.5 = 07:30, 18.75 = 18:45. Default 7 = 07:00 (7:00 AM)."); DarkGiftIV_DayEndHour = config.Bind<float>("08 - Dark Gift IV", "08 - DayEndHour", 17f, "Hour when sun damage ends (0-24 format). Use decimals: 17.5 = 17:30, 18.75 = 18:45. Default 17 = 17:00 (5:00 PM)."); DarkGiftIV_WarningMinutesBefore = config.Bind<float>("08 - Dark Gift IV", "09 - WarningMinutesBefore", 5f, "Minutes before sunrise to show warning message."); DarkGiftIV_WarningMessage = config.Bind<string>("08 - Dark Gift IV", "10 - WarningMessage", "The sun rises soon... Seek shelter!", "Warning message shown before sunrise."); DarkGiftIV_SunsetWarningMinutesBefore = config.Bind<float>("08 - Dark Gift IV", "11 - SunsetWarningMinutesBefore", 5f, "Minutes before sunset to show warning message."); DarkGiftIV_SunsetWarningMessage = config.Bind<string>("08 - Dark Gift IV", "12 - SunsetWarningMessage", "The sun sets soon... You may roam freely!", "Warning message shown before sunset."); Tier4_SkinToggleHotkey = config.Bind<string>("08 - Dark Gift IV", "13 - Skin Toggle Hotkey", "V", "Hotkey to toggle vampire skin visibility for Tier 4 vampires. Allows master vampires to blend in with mortals."); Tier4_SkinToggleCooldown = config.Bind<float>("08 - Dark Gift IV", "14 - Skin Toggle Cooldown", 120f, "Cooldown in seconds between vampire skin toggles to prevent spam."); BatCommand_Enabled = config.Bind<bool>("09 - Bat Command", "01 - Enabled", true, "Enable the ability to command nearby tamed bats with a hotkey."); BatCommand_Hotkey = config.Bind<string>("09 - Bat Command", "02 - Hotkey", "C", "Hotkey to command all nearby tamed bats to follow you."); BatCommand_Radius = config.Bind<float>("09 - Bat Command", "03 - Command Radius", 50f, "Radius in meters to detect and command tamed bats."); BatSummon_Enabled = config.Bind<bool>("10 - Bat Summon", "01 - Enabled", true, "Enable the ability to summon bat familiars with a hotkey."); BatSummon_Hotkey = config.Bind<string>("10 - Bat Summon", "02 - Hotkey", "B", "Hotkey to summon bat familiars. Each vampire tier can summon a different number of bats."); BatSummon_EnableSFX = config.Bind<bool>("10 - Bat Summon", "03 - Enable SFX", true, "Enable sound effects when summoning bats."); BatSummon_EnableVFX = config.Bind<bool>("10 - Bat Summon", "04 - Enable VFX", false, "Enable visual effects when summoning bats."); BatSummon_SFXPrefab = config.Bind<string>("10 - Bat Summon", "05 - SFX Prefab", "sfx_fenring_howl1", "Prefab name for the sound effect to play when summoning bats."); BatSummon_VFXPrefab = config.Bind<string>("10 - Bat Summon", "06 - VFX Prefab", "", "Prefab name for the visual effect to play when summoning bats."); BatSummon_Tier1_MaxBats = config.Bind<int>("10 - Bat Summon", "07 - Tier 1 Max Bats", 1, "Maximum number of bats that can be summoned at Tier 1."); BatSummon_Tier1_Cooldown = config.Bind<float>("10 - Bat Summon", "08 - Tier 1 Cooldown", 2f, "Cooldown in seconds between bat summons for Tier 1 (default 2 minutes)."); BatSummon_Tier2_MaxBats = config.Bind<int>("10 - Bat Summon", "09 - Tier 2 Max Bats", 2, "Maximum number of bats that can be summoned at Tier 2."); BatSummon_Tier2_Cooldown = config.Bind<float>("10 - Bat Summon", "10 - Tier 2 Cooldown", 2f, "Cooldown in seconds between bat summons for Tier 2 (default 2 minutes)."); BatSummon_Tier3_MaxBats = config.Bind<int>("10 - Bat Summon", "11 - Tier 3 Max Bats", 3, "Maximum number of bats that can be summoned at Tier 3."); BatSummon_Tier3_Cooldown = config.Bind<float>("10 - Bat Summon", "12 - Tier 3 Cooldown", 2f, "Cooldown in seconds between bat summons for Tier 3 (default 2 minutes)."); BatSummon_Tier4_MaxBats = config.Bind<int>("10 - Bat Summon", "13 - Tier 4 Max Bats", 4, "Maximum number of bats that can be summoned at Tier 4."); BatSummon_Tier4_Cooldown = config.Bind<float>("10 - Bat Summon", "14 - Tier 4 Cooldown", 2f, "Cooldown in seconds between bat summons for Tier 4 (default 2 minutes)."); HomingProjectile_Enabled = config.Bind<bool>("11 - Homing Projectiles", "01 - Enabled", true, "Enable homing behavior for projectiles. Projectiles will fly straight briefly, then track the nearest enemy."); HomingProjectile_Whitelist = config.Bind<string>("11 - Homing Projectiles", "02 - Projectile Whitelist", "vampdragon_fireball_projectile,vampdragon_spitball_projectile", "Comma-separated list of projectile prefab names that should have homing behavior (e.g., 'vampdragon_fireball_projectile,arrow_fire'). Add any attack projectiles you want to make homing."); } } } namespace Shawesomes_Dark_Gift.Patches { [HarmonyPatch(typeof(EggGrow))] public static class DragonEggImprinting { private static Vector3 s_lastEggPosition; private static bool s_dragonEggHatching; [HarmonyPatch("GrowUpdate")] [HarmonyPrefix] private static void GrowUpdate_Prefix(EggGrow __instance) { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)__instance == (Object)null) && !((Object)(object)__instance.m_grownPrefab == (Object)null) && !((Object)(object)((Component)__instance).transform == (Object)null)) { string name = ((Object)__instance.m_grownPrefab).name; if (!(name != "sdg_vampiredragon")) { s_lastEggPosition = ((Component)__instance).transform.position; s_dragonEggHatching = true; } } } [HarmonyPatch("GrowUpdate")] [HarmonyPostfix] private static void GrowUpdate_Postfix(EggGrow __instance) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)__instance == (Object)null) && s_dragonEggHatching) { s_dragonEggHatching = false; if ((Object)(object)ZNetScene.instance != (Object)null) { ((MonoBehaviour)ZNetScene.instance).StartCoroutine(ImprintDragonNextFrame(s_lastEggPosition)); } } } private static IEnumerator ImprintDragonNextFrame(Vector3 eggPosition) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) yield return null; Character dragon = null; float searchRadius = 5f; List<Character> allCharacters = Character.GetAllCharacters(); if (allCharacters == null) { yield break; } foreach (Character character in allCharacters) { if ((Object)(object)character == (Object)null || (Object)(object)((Component)character).gameObject == (Object)null || (Object)(object)((Component)character).transform == (Object)null) { continue; } string prefabName = ((Object)((Component)character).gameObject).name.Replace("(Clone)", "").Trim(); if (!(prefabName != "sdg_vampiredragon")) { float distance = Vector3.Distance(eggPosition, ((Component)character).transform.position); if (distance <= searchRadius) { dragon = character; break; } } } if (!((Object)(object)dragon == (Object)null)) { if (!dragon.IsTamed()) { yield return null; } ImprintDragon(dragon, eggPosition); } } private static void ImprintDragon(Character dragon, Vector3 position) { //IL_00f6: 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) if ((Object)(object)dragon == (Object)null) { return; } Tameable component = ((Component)dragon).GetComponent<Tameable>(); if ((Object)(object)component == (Object)null) { return; } string hoverName = component.GetHoverName(); if (hoverName.Contains("'s Dragon Familiar")) { return; } Player val = null; float num = float.MaxValue; float num2 = 5f; VampireGift vampireGift = Object.FindObjectOfType<VampireGift>(); foreach (Player allPlayer in Player.GetAllPlayers()) { if ((Object)(object)allPlayer == (Object)null || (Object)(object)((Component)allPlayer).transform == (Object)null) { continue; } if ((Object)(object)vampireGift != (Object)null && (Object)(object)allPlayer == (Object)(object)Player.m_localPlayer) { if (!vampireGift.IsVampire || vampireGift.VampireTier < 4) { continue; } } else if ((Object)(object)allPlayer != (Object)(object)Player.m_localPlayer) { continue; } float num3 = Vector3.Distance(position, ((Component)allPlayer).transform.position); if (num3 < num && num3 <= num2) { num = num3; val = allPlayer; } } if (!((Object)(object)val != (Object)null)) { return; } string playerName = val.GetPlayerName(); string text = playerName + "'s Dragon Familiar"; if ((Object)(object)component.m_nview != (Object)null && component.m_nview.IsValid()) { component.m_nview.GetZDO().Set(ZDOVars.s_tamedName, text); if ((Object)(object)MessageHud.instance != (Object)null && (Object)(object)val == (Object)(object)Player.m_localPlayer) { MessageHud.instance.ShowMessage((MessageType)2, "A dragon has imprinted on you!", 0, (Sprite)null, false); } } } } [HarmonyPatch(typeof(Projectile), "Setup")] public static class HomingProjectilePatch { [HarmonyPostfix] private static void Projectile_Setup_Postfix(Projectile __instance, Character owner) { if (VampireConfig.HomingProjectile_Enabled.Value && !((Object)(object)__instance == (Object)null) && !((Object)(object)((Component)__instance).gameObject == (Object)null) && !((Object)(object)owner == (Object)null)) { string value = ((Object)((Component)__instance).gameObject).name.Replace("(Clone)", "").Trim(); string[] source = (from s in VampireConfig.HomingProjectile_Whitelist.Value.Split(new char[1] { ',' }) select s.Trim() into s where !string.IsNullOrEmpty(s) select s).ToArray(); if (source.Contains(value)) { HomingProjectile homingProjectile = ((Component)__instance).gameObject.AddComponent<HomingProjectile>(); homingProjectile.Initialize(owner); } } } } [HarmonyPatch(typeof(Tameable))] public static class SaddleActivationPatch { private static readonly Dictionary<string, List<string>> SaddleObjectPrefixes = new Dictionary<string, List<string>> { { "sdg_vampiredragon", new List<string> { "Mat", "Rune" } } }; [HarmonyPatch("SetSaddle")] [HarmonyPostfix] private static void SetSaddle_Postfix(Tameable __instance, bool enabled) { if ((Object)(object)__instance == (Object)null || (Object)(object)__instance.m_saddle == (Object)null) { return; } Character component = ((Component)__instance).GetComponent<Character>(); if ((Object)(object)component == (Object)null) { return; } string key = ((Object)((Component)component).gameObject).name.Replace("(Clone)", "").Trim(); if (!SaddleObjectPrefixes.ContainsKey(key)) { return; } List<string> list = SaddleObjectPrefixes[key]; if (list == null || list.Count == 0) { return; } Transform transform = ((Component)component).transform; foreach (string item in list) { List<Transform> list2 = FindAllChildrenWithPrefix(transform, item); foreach (Transform item2 in list2) { ((Component)item2).gameObject.SetActive(enabled); } } } private static List<Transform> FindAllChildrenWithPrefix(Transform parent, string prefix) { List<Transform> list = new List<Transform>(); FindAllChildrenWithPrefixRecursive(parent, prefix, list); return list; } private static void FindAllChildrenWithPrefixRecursive(Transform parent, string prefix, List<Transform> results) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown foreach (Transform item in parent) { Transform val = item; if (((Object)val).name.StartsWith(prefix)) { results.Add(val); } FindAllChildrenWithPrefixRecursive(val, prefix, results); } } } [HarmonyPatch(typeof(Character))] public static class SaddleArmorSystem { public class ArmorConfig { public float MaxArmor { get; set; } public float ArmorPerLevel { get; set; } public float RegenDelay { get; set; } public float RegenRate { get; set; } public string? EffectGameObjectPrefix { get; set; } = ""; } private static readonly Dictionary<string, ArmorConfig> CreatureArmorConfigs = new Dictionary<string, ArmorConfig> { { "sdg_vampiredragon", new ArmorConfig { MaxArmor = 2000f, ArmorPerLevel = 500f, RegenDelay = 30f, RegenRate = 10f, EffectGameObjectPrefix = "Rune" } } }; private const string ARMOR_HP_KEY = "SaddleArmorHP"; private const string LAST_DAMAGE_TIME_KEY = "SaddleArmorLastDamage"; [HarmonyPatch("ApplyDamage")] [HarmonyPrefix] private static void ApplyDamage_Prefix(Character __instance, ref HitData hit) { if ((Object)(object)__instance == (Object)null || hit == null) { return; } Tameable component = ((Component)__instance).GetComponent<Tameable>(); if ((Object)(object)component == (Object)null || !component.HaveSaddle()) { return; } string key = ((Object)((Component)__instance).gameObject).name.Replace("(Clone)", "").Trim(); if (!CreatureArmorConfigs.ContainsKey(key)) { return; } ZNetView component2 = ((Component)__instance).GetComponent<ZNetView>(); if ((Object)(object)component2 == (Object)null || !component2.IsValid()) { return; } float maxArmorHP = GetMaxArmorHP(__instance); float @float = component2.GetZDO().GetFloat("SaddleArmorHP", maxArmorHP); if (@float > 0f) { float totalDamage = hit.GetTotalDamage(); if (totalDamage <= @float) { @float -= totalDamage; ((DamageTypes)(ref hit.m_damage)).Modify(0f); } else { float num = totalDamage - @float; @float = 0f; ((DamageTypes)(ref hit.m_damage)).Modify(num / totalDamage); } component2.GetZDO().Set("SaddleArmorHP", @float); component2.GetZDO().Set("SaddleArmorLastDamage", Time.time); } } [HarmonyPatch("Awake")] [HarmonyPostfix] private static void Awake_Postfix(Character __instance) { if ((Object)(object)__instance == (Object)null) { return; } Tameable component = ((Component)__instance).GetComponent<Tameable>(); if ((Object)(object)component == (Object)null) { return; } string key = ((Object)((Component)__instance).gameObject).name.Replace("(Clone)", "").Trim(); if (CreatureArmorConfigs.ContainsKey(key)) { SaddleArmorRegen component2 = ((Component)__instance).gameObject.GetComponent<SaddleArmorRegen>(); if ((Object)(object)component2 == (Object)null) { ((Component)__instance).gameObject.AddComponent<SaddleArmorRegen>(); } } } public static float GetArmorHP(Character character) { if ((Object)(object)character == (Object)null) { return 0f; } Tameable component = ((Component)character).GetComponent<Tameable>(); if ((Object)(object)component == (Object)null || !component.HaveSaddle()) { return 0f; } string key = ((Object)((Component)character).gameObject).name.Replace("(Clone)", "").Trim(); if (!CreatureArmorConfigs.ContainsKey(key)) { return 0f; } ZNetView component2 = ((Component)character).GetComponent<ZNetView>(); if ((Object)(object)component2 == (Object)null || !component2.IsValid()) { return 0f; } float maxArmorHP = GetMaxArmorHP(character); return component2.GetZDO().GetFloat("SaddleArmorHP", maxArmorHP); } public static float GetMaxArmorHP(Character character) { if ((Object)(object)character == (Object)null) { return 0f; } string key = ((Object)((Component)character).gameObject).name.Replace("(Clone)", "").Trim(); if (!CreatureArmorConfigs.ContainsKey(key)) { return 0f; } ArmorConfig armorConfig = CreatureArmorConfigs[key]; int saddleQuality = GetSaddleQuality(character); return armorConfig.MaxArmor + armorConfig.ArmorPerLevel * (float)(saddleQuality - 1); } private static int GetSaddleQuality(Character character) { Tameable component = ((Component)character).GetComponent<Tameable>(); if ((Object)(object)component == (Object)null || (Object)(object)component.m_saddleItem == (Object)null) { return 1; } return component.m_saddleItem.m_itemData.m_quality; } public static ArmorConfig? GetArmorConfig(string prefabName) { if (CreatureArmorConfigs.ContainsKey(prefabName)) { return CreatureArmorConfigs[prefabName]; } return null; } } public class SaddleArmorRegen : MonoBehaviour { private Character? _character = null; private Tameable? _tameable = null; private ZNetView? _nview = null; private string? _prefabName = null; private List<GameObject> _effectObjects = new List<GameObject>(); private bool _lastArmorState = true; private void Awake() { _character = ((Component)this).GetComponent<Character>(); _tameable = ((Component)this).GetComponent<Tameable>(); _nview = ((Component)this).GetComponent<ZNetView>(); _prefabName = ((Object)((Component)this).gameObject).name.Replace("(Clone)", "").Trim(); } private void Start() { if (_prefabName == null) { return; } SaddleArmorSystem.ArmorConfig armorConfig = SaddleArmorSystem.GetArmorConfig(_prefabName); if (armorConfig != null && !string.IsNullOrEmpty(armorConfig.EffectGameObjectPrefix)) { FindAllChildrenWithPrefix(((Component)this).transform, armorConfig.EffectGameObjectPrefix, _effectObjects); if (_effectObjects.Count > 0) { UpdateEffectState(active: true); } } } private void FixedUpdate() { if ((Object)(object)_character == (Object)null || (Object)(object)_tameable == (Object)null || !_tameable.HaveSaddle()) { UpdateEffectState(active: false); } else { if ((Object)(object)_nview == (Object)null || !_nview.IsValid() || !_nview.IsOwner() || _prefabName == null) { return; } SaddleArmorSystem.ArmorConfig armorConfig = SaddleArmorSystem.GetArmorConfig(_prefabName); if (armorConfig == null) { return; } float maxArmorHP = SaddleArmorSystem.GetMaxArmorHP(_character); float @float = _nview.GetZDO().GetFloat("SaddleArmorHP", maxArmorHP); bool active = @float > 0f; UpdateEffectState(active); if (!(@float < maxArmorHP)) { return; } float float2 = _nview.GetZDO().GetFloat("SaddleArmorLastDamage", 0f); float num = Time.time - float2; if (num >= armorConfig.RegenDelay) { @float += armorConfig.RegenRate * Time.fixedDeltaTime; if (@float > maxArmorHP) { @float = maxArmorHP; } _nview.GetZDO().Set("SaddleArmorHP", @float); } } } private void UpdateEffectState(bool active) { if (_effectObjects.Count <= 0 || _lastArmorState == active) { return; } foreach (GameObject effectObject in _effectObjects) { if ((Object)(object)effectObject != (Object)null) { effectObject.SetActive(active); } } _lastArmorState = active; } private void FindAllChildrenWithPrefix(Transform parent, string prefix, List<GameObject> results) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown foreach (Transform item in parent) { Transform val = item; if (((Object)val).name.StartsWith(prefix)) { results.Add(((Component)val).gameObject); } FindAllChildrenWithPrefix(val, prefix, results); } } } public static class SimpleMountController { public class AttackMapping { public KeyCode Key { get; set; } public int AttackIndex { get; set; } = -1; public string? AttackPrefab { get; set; } = null; public float StaminaCost { get; set; } = 0f; public float Cooldown { get; set; } = 0.5f; } public class CreatureAttackConfig { public List<AttackMapping>? GroundAttacks { get; set; } public List<AttackMapping>? AirAttacks { get; set; } } [HarmonyPatch(typeof(Player), "SetControls")] [HarmonyPriority(800)] public static class MountControlsPatch { private static List<ItemData>? s_cachedWeapons; private static float s_lastWeaponCacheTime; private const float WEAPON_CACHE_DURATION = 1f; private static void Prefix(Player __instance, ref bool attack, ref bool secondaryAttack, ref bool block, ref bool jump) { //IL_016f: 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_0187: Invalid comparison between Unknown and I4 //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Invalid comparison between Unknown and I4 //IL_01c2: Unknown result type (might be due to invalid IL or missing references) if (!((Character)__instance).IsRiding()) { return; } IDoodadController doodadController = __instance.m_doodadController; Sadle val = (Sadle)(object)((doodadController is Sadle) ? doodadController : null); if ((Object)(object)val == (Object)null || (Object)(object)val.m_character == (Object)null) { return; } string text = ((Object)((Component)val.m_character).gameObject).name.Replace("(Clone)", "").Trim(); if (!ManagedCreatures.Contains(text)) { return; } if (IsUIOpen()) { s_flightKeyPressed = false; s_attackKeysPressed.Clear(); attack = false; secondaryAttack = false; jump = false; return; } if (CanFly(val) && GetFlightKeyDown()) { ToggleFlight(val); } bool flag = CanFly(val) && val.m_character.IsFlying(); if (flag & jump) { jump = false; } if (jump && !flag) { val.m_character.Jump(false); jump = false; } if (AttackConfigs.TryGetValue(text, out CreatureAttackConfig value)) { List<AttackMapping> list = (flag ? value.AirAttacks : value.GroundAttacks); if (list == null) { return; } foreach (AttackMapping item in list) { if (!GetAttackKeyDown(item.Key) && !(((int)item.Key == 323) & attack) && !(((int)item.Key == 324) & block)) { continue; } string key = $"{((object)val).GetHashCode()}_{item.Key}"; if (s_attackCooldowns.TryGetValue(key, out var value2) && Time.time < value2) { break; } if (item.StaminaCost > 0f && !HasEnoughStamina(val, item.StaminaCost)) { Player localPlayer = Player.m_localPlayer; if (localPlayer != null) { ((Character)localPlayer).Message((MessageType)2, "Not enough stamina!", 0, (Sprite)null); } break; } int attackIndex = ResolveAttackIndex(val, item, flag); if (item.StaminaCost > 0f) { ConsumeStamina(val, item.StaminaCost); } HandleAttack(val, attackIndex); s_attackCooldowns[key] = Time.time + item.Cooldown; break; } } attack = false; secondaryAttack = false; block = false; } private static bool IsUIOpen() { return ((Object)(object)Chat.instance != (Object)null && Chat.instance.HasFocus()) || Console.IsVisible() || TextInput.IsVisible() || Menu.IsVisible() || InventoryGui.IsVisible() || StoreGui.IsVisible() || Minimap.IsOpen(); } private static void ToggleFlight(Sadle sadle) { if ((Object)(object)sadle == (Object)null || (Object)(object)sadle.m_character == (Object)null) { return; } sadle.m_character.m_flying = !sadle.m_character.m_flying; if ((Object)(object)sadle.m_character.m_animator != (Object)null) { if (sadle.m_character.m_flying) { sadle.m_character.m_animator.SetTrigger(TakeoffAnimationTrigger); } else { sadle.m_character.m_animator.SetTrigger(LandingAnimationTrigger); } } string text = (sadle.m_character.m_flying ? "Flight enabled" : "Flight disabled"); Player localPlayer = Player.m_localPlayer; if (localPlayer != null) { ((Character)localPlayer).Message((MessageType)2, text, 0, (