using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using UnityEngine; using YamlDotNet.Serialization; using YamlDotNet.Serialization.NamingConventions; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("Pilgrim")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+83a082a7ef58ce93e55f263031e1978d96c09961")] [assembly: AssemblyProduct("Pilgrim")] [assembly: AssemblyTitle("Pilgrim")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } } namespace EnvReporter { [BepInPlugin("com.ctogle.pilgrim", "Pilgrim", "0.2.0")] public class Plugin : BaseUnityPlugin { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static FileSystemEventHandler <>9__82_0; public static ConsoleEvent <>9__84_0; public static Func <>9__84_15; public static ConsoleEvent <>9__84_1; public static ConsoleEvent <>9__84_2; public static ConsoleEvent <>9__84_3; public static Func <>9__84_16; public static Func <>9__84_17; public static ConsoleEvent <>9__84_4; public static ConsoleEvent <>9__84_5; public static ConsoleEvent <>9__84_6; public static ConsoleEvent <>9__84_7; public static ConsoleEvent <>9__84_8; public static ConsoleEvent <>9__84_9; public static Func <>9__84_18; public static Func <>9__84_19; public static Func <>9__84_20; public static Func <>9__84_21; public static ConsoleEvent <>9__84_10; public static ConsoleEvent <>9__84_11; public static ConsoleEvent <>9__84_12; public static ConsoleEvent <>9__84_13; public static ConsoleEvent <>9__84_14; public static Predicate <>9__85_0; public static Predicate <>9__92_0; public static Predicate <>9__96_0; public static Predicate <>9__99_0; public static Predicate <>9__100_0; public static Predicate <>9__104_0; internal void b__82_0(object _, FileSystemEventArgs __) { _cfgDirty = true; } internal void b__84_0(ConsoleEventArgs args) { //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_0324: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Unknown result type (might be due to invalid IL or missing references) EnvMan instance = EnvMan.instance; if ((Object)(object)instance == (Object)null) { args.Context.AddString("EnvMan not ready."); return; } float tod = GetTod(); string todLabel = GetTodLabel(tod); string text = GetEnvSetupName(instance, "m_currentEnv") ?? "unknown"; string text2 = GetEnvSetupName(instance, "m_nextEnv") ?? "unknown"; string text3 = instance.m_debugEnv ?? ""; string text4 = (((Object)(object)Scheduler != (Object)null && Scheduler.Active) ? $"ON (prob {Scheduler.Probability:P0})" : "OFF"); double num = (((Object)(object)ZNet.instance != (Object)null) ? ZNet.instance.GetTimeSeconds() : 0.0); args.Context.AddString("=== World State ==="); args.Context.AddString($"TOD : {tod:F2} ({todLabel}) [ZNet raw: {num:F0}s mod1800={num % 1800.0:F0}]"); args.Context.AddString("Current env : " + text + ((text3.Length > 0) ? (" [forced: " + text3 + "]") : "")); args.Context.AddString("Next env : " + text2); args.Context.AddString($"Is wet : {EnvMan.IsWet()}"); args.Context.AddString($"Is cold : {EnvMan.IsCold()}"); args.Context.AddString($"Is freezing : {EnvMan.IsFreezing()}"); args.Context.AddString($"Wind : {instance.GetWindIntensity():F2} dir {instance.GetWindDir()}"); args.Context.AddString("Scheduler : " + text4); RandEventSystem instance2 = RandEventSystem.instance; if ((Object)(object)instance2 != (Object)null) { object obj = AnyField(instance2, "m_activeEvent", "m_currentEvent"); if (obj != null && (!(AnyField(instance2, "m_haveActiveEvent") is bool flag) || flag) && obj != null) { string arg = (AnyField(obj, "m_name") as string) ?? "?"; float num2 = ((AnyField(instance2, "m_eventTimer", "m_timer") is float num3) ? num3 : 0f); string arg2 = ((AnyField(instance2, "m_eventPos", "m_pos") is Vector3 val) ? $"({val.x:F0},{val.z:F0})" : "?"); args.Context.AddString($"Active raid : {arg} | {num2:F0}s | @ {arg2}"); } else { args.Context.AddString("Active raid : none"); } } } internal void b__84_1(ConsoleEventArgs args) { //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) List allPlayers = Player.GetAllPlayers(); if (allPlayers == null || allPlayers.Count == 0) { args.Context.AddString("No players found."); return; } args.Context.AddString($"=== Players ({allPlayers.Count}) ==="); List list = new List(); foreach (Player item in allPlayers) { string playerName = item.GetPlayerName(); float health = ((Character)item).GetHealth(); float maxHealth = ((Character)item).GetMaxHealth(); float stamina = item.GetStamina(); float maxStamina = ((Character)item).GetMaxStamina(); float eitr = item.GetEitr(); float maxEitr = ((Character)item).GetMaxEitr(); Vector3 position = ((Component)item).transform.position; list.Add(position); string arg = ((object)item.GetCurrentBiome()/*cast due to .constrained prefix*/).ToString(); SEMan sEMan = ((Character)item).GetSEMan(); List list2 = ((sEMan != null) ? sEMan.GetStatusEffects() : null); string text = ((list2 != null && list2.Count > 0) ? string.Join(", ", list2.Select((StatusEffect e) => (!string.IsNullOrEmpty(e.m_name)) ? e.m_name : ((Object)e).name)) : "none"); args.Context.AddString("--- " + playerName + " ---"); args.Context.AddString($" HP {health:F0}/{maxHealth:F0} | Stamina {stamina:F0}/{maxStamina:F0} | Eitr {eitr:F0}/{maxEitr:F0}"); args.Context.AddString($" Biome: {arg} | Pos: ({position.x:F0},{position.z:F0})"); args.Context.AddString(" Effects: " + text); } if (list.Count <= 1) { return; } float num = 0f; for (int num2 = 0; num2 < list.Count; num2++) { for (int num3 = num2 + 1; num3 < list.Count; num3++) { float num4 = Vector3.Distance(list[num2], list[num3]); if (num4 > num) { num = num4; } } } args.Context.AddString($"Party spread: {num:F0}m"); } internal string b__84_15(StatusEffect e) { if (!string.IsNullOrEmpty(e.m_name)) { return e.m_name; } return ((Object)e).name; } internal void b__84_2(ConsoleEventArgs args) { ClearSkiesExpiry = 0f; RainExpiry = 0f; GiantRainExpiry = 0f; WaterWalkExpiry = 0f; SeekEnvExpiry = 0f; DungeonEnvExpiry = 0f; HomeEnvExpiry = 0f; if (GiantExpiry > 0f) { Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer != (Object)null) { DeactivateGiant(localPlayer); } else { GiantExpiry = 0f; } } if ((Object)(object)EnvMan.instance != (Object)null) { EnvMan.instance.m_debugEnv = ""; } EnvMan instance = EnvMan.instance; if (instance != null) { instance.ResetDebugWind(); } args.Context.AddString("Weather overrides cleared."); } internal void b__84_3(ConsoleEventArgs args) { ActivateSeek(args.Context); } internal void b__84_4(ConsoleEventArgs args) { EnvScheduler scheduler = Scheduler; if ((Object)(object)scheduler == (Object)null) { args.Context.AddString("Scheduler not ready."); return; } if (args.Length < 2) { PrintSchedule(args, scheduler); return; } switch (args[1].ToLower()) { case "on": scheduler.Active = true; args.Context.AddString("Scheduler ON"); break; case "off": scheduler.Active = false; args.Context.AddString("Scheduler OFF"); break; case "prob": { if (args.Length >= 3 && float.TryParse(args[2], out var result)) { scheduler.Probability = Mathf.Clamp01(result); args.Context.AddString($"Probability → {scheduler.Probability:P0}"); } break; } case "night": if (args.Length >= 3) { scheduler.NightPool = (from x in args[2].Split(',') select x.Trim()).ToList(); args.Context.AddString("Night pool → " + string.Join(", ", scheduler.NightPool)); } break; case "noon": if (args.Length >= 3) { scheduler.NoonPool = (from x in args[2].Split(',') select x.Trim()).ToList(); args.Context.AddString("Noon pool → " + string.Join(", ", scheduler.NoonPool)); } break; default: PrintSchedule(args, scheduler); break; } } internal string b__84_16(string x) { return x.Trim(); } internal string b__84_17(string x) { return x.Trim(); } internal void b__84_5(ConsoleEventArgs args) { Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null) { args.Context.AddString("No local player."); return; } ActivateWaterWalk(localPlayer); args.Context.AddString("Water walk active."); } internal void b__84_6(ConsoleEventArgs args) { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Scheduler == (Object)null) { args.Context.AddString("Scheduler not ready."); return; } string text = ((args.Length > 1) ? args[1].ToLower() : "n"); Vector3 direction = (Vector3)(text switch { "s" => new Vector3(0f, 0f, -1f), "e" => new Vector3(1f, 0f, 0f), "w" => new Vector3(-1f, 0f, 0f), _ => new Vector3(0f, 0f, 1f), }); Scheduler.SendBird(direction); args.Context.AddString("Bird away (" + text + ")."); } internal void b__84_7(ConsoleEventArgs args) { args.Context.AddString("=== Campfire Rituals ==="); args.Context.AddString(" " + SeekFood + " (Boar Meat) → Guiding Wind — seek next boss altar"); args.Context.AddString(" Mushroom* (Yellow Mushroom) → Reset forsaken power cooldown"); args.Context.AddString(" " + HomeFood + " (Dandelion) → Guiding Wind — find your bed"); args.Context.AddString(" " + FeatherFood + " (Feathers) → Feather Fall — no fall damage 60s"); args.Context.AddString(" Any Trophy → Dungeon Seeker — find nearest dungeon"); args.Context.AddString($"Global cooldown: {RitualCooldownDuration}s. Hold item in slot 1, look at burning campfire, press 1."); } internal void b__84_8(ConsoleEventArgs args) { Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null) { return; } string text = ((args.Args.Length > 1) ? args.Args[1].ToLower() : "all"); (string, bool, string, string)[] ritualItemMap = RitualItemMap; for (int i = 0; i < ritualItemMap.Length; i++) { (string, bool, string, string) tuple = ritualItemMap[i]; string item = tuple.Item3; string item2 = tuple.Item4; if (!(text != "all") || !(item != text)) { LearnRitual(localPlayer, item, item2); } } args.Context.AddString((text == "all") ? "All rituals learned." : ("Learned: " + text)); } internal void b__84_9(ConsoleEventArgs args) { Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null) { return; } string text = ((args.Args.Length > 1) ? args.Args[1].ToLower() : "all"); (string, bool, string, string)[] ritualItemMap = RitualItemMap; for (int i = 0; i < ritualItemMap.Length; i++) { string item = ritualItemMap[i].Item3; if (!(text != "all") || !(item != text)) { localPlayer.m_customData.Remove("ath_known_" + item); } } args.Context.AddString((text == "all") ? "All rituals forgotten." : ("Forgotten: " + text)); } internal void b__84_10(ConsoleEventArgs args) { //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) ZNetScene instance = ZNetScene.instance; if ((Object)(object)instance == (Object)null) { args.Context.AddString("ZNetScene not ready."); return; } BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; Dictionary dictionary = typeof(ZNetScene).GetField("m_namedPrefabs", bindingAttr)?.GetValue(instance) as Dictionary; if (args.Length < 2 || args[1] == "list") { if (dictionary == null) { args.Context.AddString("Could not read prefab list."); return; } List list = (from g in dictionary.Values where (Object)(object)g != (Object)null select ((Object)g).name into n where n.StartsWith("vfx_") || n.StartsWith("fx_") || n.StartsWith("sfx_") orderby n select n).ToList(); args.Context.AddString($"=== {list.Count} VFX prefabs ==="); { foreach (string item in list) { args.Context.AddString(" " + item); } return; } } Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null)) { GameObject prefab = instance.GetPrefab(args[1]); if ((Object)(object)prefab == (Object)null) { args.Context.AddString("Prefab '" + args[1] + "' not found."); return; } Object.Instantiate(prefab, ((Component)localPlayer).transform.position, Quaternion.identity); args.Context.AddString("Spawned " + args[1]); } } internal bool b__84_18(GameObject g) { return (Object)(object)g != (Object)null; } internal string b__84_19(GameObject g) { return ((Object)g).name; } internal bool b__84_20(string n) { if (!n.StartsWith("vfx_") && !n.StartsWith("fx_")) { return n.StartsWith("sfx_"); } return true; } internal string b__84_21(string n) { return n; } internal void b__84_11(ConsoleEventArgs args) { Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null)) { Vagon val = CartUpgrade.FindNearest(localPlayer, 10f); if ((Object)(object)val == (Object)null) { args.Context.AddString("No cart within 10m."); } else { CartUpgrade.Upgrade(localPlayer, val, args); } } } internal void b__84_12(ConsoleEventArgs args) { EnvMan instance = EnvMan.instance; if ((Object)(object)instance == (Object)null) { args.Context.AddString("EnvMan not ready."); return; } args.Context.AddString($"=== Environments ({instance.m_environments.Count}) ==="); foreach (EnvSetup environment in instance.m_environments) { args.Context.AddString(" " + environment.m_name); } } internal void b__84_13(ConsoleEventArgs args) { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null) { return; } int num = 0; MonoBehaviour[] array = Object.FindObjectsOfType(); foreach (MonoBehaviour val in array) { if ((Object)(object)val == (Object)null || ((object)val).GetType().Name != "RandomFlyingBird" || Vector3.Distance(((Component)val).transform.position, ((Component)localPlayer).transform.position) > 60f) { continue; } num++; args.Context.AddString($"--- Bird {num} ({((Object)((Component)val).gameObject).name}) ---"); BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; FieldInfo[] fields = ((object)val).GetType().GetFields(bindingAttr); foreach (FieldInfo fieldInfo in fields) { try { args.Context.AddString($" {fieldInfo.FieldType.Name} {fieldInfo.Name} = {fieldInfo.GetValue(val)}"); } catch { } } Component[] componentsInChildren = ((Component)val).GetComponentsInChildren(); foreach (Component val2 in componentsInChildren) { PropertyInfo propertyInfo = ((object)val2)?.GetType().GetProperty("parameters"); if (propertyInfo == null || !(propertyInfo.GetValue(val2) is Array array2)) { continue; } foreach (object item in array2) { PropertyInfo property = item.GetType().GetProperty("name"); PropertyInfo property2 = item.GetType().GetProperty("type"); args.Context.AddString($" Anim param: {property?.GetValue(item)} ({property2?.GetValue(item)})"); } } } if (num == 0) { args.Context.AddString("No birds within 60m."); } } internal void b__84_14(ConsoleEventArgs args) { EnvMan instance = EnvMan.instance; if ((Object)(object)instance == (Object)null) { args.Context.AddString("EnvMan not ready."); return; } FieldInfo[] fields = typeof(EnvMan).GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); foreach (FieldInfo fieldInfo in fields) { string name = fieldInfo.Name; if (name.ToLower().Contains("env") || name.ToLower().Contains("current") || name.ToLower().Contains("debug") || name.ToLower().Contains("time")) { object value = fieldInfo.GetValue(instance); string text = ((value == null) ? "null" : value.ToString()); EnvSetup val = (EnvSetup)((value is EnvSetup) ? value : null); if (val != null) { text = "EnvSetup(" + val.m_name + ")"; } args.Context.AddString(fieldInfo.FieldType.Name + " " + name + " = " + text); } } } internal bool b__85_0(StatusEffect s) { return ((Object)s).name == "SE_GuidingWind"; } internal bool b__92_0(StatusEffect s) { return ((Object)s).name == "SE_GuidingWind"; } internal bool b__96_0(StatusEffect s) { return ((Object)s).name == "SE_GuidingWind"; } internal bool b__99_0(StatusEffect s) { return ((Object)s).name == "SE_WaterWalk"; } internal bool b__100_0(StatusEffect s) { return ((Object)s).name == "SE_Giant"; } internal bool b__104_0(StatusEffect s) { return ((Object)s).name == "SE_FlamingSword"; } } internal static ManualLogSource Log = null; internal static EnvScheduler? Scheduler; internal static SE_GuidingWind? GuidingWindSE; internal static SE_WaterWalk? WaterWalkSE; internal static SE_Giant? GiantSE; internal static SE_FlamingSword? FlamingSwordSE; internal static PilgrimConfig Cfg = PilgrimConfig.Default(); private static bool _cfgDirty = false; private static FileSystemWatcher? _cfgWatcher; internal static Vector3? SeekOverrideTarget = null; internal static readonly (string Match, bool Prefix, string Key, string Display)[] RitualItemMap = new(string, bool, string, string)[14] { ("RawMeat", false, "seek_altar", "Boar Meat"), ("Mushroom", true, "restore_power", "Mushroom"), ("Dandelion", false, "seek_bed", "Dandelion"), ("Feathers", false, "feather_fall", "Feathers"), ("Coins", false, "seek_trader", "Coins"), ("Trophy", true, "seek_dungeon", "a Trophy"), ("GreydwarfEye", false, "clear_skies", "Greydwarf Eye"), ("Stone", false, "water_walk", "Stone"), ("AncientSeed", false, "growth", "Ancient Seed"), ("BoneFragments", false, "tame_flock", "Bone Fragments"), ("Flint", false, "seek_player", "Flint"), ("Resin", false, "kindle", "Resin"), ("YmirRemains", false, "giant", "Ymir Flesh"), ("SurtlingCore", false, "flaming_sword", "Surtling Core") }; internal static float RitualCooldownRemaining = 0f; internal static float FeatherRitualExpiry = 0f; internal static float ClearSkiesExpiry = 0f; internal static float RainExpiry = 0f; internal static float GiantRainExpiry = 0f; internal static float WaterWalkExpiry = 0f; internal static float SeekEnvExpiry = 0f; internal static float DungeonEnvExpiry = 0f; internal static float HomeEnvExpiry = 0f; internal static bool GrowthBlessingActive = false; internal static bool TameBlessingActive = false; internal static float FlamingSwordExpiry = 0f; private static ItemData? _flamingSwordItem = null; private static ItemData? _origRightItem = null; internal const string FlamingSwordPrefab = "SwordIronFire"; internal static float GiantExpiry = 0f; internal static float GiantTargetScale = 1f; internal const float GiantCarryBonus = 300f; internal const float GiantScale = 3f; internal const float GiantWalkMult = 1.5f; internal const float GiantRunMult = 2.5f; internal const float GiantJumpMult = 1.2f; internal static bool GiantSpeedApplied = false; private static DamageTypes _origUnarmedDmg; private static short _origUnarmedTier; private static float _origAttackRange; private static float _origAttackHeight; private static float _origAttackOffset; private static float _origAutoPickupRange; private static float _origSwimDepth; internal static readonly Dictionary TrophyToPower = new Dictionary { { "TrophyEikthyr", "GP_Eikthyr" }, { "TrophyTheElder", "GP_TheElder" }, { "TrophyBonemass", "GP_Bonemass" }, { "TrophyDragonQueen", "GP_Moder" }, { "TrophyGoblinKing", "GP_Yagluth" }, { "TrophySeekerQueen", "GP_Queen" }, { "TrophyFader", "GP_Fader" } }; private static readonly Random Rng = new Random(); private static readonly string[] DungeonLocations = new string[7] { "Crypt2", "Crypt3", "Crypt4", "SunkenCrypt", "MountainCave", "MountainCave02", "InfectedMine" }; private static readonly string[] TraderLocations = new string[2] { "Vendor_BlackForest", "Hildir_camp" }; private static MethodInfo? _isExploredMethod; private static readonly (string boss, string prefab)[] BossChain = new(string, string)[7] { ("Eikthyr", "Eikthyrpower"), ("The Elder", "GDKing"), ("Bonemass", "Bonemass"), ("Moder", "Dragonqueen"), ("Yagluth", "GoblinKing"), ("The Queen", "SeekerQueen"), ("Fader", "Fader") }; private static readonly string[] BossKeys = new string[7] { "defeated_eikthyr", "defeated_gdking", "defeated_bonemass", "defeated_dragon", "defeated_goblinking", "defeated_queen", "defeated_fader" }; internal static string ConfigPath => Path.Combine(Paths.ConfigPath, "Pilgrim.yaml"); internal static string SeekFood => Cfg.Rituals.Items.GetValueOrDefault("seek_altar")?.Item ?? "RawMeat"; internal static string HomeFood => Cfg.Rituals.Items.GetValueOrDefault("seek_bed")?.Item ?? "Dandelion"; internal static string FeatherFood => Cfg.Rituals.Items.GetValueOrDefault("feather_fall")?.Item ?? "Feathers"; internal static string TraderFood => Cfg.Rituals.Items.GetValueOrDefault("seek_trader")?.Item ?? "Coins"; internal static string GrowthFood => Cfg.Rituals.Items.GetValueOrDefault("growth")?.Item ?? "AncientSeed"; internal static string PlayerSeekFood => Cfg.Rituals.Items.GetValueOrDefault("seek_player")?.Item ?? "Flint"; internal static string KindleFood => Cfg.Rituals.Items.GetValueOrDefault("kindle")?.Item ?? "Resin"; internal static string TameFood => Cfg.Rituals.Items.GetValueOrDefault("tame_flock")?.Item ?? "BoneFragments"; internal static string GiantFood => Cfg.Rituals.Items.GetValueOrDefault("giant")?.Item ?? "YmirRemains"; internal static string FlamingSwordFood => Cfg.Rituals.Items.GetValueOrDefault("flaming_sword")?.Item ?? "SurtlingCore"; internal static float RitualCooldownDuration => Cfg.Rituals.Cooldown; internal static float ClearSkiesDuration => Cfg.Rituals.Items.GetValueOrDefault("clear_skies")?.Duration ?? 900f; internal static float RainDuration => Cfg.Rituals.Items.GetValueOrDefault("restore_power")?.Duration ?? 600f; internal static float WaterWalkDuration => Cfg.Rituals.Items.GetValueOrDefault("water_walk")?.Duration ?? 60f; internal static float SeekEnvDuration => 60f; internal static float DungeonEnvDuration => 60f; internal static float HomeEnvDuration => 60f; internal static void LoadConfig() { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Expected O, but got Unknown try { if (!File.Exists(ConfigPath)) { string contents = ((BuilderSkeleton)new SerializerBuilder()).WithNamingConvention(UnderscoredNamingConvention.Instance).Build().Serialize((object)PilgrimConfig.Default()); File.WriteAllText(ConfigPath, contents); Log.LogInfo((object)("[Pilgrim] Wrote default config to " + ConfigPath)); } Cfg = ((BuilderSkeleton)new DeserializerBuilder()).WithNamingConvention(UnderscoredNamingConvention.Instance).IgnoreUnmatchedProperties().Build() .Deserialize(File.ReadAllText(ConfigPath)); PilgrimConfig pilgrimConfig = PilgrimConfig.Default(); bool flag = false; foreach (var (key, value) in pilgrimConfig.Rituals.Items) { if (!Cfg.Rituals.Items.ContainsKey(key)) { Cfg.Rituals.Items[key] = value; flag = true; } } if (flag) { string contents2 = ((BuilderSkeleton)new SerializerBuilder()).WithNamingConvention(UnderscoredNamingConvention.Instance).Build().Serialize((object)Cfg); File.WriteAllText(ConfigPath, contents2); Log.LogInfo((object)"[Pilgrim] Backfilled missing ritual config keys."); } Log.LogInfo((object)"[Pilgrim] Config loaded."); } catch (Exception ex) { Log.LogError((object)("[Pilgrim] Config load failed: " + ex.Message + " — using defaults.")); Cfg = PilgrimConfig.Default(); } } internal static bool IsRitualKnown(Player player, string key) { return player.m_customData.ContainsKey("ath_known_" + key); } internal static void LearnRitual(Player player, string key, string itemDisplayName) { if (!IsRitualKnown(player, key)) { player.m_customData["ath_known_" + key] = "1"; if (Cfg.Rituals.Items.TryGetValue(key, out RitualItemConfig value)) { ((Character)player).Message((MessageType)1, "Ritual discovered: " + value.HoverText, 0, (Sprite)null); ((Character)player).Message((MessageType)2, "Ritual discovered\n" + value.HoverText + "\nOffer " + itemDisplayName + " at a burning campfire.", 0, (Sprite)null); } } } private void Awake() { //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) Log = ((BaseUnityPlugin)this).Logger; LoadConfig(); _cfgWatcher = new FileSystemWatcher(Paths.ConfigPath, "Pilgrim.yaml") { NotifyFilter = NotifyFilters.LastWrite, EnableRaisingEvents = true }; _cfgWatcher.Changed += delegate { _cfgDirty = true; }; try { new Harmony("com.ctogle.pilgrim").PatchAll(); } catch (Exception ex) { Log.LogError((object)("[Pilgrim] Harmony patch failed: " + ex.Message)); } RegisterCommands(); GameObject val = new GameObject("AthScheduler"); Object.DontDestroyOnLoad((Object)val); Scheduler = val.AddComponent(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Pilgrim loaded."); } private void Update() { if (_cfgDirty) { _cfgDirty = false; LoadConfig(); } } private void RegisterCommands() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Expected O, but got Unknown //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Expected O, but got Unknown //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Expected O, but got Unknown //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Expected O, but got Unknown //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Expected O, but got Unknown //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Expected O, but got Unknown //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Expected O, but got Unknown //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Expected O, but got Unknown //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Expected O, but got Unknown //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Expected O, but got Unknown //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Expected O, but got Unknown //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Expected O, but got Unknown //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_02f6: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Expected O, but got Unknown //IL_0342: Unknown result type (might be due to invalid IL or missing references) //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Expected O, but got Unknown object obj = <>c.<>9__84_0; if (obj == null) { ConsoleEvent val = delegate(ConsoleEventArgs args) { //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_0324: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Unknown result type (might be due to invalid IL or missing references) EnvMan instance = EnvMan.instance; if ((Object)(object)instance == (Object)null) { args.Context.AddString("EnvMan not ready."); } else { float tod = GetTod(); string todLabel = GetTodLabel(tod); string text = GetEnvSetupName(instance, "m_currentEnv") ?? "unknown"; string text2 = GetEnvSetupName(instance, "m_nextEnv") ?? "unknown"; string text3 = instance.m_debugEnv ?? ""; string text4 = (((Object)(object)Scheduler != (Object)null && Scheduler.Active) ? $"ON (prob {Scheduler.Probability:P0})" : "OFF"); double num = (((Object)(object)ZNet.instance != (Object)null) ? ZNet.instance.GetTimeSeconds() : 0.0); args.Context.AddString("=== World State ==="); args.Context.AddString($"TOD : {tod:F2} ({todLabel}) [ZNet raw: {num:F0}s mod1800={num % 1800.0:F0}]"); args.Context.AddString("Current env : " + text + ((text3.Length > 0) ? (" [forced: " + text3 + "]") : "")); args.Context.AddString("Next env : " + text2); args.Context.AddString($"Is wet : {EnvMan.IsWet()}"); args.Context.AddString($"Is cold : {EnvMan.IsCold()}"); args.Context.AddString($"Is freezing : {EnvMan.IsFreezing()}"); args.Context.AddString($"Wind : {instance.GetWindIntensity():F2} dir {instance.GetWindDir()}"); args.Context.AddString("Scheduler : " + text4); RandEventSystem instance2 = RandEventSystem.instance; if ((Object)(object)instance2 != (Object)null) { object obj16 = AnyField(instance2, "m_activeEvent", "m_currentEvent"); if (obj16 != null && (!(AnyField(instance2, "m_haveActiveEvent") is bool flag) || flag) && obj16 != null) { string arg = (AnyField(obj16, "m_name") as string) ?? "?"; float num2 = ((AnyField(instance2, "m_eventTimer", "m_timer") is float num3) ? num3 : 0f); string arg2 = ((AnyField(instance2, "m_eventPos", "m_pos") is Vector3 val16) ? $"({val16.x:F0},{val16.z:F0})" : "?"); args.Context.AddString($"Active raid : {arg} | {num2:F0}s | @ {arg2}"); } else { args.Context.AddString("Active raid : none"); } } } }; <>c.<>9__84_0 = val; obj = (object)val; } new ConsoleCommand("ath_envstate", "world env, TOD, raid, wind", (ConsoleEvent)obj, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); object obj2 = <>c.<>9__84_1; if (obj2 == null) { ConsoleEvent val2 = delegate(ConsoleEventArgs args) { //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) List allPlayers = Player.GetAllPlayers(); if (allPlayers == null || allPlayers.Count == 0) { args.Context.AddString("No players found."); } else { args.Context.AddString($"=== Players ({allPlayers.Count}) ==="); List list = new List(); foreach (Player item3 in allPlayers) { string playerName = item3.GetPlayerName(); float health = ((Character)item3).GetHealth(); float maxHealth = ((Character)item3).GetMaxHealth(); float stamina = item3.GetStamina(); float maxStamina = ((Character)item3).GetMaxStamina(); float eitr = item3.GetEitr(); float maxEitr = ((Character)item3).GetMaxEitr(); Vector3 position = ((Component)item3).transform.position; list.Add(position); string arg = ((object)item3.GetCurrentBiome()/*cast due to .constrained prefix*/).ToString(); SEMan sEMan = ((Character)item3).GetSEMan(); List list2 = ((sEMan != null) ? sEMan.GetStatusEffects() : null); string text = ((list2 != null && list2.Count > 0) ? string.Join(", ", list2.Select((StatusEffect e) => (!string.IsNullOrEmpty(e.m_name)) ? e.m_name : ((Object)e).name)) : "none"); args.Context.AddString("--- " + playerName + " ---"); args.Context.AddString($" HP {health:F0}/{maxHealth:F0} | Stamina {stamina:F0}/{maxStamina:F0} | Eitr {eitr:F0}/{maxEitr:F0}"); args.Context.AddString($" Biome: {arg} | Pos: ({position.x:F0},{position.z:F0})"); args.Context.AddString(" Effects: " + text); } if (list.Count > 1) { float num = 0f; for (int num2 = 0; num2 < list.Count; num2++) { for (int num3 = num2 + 1; num3 < list.Count; num3++) { float num4 = Vector3.Distance(list[num2], list[num3]); if (num4 > num) { num = num4; } } } args.Context.AddString($"Party spread: {num:F0}m"); } } }; <>c.<>9__84_1 = val2; obj2 = (object)val2; } new ConsoleCommand("ath_playerstats", "all players stats + party spread", (ConsoleEvent)obj2, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); object obj3 = <>c.<>9__84_2; if (obj3 == null) { ConsoleEvent val3 = delegate(ConsoleEventArgs args) { ClearSkiesExpiry = 0f; RainExpiry = 0f; GiantRainExpiry = 0f; WaterWalkExpiry = 0f; SeekEnvExpiry = 0f; DungeonEnvExpiry = 0f; HomeEnvExpiry = 0f; if (GiantExpiry > 0f) { Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer != (Object)null) { DeactivateGiant(localPlayer); } else { GiantExpiry = 0f; } } if ((Object)(object)EnvMan.instance != (Object)null) { EnvMan.instance.m_debugEnv = ""; } EnvMan instance = EnvMan.instance; if (instance != null) { instance.ResetDebugWind(); } args.Context.AddString("Weather overrides cleared."); }; <>c.<>9__84_2 = val3; obj3 = (object)val3; } new ConsoleCommand("ath_clearenv", "cancel all Pilgrim weather overrides", (ConsoleEvent)obj3, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); object obj4 = <>c.<>9__84_3; if (obj4 == null) { ConsoleEvent val4 = delegate(ConsoleEventArgs args) { ActivateSeek(args.Context); }; <>c.<>9__84_3 = val4; obj4 = (object)val4; } new ConsoleCommand("ath_seek", "point wind toward next boss altar", (ConsoleEvent)obj4, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); object obj5 = <>c.<>9__84_4; if (obj5 == null) { ConsoleEvent val5 = delegate(ConsoleEventArgs args) { EnvScheduler scheduler = Scheduler; if ((Object)(object)scheduler == (Object)null) { args.Context.AddString("Scheduler not ready."); } else if (args.Length < 2) { PrintSchedule(args, scheduler); } else { switch (args[1].ToLower()) { case "on": scheduler.Active = true; args.Context.AddString("Scheduler ON"); break; case "off": scheduler.Active = false; args.Context.AddString("Scheduler OFF"); break; case "prob": { if (args.Length >= 3 && float.TryParse(args[2], out var result)) { scheduler.Probability = Mathf.Clamp01(result); args.Context.AddString($"Probability → {scheduler.Probability:P0}"); } break; } case "night": if (args.Length >= 3) { scheduler.NightPool = (from x in args[2].Split(',') select x.Trim()).ToList(); args.Context.AddString("Night pool → " + string.Join(", ", scheduler.NightPool)); } break; case "noon": if (args.Length >= 3) { scheduler.NoonPool = (from x in args[2].Split(',') select x.Trim()).ToList(); args.Context.AddString("Noon pool → " + string.Join(", ", scheduler.NoonPool)); } break; default: PrintSchedule(args, scheduler); break; } } }; <>c.<>9__84_4 = val5; obj5 = (object)val5; } new ConsoleCommand("ath_schedule", "ath_schedule [on|off|prob <0-1>|night |noon ]", (ConsoleEvent)obj5, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); object obj6 = <>c.<>9__84_5; if (obj6 == null) { ConsoleEvent val6 = delegate(ConsoleEventArgs args) { Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null) { args.Context.AddString("No local player."); } else { ActivateWaterWalk(localPlayer); args.Context.AddString("Water walk active."); } }; <>c.<>9__84_5 = val6; obj6 = (object)val6; } new ConsoleCommand("ath_waterwalk", "walk on water for 2 minutes", (ConsoleEvent)obj6, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); object obj7 = <>c.<>9__84_6; if (obj7 == null) { ConsoleEvent val7 = delegate(ConsoleEventArgs args) { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Scheduler == (Object)null) { args.Context.AddString("Scheduler not ready."); } else { string text = ((args.Length > 1) ? args[1].ToLower() : "n"); Vector3 direction = (Vector3)(text switch { "s" => new Vector3(0f, 0f, -1f), "e" => new Vector3(1f, 0f, 0f), "w" => new Vector3(-1f, 0f, 0f), _ => new Vector3(0f, 0f, 1f), }); Scheduler.SendBird(direction); args.Context.AddString("Bird away (" + text + ")."); } }; <>c.<>9__84_6 = val7; obj7 = (object)val7; } new ConsoleCommand("ath_bird", "ath_bird [n|s|e|w] — send a crow flying in a direction (default: north)", (ConsoleEvent)obj7, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); object obj8 = <>c.<>9__84_7; if (obj8 == null) { ConsoleEvent val8 = delegate(ConsoleEventArgs args) { args.Context.AddString("=== Campfire Rituals ==="); args.Context.AddString(" " + SeekFood + " (Boar Meat) → Guiding Wind — seek next boss altar"); args.Context.AddString(" Mushroom* (Yellow Mushroom) → Reset forsaken power cooldown"); args.Context.AddString(" " + HomeFood + " (Dandelion) → Guiding Wind — find your bed"); args.Context.AddString(" " + FeatherFood + " (Feathers) → Feather Fall — no fall damage 60s"); args.Context.AddString(" Any Trophy → Dungeon Seeker — find nearest dungeon"); args.Context.AddString($"Global cooldown: {RitualCooldownDuration}s. Hold item in slot 1, look at burning campfire, press 1."); }; <>c.<>9__84_7 = val8; obj8 = (object)val8; } new ConsoleCommand("ath_rituals", "list available campfire rituals", (ConsoleEvent)obj8, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); object obj9 = <>c.<>9__84_8; if (obj9 == null) { ConsoleEvent val9 = delegate(ConsoleEventArgs args) { Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null)) { string text = ((args.Args.Length > 1) ? args.Args[1].ToLower() : "all"); (string, bool, string, string)[] ritualItemMap = RitualItemMap; for (int i = 0; i < ritualItemMap.Length; i++) { (string, bool, string, string) tuple = ritualItemMap[i]; string item = tuple.Item3; string item2 = tuple.Item4; if (!(text != "all") || !(item != text)) { LearnRitual(localPlayer, item, item2); } } args.Context.AddString((text == "all") ? "All rituals learned." : ("Learned: " + text)); } }; <>c.<>9__84_8 = val9; obj9 = (object)val9; } new ConsoleCommand("ath_learn", "ath_learn [ritual|all] — unlock ritual discovery (for testing)", (ConsoleEvent)obj9, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); object obj10 = <>c.<>9__84_9; if (obj10 == null) { ConsoleEvent val10 = delegate(ConsoleEventArgs args) { Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null)) { string text = ((args.Args.Length > 1) ? args.Args[1].ToLower() : "all"); (string, bool, string, string)[] ritualItemMap = RitualItemMap; for (int i = 0; i < ritualItemMap.Length; i++) { string item = ritualItemMap[i].Item3; if (!(text != "all") || !(item != text)) { localPlayer.m_customData.Remove("ath_known_" + item); } } args.Context.AddString((text == "all") ? "All rituals forgotten." : ("Forgotten: " + text)); } }; <>c.<>9__84_9 = val10; obj10 = (object)val10; } new ConsoleCommand("ath_forget", "ath_forget [ritual|all] — reset ritual discovery", (ConsoleEvent)obj10, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); object obj11 = <>c.<>9__84_10; if (obj11 == null) { ConsoleEvent val11 = delegate(ConsoleEventArgs args) { //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) ZNetScene instance = ZNetScene.instance; if ((Object)(object)instance == (Object)null) { args.Context.AddString("ZNetScene not ready."); } else { BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; Dictionary dictionary = typeof(ZNetScene).GetField("m_namedPrefabs", bindingAttr)?.GetValue(instance) as Dictionary; if (args.Length < 2 || args[1] == "list") { if (dictionary != null) { List list = (from g in dictionary.Values where (Object)(object)g != (Object)null select ((Object)g).name into n where n.StartsWith("vfx_") || n.StartsWith("fx_") || n.StartsWith("sfx_") orderby n select n).ToList(); args.Context.AddString($"=== {list.Count} VFX prefabs ==="); { foreach (string item4 in list) { args.Context.AddString(" " + item4); } return; } } args.Context.AddString("Could not read prefab list."); } else { Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null)) { GameObject prefab = instance.GetPrefab(args[1]); if ((Object)(object)prefab == (Object)null) { args.Context.AddString("Prefab '" + args[1] + "' not found."); } else { Object.Instantiate(prefab, ((Component)localPlayer).transform.position, Quaternion.identity); args.Context.AddString("Spawned " + args[1]); } } } } }; <>c.<>9__84_10 = val11; obj11 = (object)val11; } new ConsoleCommand("ath_vfx", "ath_vfx — preview a VFX at your position, or list all vfx_ prefabs", (ConsoleEvent)obj11, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); object obj12 = <>c.<>9__84_11; if (obj12 == null) { ConsoleEvent val12 = delegate(ConsoleEventArgs args) { Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null)) { Vagon val16 = CartUpgrade.FindNearest(localPlayer, 10f); if ((Object)(object)val16 == (Object)null) { args.Context.AddString("No cart within 10m."); } else { CartUpgrade.Upgrade(localPlayer, val16, args); } } }; <>c.<>9__84_11 = val12; obj12 = (object)val12; } new ConsoleCommand("ath_upgradecart", "upgrade nearest cart capacity (or Shift+E on cart)", (ConsoleEvent)obj12, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); object obj13 = <>c.<>9__84_12; if (obj13 == null) { ConsoleEvent val13 = delegate(ConsoleEventArgs args) { EnvMan instance = EnvMan.instance; if ((Object)(object)instance == (Object)null) { args.Context.AddString("EnvMan not ready."); return; } args.Context.AddString($"=== Environments ({instance.m_environments.Count}) ==="); foreach (EnvSetup environment in instance.m_environments) { args.Context.AddString(" " + environment.m_name); } }; <>c.<>9__84_12 = val13; obj13 = (object)val13; } new ConsoleCommand("ath_envlist", "lists all registered environments", (ConsoleEvent)obj13, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); object obj14 = <>c.<>9__84_13; if (obj14 == null) { ConsoleEvent val14 = delegate(ConsoleEventArgs args) { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null)) { int num = 0; MonoBehaviour[] array = Object.FindObjectsOfType(); foreach (MonoBehaviour val16 in array) { if (!((Object)(object)val16 == (Object)null) && !(((object)val16).GetType().Name != "RandomFlyingBird") && !(Vector3.Distance(((Component)val16).transform.position, ((Component)localPlayer).transform.position) > 60f)) { num++; args.Context.AddString($"--- Bird {num} ({((Object)((Component)val16).gameObject).name}) ---"); BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; FieldInfo[] fields = ((object)val16).GetType().GetFields(bindingAttr); foreach (FieldInfo fieldInfo in fields) { try { args.Context.AddString($" {fieldInfo.FieldType.Name} {fieldInfo.Name} = {fieldInfo.GetValue(val16)}"); } catch { } } Component[] componentsInChildren = ((Component)val16).GetComponentsInChildren(); foreach (Component val17 in componentsInChildren) { PropertyInfo propertyInfo = ((object)val17)?.GetType().GetProperty("parameters"); if (!(propertyInfo == null) && propertyInfo.GetValue(val17) is Array array2) { foreach (object item5 in array2) { PropertyInfo property = item5.GetType().GetProperty("name"); PropertyInfo property2 = item5.GetType().GetProperty("type"); args.Context.AddString($" Anim param: {property?.GetValue(item5)} ({property2?.GetValue(item5)})"); } } } } } if (num == 0) { args.Context.AddString("No birds within 60m."); } } }; <>c.<>9__84_13 = val14; obj14 = (object)val14; } new ConsoleCommand("ath_birdparams", "dump RandomFlyingBird fields and animator params on nearby birds", (ConsoleEvent)obj14, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); object obj15 = <>c.<>9__84_14; if (obj15 == null) { ConsoleEvent val15 = delegate(ConsoleEventArgs args) { EnvMan instance = EnvMan.instance; if ((Object)(object)instance == (Object)null) { args.Context.AddString("EnvMan not ready."); } else { FieldInfo[] fields = typeof(EnvMan).GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); foreach (FieldInfo fieldInfo in fields) { string name = fieldInfo.Name; if (name.ToLower().Contains("env") || name.ToLower().Contains("current") || name.ToLower().Contains("debug") || name.ToLower().Contains("time")) { object value = fieldInfo.GetValue(instance); string text = ((value == null) ? "null" : value.ToString()); EnvSetup val16 = (EnvSetup)((value is EnvSetup) ? value : null); if (val16 != null) { text = "EnvSetup(" + val16.m_name + ")"; } args.Context.AddString(fieldInfo.FieldType.Name + " " + name + " = " + text); } } } }; <>c.<>9__84_14 = val15; obj15 = (object)val15; } new ConsoleCommand("ath_envdump", "dumps env-related EnvMan fields", (ConsoleEvent)obj15, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); } internal static void ActivateSeek(Terminal? ctx = null, string message = "The wind stirs.") { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null) { return; } SeekOverrideTarget = null; var (text, prefabName) = GetNextBoss(); if (text == null) { Msg(ctx, "All known bosses defeated. The path is your own."); return; } if (!FindClosestLocation(prefabName, ((Component)localPlayer).transform.position, out var result)) { Msg(ctx, "Next boss: " + text + " — altar not yet in loaded zones."); return; } Vector3 position = ((Component)localPlayer).transform.position; float num = result.x - position.x; float num2 = result.z - position.z; float num3 = Mathf.Sqrt(num * num + num2 * num2); float num4 = Mathf.Atan2(num, num2) * 57.29578f; if (num4 < 0f) { num4 += 360f; } StatusEffect val = ObjectDB.instance?.m_StatusEffects?.Find((StatusEffect s) => ((Object)s).name == "SE_GuidingWind"); if ((Object)(object)val == (Object)null) { val = (StatusEffect)(object)GuidingWindSE; } if ((Object)(object)val != (Object)null) { ((Character)localPlayer).GetSEMan().AddStatusEffect(val, true, 0, 0f); Log.LogInfo((object)$"[EnvR] Applied SE: {((Object)val).name} ttl={val.m_ttl}"); } else { Log.LogWarning((object)"[EnvR] GuidingWindSE is null — ObjectDB patch may not have run"); } SeekEnvExpiry = Time.time + SeekEnvDuration; if ((Object)(object)EnvMan.instance != (Object)null) { EnvMan.instance.m_debugEnv = "LastLight"; } if ((Object)(object)ctx != (Object)null) { Msg(ctx, "=== Guiding Wind ==="); Msg(ctx, "Seek : " + text); Msg(ctx, $"Distance : {num3:F0}m ({num3 / 1000f:F1}km)"); Msg(ctx, $"Bearing : {num4:F0}°"); Msg(ctx, "Follow the wind."); } else { ((Character)localPlayer).Message((MessageType)2, message.Replace("{boss}", text), 0, (Sprite)null); } } internal static void ActivateCooldownReset(Player player, string message = "The flame accepts your offering. {power} is ready.") { BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; FieldInfo field = typeof(Player).GetField("m_guardianPower", bindingAttr); FieldInfo field2 = typeof(Player).GetField("m_guardianPowerCooldown", bindingAttr); string powerName = field?.GetValue(player) as string; if (string.IsNullOrEmpty(powerName)) { ((Character)player).Message((MessageType)2, "No forsaken power to reset.", 0, (Sprite)null); return; } if (((field2?.GetValue(player) is float num) ? num : 0f) <= 0f) { ((Character)player).Message((MessageType)2, "Your power is already ready.", 0, (Sprite)null); return; } field2?.SetValue(player, 0f); string newValue = (ObjectDB.instance?.m_StatusEffects?.Find((StatusEffect s) => ((Object)s).name == powerName))?.m_name ?? powerName; ((Character)player).Message((MessageType)2, message.Replace("{power}", newValue), 0, (Sprite)null); RainExpiry = Time.time + RainDuration; if ((Object)(object)EnvMan.instance != (Object)null) { EnvMan.instance.m_debugEnv = "Rain"; } } private static bool IsUnexplored(Vector3 pos) { //IL_0052: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Minimap.instance == (Object)null) { return true; } if ((object)_isExploredMethod == null) { _isExploredMethod = typeof(Minimap).GetMethod("IsExplored", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } if (_isExploredMethod == null) { return true; } if (_isExploredMethod.Invoke(Minimap.instance, new object[1] { pos }) is bool flag) { return !flag; } return false; } private static bool FindNearestUnexplored(string[] locationNames, Vector3 from, out Vector3 bestPos, out string bestName, out float bestDist) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) bestPos = Vector3.zero; bestName = ""; bestDist = float.MaxValue; foreach (string text in locationNames) { if (FindClosestLocation(text, from, out var result) && IsUnexplored(result)) { float num = Vector3.Distance(from, result); if (num < bestDist) { bestDist = num; bestPos = result; bestName = text; } } } return bestDist < float.MaxValue; } internal static void ActivateDungeonSeek(Player player, string trophyPrefab, string message = "The veil parts — something stirs nearby.") { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) if (!FindNearestUnexplored(DungeonLocations, ((Component)player).transform.position, out Vector3 bestPos, out string bestName, out float bestDist)) { ((Character)player).Message((MessageType)2, "The spirits do not answer. No unexplored dungeon found.", 0, (Sprite)null); return; } SeekOverrideTarget = bestPos; DungeonEnvExpiry = Time.time + DungeonEnvDuration; if ((Object)(object)EnvMan.instance != (Object)null) { EnvMan.instance.m_debugEnv = "VoidWhisper"; } StatusEffect val = (StatusEffect)(((object)ObjectDB.instance?.m_StatusEffects?.Find((StatusEffect s) => ((Object)s).name == "SE_GuidingWind")) ?? ((object)GuidingWindSE)); if ((Object)(object)val != (Object)null) { ((Character)player).GetSEMan().AddStatusEffect(val, true, 0, 0f); } ((Character)player).Message((MessageType)2, message, 0, (Sprite)null); Log.LogInfo((object)$"[EnvR] Dungeon seek: {bestName} at {bestDist:F0}m"); } internal static void ActivateTraderSeek(Player player) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) if (!FindNearestUnexplored(TraderLocations, ((Component)player).transform.position, out Vector3 bestPos, out string bestName, out float bestDist)) { bestDist = float.MaxValue; string[] traderLocations = TraderLocations; foreach (string text in traderLocations) { if (FindClosestLocation(text, ((Component)player).transform.position, out var result)) { float num = Vector3.Distance(((Component)player).transform.position, result); if (num < bestDist) { bestDist = num; bestPos = result; bestName = text; } } } if (bestDist == float.MaxValue) { ((Character)player).Message((MessageType)2, "The merchants are beyond reach.", 0, (Sprite)null); return; } } ((Character)player).Message((MessageType)2, Cfg.Rituals.Items.GetValueOrDefault("seek_trader")?.Message ?? "Gold calls to gold...", 0, (Sprite)null); Log.LogInfo((object)$"[EnvR] Trader seek: {bestName} at {bestDist:F0}m"); Vector3 val = bestPos - ((Component)player).transform.position; val.y = 0f; if (val != Vector3.zero && (Object)(object)Scheduler != (Object)null) { Scheduler.SendBird(((Vector3)(ref val)).normalized); } } internal static void ActivateKindle(Player player, string message = "The darkness yields.") { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) int num = 0; Fireplace[] array = Object.FindObjectsOfType(); foreach (Fireplace val in array) { if (!(Vector3.Distance(((Component)val).transform.position, ((Component)player).transform.position) > 20f)) { val.SetFuel(val.m_maxFuel); num++; } } string text = ((num > 0) ? message : "No fires nearby to kindle."); ((Character)player).Message((MessageType)2, text, 0, (Sprite)null); Log.LogInfo((object)$"[Pilgrim] Kindle: lit {num} fires within {20f}m"); } internal static void ActivatePlayerSeek(Player player) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) Player val = null; float num = float.MaxValue; foreach (Player allPlayer in Player.GetAllPlayers()) { if (!((Object)(object)allPlayer == (Object)(object)player)) { float num2 = Vector3.Distance(((Component)player).transform.position, ((Component)allPlayer).transform.position); if (num2 < num) { num = num2; val = allPlayer; } } } if ((Object)(object)val == (Object)null) { ((Character)player).Message((MessageType)2, "You are alone...", 0, (Sprite)null); return; } Vector3 val2 = ((Component)val).transform.position - ((Component)player).transform.position; val2.y = 0f; if (val2 != Vector3.zero && (Object)(object)Scheduler != (Object)null) { Scheduler.SendBird(((Vector3)(ref val2)).normalized); } ((Character)player).Message((MessageType)2, "Find fellowship.", 0, (Sprite)null); Log.LogInfo((object)$"[EnvR] Player seek: {val.GetPlayerName()} at {num:F0}m"); } internal static void ActivateHomeSeek(Player player, string message = "The flower carries you home...") { //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) Bed val = null; float num = float.MaxValue; Bed[] array = Object.FindObjectsOfType(); foreach (Bed val2 in array) { object obj = typeof(Bed).GetMethod("IsMine", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.Invoke(val2, null); if (obj is bool && (bool)obj) { float num2 = Vector3.Distance(((Component)player).transform.position, ((Component)val2).transform.position); if (num2 < num) { num = num2; val = val2; } } } Vector3 val3 = (((Object)(object)val != (Object)null) ? ((Component)val).transform.position : Vector3.zero); Log.LogInfo((object)$"[EnvR] HomeSeek: bed={((val != null) ? ((Object)val).name : null)} pos={val3} dist={num:F0}m"); if (val3 == Vector3.zero) { ((Character)player).Message((MessageType)2, "No bed found in loaded area — travel closer to home.", 0, (Sprite)null); return; } SeekOverrideTarget = val3; HomeEnvExpiry = Time.time + HomeEnvDuration; if ((Object)(object)EnvMan.instance != (Object)null) { EnvMan.instance.m_debugEnv = "DreamWalk"; } StatusEffect val4 = (StatusEffect)(((object)ObjectDB.instance?.m_StatusEffects?.Find((StatusEffect s) => ((Object)s).name == "SE_GuidingWind")) ?? ((object)GuidingWindSE)); if ((Object)(object)val4 != (Object)null) { ((Character)player).GetSEMan().AddStatusEffect(val4, true, 0, 0f); } float num3 = Vector3.Distance(((Component)player).transform.position, val3); ((Character)player).Message((MessageType)2, message, 0, (Sprite)null); Log.LogInfo((object)$"[EnvR] Home seek: bed at {val3}, dist {num3:F0}m"); } internal static void ActivateFeatherRitual(Player player, string message = "Light as a feather — fall without fear.") { ZNetScene instance = ZNetScene.instance; GameObject obj = ((instance != null) ? instance.GetPrefab("CapeFeather") : null); StatusEffect val = ((obj != null) ? obj.GetComponent() : null)?.m_itemData?.m_shared?.m_equipStatusEffect; if ((Object)(object)val == (Object)null) { ((Character)player).Message((MessageType)2, "The feathers scatter in the wind... (feather SE not found)", 0, (Sprite)null); Log.LogWarning((object)"[EnvR] CapeFeather SE not found — check prefab name"); return; } StatusEffect val2 = Object.Instantiate(val); val2.m_ttl = 60f; val2.m_startMessage = ""; val2.m_stopMessage = ""; ((Character)player).GetSEMan().AddStatusEffect(val2, true, 0, 0f); FeatherRitualExpiry = Time.time + 60f; ((Character)player).Message((MessageType)2, message, 0, (Sprite)null); } internal static void ActivateClearSkies(Player player, string message = "The clouds part.") { ClearSkiesExpiry = Time.time + ClearSkiesDuration; if ((Object)(object)EnvMan.instance != (Object)null) { EnvMan.instance.m_debugEnv = "Clear"; } ((Character)player).Message((MessageType)2, message, 0, (Sprite)null); Log.LogInfo((object)$"[Pilgrim] Clear skies active for {ClearSkiesDuration}s"); } internal static void ActivateWaterWalk(Player player, string message = "The sea grows still beneath your feet.") { WaterWalkExpiry = Time.time + WaterWalkDuration; if ((Object)(object)EnvMan.instance != (Object)null) { EnvMan.instance.SetDebugWind(0f, 0f); } StatusEffect val = (StatusEffect)(((object)ObjectDB.instance?.m_StatusEffects?.Find((StatusEffect s) => ((Object)s).name == "SE_WaterWalk")) ?? ((object)WaterWalkSE)); if ((Object)(object)val != (Object)null) { ((Character)player).GetSEMan().AddStatusEffect(val, true, 0, 0f); } ((Character)player).Message((MessageType)2, message, 0, (Sprite)null); } internal static void ActivateGiant(Player player, string message = "The mountain answers. You are vast.") { //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) float num = Cfg.Rituals.Items.GetValueOrDefault("giant")?.Duration ?? 180f; GiantExpiry = Time.time + num; GiantTargetScale = 3f; ZNetView component = ((Component)player).GetComponent(); if (component != null) { ZDO zDO = component.GetZDO(); if (zDO != null) { zDO.Set("ath_scale", 3f); } } player.m_maxCarryWeight += 300f; StatusEffect val = (StatusEffect)(((object)ObjectDB.instance?.m_StatusEffects?.Find((StatusEffect s) => ((Object)s).name == "SE_Giant")) ?? ((object)GiantSE)); if ((Object)(object)val != (Object)null) { val.m_ttl = num; ((Character)player).GetSEMan().AddStatusEffect(val, true, 0, 0f); } ApplyGiantSpeed(player); SharedData val2 = ((Humanoid)player).m_unarmedWeapon?.m_itemData?.m_shared; if (val2 != null) { _origUnarmedDmg = val2.m_damages; _origUnarmedTier = (short)val2.m_toolTier; _origAttackRange = val2.m_attack.m_attackRange; _origAttackHeight = val2.m_attack.m_attackHeight; _origAttackOffset = val2.m_attack.m_attackOffset; val2.m_damages.m_blunt = 200f; val2.m_damages.m_chop = 200f; val2.m_damages.m_pickaxe = 200f; val2.m_toolTier = 100; val2.m_attack.m_attackRange = _origAttackRange * 3f; val2.m_attack.m_attackHeight = _origAttackHeight * 3f; val2.m_attack.m_attackOffset = _origAttackOffset * 3f; } VdsSwimSuppressor.Suppress(); if ((Object)(object)EnvMan.instance != (Object)null) { EnvMan.instance.m_debugEnv = "GoldenAscent"; } ((Character)player).Message((MessageType)2, message, 0, (Sprite)null); } internal static void ApplyGiantSpeed(Player player) { if (!GiantSpeedApplied) { ((Character)player).m_walkSpeed = ((Character)player).m_walkSpeed * 1.5f; ((Character)player).m_runSpeed = ((Character)player).m_runSpeed * 2.5f; ((Character)player).m_swimSpeed = ((Character)player).m_swimSpeed * 1.5f; ((Character)player).m_jumpForce = ((Character)player).m_jumpForce * 1.2f; _origAutoPickupRange = player.m_autoPickupRange; player.m_autoPickupRange = 0f; _origSwimDepth = ((Character)player).m_swimDepth; ((Character)player).m_swimDepth = _origSwimDepth * 3f; GiantSpeedApplied = true; ((Character)player).Message((MessageType)1, "Auto-pickup disabled while giant.", 0, (Sprite)null); } } internal static void RemoveGiantSpeed(Player player) { if (GiantSpeedApplied) { ((Character)player).m_walkSpeed = ((Character)player).m_walkSpeed / 1.5f; ((Character)player).m_runSpeed = ((Character)player).m_runSpeed / 2.5f; ((Character)player).m_swimSpeed = ((Character)player).m_swimSpeed / 1.5f; ((Character)player).m_jumpForce = ((Character)player).m_jumpForce / 1.2f; player.m_autoPickupRange = _origAutoPickupRange; ((Character)player).m_swimDepth = _origSwimDepth; GiantSpeedApplied = false; } } internal static void DeactivateGiant(Player player) { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) GiantExpiry = 0f; GiantTargetScale = 1f; ZNetView component = ((Component)player).GetComponent(); if (component != null) { ZDO zDO = component.GetZDO(); if (zDO != null) { zDO.Set("ath_scale", 1f); } } RemoveGiantSpeed(player); SharedData val = ((Humanoid)player).m_unarmedWeapon?.m_itemData?.m_shared; if (val != null) { val.m_damages = _origUnarmedDmg; val.m_toolTier = _origUnarmedTier; val.m_attack.m_attackRange = _origAttackRange; val.m_attack.m_attackHeight = _origAttackHeight; val.m_attack.m_attackOffset = _origAttackOffset; } player.m_maxCarryWeight = Mathf.Max(player.m_maxCarryWeight - 300f, 300f); SEMan sEMan = ((Character)player).GetSEMan(); SE_Giant? giantSE = GiantSE; sEMan.RemoveStatusEffect((giantSE != null) ? ((StatusEffect)giantSE).NameHash() : 0, false); VdsSwimSuppressor.Restore(); if (EnvMan.instance?.m_debugEnv == "GoldenAscent") { EnvMan.instance.m_debugEnv = "Rain"; } GiantRainExpiry = Time.time + 600f; ((Character)player).Message((MessageType)1, "You return to mortal scale.", 0, (Sprite)null); } internal static void ActivateFlamingSword(Player player, string message = "Dyrnwyn answers. Let it burn.") { if (FlamingSwordExpiry > 0f) { DeactivateFlamingSword(player, immediate: true); } BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; object? obj = typeof(Humanoid).GetField("m_rightItem", bindingAttr)?.GetValue(player); ItemData val = (ItemData)((obj is ItemData) ? obj : null); if (val != null) { ((Humanoid)player).UnequipItem(val, true); ((Humanoid)player).GetInventory().RemoveItem(val); } ItemData val2 = ((Humanoid)player).GetInventory().AddItem("SwordIronFire", 1, 1, 0, 0L, "", false); if (val2 == null) { ((Character)player).Message((MessageType)2, "No room in your pack for the flame.", 0, (Sprite)null); if (val != null) { ((Humanoid)player).GetInventory().AddItem(val); ((Humanoid)player).EquipItem(val, true); } return; } _origRightItem = val; _flamingSwordItem = val2; ((Humanoid)player).EquipItem(val2, true); SpawnSmokePuff(player); float num = Cfg.Rituals.Items.GetValueOrDefault("flaming_sword")?.Duration ?? 60f; FlamingSwordExpiry = Time.time + num; StatusEffect val3 = (StatusEffect)(((object)ObjectDB.instance?.m_StatusEffects?.Find((StatusEffect s) => ((Object)s).name == "SE_FlamingSword")) ?? ((object)FlamingSwordSE)); if ((Object)(object)val3 != (Object)null) { val3.m_ttl = num; ((Character)player).GetSEMan().AddStatusEffect(val3, true, 0, 0f); } TryPlayEmote(player, "cheer"); Scheduler?.RunDelayed(0.5f, delegate { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) ZNetScene instance = ZNetScene.instance; GameObject val4 = ((instance != null) ? instance.GetPrefab("fx_chainlightning_hit") : null); if (!((Object)(object)val4 == (Object)null)) { Vector3 val5 = (((Component)player).transform.Find("Visual/Armature/Hips/Spine/Spine1/Spine2/RightShoulder/RightArm/RightForeArm/RightHand/RightHandMiddle1") ?? ((Component)player).transform).position + Vector3.up * 0.5f + ((Component)player).transform.forward * 0.5f; Object.Destroy((Object)(object)Object.Instantiate(val4, val5, Quaternion.identity), 4f); Log.LogInfo((object)"[Pilgrim] FlamingSword VFX: fx_chainlightning_hit"); } }); ((Character)player).Message((MessageType)2, message, 0, (Sprite)null); Log.LogInfo((object)string.Format("[Pilgrim] FlamingSword: swapped in {0} for {1}s", "SwordIronFire", num)); } private static void TryPlayEmote(Player player, string emoteName) { try { if (!((Object)(object)player != (Object)(object)Player.m_localPlayer)) { player.StartEmote(emoteName, true); } } catch (Exception ex) { Log.LogWarning((object)("[Pilgrim] TryPlayEmote failed: " + ex.Message)); } } internal static void DeactivateFlamingSword(Player player, bool immediate = false) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) FlamingSwordExpiry = 0f; ZNetScene instance = ZNetScene.instance; GameObject val = ((instance != null) ? instance.GetPrefab("fx_fireskeleton_nova") : null); if ((Object)(object)val != (Object)null) { Object.Instantiate(val, ((Component)player).transform.position, Quaternion.identity); } if (immediate) { FinishSwordSwapBack(player); return; } Scheduler?.RunDelayed(0.5f, delegate { FinishSwordSwapBack(player); }); } private static void FinishSwordSwapBack(Player player) { if (_flamingSwordItem != null) { ((Humanoid)player).UnequipItem(_flamingSwordItem, true); ((Humanoid)player).GetInventory().RemoveItem(_flamingSwordItem); if (_origRightItem != null) { ((Humanoid)player).GetInventory().AddItem(_origRightItem); ((Humanoid)player).EquipItem(_origRightItem, true); } _flamingSwordItem = null; _origRightItem = null; } SpawnSmokePuff(player); SEMan sEMan = ((Character)player).GetSEMan(); SE_FlamingSword? flamingSwordSE = FlamingSwordSE; sEMan.RemoveStatusEffect((flamingSwordSE != null) ? ((StatusEffect)flamingSwordSE).NameHash() : 0, false); ((Character)player).Message((MessageType)1, "The flame fades.", 0, (Sprite)null); } private static void SpawnSmokePuff(Player player) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) ZNetScene instance = ZNetScene.instance; GameObject val = ((instance != null) ? instance.GetPrefab("vfx_Smoked") : null); if (!((Object)(object)val == (Object)null)) { Transform val2 = ((Component)player).transform.Find("Visual/Armature/Hips/Spine/Spine1/Spine2/RightShoulder/RightArm/RightForeArm/RightHand/RightHandMiddle1") ?? ((Component)player).transform; Object.Destroy((Object)(object)Object.Instantiate(val, val2.position, Quaternion.identity), 3f); } } internal static void GrantTrophyPower(Player player, string trophyPrefab, Terminal? ctx = null, Vector3? vfxPos = null) { //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) if (TrophyToPower.TryGetValue(trophyPrefab, out string value)) { player.SetGuardianPower(value); trophyPrefab.Replace("Trophy", "").Replace("TheElder", "The Elder").Replace("DragonQueen", "Moder") .Replace("GoblinKing", "Yagluth") .Replace("SeekerQueen", "The Queen"); SpawnTrophyVFX((Vector3)(((??)vfxPos) ?? ((Component)player).transform.position)); ((Character)player).Message((MessageType)1, "You claim the power of the forsaken.", 0, (Sprite)null); } } internal static void SpawnRitualVFX(Vector3 firePos, Vector3 playerPos) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) ZNetScene instance = ZNetScene.instance; if ((Object)(object)instance == (Object)null) { return; } GameObject prefab = instance.GetPrefab("fx_batteringram_fire"); if ((Object)(object)prefab != (Object)null) { Vector3 val = firePos - playerPos; val.y = 0f; if (val == Vector3.zero) { val = Vector3.forward; } Object.Destroy((Object)(object)Object.Instantiate(prefab, firePos, Quaternion.LookRotation(((Vector3)(ref val)).normalized)), 4f); } GameObject prefab2 = instance.GetPrefab("fx_fireskeleton_nova"); if ((Object)(object)prefab2 != (Object)null) { Object.Instantiate(prefab2, firePos, Quaternion.identity); } } private static void SpawnTrophyVFX(Vector3 pos) { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) ZNetScene instance = ZNetScene.instance; if ((Object)(object)instance == (Object)null) { return; } string[] array = new string[4] { Cfg.Trophies.Vfx, "vfx_guardianpower_activate", "vfx_offering", "vfx_lootspawn" }; foreach (string text in array) { GameObject prefab = instance.GetPrefab(text); if ((Object)(object)prefab != (Object)null) { Object.Instantiate(prefab, pos, Quaternion.identity); Log.LogInfo((object)("[Pilgrim] Trophy VFX: " + text)); break; } } } internal static (string? boss, string? prefab) GetNextBoss() { ZoneSystem instance = ZoneSystem.instance; if ((Object)(object)instance == (Object)null) { return (boss: null, prefab: null); } for (int i = 0; i < BossChain.Length; i++) { if (i >= BossKeys.Length || !instance.GetGlobalKey(BossKeys[i])) { return (boss: BossChain[i].boss, prefab: BossChain[i].prefab); } } return (boss: null, prefab: null); } internal static bool FindClosestLocation(string prefabName, Vector3 refPos, out Vector3 result) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) result = Vector3.zero; ZoneSystem instance = ZoneSystem.instance; if ((Object)(object)instance == (Object)null) { return false; } LocationInstance val = default(LocationInstance); if (instance.FindClosestLocation(prefabName, refPos, ref val)) { result = val.m_position; return true; } return false; } private static void PrintSchedule(ConsoleEventArgs args, EnvScheduler s) { args.Context.AddString(string.Format("Scheduler : {0} | prob {1:P0}", s.Active ? "ON" : "OFF", s.Probability)); args.Context.AddString("Night pool: " + string.Join(", ", s.NightPool)); args.Context.AddString("Noon pool : " + string.Join(", ", s.NoonPool)); } private static string? GetEnvSetupName(EnvMan em, string fieldName) { object? obj = typeof(EnvMan).GetField(fieldName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(em); EnvSetup val = (EnvSetup)((obj is EnvSetup) ? obj : null); if (val != null && !string.IsNullOrEmpty(val.m_name)) { return val.m_name; } return null; } private static object? AnyField(object obj, params string[] names) { Type type = obj.GetType(); foreach (string name in names) { object obj2 = type.GetField(name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(obj); if (obj2 != null) { return obj2; } } return null; } private static void Msg(Terminal? ctx, string text) { if ((Object)(object)ctx != (Object)null) { ctx.AddString(text); return; } MessageHud instance = MessageHud.instance; if (instance != null) { instance.ShowMessage((MessageType)1, text, 0, (Sprite)null, false); } } private static void Announce(string text) { if ((Object)(object)Chat.instance != (Object)null) { Chat.instance.SendText((Type)1, text); } } internal static float GetTod() { EnvMan instance = EnvMan.instance; if ((Object)(object)instance != (Object)null) { BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; FieldInfo? field = typeof(EnvMan).GetField("m_debugTimeOfDay", bindingAttr); FieldInfo field2 = typeof(EnvMan).GetField("m_debugTime", bindingAttr); object obj = field?.GetValue(instance); bool flag = default(bool); int num; if (obj is bool) { flag = (bool)obj; num = 1; } else { num = 0; } if (((uint)num & (flag ? 1u : 0u)) != 0) { obj = field2?.GetValue(instance); if (obj is float) { return (float)obj; } } } if ((Object)(object)ZNet.instance == (Object)null) { return 0f; } return (float)(ZNet.instance.GetTimeSeconds() % 1800.0 / 1800.0); } private static string GetTodLabel(float t) { if (t < 0.25f) { return "night"; } if (t < 0.32f) { return "dawn"; } if (t < 0.5f) { return "morning"; } if (t < 0.68f) { return "afternoon"; } if (t < 0.75f) { return "dusk"; } return "night"; } internal static Random GetRng() { return Rng; } } [HarmonyPatch(typeof(Character), "ApplyDamage")] internal class FeatherFallPatch { private static void Prefix(Character __instance, ref HitData hit) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Invalid comparison between Unknown and I4 if (!((Object)(object)__instance != (Object)(object)Player.m_localPlayer) && !(Time.time > Plugin.FeatherRitualExpiry) && (int)hit.m_hitType == 3) { hit.m_damage.m_damage = 0f; } } } [HarmonyPatch(typeof(Character), "IsOnGround")] internal class WaterWalkGroundPatch { private static bool Prefix(Character __instance, ref bool __result) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)__instance != (Object)(object)Player.m_localPlayer) { return true; } if (Plugin.WaterWalkExpiry <= 0f || Time.time >= Plugin.WaterWalkExpiry) { return true; } WaterVolume val = null; float waterLevel = Floating.GetWaterLevel(((Component)__instance).transform.position, ref val); if (((Component)__instance).transform.position.y <= waterLevel + 0.02f) { __result = true; return false; } return true; } } [HarmonyPatch(typeof(Character), "IsSwimming")] internal class WaterWalkSwimPatch { private static bool Prefix(ref bool __result) { if (Plugin.WaterWalkExpiry > 0f && Time.time < Plugin.WaterWalkExpiry) { __result = false; return false; } return true; } } [HarmonyPatch(typeof(Character), "UpdateWater")] internal class WaterWalkUpdatePatch { private static bool Prefix() { if (Plugin.WaterWalkExpiry > 0f) { return !(Time.time < Plugin.WaterWalkExpiry); } return true; } } [HarmonyPatch(typeof(Character), "Jump")] internal class WaterWalkJumpPatch { private static void Postfix(Character __instance) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)__instance != (Object)(object)Player.m_localPlayer || Plugin.WaterWalkExpiry <= 0f || Time.time >= Plugin.WaterWalkExpiry) { return; } WaterVolume val = null; float waterLevel = Floating.GetWaterLevel(((Component)__instance).transform.position, ref val); if (!(((Component)__instance).transform.position.y > waterLevel + 0.5f)) { BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.NonPublic; object? obj = typeof(Character).GetField("m_body", bindingAttr)?.GetValue(__instance); Rigidbody val2 = (Rigidbody)((obj is Rigidbody) ? obj : null); if (val2 != null) { val2.AddForce(Vector3.up * 4f, (ForceMode)2); } } } } [HarmonyPatch(typeof(Fireplace), "GetHoverText")] internal class FireplaceHoverPatch { private static readonly string[] CampfirePrefabs = new string[3] { "fire_pit", "fire_pit_iron", "hearth" }; private static void Postfix(Fireplace __instance, ref string __result) { if (!__instance.IsBurning()) { return; } string goName = ((Object)((Component)__instance).gameObject).name.ToLower().Replace("(clone)", "").Trim(); if (!Array.Exists(CampfirePrefabs, (string p) => goName.StartsWith(p)) || !Plugin.Cfg.Rituals.Enabled) { return; } Player player = Player.m_localPlayer; Dictionary items = Plugin.Cfg.Rituals.Items; HashSet hashSet = new HashSet(); StringBuilder stringBuilder = new StringBuilder(); (string, bool, string, string)[] ritualItemMap = Plugin.RitualItemMap; for (int num = 0; num < ritualItemMap.Length; num++) { string item = ritualItemMap[num].Item3; if (hashSet.Add(item) && KnownAndEnabled(item) && items.TryGetValue(item, out RitualItemConfig value)) { stringBuilder.Append("\n " + item switch { "seek_altar" => "Boar Meat", "restore_power" => "Mushroom", "seek_bed" => "Dandelion", "feather_fall" => "Feathers", "seek_trader" => "Coins", "seek_dungeon" => "Trophy", "clear_skies" => "Greydwarf Eye", "water_walk" => "Stone", "growth" => "Ancient Seed", "tame_flock" => "Bone Fragments", "seek_player" => "Flint", "kindle" => "Resin", "giant" => "Ymir Flesh", "flaming_sword" => "Surtling Core", _ => item, } + " — " + value.HoverText); } } HashSet hashSet2 = new HashSet(); HashSet hashSet3 = new HashSet(); ritualItemMap = Plugin.RitualItemMap; for (int num = 0; num < ritualItemMap.Length; num++) { string item2 = ritualItemMap[num].Item3; if (items.TryGetValue(item2, out RitualItemConfig value2) && value2.Enabled) { hashSet2.Add(item2); if ((Object)(object)player != (Object)null && Plugin.IsRitualKnown(player, item2)) { hashSet3.Add(item2); } } } if (stringBuilder.Length != 0) { string text = ((Plugin.RitualCooldownRemaining > 0f) ? $" ({Plugin.RitualCooldownRemaining:F0}s)" : ""); string text2 = string.Format(" {1}/{2}", (hashSet3.Count < hashSet2.Count) ? "yellow" : "green", hashSet3.Count, hashSet2.Count); __result = __result + "\n── Offerings" + text2 + text + " ──"; __result += stringBuilder.ToString(); __result += ""; } bool KnownAndEnabled(string key) { if (items.TryGetValue(key, out RitualItemConfig value3) && value3.Enabled) { if (!((Object)(object)player == (Object)null)) { return Plugin.IsRitualKnown(player, key); } return true; } return false; } } } [HarmonyPatch(typeof(Player), "UseHotbarItem")] internal class UseHotbarItemPatch { private static readonly string[] CampfirePrefabs = new string[3] { "fire_pit", "fire_pit_iron", "hearth" }; private static bool Prefix(Player __instance, int index) { //IL_02f6: Unknown result type (might be due to invalid IL or missing references) //IL_0306: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)__instance != (Object)(object)Player.m_localPlayer) { return true; } GameObject hoverObject = ((Humanoid)__instance).GetHoverObject(); if ((Object)(object)hoverObject == (Object)null) { return true; } Fireplace componentInParent = hoverObject.GetComponentInParent(); if ((Object)(object)componentInParent == (Object)null || !componentInParent.IsBurning()) { return true; } string goName = ((Object)((Component)componentInParent).gameObject).name.ToLower().Replace("(clone)", "").Trim(); if (!Array.Exists(CampfirePrefabs, (string p) => goName.StartsWith(p))) { return true; } if (!Plugin.Cfg.Rituals.Enabled) { return true; } ItemData itemAt = ((Humanoid)__instance).GetInventory().GetItemAt(index - 1, 0); if ((Object)(object)itemAt?.m_dropPrefab == (Object)null) { return true; } string prefab = ((Object)itemAt.m_dropPrefab).name; Dictionary ritualItems = Plugin.Cfg.Rituals.Items; if ((!(prefab == Plugin.SeekFood) || !RitualEnabled("seek_altar")) && (!prefab.StartsWith("Mushroom") || !RitualEnabled("restore_power")) && (!(prefab == Plugin.HomeFood) || !RitualEnabled("seek_bed")) && (!(prefab == Plugin.FeatherFood) || !RitualEnabled("feather_fall")) && (!(prefab == Plugin.TraderFood) || !RitualEnabled("seek_trader")) && (!prefab.StartsWith("Trophy") || !RitualEnabled("seek_dungeon")) && (!(prefab == "GreydwarfEye") || !RitualEnabled("clear_skies")) && (!(prefab == "Stone") || !RitualEnabled("water_walk")) && (!(prefab == Plugin.GrowthFood) || !RitualEnabled("growth")) && (!(prefab == Plugin.PlayerSeekFood) || !RitualEnabled("seek_player")) && (!(prefab == Plugin.KindleFood) || !RitualEnabled("kindle")) && (!(prefab == Plugin.TameFood) || !RitualEnabled("tame_flock")) && (!(prefab == Plugin.GiantFood) || !RitualEnabled("giant")) && (!(prefab == Plugin.FlamingSwordFood) || !RitualEnabled("flaming_sword"))) { return true; } if (Plugin.RitualCooldownRemaining > 0f) { ((Character)__instance).Message((MessageType)2, "The fire is not ready...", 0, (Sprite)null); return false; } Plugin.SpawnRitualVFX(((Component)componentInParent).transform.position, ((Component)__instance).transform.position); if (prefab == Plugin.SeekFood) { SEMan sEMan = ((Character)__instance).GetSEMan(); SE_GuidingWind? guidingWindSE = Plugin.GuidingWindSE; if (sEMan.HaveStatusEffect((guidingWindSE != null) ? ((StatusEffect)guidingWindSE).NameHash() : 0)) { ((Character)__instance).Message((MessageType)2, "The wind already guides you.", 0, (Sprite)null); return false; } Consume(); Plugin.ActivateSeek(null, RitualMsg("seek_altar", "The wind stirs.")); return false; } if (prefab.StartsWith("Mushroom")) { BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; if (((typeof(Player).GetField("m_guardianPowerCooldown", bindingAttr)?.GetValue(__instance) is float num) ? num : 0f) <= 0f) { ((Character)__instance).Message((MessageType)2, "Your power is already ready.", 0, (Sprite)null); return false; } Consume(); Plugin.ActivateCooldownReset(__instance, RitualMsg("restore_power", "The storm answers.")); return false; } if (prefab == Plugin.HomeFood) { Consume(); Plugin.ActivateHomeSeek(__instance, RitualMsg("seek_bed", "The flower carries you home...")); return false; } if (prefab == Plugin.FeatherFood) { Consume(); Plugin.ActivateFeatherRitual(__instance, RitualMsg("feather_fall", "The feathers catch the wind.")); return false; } if (prefab == Plugin.TraderFood) { Consume(); Plugin.ActivateTraderSeek(__instance); return false; } if (prefab.StartsWith("Trophy")) { Consume(); Plugin.ActivateDungeonSeek(__instance, prefab, RitualMsg("seek_dungeon", "The veil parts — something stirs nearby.")); return false; } if (prefab == "GreydwarfEye") { Consume(); Plugin.ActivateClearSkies(__instance, RitualMsg("clear_skies", "The clouds part.")); return false; } if (prefab == "Stone") { Consume(); Plugin.ActivateWaterWalk(__instance, RitualMsg("water_walk", "The sea grows still beneath your feet.")); return false; } if (prefab == Plugin.GrowthFood) { if (Plugin.GrowthBlessingActive) { ((Character)__instance).Message((MessageType)2, "The seed's blessing already waits in your dreams.", 0, (Sprite)null); return false; } Consume(); Plugin.GrowthBlessingActive = true; ((Character)__instance).Message((MessageType)2, RitualMsg("growth", "The seed remembers the earth. Sleep, and your crops will answer."), 0, (Sprite)null); return false; } if (prefab == Plugin.PlayerSeekFood) { Consume(); Plugin.ActivatePlayerSeek(__instance); return false; } if (prefab == Plugin.KindleFood) { Consume(); Plugin.ActivateKindle(__instance, RitualMsg("kindle", "The darkness yields.")); return false; } if (prefab == Plugin.TameFood) { if (Plugin.TameBlessingActive) { ((Character)__instance).Message((MessageType)2, "The bond already waits in your dreams.", 0, (Sprite)null); return false; } Consume(); Plugin.TameBlessingActive = true; ((Character)__instance).Message((MessageType)2, RitualMsg("tame_flock", "The bones remember loyalty. Sleep, and your flock will answer."), 0, (Sprite)null); return false; } if (prefab == Plugin.GiantFood) { Plugin.Log.LogInfo((object)string.Format("[Pilgrim] YmirRemains at campfire: RitualEnabled={0} known={1} hasKey={2}", RitualEnabled("giant"), Plugin.IsRitualKnown(__instance, "giant"), ritualItems.ContainsKey("giant"))); if (RitualEnabled("giant")) { Consume(); Plugin.ActivateGiant(__instance, RitualMsg("giant", "The mountain answers. You are vast.")); return false; } } if (prefab == Plugin.FlamingSwordFood && RitualEnabled("flaming_sword")) { Consume(); Plugin.ActivateFlamingSword(__instance, RitualMsg("flaming_sword", "Dyrnwyn answers. Let it burn.")); return false; } (string, bool, string, string)[] ritualItemMap = Plugin.RitualItemMap; for (int num2 = 0; num2 < ritualItemMap.Length; num2++) { var (text, flag, text2, _) = ritualItemMap[num2]; if (flag ? prefab.StartsWith(text) : (prefab == text)) { if (ritualItems.TryGetValue(text2, out RitualItemConfig value) && value.Enabled && Plugin.IsRitualKnown(__instance, text2)) { Plugin.Log.LogWarning((object)("[Pilgrim] Ritual '" + text2 + "' matched but not handled above — check UseHotbarItemPatch")); } else { ((Character)__instance).Message((MessageType)2, "You sense a ritual here, but don't yet understand this offering.", 0, (Sprite)null); } return false; } } return true; void Consume() { CartUpgrade.RemoveByPrefab(((Humanoid)__instance).GetInventory(), prefab, 1); Plugin.RitualCooldownRemaining = Plugin.RitualCooldownDuration; } bool RitualEnabled(string key) { if (ritualItems.TryGetValue(key, out RitualItemConfig value2) && value2.Enabled) { return Plugin.IsRitualKnown(__instance, key); } return false; } string RitualMsg(string key, string fallback) { if (!ritualItems.TryGetValue(key, out RitualItemConfig value2)) { return fallback; } return value2.Message; } } } [HarmonyPatch(typeof(Player), "SetSleeping")] internal class GrowthBlessingPatch { private static void Postfix(Player __instance, bool sleep) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) if (!sleep || (Object)(object)__instance != (Object)(object)Player.m_localPlayer || !Plugin.GrowthBlessingActive) { return; } Plugin.GrowthBlessingActive = false; int num = 0; Vector3 position = ((Component)__instance).transform.position; Plant[] array = Object.FindObjectsOfType(); foreach (Plant val in array) { if (!(Vector3.Distance(((Component)val).transform.position, position) > 30f)) { ZNetView component = ((Component)val).GetComponent(); if (!((Object)(object)component == (Object)null) && component.IsValid() && component.IsOwner()) { long ticks = (ZNet.instance.GetTime() - TimeSpan.FromSeconds(10000.0)).Ticks; component.GetZDO().Set(ZDOVars.s_plantTime, ticks); val.Grow(); num++; } } } if (num > 0) { ((Character)__instance).Message((MessageType)1, $"{num} crops answered the blessing.", 0, (Sprite)null); } if (!Plugin.TameBlessingActive) { return; } Plugin.TameBlessingActive = false; int num2 = 0; Tameable[] array2 = Object.FindObjectsOfType(); foreach (Tameable val2 in array2) { if (Vector3.Distance(((Component)val2).transform.position, position) > 30f) { continue; } ZNetView component2 = ((Component)val2).GetComponent(); if (!((Object)(object)component2 == (Object)null) && component2.IsValid() && component2.IsOwner() && !(component2.GetZDO().GetFloat(ZDOVars.s_tameTimeLeft, -1f) < 0f)) { Character component3 = ((Component)val2).GetComponent(); if ((Object)(object)component3 != (Object)null) { component3.SetTamed(true); } num2++; } } if (num2 > 0) { ((Character)__instance).Message((MessageType)1, $"{num2} creatures answered the bond.", 0, (Sprite)null); } } } [HarmonyPatch(typeof(ItemStand), "Interact")] internal class ItemStandPatch { private static bool Prefix(ItemStand __instance, Humanoid user, bool hold, bool alt) { //IL_00af: Unknown result type (might be due to invalid IL or missing references) if (!Plugin.Cfg.Trophies.Enabled) { return true; } if (hold || !alt) { return true; } if (!__instance.HaveAttachment()) { return true; } string text = __instance.GetAttachedItem() ?? ""; Console instance = Console.instance; if (instance != null) { ((Terminal)instance).AddString($"[EnvR] ItemStand attached='{text}' hasAttach={__instance.HaveAttachment()}"); } if (string.IsNullOrEmpty(text)) { return true; } if (!Plugin.TrophyToPower.ContainsKey(text)) { Console instance2 = Console.instance; if (instance2 != null) { ((Terminal)instance2).AddString("[EnvR] '" + text + "' not in TrophyToPower map"); } return true; } Player val = (Player)(object)((user is Player) ? user : null); if ((Object)(object)val == (Object)null) { return true; } Plugin.GrantTrophyPower(val, text, null, ((Component)val).transform.position); return false; } } public class SE_GuidingWind : StatusEffect { private float _windTimer; public override void Setup(Character character) { ((StatusEffect)this).Setup(character); string[] array = new string[1] { "Rested" }; foreach (string candidate in array) { StatusEffect val = ObjectDB.instance?.m_StatusEffects?.Find((StatusEffect s) => ((Object)s).name == candidate); if ((Object)(object)val?.m_icon != (Object)null) { base.m_icon = val.m_icon; Plugin.Log.LogInfo((object)("[Pilgrim] GuidingWind icon from " + candidate)); break; } } if ((Object)(object)base.m_icon == (Object)null) { Plugin.Log.LogWarning((object)"[Pilgrim] GuidingWind: no icon found from any candidate"); } RefreshWind(); } public override void UpdateStatusEffect(float dt) { ((StatusEffect)this).UpdateStatusEffect(dt); _windTimer -= dt; if (_windTimer <= 0f) { _windTimer = 30f; RefreshWind(); } } public override void Stop() { ((StatusEffect)this).Stop(); EnvMan instance = EnvMan.instance; if ((Object)(object)instance != (Object)null) { instance.ResetDebugWind(); if (instance.m_debugEnv == "GoldenAscent") { instance.m_debugEnv = ""; } if (instance.m_debugEnv == "DreamWalk" && Plugin.HomeEnvExpiry <= 0f) { instance.m_debugEnv = ""; } if (instance.m_debugEnv == "LastLight" && Plugin.SeekEnvExpiry <= 0f) { instance.m_debugEnv = ""; } if (instance.m_debugEnv == "VoidWhisper" && Plugin.DungeonEnvExpiry <= 0f) { instance.m_debugEnv = ""; } Plugin.SeekOverrideTarget = null; } } public override string GetIconText() { float num = Mathf.Max(0f, base.m_ttl - base.m_time); int num2 = (int)(num / 60f); int num3 = (int)(num % 60f); if (num2 <= 0) { return $"{num3}s"; } return $"{num2}m {num3:D2}s"; } private void RefreshWind() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) Character character = base.m_character; Player val = (Player)(object)((character is Player) ? character : null); if ((Object)(object)val == (Object)null || (Object)(object)EnvMan.instance == (Object)null) { return; } Vector3 result; if (Plugin.SeekOverrideTarget.HasValue) { result = Plugin.SeekOverrideTarget.Value; EnvMan.instance.m_debugEnv = "VoidWhisper"; } else { string item = Plugin.GetNextBoss().prefab; if (item == null || !Plugin.FindClosestLocation(item, ((Component)val).transform.position, out result)) { return; } EnvMan.instance.m_debugEnv = "LastLight"; } Vector3 position = ((Component)val).transform.position; float num = Mathf.Atan2(result.x - position.x, result.z - position.z) * 57.29578f; if (num < 0f) { num += 360f; } EnvMan.instance.SetDebugWind(num, 1f); } } [HarmonyPatch(typeof(ObjectDB), "Awake")] internal class ObjectDBAwakePatch { private static bool _done; private static void Postfix(ObjectDB __instance) { if (!_done) { _done = true; SE_GuidingWind sE_GuidingWind = ScriptableObject.CreateInstance(); ((Object)sE_GuidingWind).name = "SE_GuidingWind"; ((StatusEffect)sE_GuidingWind).m_name = "Guiding Wind"; ((StatusEffect)sE_GuidingWind).m_tooltip = "The gods guide your path. Follow the wind."; ((StatusEffect)sE_GuidingWind).m_ttl = 60f; ((StatusEffect)sE_GuidingWind).m_startMessage = ""; ((StatusEffect)sE_GuidingWind).m_stopMessage = ""; __instance.m_StatusEffects.Add((StatusEffect)(object)sE_GuidingWind); Plugin.GuidingWindSE = sE_GuidingWind; Plugin.Log.LogInfo((object)"[EnvR] Registered SE_GuidingWind"); SE_WaterWalk sE_WaterWalk = ScriptableObject.CreateInstance(); ((Object)sE_WaterWalk).name = "SE_WaterWalk"; ((StatusEffect)sE_WaterWalk).m_name = "Still Waters"; ((StatusEffect)sE_WaterWalk).m_tooltip = "The sea is glass beneath your feet."; ((StatusEffect)sE_WaterWalk).m_ttl = 0f; ((StatusEffect)sE_WaterWalk).m_startMessage = ""; ((StatusEffect)sE_WaterWalk).m_stopMessage = ""; __instance.m_StatusEffects.Add((StatusEffect)(object)sE_WaterWalk); Plugin.WaterWalkSE = sE_WaterWalk; SE_Giant sE_Giant = ScriptableObject.CreateInstance(); ((Object)sE_Giant).name = "SE_Giant"; ((StatusEffect)sE_Giant).m_name = "Ymir's Fury"; ((StatusEffect)sE_Giant).m_tooltip = "You walk as a mountain. Carry more, strike fear."; ((StatusEffect)sE_Giant).m_ttl = 180f; ((StatusEffect)sE_Giant).m_startMessage = ""; ((StatusEffect)sE_Giant).m_stopMessage = ""; __instance.m_StatusEffects.Add((StatusEffect)(object)sE_Giant); Plugin.GiantSE = sE_Giant; SE_FlamingSword sE_FlamingSword = ScriptableObject.CreateInstance(); ((Object)sE_FlamingSword).name = "SE_FlamingSword"; ((StatusEffect)sE_FlamingSword).m_name = "Dyrnwyn"; ((StatusEffect)sE_FlamingSword).m_tooltip = "A blade of fire, summoned and bound to flicker out in time."; ((StatusEffect)sE_FlamingSword).m_ttl = 60f; ((StatusEffect)sE_FlamingSword).m_startMessage = ""; ((StatusEffect)sE_FlamingSword).m_stopMessage = ""; __instance.m_StatusEffects.Add((StatusEffect)(object)sE_FlamingSword); Plugin.FlamingSwordSE = sE_FlamingSword; } } } public class SE_WaterWalk : StatusEffect { public override void Setup(Character character) { ((StatusEffect)this).Setup(character); StatusEffect val = ObjectDB.instance?.m_StatusEffects?.Find((StatusEffect s) => ((Object)s).name == "Rested"); if ((Object)(object)val?.m_icon != (Object)null) { base.m_icon = val.m_icon; } } public override string GetIconText() { float num = Mathf.Max(0f, Plugin.WaterWalkExpiry - Time.time); int num2 = (int)(num / 60f); int num3 = (int)(num % 60f); if (num2 <= 0) { return $"{num3}s"; } return $"{num2}m {num3:D2}s"; } } public class SE_Giant : StatusEffect { public override void Setup(Character character) { ((StatusEffect)this).Setup(character); string[] array = new string[5] { "GP_Yagluth", "GP_Bonemass", "GP_Eikthyr", "SE_Burning", "Rested" }; foreach (string c in array) { StatusEffect val = ObjectDB.instance?.m_StatusEffects?.Find((StatusEffect s) => ((Object)s).name == c); if ((Object)(object)val?.m_icon != (Object)null) { base.m_icon = val.m_icon; break; } } } public override string GetIconText() { float num = Mathf.Max(0f, Plugin.GiantExpiry - Time.time); int num2 = (int)(num / 60f); int num3 = (int)(num % 60f); if (num2 <= 0) { return $"{num3}s"; } return $"{num2}m {num3:D2}s"; } } public class SE_FlamingSword : StatusEffect { public override void Setup(Character character) { ((StatusEffect)this).Setup(character); ZNetScene instance = ZNetScene.instance; GameObject obj = ((instance != null) ? instance.GetPrefab("SwordIronFire") : null); SharedData val = ((obj == null) ? null : obj.GetComponent()?.m_itemData?.m_shared); if (val?.m_icons != null && val.m_icons.Length != 0) { base.m_icon = val.m_icons[0]; return; } string[] array = new string[3] { "SE_Burning", "GP_Eikthyr", "Rested" }; foreach (string c in array) { StatusEffect val2 = ObjectDB.instance?.m_StatusEffects?.Find((StatusEffect s) => ((Object)s).name == c); if ((Object)(object)val2?.m_icon != (Object)null) { base.m_icon = val2.m_icon; break; } } } public override string GetIconText() { float num = Mathf.Max(0f, Plugin.FlamingSwordExpiry - Time.time); int num2 = (int)(num / 60f); int num3 = (int)(num % 60f); if (num2 <= 0) { return $"{num3}s"; } return $"{num2}m {num3:D2}s"; } } [HarmonyPatch(typeof(Character), "RPC_Damage")] internal class GiantDamageResistPatch { private static void Prefix(Character __instance, HitData hit) { if (!((Object)(object)__instance != (Object)(object)Player.m_localPlayer) && !(Plugin.GiantExpiry <= 0f) && !(Time.time > Plugin.GiantExpiry)) { hit.m_damage.m_blunt *= 0.1f; hit.m_damage.m_slash *= 0.1f; hit.m_damage.m_pierce *= 0.1f; hit.m_damage.m_chop *= 0.1f; hit.m_damage.m_pickaxe *= 0.1f; hit.m_damage.m_fire *= 0.1f; hit.m_damage.m_frost *= 0.1f; hit.m_damage.m_lightning *= 0.1f; hit.m_damage.m_poison *= 0.1f; hit.m_damage.m_spirit *= 0.1f; } } } [HarmonyPatch(typeof(WaterVolume), "GetWaterSurface")] internal class GiantWaterSurfacePatch { private static void Postfix(ref float __result) { if (!(Plugin.GiantExpiry <= 0f) && !(Time.time >= Plugin.GiantExpiry)) { __result -= 2.4f; } } } internal static class VdsSwimSuppressor { private const string VdsGuid = "blacks7ar.VikingsDoSwim"; private static readonly Harmony _h = new Harmony("com.ctogle.pilgrim.vdssuppressor"); private static readonly MethodInfo _target = typeof(Character).GetMethod("OnSwimming", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); private static readonly List<(MethodInfo method, HarmonyPatchType type)> _saved = new List<(MethodInfo, HarmonyPatchType)>(); internal static void Suppress() { if (_target == null) { return; } Patches patchInfo = Harmony.GetPatchInfo((MethodBase)_target); if (patchInfo == null) { return; } _saved.Clear(); foreach (Patch prefix in patchInfo.Prefixes) { if (prefix.owner == "blacks7ar.VikingsDoSwim") { _h.Unpatch((MethodBase)_target, prefix.PatchMethod); _saved.Add((prefix.PatchMethod, (HarmonyPatchType)1)); } } foreach (Patch postfix in patchInfo.Postfixes) { if (postfix.owner == "blacks7ar.VikingsDoSwim") { _h.Unpatch((MethodBase)_target, postfix.PatchMethod); _saved.Add((postfix.PatchMethod, (HarmonyPatchType)2)); } } foreach (Patch transpiler in patchInfo.Transpilers) { if (transpiler.owner == "blacks7ar.VikingsDoSwim") { _h.Unpatch((MethodBase)_target, transpiler.PatchMethod); _saved.Add((transpiler.PatchMethod, (HarmonyPatchType)3)); } } } internal static void Restore() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected I4, but got Unknown if (_target == null) { return; } foreach (var item3 in _saved) { MethodInfo item = item3.method; HarmonyPatchType item2 = item3.type; HarmonyMethod val = new HarmonyMethod(item); switch (item2 - 1) { case 0: _h.Patch((MethodBase)_target, val, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); break; case 1: _h.Patch((MethodBase)_target, (HarmonyMethod)null, val, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); break; case 2: _h.Patch((MethodBase)_target, (HarmonyMethod)null, (HarmonyMethod)null, val, (HarmonyMethod)null, (HarmonyMethod)null); break; } } _saved.Clear(); } } [HarmonyPatch(typeof(Vagon), "Interact")] internal class VagonInteractPatch { private static bool Prefix(Vagon __instance, Humanoid character, bool hold, bool alt) { if (!Plugin.Cfg.Carts.Enabled) { return true; } if (!alt) { return true; } Player val = (Player)(object)((character is Player) ? character : null); if ((Object)(object)val == (Object)null) { return true; } CartUpgrade.Upgrade(val, __instance); return false; } } [HarmonyPatch(typeof(Vagon), "GetHoverText")] internal class VagonHoverPatch { private static void Postfix(Vagon __instance, ref string __result) { if (!Plugin.Cfg.Carts.Enabled) { return; } ZNetView component = ((Component)__instance).GetComponent(); int? obj; if (component == null) { obj = null; } else { ZDO zDO = component.GetZDO(); obj = ((zDO != null) ? new int?(zDO.GetInt("ath_cart_level", 0)) : ((int?)null)); } int? num = obj; int valueOrDefault = num.GetValueOrDefault(); _ = CartUpgrade.Heights[Mathf.Clamp(valueOrDefault, 0, CartUpgrade.Heights.Length - 1)]; if (valueOrDefault >= CartUpgrade.Heights.Length - 1) { __result += "\nCart fully reinforced"; __result += "\n[G] Release cart"; return; } (string item, int amount)[] obj2 = CartUpgrade.Costs[valueOrDefault]; __result += "\n[Shift+E] Reinforce cart"; (string, int)[] array = obj2; for (int i = 0; i < array.Length; i++) { var (arg, num2) = array[i]; __result += $"\n {num2}x {arg}"; } __result += "\n[G] Release cart"; } } [HarmonyPatch(typeof(ItemStand), "GetHoverText")] internal class ItemStandHoverPatch { private static Exception Finalizer(Exception __exception, ItemStand __instance, ref string __result) { if (Plugin.Cfg.Trophies.Enabled && __instance.HaveAttachment()) { string key = __instance.GetAttachedItem() ?? ""; if (Plugin.TrophyToPower.ContainsKey(key) && !__result.Contains("Shift+E")) { __result += "\n[Shift+E] Claim Forsaken Power"; } } return __exception; } } [HarmonyPatch(typeof(Vagon), "Awake")] internal class VagonAwakePatch { private static void Postfix(Vagon __instance) { ((MonoBehaviour)__instance).StartCoroutine(RestoreAfterLoad(__instance)); } private static IEnumerator RestoreAfterLoad(Vagon vagon) { yield return null; ZNetView component = ((Component)vagon).GetComponent(); if (!((Object)(object)component == (Object)null) && component.IsValid()) { ZDO zDO = component.GetZDO(); int num = ((zDO != null) ? zDO.GetInt("ath_cart_level", 0) : 0); if (num > 0) { CartUpgrade.ApplySize(vagon, num); } CartUpgrade.ApplyTint(vagon, num); } } } [HarmonyPatch(typeof(WearNTear), "Awake")] internal class VagonDestroyPatch { private static void Postfix(WearNTear __instance) { if (!Plugin.Cfg.Carts.Enabled || (Object)(object)((Component)__instance).GetComponent() == (Object)null) { return; } WearNTear obj = __instance; obj.m_onDestroyed = (Action)Delegate.Combine(obj.m_onDestroyed, (Action)delegate { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) ZNetView component = ((Component)__instance).GetComponent(); if (!((Object)(object)component == (Object)null) && component.IsValid() && component.IsOwner()) { ZDO zDO = component.GetZDO(); int num = ((zDO != null) ? zDO.GetInt("ath_cart_level", 0) : 0); if (num > 0) { ZNetScene instance = ZNetScene.instance; if (!((Object)(object)instance == (Object)null)) { Vector3 position = ((Component)__instance).transform.position; for (int i = 0; i < num && i < CartUpgrade.Costs.Length; i++) { (string, int)[] array = CartUpgrade.Costs[i]; for (int j = 0; j < array.Length; j++) { (string, int) tuple = array[j]; string item = tuple.Item1; int item2 = tuple.Item2; GameObject prefab = instance.GetPrefab(item); if (!((Object)(object)prefab == (Object)null)) { for (int k = 0; k < item2; k++) { Object.Instantiate(prefab, position + Random.insideUnitSphere * 0.5f, Quaternion.identity); } } } } } } } }); } } [HarmonyPatch(typeof(Player), "AddKnownItem")] internal class RitualDiscoveryPatch { private static void Postfix(Player __instance, ItemData item) { if ((Object)(object)__instance != (Object)(object)Player.m_localPlayer || !Plugin.Cfg.Rituals.Enabled) { return; } GameObject dropPrefab = item.m_dropPrefab; string text = ((dropPrefab != null) ? ((Object)dropPrefab).name : null) ?? ""; if (string.IsNullOrEmpty(text)) { return; } (string, bool, string, string)[] ritualItemMap = Plugin.RitualItemMap; for (int i = 0; i < ritualItemMap.Length; i++) { var (text2, flag, key, itemDisplayName) = ritualItemMap[i]; if ((flag ? text.StartsWith(text2) : (text == text2)) && Plugin.Cfg.Rituals.Items.TryGetValue(key, out RitualItemConfig value) && value.Enabled && !Plugin.IsRitualKnown(__instance, key)) { Plugin.LearnRitual(__instance, key, itemDisplayName); } } } } [HarmonyPatch(typeof(Player), "OnSpawned")] internal class RitualBackfillPatch { private static void Postfix(Player __instance) { if ((Object)(object)__instance != (Object)(object)Player.m_localPlayer || !Plugin.Cfg.Rituals.Enabled) { return; } Inventory inventory = ((Humanoid)__instance).GetInventory(); if (inventory == null) { return; } foreach (ItemData allItem in inventory.GetAllItems()) { GameObject dropPrefab = allItem.m_dropPrefab; string text = ((dropPrefab != null) ? ((Object)dropPrefab).name : null) ?? ""; if (string.IsNullOrEmpty(text)) { continue; } (string, bool, string, string)[] ritualItemMap = Plugin.RitualItemMap; for (int i = 0; i < ritualItemMap.Length; i++) { var (text2, flag, text3, _) = ritualItemMap[i]; if (!Plugin.IsRitualKnown(__instance, text3) && Plugin.Cfg.Rituals.Items.TryGetValue(text3, out RitualItemConfig value) && value.Enabled && (flag ? text.StartsWith(text2) : (text == text2))) { __instance.m_customData["ath_known_" + text3] = "1"; } } } } } internal static class ItemUtil { public static int CountByPrefab(Inventory inv, string prefab) { return inv.GetAllItems().Where(delegate(ItemData i) { GameObject dropPrefab = i.m_dropPrefab; return ((dropPrefab != null) ? ((Object)dropPrefab).name : null) == prefab; }).Sum((ItemData i) => i.m_stack); } public static void RemoveByPrefab(Inventory inv, string prefab, int amount) { foreach (ItemData item in inv.GetAllItems().Where(delegate(ItemData i) { GameObject dropPrefab = i.m_dropPrefab; return ((dropPrefab != null) ? ((Object)dropPrefab).name : null) == prefab; }).ToList()) { int num = Mathf.Min(amount, item.m_stack); item.m_stack -= num; amount -= num; if (item.m_stack <= 0) { inv.RemoveItem(item); } if (amount <= 0) { break; } } } } internal static class CartUpgrade { public const int BaseWidth = 6; public static readonly int[] Heights = new int[5] { 3, 4, 5, 6, 7 }; internal static readonly (string item, int amount)[][] Costs = new(string, int)[4][] { new(string, int)[2] { ("FineWood", 10), ("BronzeNails", 20) }, new(string, int)[2] { ("ElderBark", 10), ("IronNails", 20) }, new(string, int)[2] { ("Silver", 5), ("WolfPelt", 5) }, new(string, int)[2] { ("BlackMetal", 5), ("LoxPelt", 3) } }; private static readonly Color[] LevelTints = (Color[])(object)new Color[5] { new Color(1f, 1f, 1f), new Color(1f, 0.82f, 0.55f), new Color(0.7f, 0.72f, 0.75f), new Color(0.88f, 0.94f, 1f), new Color(0.3f, 0.26f, 0.22f) }; public static void ApplyTint(Vagon vagon, int level) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) level = Mathf.Clamp(level, 0, LevelTints.Length - 1); Color color = LevelTints[level]; Renderer[] componentsInChildren = ((Component)vagon).GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { Material[] materials = componentsInChildren[i].materials; foreach (Material val in materials) { if (val.HasProperty("_Color")) { val.color = color; } } } } public static void ApplySize(Vagon vagon, int level) { //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) level = Mathf.Clamp(level, 0, Heights.Length - 1); BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; object? obj = typeof(Vagon).GetField("m_container", bindingAttr)?.GetValue(vagon); Container val = (Container)((obj is Container) ? obj : null); Inventory val2 = ((val != null) ? val.GetInventory() : null); Plugin.Log.LogInfo((object)$"[EnvR] Cart container={(Object)(object)val != (Object)null} inv={val2 != null}"); if (val2 == null) { Plugin.Log.LogWarning((object)"[EnvR] Could not get cart inventory via m_container"); return; } FieldInfo field = typeof(Inventory).GetField("m_width", bindingAttr); FieldInfo field2 = typeof(Inventory).GetField("m_height", bindingAttr); if (field == null || field2 == null) { Plugin.Log.LogWarning((object)"[EnvR] Inventory m_width/m_height fields not found"); return; } Plugin.Log.LogInfo((object)$"[EnvR] Before resize: {field.GetValue(val2)}x{field2.GetValue(val2)}"); field.SetValue(val2, 6); field2.SetValue(val2, Heights[level]); Plugin.Log.LogInfo((object)$"[EnvR] After resize: {field.GetValue(val2)}x{field2.GetValue(val2)}"); val2.m_onChanged?.Invoke(); ZNetScene instance = ZNetScene.instance; if ((Object)(object)instance != (Object)null) { GameObject prefab = instance.GetPrefab("vfx_Place_cart"); if ((Object)(object)prefab != (Object)null) { Object.Instantiate(prefab, ((Component)vagon).transform.position, Quaternion.identity); } } InventoryGui instance2 = InventoryGui.instance; if ((Object)(object)instance2 != (Object)null && instance2.IsContainerOpen()) { instance2.Hide(); } } public static int CountByPrefab(Inventory inv, string prefab) { return ItemUtil.CountByPrefab(inv, prefab); } public static void RemoveByPrefab(Inventory inv, string prefab, int amount) { ItemUtil.RemoveByPrefab(inv, prefab, amount); } public static void Upgrade(Player player, Vagon cart, ConsoleEventArgs? args = null) { ZNetView component = ((Component)cart).GetComponent(); if ((Object)(object)component == (Object)null) { if (args != null) { args.Context.AddString("Cart has no network view."); } return; } ZDO zDO = component.GetZDO(); int num = ((zDO != null) ? zDO.GetInt("ath_cart_level", 0) : 0); int num2 = num + 1; if (num2 >= Heights.Length) { string text = "The cart is already fully reinforced."; if (args != null) { args.Context.AddString(text); } else { ((Character)player).Message((MessageType)2, text, 0, (Sprite)null); } return; } (string, int)[] array = Costs[num]; Inventory inventory = ((Humanoid)player).GetInventory(); (string, int)[] array2 = array; for (int i = 0; i < array2.Length; i++) { var (text2, num3) = array2[i]; if (CountByPrefab(inventory, text2) < num3) { string text3 = "You lack the " + text2 + "."; if (args != null) { args.Context.AddString(text3); } else { ((Character)player).Message((MessageType)2, text3, 0, (Sprite)null); } return; } } array2 = array; for (int i = 0; i < array2.Length; i++) { var (prefab, amount) = array2[i]; RemoveByPrefab(inventory, prefab, amount); } component.GetZDO().Set("ath_cart_level", num2); ApplySize(cart, num2); ApplyTint(cart, num2); _ = Heights[num2]; string text4 = "Cart reinforced."; if (args != null) { args.Context.AddString(text4); } ((Character)player).Message((MessageType)2, text4, 0, (Sprite)null); } public static Vagon? FindNearest(Player player, float maxDist = 5f) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) Vagon result = null; float num = maxDist; Vagon[] array = Object.FindObjectsOfType(); foreach (Vagon val in array) { float num2 = Vector3.Distance(((Component)player).transform.position, ((Component)val).transform.position); if (num2 < num) { num = num2; result = val; } } return result; } } public class EnvScheduler : MonoBehaviour { public bool Active; public float Probability = 0.6f; public List NightPool = new List { "DreamWalk", "VoidWhisper", "MidnightVeil" }; public List NoonPool = new List { "GoldenAscent", "PilgrimDawn", "TropicalHaze" }; private bool _lastNight; private bool _noonRolled; private string? _setByUs; private long _lastNightPeriod = -1L; private long _lastNoonPeriod = -1L; private readonly Random _rng = new Random(); private static readonly KeyCode[] HotbarKeys; private static readonly string[] CampfirePrefabs; public void RunDelayed(float delay, Action action) { ((MonoBehaviour)this).StartCoroutine(DelayedAction(delay, action)); } private IEnumerator DelayedAction(float delay, Action action) { yield return (object)new WaitForSeconds(delay); action(); } private void Update() { //IL_0461: Unknown result type (might be due to invalid IL or missing references) //IL_0495: Unknown result type (might be due to invalid IL or missing references) //IL_049c: Unknown result type (might be due to invalid IL or missing references) //IL_0756: Unknown result type (might be due to invalid IL or missing references) //IL_0762: Unknown result type (might be due to invalid IL or missing references) //IL_05eb: Unknown result type (might be due to invalid IL or missing references) //IL_05fe: Unknown result type (might be due to invalid IL or missing references) //IL_0621: Unknown result type (might be due to invalid IL or missing references) //IL_0670: Unknown result type (might be due to invalid IL or missing references) //IL_0636: Unknown result type (might be due to invalid IL or missing references) //IL_0654: Unknown result type (might be due to invalid IL or missing references) //IL_065e: Unknown result type (might be due to invalid IL or missing references) //IL_06b0: Unknown result type (might be due to invalid IL or missing references) //IL_0685: Unknown result type (might be due to invalid IL or missing references) //IL_0696: Unknown result type (might be due to invalid IL or missing references) //IL_06a0: Unknown result type (might be due to invalid IL or missing references) //IL_0708: Unknown result type (might be due to invalid IL or missing references) if (Plugin.RitualCooldownRemaining > 0f) { Plugin.RitualCooldownRemaining -= Time.deltaTime; } if (Plugin.ClearSkiesExpiry > 0f) { EnvMan instance = EnvMan.instance; if (Time.time >= Plugin.ClearSkiesExpiry) { if ((Object)(object)instance != (Object)null && instance.m_debugEnv == "Clear") { instance.m_debugEnv = ""; } Plugin.ClearSkiesExpiry = 0f; Player localPlayer = Player.m_localPlayer; if (localPlayer != null) { ((Character)localPlayer).Message((MessageType)1, "The skies begin to darken again.", 0, (Sprite)null); } } else if ((Object)(object)instance != (Object)null && instance.m_debugEnv != "Clear") { Plugin.ClearSkiesExpiry = 0f; } } if (Plugin.GiantRainExpiry > 0f) { EnvMan instance2 = EnvMan.instance; if (Time.time >= Plugin.GiantRainExpiry) { if ((Object)(object)instance2 != (Object)null && instance2.m_debugEnv == "Rain") { instance2.m_debugEnv = ""; } Plugin.GiantRainExpiry = 0f; } else if ((Object)(object)instance2 != (Object)null && instance2.m_debugEnv != "Rain") { Plugin.GiantRainExpiry = 0f; } } if (Plugin.RainExpiry > 0f) { EnvMan instance3 = EnvMan.instance; if (Time.time >= Plugin.RainExpiry) { if ((Object)(object)instance3 != (Object)null && instance3.m_debugEnv == "Rain") { instance3.m_debugEnv = ""; } Plugin.RainExpiry = 0f; Player localPlayer2 = Player.m_localPlayer; if (localPlayer2 != null) { ((Character)localPlayer2).Message((MessageType)1, "The rain passes.", 0, (Sprite)null); } } else if ((Object)(object)instance3 != (Object)null && instance3.m_debugEnv != "Rain") { Plugin.RainExpiry = 0f; } } if (Plugin.SeekEnvExpiry > 0f) { EnvMan instance4 = EnvMan.instance; if (Time.time >= Plugin.SeekEnvExpiry) { if ((Object)(object)instance4 != (Object)null && instance4.m_debugEnv == "LastLight") { instance4.m_debugEnv = ""; } Plugin.SeekEnvExpiry = 0f; } else if ((Object)(object)instance4 != (Object)null && instance4.m_debugEnv != "LastLight") { Plugin.SeekEnvExpiry = 0f; } } if (Plugin.DungeonEnvExpiry > 0f) { EnvMan instance5 = EnvMan.instance; if (Time.time >= Plugin.DungeonEnvExpiry) { if ((Object)(object)instance5 != (Object)null && instance5.m_debugEnv == "VoidWhisper") { instance5.m_debugEnv = ""; } Plugin.DungeonEnvExpiry = 0f; } else if ((Object)(object)instance5 != (Object)null && instance5.m_debugEnv != "VoidWhisper") { Plugin.DungeonEnvExpiry = 0f; } } if (Plugin.HomeEnvExpiry > 0f) { EnvMan instance6 = EnvMan.instance; if (Time.time >= Plugin.HomeEnvExpiry) { if ((Object)(object)instance6 != (Object)null && instance6.m_debugEnv == "DreamWalk") { instance6.m_debugEnv = ""; } Plugin.HomeEnvExpiry = 0f; } else if ((Object)(object)instance6 != (Object)null && instance6.m_debugEnv != "DreamWalk") { Plugin.HomeEnvExpiry = 0f; } } if (Plugin.GiantExpiry > 0f && Time.time >= Plugin.GiantExpiry) { Player localPlayer3 = Player.m_localPlayer; if ((Object)(object)localPlayer3 != (Object)null) { Plugin.DeactivateGiant(localPlayer3); } else { Plugin.GiantExpiry = 0f; Plugin.GiantTargetScale = 1f; } } if (Plugin.FlamingSwordExpiry > 0f && Time.time >= Plugin.FlamingSwordExpiry) { Player localPlayer4 = Player.m_localPlayer; if ((Object)(object)localPlayer4 != (Object)null) { Plugin.DeactivateFlamingSword(localPlayer4); } else { Plugin.FlamingSwordExpiry = 0f; } } Player localPlayer5 = Player.m_localPlayer; if ((Object)(object)localPlayer5 != (Object)null) { ZNetView component = ((Component)localPlayer5).GetComponent(); ZDO val = ((component != null) ? component.GetZDO() : null); if (val != null) { val.Set("ath_scale", Plugin.GiantTargetScale); } } foreach (Player allPlayer in Player.GetAllPlayers()) { if (!((Object)(object)allPlayer == (Object)null)) { ZNetView component2 = ((Component)allPlayer).GetComponent(); float? obj; if (component2 == null) { obj = null; } else { ZDO zDO = component2.GetZDO(); obj = ((zDO != null) ? new float?(zDO.GetFloat("ath_scale", 1f)) : ((float?)null)); } float num = obj ?? 1f; float x = ((Component)allPlayer).transform.localScale.x; if (!Mathf.Approximately(x, num)) { float num2 = Mathf.MoveTowards(x, num, Time.deltaTime * 0.4f); ((Component)allPlayer).transform.localScale = Vector3.one * num2; } } } if (Plugin.WaterWalkExpiry > 0f) { if (Time.time >= Plugin.WaterWalkExpiry) { Plugin.WaterWalkExpiry = 0f; EnvMan instance7 = EnvMan.instance; if (instance7 != null) { instance7.ResetDebugWind(); } Player localPlayer6 = Player.m_localPlayer; if ((Object)(object)localPlayer6 != (Object)null) { SEMan sEMan = ((Character)localPlayer6).GetSEMan(); SE_WaterWalk? waterWalkSE = Plugin.WaterWalkSE; sEMan.RemoveStatusEffect((waterWalkSE != null) ? ((StatusEffect)waterWalkSE).NameHash() : 0, false); ((Character)localPlayer6).Message((MessageType)1, "The sea stirs once more.", 0, (Sprite)null); } } Player localPlayer7 = Player.m_localPlayer; if ((Object)(object)localPlayer7 != (Object)null && Plugin.WaterWalkExpiry > 0f) { BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.NonPublic; typeof(Character).GetField("m_inWater", bindingAttr)?.SetValue(localPlayer7, false); typeof(Character).GetField("m_swimming", bindingAttr)?.SetValue(localPlayer7, false); object? obj2 = typeof(Character).GetField("m_body", bindingAttr)?.GetValue(localPlayer7); Rigidbody val2 = (Rigidbody)((obj2 is Rigidbody) ? obj2 : null); if (val2 != null) { WaterVolume val3 = null; float num3 = Floating.GetWaterLevel(((Component)localPlayer7).transform.position, ref val3) - ((Component)localPlayer7).transform.position.y; bool flag = num3 > -0.02f; if (num3 > 0.05f && val2.velocity.y <= 0f) { val2.velocity = new Vector3(val2.velocity.x, Mathf.Min(num3 * 10f, 5f), val2.velocity.z); } else if (flag && val2.velocity.y < 0f) { val2.velocity = new Vector3(val2.velocity.x, 0f, val2.velocity.z); } if (flag && val2.velocity.y <= 0f) { typeof(Character).GetField("m_groundContact", bindingAttr)?.SetValue(localPlayer7, true); typeof(Character).GetField("m_groundContactNormal", bindingAttr)?.SetValue(localPlayer7, Vector3.up); } } } } Player localPlayer8 = Player.m_localPlayer; if ((Object)(object)localPlayer8 == (Object)null || !Input.GetKeyDown((KeyCode)103)) { return; } Vagon val4 = null; float num4 = 15f; Vagon[] array = Object.FindObjectsOfType(); foreach (Vagon val5 in array) { float num5 = Vector3.Distance(((Component)localPlayer8).transform.position, ((Component)val5).transform.position); if (num5 < num4) { num4 = num5; val4 = val5; } } if ((Object)(object)val4 != (Object)null) { val4.Interact((Humanoid)(object)localPlayer8, false, false); ((Character)localPlayer8).Message((MessageType)1, "Cart released.", 0, (Sprite)null); } else { ((Character)localPlayer8).Message((MessageType)1, "[G] No cart nearby.", 0, (Sprite)null); } } private void Start() { ((MonoBehaviour)this).StartCoroutine(Loop()); } public void SendBird(Vector3 direction, float speed = 10f) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_02de: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_02f6: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_0306: Unknown result type (might be due to invalid IL or missing references) //IL_030b: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Unknown result type (might be due to invalid IL or missing references) //IL_031e: Unknown result type (might be due to invalid IL or missing references) //IL_0324: Unknown result type (might be due to invalid IL or missing references) //IL_0329: Unknown result type (might be due to invalid IL or missing references) //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_0336: Unknown result type (might be due to invalid IL or missing references) //IL_0337: Unknown result type (might be due to invalid IL or missing references) //IL_0341: Unknown result type (might be due to invalid IL or missing references) //IL_0346: Unknown result type (might be due to invalid IL or missing references) //IL_034c: Unknown result type (might be due to invalid IL or missing references) //IL_0351: Unknown result type (might be due to invalid IL or missing references) //IL_0356: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_036f: Unknown result type (might be due to invalid IL or missing references) //IL_0374: Unknown result type (might be due to invalid IL or missing references) //IL_0379: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_0382: Unknown result type (might be due to invalid IL or missing references) //IL_038c: Unknown result type (might be due to invalid IL or missing references) //IL_0391: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Unknown result type (might be due to invalid IL or missing references) //IL_039c: Unknown result type (might be due to invalid IL or missing references) //IL_03a1: Unknown result type (might be due to invalid IL or missing references) //IL_03a9: Unknown result type (might be due to invalid IL or missing references) //IL_03af: Unknown result type (might be due to invalid IL or missing references) //IL_03b4: Unknown result type (might be due to invalid IL or missing references) //IL_03ba: Unknown result type (might be due to invalid IL or missing references) //IL_03bf: Unknown result type (might be due to invalid IL or missing references) //IL_03c4: Unknown result type (might be due to invalid IL or missing references) //IL_03cc: Unknown result type (might be due to invalid IL or missing references) //IL_03d6: Unknown result type (might be due to invalid IL or missing references) //IL_03db: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03e6: Unknown result type (might be due to invalid IL or missing references) //IL_03eb: Unknown result type (might be due to invalid IL or missing references) //IL_03f3: Unknown result type (might be due to invalid IL or missing references) //IL_03f4: Unknown result type (might be due to invalid IL or missing references) //IL_03fe: Unknown result type (might be due to invalid IL or missing references) //IL_0403: Unknown result type (might be due to invalid IL or missing references) //IL_0409: Unknown result type (might be due to invalid IL or missing references) //IL_040e: Unknown result type (might be due to invalid IL or missing references) //IL_0413: Unknown result type (might be due to invalid IL or missing references) //IL_041d: Unknown result type (might be due to invalid IL or missing references) //IL_0422: Unknown result type (might be due to invalid IL or missing references) //IL_0427: Unknown result type (might be due to invalid IL or missing references) //IL_042f: Unknown result type (might be due to invalid IL or missing references) //IL_0435: Unknown result type (might be due to invalid IL or missing references) //IL_043a: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Unknown result type (might be due to invalid IL or missing references) //IL_0445: Unknown result type (might be due to invalid IL or missing references) //IL_044a: Unknown result type (might be due to invalid IL or missing references) //IL_0454: Unknown result type (might be due to invalid IL or missing references) //IL_0459: Unknown result type (might be due to invalid IL or missing references) //IL_045e: Unknown result type (might be due to invalid IL or missing references) //IL_0466: Unknown result type (might be due to invalid IL or missing references) //IL_0467: Unknown result type (might be due to invalid IL or missing references) //IL_0471: Unknown result type (might be due to invalid IL or missing references) //IL_0476: Unknown result type (might be due to invalid IL or missing references) //IL_047c: Unknown result type (might be due to invalid IL or missing references) //IL_0481: Unknown result type (might be due to invalid IL or missing references) //IL_0486: Unknown result type (might be due to invalid IL or missing references) //IL_0490: Unknown result type (might be due to invalid IL or missing references) //IL_0495: Unknown result type (might be due to invalid IL or missing references) //IL_049a: Unknown result type (might be due to invalid IL or missing references) //IL_04a2: Unknown result type (might be due to invalid IL or missing references) //IL_04a8: Unknown result type (might be due to invalid IL or missing references) //IL_04ad: Unknown result type (might be due to invalid IL or missing references) //IL_04b3: Unknown result type (might be due to invalid IL or missing references) //IL_04b8: Unknown result type (might be due to invalid IL or missing references) //IL_04bd: Unknown result type (might be due to invalid IL or missing references) //IL_04c7: Unknown result type (might be due to invalid IL or missing references) //IL_04cc: Unknown result type (might be due to invalid IL or missing references) //IL_04d1: Unknown result type (might be due to invalid IL or missing references) //IL_04d9: Unknown result type (might be due to invalid IL or missing references) //IL_04da: Unknown result type (might be due to invalid IL or missing references) //IL_04e4: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Unknown result type (might be due to invalid IL or missing references) //IL_04ef: Unknown result type (might be due to invalid IL or missing references) //IL_04f4: Unknown result type (might be due to invalid IL or missing references) //IL_04f9: Unknown result type (might be due to invalid IL or missing references) //IL_0503: Unknown result type (might be due to invalid IL or missing references) //IL_0508: Unknown result type (might be due to invalid IL or missing references) //IL_050d: Unknown result type (might be due to invalid IL or missing references) //IL_0515: Unknown result type (might be due to invalid IL or missing references) //IL_051b: Unknown result type (might be due to invalid IL or missing references) //IL_0520: Unknown result type (might be due to invalid IL or missing references) //IL_0526: Unknown result type (might be due to invalid IL or missing references) //IL_052b: Unknown result type (might be due to invalid IL or missing references) //IL_0530: Unknown result type (might be due to invalid IL or missing references) //IL_053a: Unknown result type (might be due to invalid IL or missing references) //IL_053f: Unknown result type (might be due to invalid IL or missing references) //IL_0544: Unknown result type (might be due to invalid IL or missing references) //IL_054c: Unknown result type (might be due to invalid IL or missing references) //IL_054d: Unknown result type (might be due to invalid IL or missing references) //IL_0557: Unknown result type (might be due to invalid IL or missing references) //IL_055c: Unknown result type (might be due to invalid IL or missing references) //IL_0562: Unknown result type (might be due to invalid IL or missing references) //IL_0567: Unknown result type (might be due to invalid IL or missing references) //IL_056c: Unknown result type (might be due to invalid IL or missing references) //IL_0576: Unknown result type (might be due to invalid IL or missing references) //IL_057b: Unknown result type (might be due to invalid IL or missing references) //IL_0580: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_058e: Unknown result type (might be due to invalid IL or missing references) //IL_0593: Unknown result type (might be due to invalid IL or missing references) //IL_0599: Unknown result type (might be due to invalid IL or missing references) //IL_059e: Unknown result type (might be due to invalid IL or missing references) //IL_05a3: Unknown result type (might be due to invalid IL or missing references) //IL_05ad: Unknown result type (might be due to invalid IL or missing references) //IL_05b2: Unknown result type (might be due to invalid IL or missing references) //IL_05b7: Unknown result type (might be due to invalid IL or missing references) //IL_05bf: Unknown result type (might be due to invalid IL or missing references) //IL_05c0: Unknown result type (might be due to invalid IL or missing references) //IL_05ca: Unknown result type (might be due to invalid IL or missing references) //IL_05cf: Unknown result type (might be due to invalid IL or missing references) //IL_05d5: Unknown result type (might be due to invalid IL or missing references) //IL_05da: Unknown result type (might be due to invalid IL or missing references) //IL_05df: Unknown result type (might be due to invalid IL or missing references) //IL_05e9: Unknown result type (might be due to invalid IL or missing references) //IL_05ee: Unknown result type (might be due to invalid IL or missing references) //IL_05f3: Unknown result type (might be due to invalid IL or missing references) //IL_05fb: Unknown result type (might be due to invalid IL or missing references) //IL_0601: Unknown result type (might be due to invalid IL or missing references) //IL_0606: Unknown result type (might be due to invalid IL or missing references) //IL_060c: Unknown result type (might be due to invalid IL or missing references) //IL_0611: Unknown result type (might be due to invalid IL or missing references) //IL_0616: Unknown result type (might be due to invalid IL or missing references) //IL_0620: Unknown result type (might be due to invalid IL or missing references) //IL_0625: Unknown result type (might be due to invalid IL or missing references) //IL_062a: Unknown result type (might be due to invalid IL or missing references) //IL_0638: Unknown result type (might be due to invalid IL or missing references) //IL_063e: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) Vector3 normalized = ((Vector3)(ref direction)).normalized; Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer != (Object)null) { MonoBehaviour[] array = Object.FindObjectsOfType(); foreach (MonoBehaviour val in array) { if (!((Object)(object)val == (Object)null) && !(((object)val).GetType().Name != "RandomFlyingBird") && !(Vector3.Distance(((Component)val).transform.position, ((Component)localPlayer).transform.position) > 150f)) { ((MonoBehaviour)this).StartCoroutine(DelayedRedirect(((Component)val).gameObject, normalized, speed, 10f)); } } } ZNetScene instance = ZNetScene.instance; if ((Object)(object)instance != (Object)null && (Object)(object)localPlayer != (Object)null) { GameObject prefab = instance.GetPrefab("sfx_crow_death"); if ((Object)(object)prefab != (Object)null) { for (int j = 0; j < 3; j++) { Object.Instantiate(prefab, ((Component)localPlayer).transform.position + Random.insideUnitSphere * 3f, Quaternion.identity); } } } Vector3 val2 = Vector3.Cross(Vector3.up, normalized); Vector3 normalized2 = ((Vector3)(ref val2)).normalized; Vector3[] array2 = (Vector3[])(object)new Vector3[30] { Vector3.zero, -normalized2 * 3f + normalized * -4f, normalized2 * 3f + normalized * -4f, -normalized2 * 6f + normalized * -8f, normalized2 * 6f + normalized * -8f, -normalized2 * 9f + normalized * -12f, normalized2 * 9f + normalized * -12f, -normalized2 * 12f + normalized * -16f, normalized2 * 12f + normalized * -16f, -normalized2 * 2f + normalized * -6f, normalized2 * 2f + normalized * -6f, -normalized2 * 5f + normalized * -10f, normalized2 * 5f + normalized * -10f, -normalized2 * 8f + normalized * -14f, normalized2 * 8f + normalized * -14f, -normalized2 * 11f + normalized * -18f, normalized2 * 11f + normalized * -18f, -normalized2 * 14f + normalized * -20f, normalized2 * 14f + normalized * -20f, Vector3.up * 4f + normalized * -2f, -normalized2 * 4f + normalized * -5f + Vector3.up * 1.5f, normalized2 * 4f + normalized * -5f + Vector3.up * 1.5f, -normalized2 * 7f + normalized * -9f + Vector3.up * 1f, normalized2 * 7f + normalized * -9f + Vector3.up * 1f, -normalized2 * 10f + normalized * -13f + Vector3.up * 2f, normalized2 * 10f + normalized * -13f + Vector3.up * 2f, -normalized2 * 13f + normalized * -17f + Vector3.up * 1f, normalized2 * 13f + normalized * -17f + Vector3.up * 1f, -normalized2 * 1f + normalized * -3f + Vector3.up * 2.5f, normalized2 * 1f + normalized * -3f + Vector3.up * 2.5f }; for (int k = 0; k < array2.Length; k++) { ((MonoBehaviour)this).StartCoroutine(SingleBird(normalized, speed, array2[k], 3f + (float)k * 0.25f)); } } private IEnumerator DelayedRedirect(GameObject bird, Vector3 dir, float speed, float delay) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) yield return (object)new WaitForSeconds(delay); if ((Object)(object)bird != (Object)null) { ((MonoBehaviour)this).StartCoroutine(RedirectWorldBird(bird, dir, speed)); } } private IEnumerator RedirectWorldBird(GameObject bird, Vector3 dir, float speed) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)bird == (Object)null) { yield break; } BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; MonoBehaviour[] componentsInChildren = bird.GetComponentsInChildren(true); foreach (MonoBehaviour val in componentsInChildren) { if (!((Object)(object)val == (Object)null) && !(((object)val).GetType().Name != "RandomFlyingBird")) { object? obj = ((object)val).GetType().GetField("m_flyingModel", bindingAttr)?.GetValue(val); GameObject val2 = (GameObject)((obj is GameObject) ? obj : null); object? obj2 = ((object)val).GetType().GetField("m_landedModel", bindingAttr)?.GetValue(val); GameObject val3 = (GameObject)((obj2 is GameObject) ? obj2 : null); if ((Object)(object)val2 != (Object)null) { val2.SetActive(true); } if ((Object)(object)val3 != (Object)null) { val3.SetActive(false); } break; } } string[] array = new string[4] { "ZSyncAnimation", "ZSyncTransform", "RandomFlyingBird", "ZSFX" }; componentsInChildren = bird.GetComponentsInChildren(true); foreach (MonoBehaviour val4 in componentsInChildren) { if ((Object)(object)val4 != (Object)null && Array.IndexOf(array, ((object)val4).GetType().Name) >= 0) { Object.DestroyImmediate((Object)(object)val4); } } ZNetView[] componentsInChildren2 = bird.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren2.Length; i++) { Object.DestroyImmediate((Object)(object)componentsInChildren2[i]); } BaseAI[] componentsInChildren3 = bird.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren3.Length; i++) { ((Behaviour)componentsInChildren3[i]).enabled = false; } Component[] componentsInChildren4 = bird.GetComponentsInChildren(); foreach (Component val5 in componentsInChildren4) { MethodInfo methodInfo = ((object)val5)?.GetType().GetMethod("SetBool", new Type[2] { typeof(string), typeof(bool) }); if (methodInfo != null) { methodInfo.Invoke(val5, new object[2] { "flapping", true }); break; } } yield return (object)new WaitForSeconds(0.3f); if (!((Object)(object)bird == (Object)null)) { float elapsed = 0f; float wobbleOffset = Random.Range(0f, MathF.PI * 2f); while ((Object)(object)bird != (Object)null && elapsed < 200f / speed) { elapsed += Time.deltaTime; Vector3 val6 = Vector3.Cross(Vector3.up, dir); Vector3 val7 = ((Vector3)(ref val6)).normalized * Mathf.Sin(elapsed * 1.3f + wobbleOffset) * 0.4f + Vector3.up * Mathf.Sin(elapsed * 0.9f + wobbleOffset + 1f) * 0.2f; Transform transform = bird.transform; transform.position += (dir + val7) * speed * Time.deltaTime; bird.transform.rotation = Quaternion.LookRotation(dir + val7 * 0.5f); yield return null; } if ((Object)(object)bird != (Object)null) { Object.Destroy((Object)(object)bird); } } } private IEnumerator SingleBird(Vector3 dir, float speed, Vector3 formationOffset, float delay) { //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) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) ZNetScene instance = ZNetScene.instance; if ((Object)(object)instance == (Object)null) { yield break; } GameObject prefab = instance.GetPrefab("Crow"); if ((Object)(object)prefab == (Object)null) { yield break; } Player player = Player.m_localPlayer; if ((Object)(object)player == (Object)null) { yield break; } yield return (object)new WaitForSeconds(delay); float num = Random.Range(22f, 28f); Vector3 val = ((Component)player).transform.position + Vector3.up * num - dir * 100f + formationOffset; prefab.SetActive(false); GameObject bird = Object.Instantiate(prefab, val, Quaternion.LookRotation(dir)); prefab.SetActive(true); string[] array = new string[5] { "ZNetView", "ZSyncAnimation", "ZSyncTransform", "RandomFlyingBird", "ZSFX" }; MonoBehaviour[] componentsInChildren = bird.GetComponentsInChildren(true); foreach (MonoBehaviour val2 in componentsInChildren) { if ((Object)(object)val2 != (Object)null && Array.IndexOf(array, ((object)val2).GetType().Name) >= 0) { Object.DestroyImmediate((Object)(object)val2); } } ZNetView[] componentsInChildren2 = bird.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren2.Length; i++) { Object.DestroyImmediate((Object)(object)componentsInChildren2[i]); } BaseAI[] componentsInChildren3 = bird.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren3.Length; i++) { ((Behaviour)componentsInChildren3[i]).enabled = false; } bird.SetActive(true); Component val3 = ((IEnumerable)bird.GetComponentsInChildren()).FirstOrDefault((Func)((Component c) => ((object)c).GetType().Name == "Animator")); ((object)val3)?.GetType().GetMethod("SetBool", new Type[2] { typeof(string), typeof(bool) })?.Invoke(val3, new object[2] { "flapping", true }); float elapsed = 0f; float wobbleOffset = Random.Range(0f, MathF.PI * 2f); while ((Object)(object)bird != (Object)null && elapsed < 250f / speed) { elapsed += Time.deltaTime; Vector3 val4 = Vector3.Cross(Vector3.up, dir); Vector3 val5 = ((Vector3)(ref val4)).normalized * Mathf.Sin(elapsed * 1.3f + wobbleOffset) * 0.4f + Vector3.up * Mathf.Sin(elapsed * 0.9f + wobbleOffset + 1f) * 0.2f; Transform transform = bird.transform; transform.position += (dir + val5) * speed * Time.deltaTime; bird.transform.rotation = Quaternion.LookRotation(dir + val5 * 0.5f); yield return null; } if ((Object)(object)bird != (Object)null) { Object.Destroy((Object)(object)bird); } } private IEnumerator Loop() { yield return (object)new WaitForSeconds(10f); while (true) { yield return (object)new WaitForSeconds(5f); if (!Active || (Object)(object)EnvMan.instance == (Object)null || (Object)(object)ZNet.instance == (Object)null) { continue; } bool flag = EnvMan.IsNight(); float tod = Plugin.GetTod(); long num = (long)(ZNet.instance.GetTimeSeconds() / 1800.0); if (flag) { if (_lastNightPeriod != num) { _lastNightPeriod = num; ClearIfOurs(); TrySet(NightPool); } } else { if (_lastNight) { ClearIfOurs(); } if (tod >= 0.47f && tod <= 0.53f && _lastNoonPeriod != num) { _lastNoonPeriod = num; ClearIfOurs(); TrySet(NoonPool); } } _lastNight = flag; } } private void TrySet(List pool) { if (pool.Count != 0 && !(_rng.NextDouble() > (double)Probability) && (!(Plugin.ClearSkiesExpiry > 0f) || !(Time.time < Plugin.ClearSkiesExpiry)) && (!(Plugin.RainExpiry > 0f) || !(Time.time < Plugin.RainExpiry))) { string text = pool[_rng.Next(pool.Count)]; EnvMan.instance.m_debugEnv = text; _setByUs = text; } } private void ClearIfOurs() { EnvMan instance = EnvMan.instance; if ((Object)(object)instance != (Object)null && instance.m_debugEnv == _setByUs) { instance.m_debugEnv = ""; } _setByUs = null; } static EnvScheduler() { KeyCode[] array = new KeyCode[8]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); HotbarKeys = (KeyCode[])(object)array; CampfirePrefabs = new string[3] { "fire_pit", "fire_pit_iron", "hearth" }; } } public class PilgrimConfig { public TrophiesConfig Trophies { get; set; } = new TrophiesConfig(); public CartsConfig Carts { get; set; } = new CartsConfig(); public RitualsConfig Rituals { get; set; } = new RitualsConfig(); public static PilgrimConfig Default() { return new PilgrimConfig { Trophies = new TrophiesConfig { Enabled = true, Vfx = "fx_fireskeleton_nova" }, Carts = new CartsConfig { Enabled = true }, Rituals = new RitualsConfig { Enabled = true, Cooldown = 60f, Items = new Dictionary { ["seek_altar"] = new RitualItemConfig { Enabled = true, Item = "RawMeat", HoverText = "Seek the next altar", Message = "The wind stirs — {boss} awaits." }, ["restore_power"] = new RitualItemConfig { Enabled = true, Item = "Mushroom*", HoverText = "Restore your power", Message = "The flame accepts your offering. {power} is ready.", Duration = 600f }, ["seek_bed"] = new RitualItemConfig { Enabled = true, Item = "Dandelion", HoverText = "Seek your bed", Message = "The flower carries you home..." }, ["feather_fall"] = new RitualItemConfig { Enabled = true, Item = "Feathers", HoverText = "Fall without fear", Message = "Light as a feather — fall without fear." }, ["seek_trader"] = new RitualItemConfig { Enabled = true, Item = "Coins", HoverText = "Seek a merchant", Message = "Gold calls to gold..." }, ["seek_dungeon"] = new RitualItemConfig { Enabled = true, Item = "Trophy*", HoverText = "Seek the nearest dungeon", Message = "The veil parts — something stirs nearby." }, ["clear_skies"] = new RitualItemConfig { Enabled = true, Item = "GreydwarfEye", HoverText = "Clear the skies", Message = "The clouds part.", Duration = 900f }, ["water_walk"] = new RitualItemConfig { Enabled = true, Item = "Stone", HoverText = "Walk on water", Message = "The sea grows still beneath your feet.", Duration = 60f }, ["growth"] = new RitualItemConfig { Enabled = true, Item = "AncientSeed", HoverText = "Bless your crops", Message = "The seed remembers the earth. Sleep, and your crops will answer." }, ["seek_player"] = new RitualItemConfig { Enabled = true, Item = "Flint", HoverText = "Seek a fellow pilgrim", Message = "Find fellowship." }, ["kindle"] = new RitualItemConfig { Enabled = true, Item = "Resin", HoverText = "Kindle nearby fires", Message = "The darkness yields." }, ["tame_flock"] = new RitualItemConfig { Enabled = true, Item = "BoneFragments", HoverText = "Tame the flock", Message = "The bones remember loyalty. Sleep, and your flock will answer." }, ["giant"] = new RitualItemConfig { Enabled = true, Item = "YmirRemains", HoverText = "Become the mountain", Message = "The mountain answers. You are vast.", Duration = 60f }, ["flaming_sword"] = new RitualItemConfig { Enabled = true, Item = "SurtlingCore", HoverText = "Summon Dyrnwyn", Message = "Dyrnwyn answers. Let it burn.", Duration = 60f } } } }; } } public class TrophiesConfig { public bool Enabled { get; set; } = true; public string Vfx { get; set; } = "fx_fireskeleton_nova"; } public class CartsConfig { public bool Enabled { get; set; } = true; } public class RitualsConfig { public bool Enabled { get; set; } = true; public float Cooldown { get; set; } = 60f; public Dictionary Items { get; set; } = new Dictionary(); } public class RitualItemConfig { public bool Enabled { get; set; } = true; public string Item { get; set; } = ""; public string HoverText { get; set; } = ""; public string Message { get; set; } = ""; public float Duration { get; set; } } }